The invention discloses a method for measuring and calculating
system battery electricity quantity. The method comprises the following steps that: step one, a reference
voltage of a battery is obtained by using an ADC
battery voltage measurement method, and preferably, 10 times of successive AD conversion is performed, an average value of conversion results is selected, such that the reference
voltage can be obtained; step two, the compensation
voltage of each main
power consumption device is calculated according to the states of the main
power consumption devices of a
system; step three, the sum of the reference voltage and the compensation voltage of the main
power consumption devices is calculated and is adopted as post-compensation voltage; step four, corresponding
electricity quantity is obtained through a voltage-
electricity quantity relationship according to the post-compensation voltage, and the corresponding
electricity quantity is adopted as measured electricity quantity; and step five, currently displayed electricity quantity of the battery is updated with the measured electricity quantity of the battery. With the method for measuring and calculating the
system battery electricity quantity of the invention adopted, under the premise that current information is unavailable, a method in which ADC voltage is adopted to measure the electricity quantity of the battery is only utilized, and the method and algorithms are improved, and therefore, measurement accuracy is greatly increased, and the
charge and discharge curves of the battery are more approximate to authentic situations.