CN106680728A - Electricity quantity detecting method and device - Google Patents

Electricity quantity detecting method and device Download PDF

Info

Publication number
CN106680728A
CN106680728A CN201611271502.3A CN201611271502A CN106680728A CN 106680728 A CN106680728 A CN 106680728A CN 201611271502 A CN201611271502 A CN 201611271502A CN 106680728 A CN106680728 A CN 106680728A
Authority
CN
China
Prior art keywords
battery
mobile terminal
value
electricity
charge
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201611271502.3A
Other languages
Chinese (zh)
Inventor
廖野
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Tinno Wireless Technology Co Ltd
Original Assignee
Shenzhen Tinno Wireless Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Tinno Wireless Technology Co Ltd filed Critical Shenzhen Tinno Wireless Technology Co Ltd
Priority to CN201611271502.3A priority Critical patent/CN106680728A/en
Publication of CN106680728A publication Critical patent/CN106680728A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R31/00Arrangements for testing electric properties; Arrangements for locating electric faults; Arrangements for electrical testing characterised by what is being tested not provided for elsewhere
    • G01R31/36Arrangements for testing, measuring or monitoring the electrical condition of accumulators or electric batteries, e.g. capacity or state of charge [SoC]
    • G01R31/382Arrangements for monitoring battery or accumulator variables, e.g. SoC
    • G01R31/3842Arrangements for monitoring battery or accumulator variables, e.g. SoC combining voltage and current measurements

Abstract

The invention discloses an electricity quantity detecting method. The method comprises the steps that the system start stage of a mobile terminal is detected; when the mobile terminal is started to a preloader stage, the electricity quantity value of a battery of the mobile terminal is acquired; the acquired electricity quantity value is adopted as the initial electricity quantity value of the battery for display. The invention further discloses an electricity quantity detecting device. The precision of electricity quantity detection of the mobile terminal can be improved.

Description

