Invention content
In view of above-mentioned shortcoming in the prior art, it is an object of the invention to provide a kind of accurate display shifting to the user
The method and system of dynamic end cell total electricity, overcome in the prior art due in mobile terminal battery be used for a long time, battery
The defect for the battery capacity display exception that total electricity becomes smaller caused.
The technical proposal for solving the technical problem of the invention is as follows:
A kind of method of accurate display battery of mobile terminal total electricity, wherein including:
A, corresponding table of the charge and discharge number with battery total electricity is prestored;
B, mobile terminal charge and discharge number is obtained, and according to the corresponding table, it is right to find out the charge and discharge number institute
The battery total electricity answered;
C, the battery total electricity found out is shown.
It is described it is accurate display battery of mobile terminal total electricity method, wherein in the step B obtain mobile terminal fill,
The method of discharge time, including:
B1, battery is filled under charged state total electricity and obtain the total electricity that discharge condition battery is released are obtained;
Whether whether B2, the total electricity being filled with according to the battery exceed beyond the first predetermined electricity and the total electricity of releasing
Second predetermined electricity, judges whether mobile terminal completes a charge and discharge process, if charge and discharge number is then added 1, and it is defeated
Go out to fill, discharge time.
The method of the accurate display battery of mobile terminal total electricity, wherein the step B1 includes:
B11, when detecting that battery capacity changes, obtain current battery charge;
B12, current battery charge is compared with the preceding battery capacity once preserved, if before current battery charge is more than
The battery capacity once preserved thens follow the steps B13, no to then follow the steps B14;
B13, the electricity that battery is filled under present charge state is obtained, and judges whether the electricity being this time filled with exceeds first
Predetermined electricity, if without departing from thening follow the steps B15, being filled with as battery if the electricity that present battery is filled with beyond if total
Electricity;
B14, the electricity that battery is filled under present discharge state is obtained, and judges whether the electricity this time released exceeds second
Predetermined electricity, if without departing from thening follow the steps B16, being released as battery if the electricity that present battery is released beyond if total
Electricity;
B15, step B11 and B12 are repeated, when detecting that battery is in charged state again, obtains electricity under charged state
The electricity that pond is filled with, and it is added with the electricity that last battery is filled with, obtain the total electricity that battery is filled with;
B16, repetition step B11 and B12 are then obtained under discharge condition when detecting that battery is in discharge condition again
The electricity that battery is released, and its electricity released with the last time is added, obtain the total electricity of battery releasing.
The method of the accurate display battery of mobile terminal total electricity, wherein further include in the step A:
Prestore the total electricity released after the completion of the total electricity being filled with after battery charging complete and battery discharge.
The method of the accurate display battery of mobile terminal total electricity, wherein the first predetermined electricity is last electricity
The total electricity being filled with after the charging complete of pond;The second predetermined electricity is the total electricity of releasing after the completion of last battery discharge.
A kind of system of accurate display battery of mobile terminal total electricity, wherein including:
Memory module, for storing corresponding table of the charge and discharge number with battery total electricity;
Total electricity module is obtained, for obtaining mobile terminal charge and discharge number, and according to the corresponding table, finds out institute
State the battery total electricity corresponding to charge and discharge number;
Display module, the battery total electricity for will find out are shown.
The system of the accurate display battery of mobile terminal total electricity, wherein the acquisition total electricity module includes:
Discharge and recharge acquiring unit, for obtaining the total electricity and obtain electricity in discharge condition that battery in charged state is filled with
The total electricity that pond releases;
Charge and discharge number processing unit, total electricity for being filled with according to the battery whether beyond the first predetermined electricity and
Whether the total electricity of releasing exceeds the second predetermined electricity, judges whether mobile terminal completes a charge and discharge process, if then will
Charge and discharge number adds 1, and exports and fill, discharge time.
The system of the accurate display battery of mobile terminal total electricity, wherein the discharge and recharge acquiring unit includes:
Current electric quantity obtains subelement, for when detecting that battery capacity changes, obtaining current battery charge;
Charged state judgment sub-unit, for current battery charge to be compared with the preceding battery capacity once preserved,
Judge that battery is in charged state or discharge condition;
First charging judgment sub-unit, is more than the preceding battery capacity once preserved for current battery charge, obtains current
The electricity that battery is filled under charged state, and judge whether the electricity being this time filled with exceeds the first predetermined electricity;
First electric discharge judgment sub-unit, is less than the preceding battery capacity once preserved for current battery charge, obtains current
The electricity that battery is released under discharge condition, and judge whether the electricity this time released exceeds the second predetermined electricity;
Second charging judgment sub-unit, for when detecting that battery is in charged state again, obtaining under charged state
The electricity that battery is filled with, and it is added with the electricity that last battery is filled with, obtain the total electricity that battery is filled with;
Second electric discharge judgment sub-unit, for when detecting that battery is in discharge condition again, then obtaining discharge condition
The electricity that lower battery is released, and its electricity released with the last time is added, obtain the total electricity of battery releasing.
The system of the accurate display battery of mobile terminal total electricity, wherein the memory module:It is additionally operable to prestore
The total electricity released after the completion of the total electricity and battery discharge being filled with after battery charging complete.
The system of the accurate display battery of mobile terminal total electricity, wherein the first predetermined electricity is last electricity
The total electricity being filled with after the charging complete of pond;The second predetermined electricity is the total electricity of releasing after the completion of last battery discharge.
Advantageous effect, the present invention provides a kind of method and system of accurate display battery of mobile terminal total electricity, pass through
Corresponding table of the charge and discharge number with battery total electricity is prestored, obtains mobile terminal charge and discharge number, and according to described right
Table is answered, the battery total electricity corresponding to the charge and discharge number is found out, the battery total electricity found out is shown, from
And the total electricity of battery can accurately be shown, it avoids because of the abnormal puzzlement brought to user of battery display, makes for user
Facility is provided with mobile terminal.
Specific implementation mode
To make the objectives, technical solutions, and advantages of the present invention clearer and more explicit, develop simultaneously embodiment pair referring to the drawings
The present invention is further described.It should be appreciated that specific embodiment described herein is used only for explaining the present invention, and do not have to
It is of the invention in limiting.
The present invention provides a kind of methods of accurate display battery of mobile terminal total electricity, as shown in Figure 1, the method packet
Include following steps:
S1, corresponding table of the charge and discharge number with battery total electricity is prestored.
In this step, the corresponding table of the complete charge and discharge number FF and battery total electricity that store in the terminal;At this
In table, arbitrary FF values have corresponding battery total electricity value;Therefore, it as long as providing FF values, can obtain in the table corresponding
Battery total electricity value.
Since charge and discharge number is not notable in influence of the short time to battery total electricity, then in the specific corresponding table
In, the charge and discharge number of multiple adjacent numbers can correspond to a battery total electricity, such as:Number 1-50 corresponds to a battery
Total electricity, number 50-100 correspond to a battery total electricity.
The corresponding table of the charge and discharge number and battery total electricity, when carrying out long by the battery to multiple same models
Between obtain after charge and discharge detection, usage time that can also be according to multiple batteries, charge and discharge number, and its battery at this time are total
The methods of electricity obtains.
It is contemplated that in the method, multiple charge and discharge numbers can be prestored in the terminal and battery is always electric
The correspondence table of amount, mobile terminal use the model of battery according to it, identical with its model right from being matched in multiple corresponding tables
Table is answered, to realize the matched and searched of its charge and discharge number and its battery total electricity.
S2, mobile terminal charge and discharge number is obtained, and according to the corresponding table, it is right finds out the charge and discharge number institute
The battery total electricity answered.
In this step, finds out and put with described then by the corresponding table by obtaining charge and discharge number in movement
The electric corresponding battery total amount of number.
Specifically, in order to accurately obtain charging, discharging electric batteries number in mobile terminal, obtained in this step S2 mobile whole
The method for holding charge and discharge number, including:
S21, battery is filled in charged state total electricity and obtain the total electricity that battery is released in discharge condition are obtained.
Whether whether S22, the total electricity being filled with according to the battery surpass beyond the first predetermined electricity and the total electricity of releasing
Go out the second predetermined electricity, judges whether mobile terminal completes a charge and discharge process, if charge and discharge number is then added 1, and
Output is filled, discharge time.
B11, when detecting that battery capacity changes, obtain current battery charge;
B12, current battery charge is compared with the preceding battery capacity once preserved, if before current battery charge is more than
The battery capacity once preserved thens follow the steps B13, no to then follow the steps B14;
B13, the electricity that battery is filled under present charge state is obtained, and judges whether the electricity being this time filled with exceeds first
Predetermined electricity, if without departing from thening follow the steps B15, being filled with as battery if the electricity that present battery is filled with beyond if total
Electricity;
B14, the electricity that battery is filled under present discharge state is obtained, and judges whether the electricity this time released exceeds second
Predetermined electricity, if without departing from thening follow the steps B16, being released as battery if the electricity that present battery is released beyond if total
Electricity;
B15, step B11 and B12 are repeated, when detecting that battery is in charged state again, obtains electricity under charged state
The electricity that pond is filled with, and it is added with the electricity that last battery is filled with, obtain the total electricity that battery is filled with;
B16, repetition step B11 and B12 are then obtained under discharge condition when detecting that battery is in discharge condition again
The electricity that battery is released, and its electricity released with the last time is added, obtain the total electricity of battery releasing.
It in above-mentioned steps B11-B17, first determines whether that battery is in charged state or discharge condition, is filled when detecting to be in
It when electricity condition, then obtains under this charged state, the electricity being filled with, if this electricity being filled with exceeds the first predetermined electricity,
Illustrate this charging complete, can charging times directly be added 1, otherwise illustrate that this is not fully charged, it is therefore desirable to
The electricity that this is filled with is added with the electricity under charged state next time, is by the sum of the charge value being filled with of judgement twice
It is no to be more than the first predetermined electricity, to judge whether battery completes primary fully charged process.
Likewise, if battery is in discharge condition, the electricity released under this discharge condition is also obtained, if the electricity released
It less than the second predetermined electricity, then needs with the electricity released under discharge condition next time mutually to add up it, until adding up and super
Go out the second predetermined electricity, that is, when exceeding the electricity that the primary needs of discharge process completely are released, just calculates it and complete and once discharged
Journey.
It is envisioned that in order to accurately calculate the electricity obtained during next charge and discharge, it is current complete detecting
After primary fully charged or discharge process, battery total electricity cumulative during multiple charge and discharge is subtracted into battery and is worked as
When total capacity, i.e., the total electricity of battery at that time will obtain during remaining electric quantity accumulation to charge or discharge next time
In the electricity taken, whether it is judged beyond the first, second predetermined electricity.
S3, the battery total electricity found out is shown.
It is to be found out to work as in the corresponding table according to the number of the complete charge and discharge obtained in step S2 in this step
The total electricity of preceding battery, the i.e. total capacity of battery at that time, and shown.
In order to obtain the total electricity of the battery total electricity after battery charging complete and battery after the completion of electric discharge, the step S1
In further include:
Prestore the total electricity released after the completion of the total electricity being filled with after battery charging complete and battery discharge.Judging
When battery charging and discharging is completed, the first predetermined electricity is the total electricity being filled with after last battery charging complete;Described second
Predetermined electricity is the total electricity of releasing after the completion of last battery discharge.That is, for the total electricity that can be accurately filled with to battery
Amount is judged, primary to being made whether to complete while being shown to total electricity according to the charge and discharge number of battery
The predetermined electricity of charge and discharge process is updated, i.e., judges whether it completes one according to the real-time total electricity of battery at this time
Secondary charge and discharge process.
It is further to the method by taking its specific embodiment as an example in order to which the above method is described in more details
Explanation.
In specific application, there are one value FF for storage in the terminal, for preserving battery complete charge and discharge
Number(Primary charge and discharge completely refer to the electricity for being filled with total electricity size in battery and release the electricity of total electricity size
Process);It is stored with the other three value FU, FD, CA in the terminal;During wherein FU is for preserving primary charge and discharge completely,
The charge value of charging, when mobile terminal dispatches from the factory, which is 0;During FD is for preserving primary charge and discharge completely, the electricity of electric discharge
Magnitude, when mobile terminal dispatches from the factory, which is 0;CA is used to preserve last obtained battery capacity value.
It is illustrated in figure 2 the step flow chart of application implementation, as described in Figure, the method includes:
Step H10, it detects that battery capacity changes, obtains present battery amount CN;Step H20 is executed later.
Step H20, judge the size of CA and CN, if CN thens follow the steps H30 more than CA, executed if CN is less than CA
Step H40.
Step H30, FU=FU+CN-CA will obtain the electricity that battery is filled under charged state, execute step H50 later.
Step H40, FD=FD+CA-CN will obtain the electricity that battery is released under discharge condition, execute step H50 later.
Step H50, CN is assigned to CA, i.e. CA=CN, i.e., for charge and discharge state next time, this current electric quantity
The charge value that value preserves for its last time;Step H600 is executed later.
Step H60, judge FU, FD and 100 size(100 are equal to 100 when electricity is 100% herein, as electric
Pond total electricity)If meet FU more than or equal to 100 and FD be greater than or equal to 100, FU=FU-100, FD=FD-100, FF=
FF+1 executes step H70 later;If be unsatisfactory for FU is greater than or equal to 100 more than or equal to 100 and FD, do not operate.
Step H70, according to the value of the number FF of battery complete charge and discharge in charge and discharge number table corresponding with capacity
Corresponding battery total electricity value is obtained, and it is the value that battery total electricity, which is arranged,.
Wherein, described FF, FU, FD, CA are stored in the power down nonvolatile memory such as EEPROM, FLASH.
Under the premise of the above method, the present invention provides a kind of system of accurate display battery of mobile terminal total electricity, such as
Shown in Fig. 3, the system comprises:
Memory module 110, for storing corresponding table of the charge and discharge number with battery total electricity;
Total electricity module 120 is obtained, for obtaining mobile terminal charge and discharge number, and according to the corresponding table, is found out
Battery total electricity corresponding to the charge and discharge number;
Display module 130, the battery total electricity for will find out are shown.
Specifically, the acquisition total electricity module 120 includes:
Discharge and recharge acquiring unit, for obtaining the total electricity and obtain electricity in discharge condition that battery in charged state is filled with
The total electricity that pond releases;
Charge and discharge number processing unit, total electricity for being filled with according to the battery whether beyond the first predetermined electricity and
Whether the total electricity of releasing exceeds the second predetermined electricity, judges whether mobile terminal completes a charge and discharge process, if then will
Charge and discharge number adds 1, and exports and fill, discharge time.
The discharge and recharge acquiring unit includes:
Current electric quantity obtains subelement, for when detecting that battery capacity changes, obtaining current battery charge;
Charged state judgment sub-unit, for current battery charge to be compared with the preceding battery capacity once preserved,
Judge that battery is in charged state or discharge condition;
First charging judgment sub-unit, is more than the preceding battery capacity once preserved for current battery charge, obtains current
The electricity that battery is filled under charged state, and judge whether the electricity being this time filled with exceeds the first predetermined electricity;
First electric discharge judgment sub-unit, is less than the preceding battery capacity once preserved for current battery charge, obtains current
The electricity that battery is released under discharge condition, and judge whether the electricity this time released exceeds the second predetermined electricity;
Second charging judgment sub-unit, for when detecting that battery is in charged state again, obtaining under charged state
The electricity that battery is filled with, and it is added with the electricity that last battery is filled with, obtain the total electricity that battery is filled with;
Second electric discharge judgment sub-unit, for when detecting that battery is in discharge condition again, then obtaining discharge condition
The electricity that lower battery is released, and its electricity released with the last time is added, obtain the total electricity of battery releasing.
The memory module:After the completion of being additionally operable to prestore the total electricity being filled with after battery charging complete and battery discharge
The total electricity of releasing.
The first predetermined electricity is the total electricity being filled with after last battery charging complete;The second predetermined electricity is
The total electricity released after the completion of last battery discharge.
The present invention provides a kind of method and system of accurate display battery of mobile terminal total electricity, by prestoring
The corresponding table of charge and discharge number and battery total electricity obtains mobile terminal charge and discharge number, and according to the corresponding table, searches
Go out the battery total electricity corresponding to the charge and discharge number, the battery total electricity found out is shown, so as to will be electric
The total electricity in pond is accurately shown, is avoided because the abnormal puzzlement brought to user of battery display, mobile terminal is used for user
Facility is provided.
It, can according to the technique and scheme of the present invention and its hair it is understood that for those of ordinary skills
Bright design is subject to equivalent substitution or change, and all these changes or replacement should all belong to the guarantor of appended claims of the invention
Protect range.