Detection method of quantity of electricity and device
Technology neighborhood
The present invention relates to technical field of mobile terminals, more particularly to a kind of detection method of quantity of electricity and device.
Background technology
With the continuous development of mobile terminal technology, it is supplied to the function of user more and more numerous and complicated, and user also increasingly needs Monitor battery electric quantity is wanted, so as to flexible management power available, the remaining working time is explicitly shown, system is extended as far as possible The time of operation.By taking mobile phone as an example, the detection method of quantity of electricity that now most of mobile phones are adopted is also fairly simple, lacks degree of accuracy, Detection method such as current main flow is simply to measure cell voltage, then estimates corresponding battery dump energy.
To lift the precision of electric power detection, prior art proposes a kind of improved electric power detection scheme, i.e., based on coulomb The electric power detection of meter integration, however, the precision of this electric power detection mode depends on the precision of detection battery initial quantity of electricity value, if There is error in detection battery initial quantity of electricity value, in the follow-up real time electrical quantity value for using coulometer integral way to calculate battery, meeting There is cumulative error, the electricity for causing mobile phone shows that inaccurate, battery is not fully filled electricity and the suddenly failure such as shutdown.
The content of the invention
Present invention is primarily targeted at providing a kind of detection method of quantity of electricity and device, it is intended to improve the inspection of mobile terminal electricity The degree of accuracy of survey.
For achieving the above object, the present invention provides a kind of detection method of quantity of electricity, and the detection method of quantity of electricity is comprised the following steps:
The system start-up phase of detecting mobile terminal;
When the mobile terminal starts to preloader stages, the charge value of the battery of mobile terminal is obtained;
Using obtain the charge value as the battery initial quantity of electricity value, for show.
Alternatively, the step of charge value of the acquisition battery of mobile terminal includes:
Obtain the open-circuit voltage values of the battery;
Based on the open-circuit voltage values and default open-circuit voltage values for obtaining and the incidence relation of charge value, institute is determined State the charge value of battery.
Alternatively, the step of open-circuit voltage values of the acquisition battery include:
The output voltage and output current of the battery are obtained based on default analog-digital converter;
Based on the incidence relation of the output voltage and default output voltage and internal resistance value for obtaining, the electricity is determined The current internal resistance value in pond, and calculate the internal resistance value of determination and the product of the output current;
Using the difference of the output voltage and the product as the battery open-circuit voltage values.
Alternatively, before the step of charge value of the acquisition battery of mobile terminal, also include:
When the mobile terminal starts to preloader stages, whether the charge function for recognizing the mobile terminal is located In enabled state;
If then closing the charge function of the mobile terminal, and proceed to the execution acquisition battery of mobile terminal The step of charge value.
Alternatively, it is described using obtain the charge value as the battery initial quantity of electricity value, for show the step of Afterwards, also include:
Open the charge function and the electricity based on battery described in the initial quantity of electricity value real-time update of the mobile terminal Value.
Additionally, for achieving the above object, the present invention also provides a kind of electric quantity detection apparatus, and the electric quantity detection apparatus include:
Detecting module, for detecting the system start-up phase of mobile terminal;
Detection module, for when the mobile terminal starts to preloader stages, obtaining the battery of mobile terminal Charge value;
Setup module, for will obtain the charge value as the battery initial quantity of electricity value, for show.
Alternatively, the detection module is additionally operable to obtain the open-circuit voltage values of the battery;It is additionally operable to based on the institute for obtaining The incidence relation of open-circuit voltage values and default open-circuit voltage values and charge value is stated, the charge value of the battery is determined.
Alternatively, the detection module be additionally operable to based on default analog-digital converter obtain the output voltage of the battery with And output current;The incidence relation based on the output voltage and default output voltage and internal resistance value for obtaining is additionally operable to, Determine the current internal resistance value of the battery, and calculate the internal resistance value of determination and the product of the output current;Being additionally operable to will Open-circuit voltage values of the difference of the output voltage and the product as the battery.
Alternatively, the detection module is additionally operable to when the mobile terminal starts to preloader stages, and identification is described Whether the charge function of mobile terminal is in enabled state;It is additionally operable to be in enabled state in the charge function of the mobile terminal When, close the charge function of the mobile terminal;It is additionally operable to after the charge function for closing the mobile terminal, obtains the shifting The charge value of dynamic end cell.
Alternatively, the detection module is additionally operable to open the charge function of the mobile terminal and based on the initial quantity of electricity The charge value of battery described in value real-time update.
Detection method of quantity of electricity proposed by the present invention and electric quantity detection apparatus, by less in mobile terminal starting device The preloader stages detect the charge value of its battery, and the charge value that the preloader stages are detected as the electricity of battery Value, improves the degree of accuracy of initial quantity of electricity value, can accurately reflect battery electric quantity situation, is integrating subsequently through coulometer When mode calculates electricity, its cumulative error is reduced, so as to improve the degree of accuracy of mobile terminal electric power detection.
Description of the drawings
Fig. 1 is the frame structure exemplary plot of electric quantity detection apparatus first embodiment of the present invention;
Fig. 2 is the exemplary plot of electric quantity detecting circuit in electric quantity detection apparatus second embodiment of the present invention;
Fig. 3 is the schematic flow sheet of detection method of quantity of electricity first embodiment of the present invention.
The realization of the object of the invention, functional characteristics and advantage will be described further referring to the drawings in conjunction with the embodiments.
Specific embodiment
It should be appreciated that specific embodiment described herein is not intended to limit the present invention only to explain the present invention.
The present invention provides a kind of electric quantity detection apparatus, is applied to the mobile terminal of Android system, and it can specifically be built in shifting Dynamic terminal, as the entirety of mobile terminal function is realized, also separable to be arranged at mobile terminal, independently realizes function, wherein, move Dynamic terminal can be implemented in a variety of manners.For example, the mobile terminal described in the present invention can include such as mobile phone, intelligence Energy phone, notebook computer, digit broadcasting receiver, PDA (personal digital assistant), PAD (panel computer), PMP are (portable more Media player), guider etc..It will be appreciated by those skilled in the art that except be used in particular for moving purpose element it Outward, construction according to the embodiment of the present invention can also apply to the terminal of fixed type.
With reference to Fig. 1, in the first embodiment of electric quantity detection apparatus of the present invention, the electric quantity detection apparatus include:
Detecting module 10, for detecting the system start-up phase of mobile terminal;
Detection module 20, for when mobile terminal starts to preloader stages, obtaining the electricity of battery of mobile terminal Value;
Setup module 30, for will obtain charge value as battery initial quantity of electricity value, for show.
It will be appreciated by persons skilled in the art that the system starting process of mobile terminal includes three phases, respectively Preloader, lk and kernel.Inventor had found by lot of experiment validation, first as system start-up of preloader Stage, mobile terminal can only start a few devices in this stage;Lk as system start-up second stage, mobile terminal here Stage only understands actuating section equipment;And kernel, used as the three phases of system start-up, mobile terminal will own in this stage Equipment.
However, the electricity calculation of the existing mobile terminal without independent coulant meter is:In system start-up to kernel After stage, go to detect cell voltage by the ADC (Analog-to-Digital Converter, analog-digital converter) for arranging Value, then searches voltage-capacity mapping table and calculates charge value by battery voltage value, is then accumulated by coulometer Point mode calculates electricity.But thus can there is a problem of one it is serious, when mobile terminal-opening starts to kernel, by All have been started up in its ancillary equipment, CPU and DDR is operated in higher frequency so that the load of battery can be very big, causes The electric current of cell voltage ADC test points becomes therewith big, and it is inaccurate to further result in the cell voltage for detecting, so that calculating There is larger error in the battery initial quantity of electricity value come, when subsequently electricity is calculated using coulometer integral way, it may appear that accumulation Error.In view of this, idea of the invention is that:When mobile terminal starts to preloader stages, the electricity of its battery is read Used as initial quantity of electricity value, when follow-up coulometer integral way calculates electricity, the mistake of accumulation also can be reduced value, so as to be lifted The degree of accuracy of electric power detection.
Specifically, in the present embodiment, electric quantity detection apparatus pass through in real time its system of detecting module 10 to mobile terminal Startup stage is detected, the startup stage current to determine mobile terminal.It should be noted that preloader, lk and Kernel these system image files are stored in the Nand-flash of mobile terminal.When upper electric, Boot Rom are first Start, preloader is loaded in the RAM of inside, after preloader is loaded and completes, program is just from Boot Rom Jump to and start at preloader execution, after preloader has initialized external RAM, preloader is outer by lk loadings In portion RAM, then branch to go to perform in lk, and then lk is loaded with kernel and execution is jumped to in external RAM, then Kernel parts, realize the startup of Android system.In the specific implementation, specifically whether detecting mobile terminal is based on detecting module 10 Preloader is loaded in internal RAM and jumps to preloader and starts to perform by Boot Rom, wherein, will in mobile terminal Preloader be loaded in internal RAM and jump to preloader start perform when, detecting module 10 determine mobile terminal open Move the preloader stages.After it is determined that mobile terminal starts to the preloader stages, the transmission of detecting module 10 is mobile eventually End starts to the configured information in preloader stages to detection module 20.
, when the configured information of the transmission of detecting module 10 is received, identification currently can be to mobile terminal for detection module 20 Battery electric quantity value is detected, and the battery electric quantity value to mobile terminal is detected.Wherein, the detection of detection module 20 battery electricity The mode of value can be chosen according to actual needs, and the present invention is not particularly limited.After the charge value for detecting battery, Detection is obtained charge value and is transmitted to setup module 30 by detection module 20.
Setup module 30 is whole as movement using the charge value for receiving after the charge value for receiving the transmission of detection module 20 The charge value of the battery at end.
Electric quantity detection apparatus proposed by the present invention in the mobile terminal starting device less preloader stages by detecting The charge value of its battery, and the charge value that the preloader stages are detected improves initial quantity of electricity as the charge value of battery The degree of accuracy of value, can accurately reflect battery electric quantity situation, when electricity is calculated subsequently through coulometer integral way, subtract Its cumulative error is lacked, so as to improve the degree of accuracy of mobile terminal electric power detection.
Further, based on first embodiment, the second embodiment of electric quantity detection apparatus of the present invention is proposed, is implemented with first The difference of example is that in the present embodiment, the further electric power detection operation to detection module 20 is described in detail, specifically , detection module 20 is additionally operable to obtain the open-circuit voltage values of battery of mobile terminal;Be additionally operable to based on obtain open-circuit voltage values with And default open-circuit voltage values and the incidence relation of charge value, determine the charge value of battery.
It should be noted that being only described to above-mentioned difference below, other can refer to the correlation of aforementioned first embodiment Description, here is omitted.
In the present embodiment, detection module 20 detects first to the open-circuit voltage values of the battery of mobile terminal, wherein, Open-circuit voltage values are potential difference of the battery when no current passes through between both positive and negative polarity.Detection obtain battery open-circuit voltage values it Afterwards, detection module 20 is obtained based on detection open-circuit voltage values and the incidence relation of default open-circuit voltage values and charge value, Determine the charge value of the battery of mobile terminal.Wherein, the default open-circuit voltage values can be stored with the incidence relation of charge value In the local storage of mobile terminal, it is also possible to be stored in that cloud server is medium, the present invention is not particularly limited.
Additionally, in the present embodiment, open-circuit voltage values are specifically dependent upon mobile whole with the setting of the incidence relation of charge value The battery behavior at end, and drawn by lot of experiment validation.By taking mobile phone as an example, open-circuit voltage values and the electricity of certain types of mobile phone battery The incidence relation of value is as shown in table 1 below.
Charge value Open-circuit voltage
0 4336
2 4305
3 4282
5 4262
6 4244
8 4227
9 4210
Table 1
Specifically, when the open-circuit voltage values of battery are detected, detection module 20 is additionally operable to based on default analog-digital converter Obtain the output voltage and output current of battery;It is additionally operable to based on the output voltage and default output voltage and interior for obtaining The incidence relation of resistance, determines the current internal resistance value of battery, and calculates the internal resistance value of determination and the product of output current;It is additionally operable to Using the difference of output voltage and product as battery open-circuit voltage values.
It is the open-circuit voltage values for accurately detecting battery with reference to Fig. 2, the present embodiment has been connected sampling resistor in the positive pole of battery Rsense, as shown in Fig. 2 when system start-up is to the preloader stages, detection module 20 is adopted based on default analog-digital converter The voltage IBAT (load voltage) and VBAT (output voltage) at collection Rsense two ends, and IBAT and VBAT values are saved in Dram It is delivered to lk;
When system start-up is to lk, IBAT the and VBAT values that detection module 20 is stored in Dram read out, write Kernel is delivered to kernel cmdline;
When system start-up is to kernel, IBAT the and VBAT values being stored in kernel cmdline are extracted, The output current of battery is calculated by formula below;
Wherein, I represents the output current of battery, and Rsense represents the resistance of sampling resistor Rsense.
Meanwhile, detection module 20 is based on detecting the output voltage (VBAT) of battery, and default output voltage and interior The incidence relation of resistance, determines the current internal resistance value of battery.Wherein, output voltage is concrete with the setting of the incidence relation of internal resistance value Depending on the battery behavior of mobile terminal, and drawn by lot of experiment validation.By taking mobile phone as an example, certain types of mobile phone battery it is defeated The incidence relation for going out voltage and internal resistance value is as shown in table 2 below.
Internal resistance value Output voltage
1040 4167
1040 4336
1030 4313
1020 4294
1010 4276
1000 4258
990 4241
Table 2
Detection module 20 after the current internal resistance value of battery is got, open by the battery for calculating battery by formula below Road voltage:
OCV=VBAT- (I*Rbat)
Wherein, OCV represents the open-circuit voltage of battery, and VBAT represents the output voltage values of battery, and T represents the output electricity of battery Stream, Rbat represents the internal resistance value of battery.
It should be noted that when the open-circuit voltage detection circuit of battery is designed, sampling resistor Rsense is needed from high The checkpoint of the resistance of precision, VBAT and IBAT needs the resistance two ends for seeing Rsense, to reduce error during detection, carries The degree of accuracy of high electric power detection.
Further, based on aforementioned first or second embodiments, the 3rd embodiment of electric quantity detection apparatus of the present invention is proposed, It is that the present embodiment is the degree of accuracy for further improving electric power detection with aforementioned arbitrary described difference, detection module 20 is also used Whether enabled state is in the charge function for when mobile terminal starts to preloader stages, recognizing mobile terminal;Also use When the charge function in mobile terminal is in enabled state, the charge function of turning-off mobile terminal;It is additionally operable to closing movement After the charge function of terminal, the charge value of battery of mobile terminal is obtained.
It should be noted that the present embodiment is with the difference of previous embodiment, the present embodiment is detected in detection module 20 Before the operation of battery electric quantity, the detection to mobile terminal charge function is increased, illustrated only for the difference below, its He can refer to aforementioned any embodiment, and here is omitted.
In the present embodiment, detection module 20 is started in the mobile terminal for receiving the transmission of detecting module 10 During the configured information in preloader stages, whether the charge function for recognizing mobile terminal first is in enabled state, i.e. identification is moved Whether dynamic terminal is in charged state.If it should be noted that mobile terminal be in charged state, due to drawing high for external power source Effect, it will cause the charge value for detecting battery inaccurate.When being such as based on second embodiment, IBAT the and VBAT values of battery will It is driven high, causes detection module 20 inaccurate based on IBAT the and VBAT values that analog-digital converter is collected, and then causes to detect The charge value of battery is inaccurate.In view of this, to avoid the impact of charge-carrying belt, need to guarantee before the operation of detection electricity The charge function of mobile terminal has been switched off.Accordingly, when the charge function of mobile terminal is in enabled state, detection module The charge function of 20 turning-off mobile terminals, and after the charge function of turning-off mobile terminal, obtain the electricity of battery of mobile terminal Value.Wherein, the operation of the charge value of the acquisition of detection module 20 battery of mobile terminal can refer to previous embodiment, no longer go to live in the household of one's in-laws on getting married herein State.
Further, in the present embodiment, to avoid mobile terminal from affecting user because not enough power supply causes automatic shutdown Use, the charge value that detection module 20 is additionally operable to be transmitted detection module 20 to setup module 30 in setup module 30 is set to electricity After the initial quantity of electricity value in pond, or transmit to setup module 30 detection to be obtained charge value, open mobile terminal The charge value of charge function and the initial quantity of electricity value real-time update battery based on battery.
The present invention also provides a kind of detection method of quantity of electricity, and detection method of quantity of electricity electric quantity detection apparatus as shown in Figure 1 are held OK, with reference to reference to Fig. 1 and Fig. 3, the detection method of quantity of electricity includes:
Step S10, detects the system start-up phase of mobile terminal;
Step S20, when mobile terminal starts to preloader stages, obtains the charge value of battery of mobile terminal;
Step S30, using obtain charge value as battery initial quantity of electricity value, for show.
It will be appreciated by persons skilled in the art that the system starting process of mobile terminal includes three phases, respectively Preloader, lk and kernel.Inventor had found by lot of experiment validation, first as system start-up of preloader Stage, mobile terminal can only start a few devices in this stage;Lk as system start-up second stage, mobile terminal here Stage only understands actuating section equipment;And kernel, used as the three phases of system start-up, mobile terminal will own in this stage Equipment.
However, the electricity calculation of the existing mobile terminal without independent coulant meter is:In system start-up to kernel After stage, go to detect cell voltage by the ADC (Analog-to-Digital Converter, analog-digital converter) for arranging Value, then searches voltage-capacity mapping table and calculates charge value by battery voltage value, is then accumulated by coulometer Point mode calculates electricity.But thus can there is a problem of one it is serious, when mobile terminal-opening starts to kernel, by All have been started up in its ancillary equipment, CPU and DDR is operated in higher frequency so that the load of battery can be very big, causes The electric current of cell voltage ADC test points becomes therewith big, and it is inaccurate to further result in the cell voltage for detecting, so that calculating There is larger error in the battery initial quantity of electricity value come, when subsequently electricity is calculated using coulometer integral way, it may appear that accumulation Error.In view of this, idea of the invention is that:When mobile terminal starts to preloader stages, the electricity of its battery is read Used as initial quantity of electricity value, when follow-up coulometer integral way calculates electricity, the mistake of accumulation also can be reduced value, so as to be lifted The degree of accuracy of electric power detection.
Specifically, in the present embodiment, electric quantity detection apparatus pass through in real time its system of detecting module 10 to mobile terminal Startup stage is detected, the startup stage current to determine mobile terminal.It should be noted that preloader, lk and Kernel these system image files are stored in the Nand-flash of mobile terminal.When upper electric, Boot Rom are first Start, preloader is loaded in the RAM of inside, after preloader is loaded and completes, program is just from Boot Rom Jump to and start at preloader execution, after preloader has initialized external RAM, preloader is outer by lk loadings In portion RAM, then branch to go to perform in lk, and then lk is loaded with kernel and execution is jumped to in external RAM, then Kernel parts, realize the startup of Android system.In the specific implementation, specifically whether detecting mobile terminal is based on detecting module 10 Preloader is loaded in internal RAM and jumps to preloader and starts to perform by Boot Rom, wherein, will in mobile terminal Preloader be loaded in internal RAM and jump to preloader start perform when, detecting module 10 determine mobile terminal open Move the preloader stages.After it is determined that mobile terminal starts to the preloader stages, the transmission of detecting module 10 is mobile eventually End starts to the configured information in preloader stages to detection module 20.
, when the configured information of the transmission of detecting module 10 is received, identification currently can be to mobile terminal for detection module 20 Battery electric quantity value is detected, and the battery electric quantity value to mobile terminal is detected.Wherein, the detection of detection module 20 battery electricity The mode of value can be chosen according to actual needs, and the present invention is not particularly limited.After the charge value for detecting battery, Detection is obtained charge value and is transmitted to setup module 30 by detection module 20.
Setup module 30 is whole as movement using the charge value for receiving after the charge value for receiving the transmission of detection module 20 The charge value of the battery at end.
Detection method of quantity of electricity proposed by the present invention in the mobile terminal starting device less preloader stages by detecting The charge value of its battery, and the charge value that the preloader stages are detected improves initial quantity of electricity as the charge value of battery The degree of accuracy of value, can accurately reflect battery electric quantity situation, when electricity is calculated subsequently through coulometer integral way, subtract Its cumulative error is lacked, so as to improve the degree of accuracy of mobile terminal electric power detection.
Further, based on first embodiment, the second embodiment of detection method of quantity of electricity of the present invention is proposed, corresponding to aforementioned The second embodiment of electric quantity detection apparatus, be with the difference of first embodiment, in the present embodiment, further to step S20 It is described in detail, specifically, step S20 includes:
Obtain the open-circuit voltage values of battery of mobile terminal;
Based on the open-circuit voltage values and default open-circuit voltage values for obtaining and the incidence relation of charge value, battery is determined Charge value.
It should be noted that being only described to above-mentioned difference below, other can refer to the correlation of aforementioned first embodiment Description, here is omitted.
In the present embodiment, detection module 20 detects first to the open-circuit voltage values of the battery of mobile terminal, wherein, Open-circuit voltage values are potential difference of the battery when no current passes through between both positive and negative polarity.Detection obtain battery open-circuit voltage values it Afterwards, detection module 20 is obtained based on detection open-circuit voltage values and the incidence relation of default open-circuit voltage values and charge value, Determine the charge value of the battery of mobile terminal.Wherein, the default open-circuit voltage values can be stored with the incidence relation of charge value In the local storage of mobile terminal, it is also possible to be stored in that cloud server is medium, the present invention is not particularly limited.
Additionally, in the present embodiment, open-circuit voltage values are specifically dependent upon mobile whole with the setting of the incidence relation of charge value The battery behavior at end, and drawn by lot of experiment validation.By taking mobile phone as an example, open-circuit voltage values and the electricity of certain types of mobile phone battery The incidence relation of value is as shown in table 1.
Further, in the present embodiment, the step of open-circuit voltage values of aforementioned acquisition battery of mobile terminal include:
The output voltage and output current of battery are obtained based on default analog-digital converter;
Based on the incidence relation of the output voltage and default output voltage and internal resistance value for obtaining, determine that battery is current Internal resistance value, and calculate the internal resistance value of determination and the product of output current;
Using the difference of output voltage and product as battery open-circuit voltage values.
It is the open-circuit voltage values for accurately detecting battery with reference to Fig. 2, the present embodiment has been connected sampling resistor in the positive pole of battery Rsense, as shown in Fig. 2 when system start-up is to the preloader stages, detection module 20 is adopted based on default analog-digital converter The voltage IBAT (load voltage) and VBAT (output voltage) at collection Rsense two ends, and IBAT and VBAT values are saved in Dram It is delivered to lk;
When system start-up is to lk, IBAT the and VBAT values that detection module 20 is stored in Dram read out, write Kernel is delivered to kernel cmdline;
When system start-up is to kernel, IBAT the and VBAT values being stored in kernel cmdline are extracted, The output current of battery is calculated by formula below;
Wherein, I represents the output current of battery, and Rsense represents the resistance of sampling resistor Rsense.
Meanwhile, detection module 20 is based on detecting the output voltage (VBAT) of battery, and default output voltage and interior The incidence relation of resistance, determines the current internal resistance value of battery.Wherein, output voltage is concrete with the setting of the incidence relation of internal resistance value Depending on the battery behavior of mobile terminal, and drawn by lot of experiment validation.By taking mobile phone as an example, certain types of mobile phone battery it is defeated The incidence relation for going out voltage and internal resistance value is as shown in table 2.
Detection module 20 after the current internal resistance value of battery is got, open by the battery for calculating battery by formula below Road voltage:
OCV=VBAT- (I*Rbat)
Wherein, OCV represents the open-circuit voltage of battery, and VBAT represents the output voltage values of battery, and T represents the output electricity of battery Stream, Rbat represents the internal resistance value of battery.
It should be noted that when the open-circuit voltage detection circuit of battery is designed, sampling resistor Rsense is needed from high The checkpoint of the resistance of precision, VBAT and IBAT needs the resistance two ends for seeing Rsense, to reduce error during detection, carries The degree of accuracy of high electric power detection.
Further, based on aforementioned first or second embodiments, the 3rd embodiment of detection method of quantity of electricity of the present invention is proposed, Corresponding to the 3rd embodiment of aforementioned electric quantity detection apparatus, it is further to improve electricity inspection to be with the difference of previous embodiment The degree of accuracy of survey, before step S20, also includes:
When mobile terminal starts to preloader stages, recognize the charge function of mobile terminal whether in enabling shape State;
If the then charge function of turning-off mobile terminal, and proceed to execution step S20.
It should be noted that the present embodiment is with the difference of previous embodiment, the present embodiment is detected in detection module 20 Before the operation of battery electric quantity, the detection to mobile terminal charge function is increased, illustrated only for the difference below, its He can refer to aforementioned any embodiment, and here is omitted.
In the present embodiment, detection module 20 is started in the mobile terminal for receiving the transmission of detecting module 10 During the configured information in preloader stages, whether the charge function for recognizing mobile terminal first is in enabled state, i.e. identification is moved Whether dynamic terminal is in charged state.If it should be noted that mobile terminal be in charged state, due to drawing high for external power source Effect, it will cause the charge value for detecting battery inaccurate.When being such as based on second embodiment, IBAT the and VBAT values of battery will It is driven high, causes detection module 20 inaccurate based on IBAT the and VBAT values that analog-digital converter is collected, and then causes to detect The charge value of battery is inaccurate.In view of this, to avoid the impact of charge-carrying belt, need to guarantee before the operation of detection electricity The charge function of mobile terminal has been switched off.Accordingly, when the charge function of mobile terminal is in enabled state, detection module The charge function of 20 turning-off mobile terminals, and after the charge function of turning-off mobile terminal, obtain the electricity of battery of mobile terminal Value.Wherein, the operation of the charge value of the acquisition of detection module 20 battery of mobile terminal can refer to previous embodiment, no longer go to live in the household of one's in-laws on getting married herein State.
Further, in the present embodiment, to avoid mobile terminal from affecting user because not enough power supply causes automatic shutdown Use, after step S30, also include:
Open the charge function and the charge value based on initial quantity of electricity value real-time update battery of mobile terminal.
Specifically, detection module 20 is additionally operable to the electricity transmitted detection module 20 in setup module 30 to setup module 30 Value is set to after the initial quantity of electricity value of battery, or is transmitted to setup module 30 detection to be obtained charge value, is opened The charge value of the charge function of mobile terminal and the initial quantity of electricity value real-time update battery based on battery.
The preferred embodiments of the present invention are these are only, the scope of the claims of the present invention is not thereby limited, it is every using this Equivalent structure or equivalent flow conversion that bright description and accompanying drawing content are made, or directly or indirectly it is used in other related skills Art neighborhood, is included within the scope of the present invention.

Claims (10)

1. a kind of detection method of quantity of electricity, it is characterised in that the detection method of quantity of electricity includes:
The system start-up phase of detecting mobile terminal;
When the mobile terminal starts to preloader stages, the charge value of the battery of mobile terminal is obtained;
Using obtain the charge value as the battery initial quantity of electricity value, for show.
2. detection method of quantity of electricity according to claim 1, it is characterised in that the electricity of the acquisition battery of mobile terminal The step of value, includes:
Obtain the open-circuit voltage values of the battery;
Based on the open-circuit voltage values and default open-circuit voltage values for obtaining and the incidence relation of charge value, the electricity is determined The charge value in pond.
3. detection method of quantity of electricity according to claim 2, it is characterised in that the open-circuit voltage values of the acquisition battery The step of include:
The output voltage and output current of the battery are obtained based on default analog-digital converter;
Based on the incidence relation of the output voltage and default output voltage and internal resistance value for obtaining, determine that the battery is worked as Front internal resistance value, and calculate the internal resistance value of determination and the product of the output current;
Using the difference of the output voltage and the product as the battery open-circuit voltage values.
4. the detection method of quantity of electricity according to any one of claim 1-3, it is characterised in that the acquisition mobile terminal Before the step of charge value of battery, also include:
When the mobile terminal starts to preloader stages, recognize the charge function of the mobile terminal whether in making Can state;
If then closing the charge function of the mobile terminal, and proceed to the electricity for performing the acquisition battery of mobile terminal The step of value.
5. detection method of quantity of electricity according to claim 4, it is characterised in that it is described using the charge value for obtaining as institute The initial quantity of electricity value of battery is stated, after the step of display, is also included:
Open the charge function and the charge value based on battery described in the initial quantity of electricity value real-time update of the mobile terminal.
6. a kind of electric quantity detection apparatus, it is characterised in that the electric quantity detection apparatus include:
Detecting module, for detecting the system start-up phase of mobile terminal;
Detection module, for when the mobile terminal starts to preloader stages, obtaining the electricity of the battery of mobile terminal Value;
Setup module, for will obtain the charge value as the battery initial quantity of electricity value, for show.
7. electric quantity detection apparatus according to claim 6, it is characterised in that the detection module is additionally operable to obtain the electricity The open-circuit voltage values in pond;It is additionally operable to the pass with charge value based on the open-circuit voltage values and default open-circuit voltage values for obtaining Connection relation, determines the charge value of the battery.
8. electric quantity detection apparatus according to claim 7, it is characterised in that the detection module is additionally operable to based on default Analog-digital converter obtains the output voltage and output current of the battery;Be additionally operable to based on obtain the output voltage and The incidence relation of default output voltage and internal resistance value, determines the current internal resistance value of the battery, and calculates the described interior of determination The product of resistance and the output current;It is additionally operable to difference the opening as the battery of the output voltage and the product Road magnitude of voltage.
9. electric quantity detection apparatus according to any one of claim 6-8, it is characterised in that the detection module is additionally operable to When the mobile terminal starts to preloader stages, whether the charge function for recognizing the mobile terminal is in enabled state; It is additionally operable to, when the charge function of the mobile terminal is in enabled state, close the charge function of the mobile terminal;Also use In after the charge function for closing the mobile terminal, the charge value of the battery of mobile terminal is obtained.
10. electric quantity detection apparatus according to claim 9, it is characterised in that the detection module is additionally operable to open described The charge function of mobile terminal and the charge value based on battery described in the initial quantity of electricity value real-time update.
CN201611271502.3A 2016-12-30 2016-12-30 Electricity quantity detecting method and device Pending CN106680728A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611271502.3A CN106680728A (en) 2016-12-30 2016-12-30 Electricity quantity detecting method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611271502.3A CN106680728A (en) 2016-12-30 2016-12-30 Electricity quantity detecting method and device

Publications (1)

Publication Number Publication Date
CN106680728A true CN106680728A (en) 2017-05-17

Family

ID=58849804

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611271502.3A Pending CN106680728A (en) 2016-12-30 2016-12-30 Electricity quantity detecting method and device

Country Status (1)

Country Link
CN (1) CN106680728A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107290674A (en) * 2017-05-19 2017-10-24 深圳市金立通信设备有限公司 A kind of calibration method and terminal for showing charge value
CN109116290A (en) * 2018-06-14 2019-01-01 出门问问信息科技有限公司 A kind of optimization method, device and the electronic equipment of the metering of equipment voltameter
CN109507593A (en) * 2018-12-21 2019-03-22 惠州Tcl移动通信有限公司 Enabled method, relevant apparatus and the storage medium of battery of mobile terminal

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101388924A (en) * 2008-10-11 2009-03-18 深圳华为通信技术有限公司 Method and mobile terminal for prompting residue working time
CN102946479A (en) * 2012-11-02 2013-02-27 惠州Tcl移动通信有限公司 Method for mobile terminal to update electric quantity of battery and mobile terminal
CN103472400A (en) * 2013-09-06 2013-12-25 广东欧珀移动通信有限公司 Acquiring method and system for battery life of mobile terminal
CN103792489A (en) * 2013-11-22 2014-05-14 广州视源电子科技股份有限公司 Improved method for measuring and calculating system battery electricity quantity
CN104880673A (en) * 2015-05-11 2015-09-02 深圳天珑无线科技有限公司 Method for measuring battery electric quantity and mobile terminal
CN105259508A (en) * 2015-10-14 2016-01-20 惠州Tcl移动通信有限公司 Terminal and method for calculating initial electric energy thereof

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101388924A (en) * 2008-10-11 2009-03-18 深圳华为通信技术有限公司 Method and mobile terminal for prompting residue working time
CN102946479A (en) * 2012-11-02 2013-02-27 惠州Tcl移动通信有限公司 Method for mobile terminal to update electric quantity of battery and mobile terminal
CN103472400A (en) * 2013-09-06 2013-12-25 广东欧珀移动通信有限公司 Acquiring method and system for battery life of mobile terminal
CN103792489A (en) * 2013-11-22 2014-05-14 广州视源电子科技股份有限公司 Improved method for measuring and calculating system battery electricity quantity
CN104880673A (en) * 2015-05-11 2015-09-02 深圳天珑无线科技有限公司 Method for measuring battery electric quantity and mobile terminal
CN105259508A (en) * 2015-10-14 2016-01-20 惠州Tcl移动通信有限公司 Terminal and method for calculating initial electric energy thereof

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107290674A (en) * 2017-05-19 2017-10-24 深圳市金立通信设备有限公司 A kind of calibration method and terminal for showing charge value
CN109116290A (en) * 2018-06-14 2019-01-01 出门问问信息科技有限公司 A kind of optimization method, device and the electronic equipment of the metering of equipment voltameter
CN109116290B (en) * 2018-06-14 2020-08-11 出门问问信息科技有限公司 Optimization method and device for metering of equipment electricity meter and electronic equipment
CN109507593A (en) * 2018-12-21 2019-03-22 惠州Tcl移动通信有限公司 Enabled method, relevant apparatus and the storage medium of battery of mobile terminal

Similar Documents

Publication Publication Date Title
CN107870301B (en) Method and device for detecting micro short circuit of battery
CN106646256B (en) Battery capacity calculating method
US20140062417A1 (en) Intelligent charge-discharge controller for battery and electronic device having same
CN102590609B (en) The method of mobile terminal and measurement mobile terminal power consumption
CN110506215A (en) A kind of method and device of determining battery internal short-circuit
CN103901352B (en) Show the method and device of battery of mobile terminal remaining capacity
CN106680728A (en) Electricity quantity detecting method and device
CN108431749B (en) Capacitance variation detection circuit, touch screen and touch detection method
CN102005795A (en) Electric quantity detecting device for rechargeable battery
CN105046247A (en) Surface structure identification unit and circuit, identification method and electronic device
CN108896823B (en) Charging resistor detection method
US20130179103A1 (en) Battery analysis device and method thereof
CN105676145A (en) Method and device for detecting temperature and ID of battery
WO2018064865A1 (en) Method and device for acquiring battery power level and electronic device
CN102914744A (en) Mobile terminal, battery power display system of mobile terminal, and method for acquiring battery power
CN103616551B (en) The terminal and cell voltage acquisition methods of cell voltage can be accurately obtained when charging
He et al. Battery state-of-health estimation for mobile devices
CN111239617A (en) Control method and device for charge and discharge test, storage medium and system
CN116299008A (en) Battery SOH prediction method and device, electronic equipment and storage medium
US8884626B2 (en) Device calibration for battery type identification
CN205301547U (en) Electronic load device with self -learning wave form function
CN109342966A (en) Remaining battery life determination method, device, computer equipment and storage medium
CN204925309U (en) Current transformer polarity tester
CN104239675A (en) Method and Device for Determining a Parameter of a Model of a Technical Installation
CN113125974A (en) Method and device for detecting lithium separation of battery

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20170517