CN106772091B - Method and device for updating battery capacity value and terminal - Google Patents

Method and device for updating battery capacity value and terminal Download PDF

Info

Publication number
CN106772091B
CN106772091B CN201611260907.7A CN201611260907A CN106772091B CN 106772091 B CN106772091 B CN 106772091B CN 201611260907 A CN201611260907 A CN 201611260907A CN 106772091 B CN106772091 B CN 106772091B
Authority
CN
China
Prior art keywords
value
battery
terminal
battery capacity
temperature
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.)
Expired - Fee Related
Application number
CN201611260907.7A
Other languages
Chinese (zh)
Other versions
CN106772091A (en
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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201611260907.7A priority Critical patent/CN106772091B/en
Publication of CN106772091A publication Critical patent/CN106772091A/en
Application granted granted Critical
Publication of CN106772091B publication Critical patent/CN106772091B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/3644Constructional arrangements
    • G01R31/3648Constructional arrangements comprising digital calculation means, e.g. for performing an algorithm

Abstract

The embodiment of the invention discloses a method, a device and a terminal for updating a battery capacity value. The method for updating the battery capacity value comprises the following steps: detecting the working state of the terminal; when the terminal is detected to enter a pre-marked working state, acquiring a corresponding battery parameter value and a preset battery capacity calculation expression; calculating the preset battery capacity calculation expression according to the battery parameter value to obtain a corresponding output value; and updating the battery capacity value according to the output value, and calculating the residual capacity of the battery according to the updated battery capacity value. Because the terminal updates the battery capacity value when the terminal is in the pre-marked working state, and the updated battery capacity value is closer to the actual capacity value of the battery, the residual capacity value calculated according to the updated battery capacity value is also closer to the actual residual capacity of the battery, namely, the accuracy of calculating the residual capacity of the battery by the terminal can be improved.

Description

Method and device for updating battery capacity value and terminal
Technical Field
The invention belongs to the technical field of batteries, and particularly relates to a method, a device and a terminal for updating a battery capacity value.
Background
The terminal can calculate the residual electric quantity value of the terminal battery through a coulomb counter (also called coulomb counter). The calculation method needs to obtain various parameter values of the terminal battery, wherein the parameter values include a rated capacity value of the battery, and then the parameter values are substituted into a calculation formula to calculate the residual capacity value of the battery.
However, in actual use, many factors affect the capacity value of the battery, such as the use environment and the aging of the battery itself. Therefore, the accuracy of the remaining capacity calculated from the rated capacity value of the battery is low.
Disclosure of Invention
The embodiment of the invention provides a method, a device and a terminal for updating a battery capacity value, which can improve the accuracy of calculating the residual capacity of a battery by the terminal.
The embodiment of the invention provides a method for updating a battery capacity value, which comprises the following steps:
detecting the working state of the terminal;
when the terminal is detected to enter a pre-marked working state, acquiring a corresponding battery parameter value and a preset battery capacity calculation expression;
calculating the preset battery capacity calculation expression according to the battery parameter value to obtain a corresponding output value;
and updating the battery capacity value according to the output value, and calculating the residual capacity of the battery according to the updated battery capacity value.
An embodiment of the present invention further provides an apparatus for updating a battery capacity value, including:
the detection module is used for detecting the working state of the terminal;
the acquisition module is used for acquiring a corresponding battery parameter value and a preset battery capacity calculation expression when the terminal is detected to enter a pre-marked working state;
the calculation module is used for calculating the preset battery capacity calculation expression according to the battery parameter value to obtain a corresponding output value;
and the updating module is used for updating the battery capacity value according to the output value and calculating the residual electric quantity of the battery according to the updated battery capacity value.
The embodiment of the present invention further provides a terminal, which includes a memory, a processor, and a computer program that is stored in the memory and can be run in the processor, and when the processor executes the computer program, the steps in the method for updating a battery capacity value provided in the embodiment of the present invention are implemented.
According to the method, the device and the terminal for updating the battery capacity value, provided by the embodiment of the invention, the terminal detects the working state of the terminal. When the working state of the terminal is detected to be the pre-marked working state, the terminal can be triggered to acquire the battery parameter value corresponding to the pre-marked working state and the preset battery capacity calculation expression. Then, the terminal may calculate the preset battery capacity calculation expression according to the battery parameter value, and obtain a corresponding output value. Then, the terminal may update the battery capacity value according to the output value, and calculate the remaining capacity value of the battery according to the updated battery capacity value. Because the terminal updates the battery capacity value when the terminal is in the pre-marked working state, and the updated battery capacity value is closer to the actual capacity value of the battery, the residual capacity value calculated according to the updated battery capacity value is also closer to the actual residual capacity of the battery, namely, the accuracy of calculating the residual capacity of the battery by the terminal can be improved.
Drawings
The technical solution and the advantages of the present invention will be apparent from the following detailed description of the embodiments of the present invention with reference to the accompanying drawings.
Fig. 1 is a schematic flow chart illustrating a method for updating a battery capacity value according to an embodiment of the present invention.
Fig. 2 is another flow chart of a method for updating a battery capacity value according to an embodiment of the present invention.
Fig. 3 is a scene diagram illustrating a method for updating a battery capacity value according to an embodiment of the present invention.
Fig. 4 is a schematic flowchart of a method for updating a battery capacity value according to an embodiment of the present invention.
Fig. 5 is another schematic view of a scenario of a method for updating a battery capacity value according to an embodiment of the present invention.
Fig. 6 is a schematic structural diagram of an apparatus for updating a battery capacity value according to an embodiment of the present invention.
Fig. 7 is another schematic structural diagram of an apparatus for updating a battery capacity value according to an embodiment of the present invention.
Fig. 8 is a schematic structural diagram of a mobile terminal according to an embodiment of the present invention.
Detailed Description
Referring to the drawings, wherein like reference numbers refer to like elements, the principles of the present invention are illustrated as being implemented in a suitable computing environment. The following description is based on illustrated embodiments of the invention and should not be taken as limiting the invention with regard to other embodiments that are not detailed herein.
As will be described in detail below.
Referring to fig. 1, fig. 1 is a schematic flow chart illustrating a method for updating a battery capacity value according to an embodiment of the present invention, where the flow chart may include:
in step S101, the operating state of the terminal is detected.
It can be understood that the execution subject of the embodiment of the present invention may be a terminal device such as a smart phone and a tablet computer.
For example, many terminal devices on the market calculate the residual electric quantity value of the terminal battery through an electric quantity meter. This approach requires the acquisition of several parameter values of the terminal battery, including the nominal capacity value of the battery. Then, the parameter values are substituted into a certain calculation formula to calculate the residual electric quantity value of the battery. However, in practice, the capacity value of the battery is affected by many factors, such as temperature and aging of the battery itself. Therefore, the accuracy of the remaining capacity calculated from the rated capacity value of the battery is low.
In step S101 of the embodiment of the present invention, the terminal may first detect the operating state of the terminal.
It should be noted that the working state of the terminal may include, for example, a power-on state, a power-off state, a charging state, a discharging state (not charging) during normal use, and the like, and this is by way of example and is not meant to limit the present invention.
In step S102, when it is detected that the terminal enters the pre-marked operating state, a corresponding battery parameter value and a preset battery capacity calculation expression are obtained.
For example, when the terminal detects that the terminal enters the pre-marked working state, the terminal may be triggered to acquire a battery parameter value corresponding to the pre-marked working state and a preset battery capacity calculation expression. That is, when the terminal enters different pre-marked operating states, the terminal needs to obtain parameter values of different parameter items and different preset battery capacity calculation expressions.
It should be noted that the terminal may mark some operation states in advance to make them into the operation states marked in advance. For example, the pre-marked operating states may include a power-on state, a charging state, and the like.
In a possible implementation manner, the terminal may generate a preset correspondence table in advance, where the preset correspondence table carries the operation states marked in advance, the parameter items to be acquired, and the preset battery capacity calculation expression.
For example, the preset correspondence table may include the contents in table 1:
table 1: corresponding relation table of pre-marked working state, parameter value and battery capacity calculation expression
Figure BDA0001199784200000041
Based on this, for example, when the terminal detects that the working state of the terminal is the pre-marked startup state, the terminal may be triggered to acquire the current temperature value of the battery corresponding to the startup state and the preset function expression according to table 1. When the terminal detects that the working state is the pre-marked charging state, the terminal can be triggered to acquire a residual electric quantity value corresponding to the charging state when the battery starts to be charged, an electric charge quantity charged into the battery when the electric quantity is full, a preset mathematical expression and the like according to the table 1.
In one possible implementation, step S102 may include:
when detecting that the terminal enters a pre-marked working state, detecting whether the battery capacity value of the terminal is updated within a preset time range;
and if the battery capacity value of the terminal is not updated within the preset time range, acquiring a corresponding battery parameter value and a preset battery capacity calculation expression.
For example, when the terminal detects that its own operating state is the operating state marked in advance, the terminal may also detect whether it has updated the battery capacity value within a preset time range. For example, the preset time range may be within the last 6 hours of the current time.
If it is detected that the terminal does not update the battery capacity value of the terminal within the preset time range, the terminal may be triggered to acquire a battery parameter value corresponding to the pre-marked operating state and a preset battery capacity calculation expression.
If it is detected that the terminal has updated the battery capacity value of the terminal within the preset time range, the terminal may not update the battery capacity value temporarily. For example, the terminal detects that the user charges the terminal battery at time T1. At this point, the terminal may be triggered to detect whether it has updated the battery capacity value within 6 hours before time T1. For example, the terminal detects that it has updated the battery capacity value at time T0, which is 3 hours before time T1. In this case, the terminal may temporarily stop updating the battery capacity value, that is, the terminal does not need to obtain the remaining electric quantity value when the battery starts to be charged, the electric quantity charged into the battery when the electric quantity is fully charged, and the preset mathematical expression corresponding to the charging state during the charging process, and calculates the preset mathematical expression according to the remaining electric quantity value and the electric quantity to obtain the corresponding output value.
It can be understood that, when it is detected that the terminal enters the pre-marked operating state, it is further detected whether the terminal has updated the battery capacity value within the preset time range, and only when it is detected that the terminal has not updated the battery capacity value within the preset time range, the terminal is triggered to execute the step of updating the battery capacity value. That is, when it is detected that the terminal has already updated the battery capacity value within the preset time range, the terminal may cancel the step of updating the battery capacity value this time, thereby reducing the number of times of updating the battery capacity value. By the method, the occupation of the computing resources of the terminal can be reduced, and the burden of the terminal is lightened.
In step S103, the preset battery capacity calculation expression is calculated according to the battery parameter value, and a corresponding output value is obtained.
For example, after the terminal obtains the parameter value corresponding to the pre-marked working state where the terminal is currently located and the preset battery capacity calculation expression, the terminal may calculate the preset battery capacity calculation expression according to the parameter value to obtain the corresponding output value.
For example, after acquiring a current temperature value of the battery corresponding to the power-on state and a preset function expression, the terminal may calculate a dependent variable of the preset function expression, where the preset function expression takes the current temperature value as an independent variable. The dependent variable obtained by calculation is the corresponding output value.
In step S104, the battery capacity value is updated according to the output value, and the remaining capacity of the battery is calculated based on the updated battery capacity value.
For example, after the preset battery capacity calculation expression is calculated and a corresponding output value is obtained, the terminal may update the battery capacity value according to the output value, and then calculate the remaining capacity of the battery according to the updated battery capacity value.
For example, after calculating a dependent variable of a preset function expression with the current temperature value of the battery as an independent variable, the terminal may update the battery capacity value according to the dependent variable. After the battery capacity value is updated, the terminal can calculate the residual capacity of the battery by using the updated battery capacity value.
It can be understood that, since the battery capacity value is updated when the terminal is in the operation state marked in advance, and the updated battery capacity value is closer to the actual capacity value of the battery, the residual capacity value calculated according to the updated battery capacity value is also closer to the actual residual capacity of the battery, so that the accuracy of calculating the residual capacity of the battery by the terminal can be improved.
As can be seen from the above, the method for updating the battery capacity value according to the present embodiment first detects the operating state of the terminal itself. When the working state of the terminal is detected to be the pre-marked working state, the terminal can be triggered to acquire the battery parameter value corresponding to the pre-marked working state and the preset battery capacity calculation expression. Then, the terminal may calculate the preset battery capacity calculation expression according to the battery parameter value, and obtain a corresponding output value. Then, the terminal may update the battery capacity value according to the output value, and calculate the remaining capacity value of the battery according to the updated battery capacity value. Because the battery capacity value is updated when the terminal is in the pre-marked working state, and the updated battery capacity value is closer to the actual capacity value of the battery, the residual capacity value calculated according to the updated battery capacity value is also closer to the actual residual capacity of the battery, namely, the accuracy of calculating the residual capacity of the battery by the terminal can be improved.
Referring to fig. 2, fig. 2 is another schematic flow chart of a method for updating a battery capacity value according to an embodiment of the present invention, where the flow chart may include:
in step S201, the terminal detects an operating state.
In step S202, when it is detected that the operating state of the terminal is the power-on state, the terminal obtains a current temperature value of the battery.
For example, in a possible implementation, the following steps may be further included before step S201:
obtaining a plurality of battery temperature value samples and battery capacity value samples corresponding to the battery temperature value samples;
generating temperature intervals according to the battery temperature value sample, wherein each temperature interval comprises an upper temperature limit value and a lower temperature limit value;
acquiring a battery capacity value corresponding to each temperature upper limit value and a battery capacity value corresponding to each temperature lower limit value according to the battery capacity value sample;
and generating a function expression corresponding to each temperature interval according to the upper temperature limit value, the lower temperature limit value, the battery capacity value corresponding to the upper temperature limit value and the battery capacity value corresponding to the lower temperature limit value of each temperature interval, and determining the function expression as a preset function expression.
For example, the terminal may obtain 4 battery temperature value samples and battery capacity value samples corresponding to the 4 battery temperature value samples. For example, the 4 battery temperature value samples acquired by the terminal are-10 ℃,0 ℃,25 ℃ and 50 ℃, and the battery capacity value samples corresponding to the 4 temperature value samples are 2500mAh, 2700mAh, 3000mAh and 2600mAh, respectively.
In one possible embodiment, the battery capacity value samples corresponding to each battery temperature value sample may be obtained as follows: and under the environment of a laboratory, controlling the temperature of the battery to be kept at a set temperature value, and fully charging the battery under the environment of the set temperature value. Then, the battery is discharged according to the set current magnitude until the battery stops discharging, and the discharge time length of the battery during the discharge time is recorded. And then multiplying the discharge current value by the discharge time to calculate the capacity value of the battery.
For example, the battery temperature is controlled to be kept at 25 ℃, and the battery is fully charged in this temperature environment. And then, discharging the battery at the current of 500mA in the temperature environment until the battery is discharged, recording that the discharge time of the battery is 6 hours, and multiplying the discharge current value of 500mA by the discharge time of 6 hours to obtain the battery capacity value of 3000 mAh. The battery has a control circuit for self-protection, and when it is detected that the voltage of the battery has dropped to a discharge cutoff voltage during discharge of the battery, the battery stops discharging, but a small amount of electricity remains in the battery at this time. Since this amount of power is small and does not participate in the battery discharge, it can be ignored when calculating the battery capacity value.
After the battery temperature value samples and the battery capacity value samples corresponding to the battery temperature value samples are counted, the sample values can be stored in a preset file of the terminal for the terminal to call.
After obtaining a plurality of battery temperature value samples and corresponding battery capacity value samples, the terminal may first generate temperature intervals according to the battery temperature value samples, where each generated temperature interval includes an upper temperature limit value and a lower temperature limit value.
For example, the terminal generates temperature ranges of [ -10,0], [0,25] and [25,50] from the acquired 4 battery temperature value samples of-10 ℃,0 ℃,25 ℃ and 50 ℃.
After the temperature intervals are generated, the terminal may obtain a battery capacity value corresponding to the upper temperature limit value and a battery capacity value corresponding to the lower temperature limit value of each temperature interval according to the previously obtained battery capacity value sample. For example, in the temperature range [0,25], the battery capacity value corresponding to the temperature lower limit value of 0 ℃ is 2700mAh, and the battery capacity value corresponding to the temperature upper limit value of 25 ℃ is 3000 mAh.
Then, the terminal may generate a function expression corresponding to each temperature interval according to the temperature upper limit value, the temperature lower limit value, the battery capacity value corresponding to the temperature upper limit value, and the battery capacity value corresponding to the temperature lower limit value of each temperature interval, and determine the function expression as a corresponding preset function expression.
In one possible embodiment, the generated functional expression corresponding to each temperature interval may be a linear functional expression. For example, for the temperature interval [0,25], with (0,2700) and (25, 3000) as two points on the straight-line image of the corresponding linear function expression, then the linear function expression obtained by calculation is y equal to 12x + 2700. Similarly, for the temperature interval [ -10,0], the corresponding linear function expression generated is y ═ 20x + 2700. For the temperature interval [25,50], the corresponding linear function expression is generated as y ═ 16x + 3400.
After generating the function expression corresponding to each temperature zone, the terminal may determine the function expression as a preset function expression corresponding to each temperature zone. For example, the terminal may generate a correspondence table, as shown in table 2:
table 2: corresponding relation table of temperature interval and preset function expression
Temperature interval Corresponding preset function expression
[-10,0] y=20x+2700
[0,25] y=12x+2700
[25,50] y=-16x+3400
In the actual use process of the terminal, for example, steps S201 and S202 may include:
the terminal can detect the working state of the terminal, and when the working state of the terminal is detected to be the starting state, the terminal can be triggered to acquire the current temperature value of the battery.
In step S203, the terminal obtains a corresponding preset function expression according to the current temperature value.
For example, after obtaining the current temperature value of the battery, the terminal may obtain a corresponding preset function expression according to the current temperature value.
In a possible implementation manner, the terminal may determine a temperature interval to which the current temperature value belongs according to the current temperature value of the battery, and then obtain a preset function expression corresponding to the temperature interval.
For example, in step S202, the current temperature value of the battery acquired by the terminal is 22 ℃. The terminal determines that the current temperature value belongs to the temperature interval [0,25], and then the terminal may look up table 2 and obtain a preset function expression y corresponding to the temperature interval as 12x + 2700.
In step S204, the terminal calculates a dependent variable of the preset function expression, where the preset function expression takes the current temperature value as an independent variable.
For example, after obtaining a preset function expression corresponding to the current temperature value of the battery, the terminal may calculate a dependent variable of the preset function expression, where the preset function expression uses the current temperature value as an independent variable.
For example, after the preset function expression y is obtained as 12x +2700, the terminal may calculate the preset function expression y as 12x +2700 using the value of the current temperature value 22 ℃ as an independent variable, and obtain a dependent variable as 2964.
In step S205, the terminal updates the battery capacity value according to the dependent variable, and calculates the remaining capacity of the battery according to the updated battery capacity value.
For example, after the dependent variable of the preset function expression is obtained through calculation, the terminal may update the battery capacity value according to the dependent variable, and calculate the remaining capacity of the battery according to the updated battery capacity value.
For example, after the dependent variable 2964 is calculated, the terminal may replace the original battery capacity value with the dependent variable 2964. And, before the next update of the battery capacity value, the control terminal calculates the remaining capacity of the battery according to the updated battery capacity value 2964 mAh.
It can be understood that, because the remaining capacity of the battery needs to be calculated when the terminal is powered on, the battery capacity value is updated according to the battery temperature value when the terminal is powered on, so that the updated battery capacity value is closer to the actual capacity value, and the remaining capacity of the battery calculated according to the updated battery capacity value is also closer to the actual remaining capacity value, that is, the accuracy of calculating the remaining capacity of the terminal can be improved by the method.
Referring to fig. 3, fig. 3 is a scene diagram illustrating a method for updating a battery capacity value according to an embodiment of the present invention.
For example, the terminal is originally in the power-off state, and then the user picks up the terminal and triggers the terminal power key with the thumb to perform the power-on operation on the terminal, and at this time, the terminal detects that the terminal enters the power-on state.
When the working state of the terminal is detected to be the starting state, the terminal can be triggered to acquire the current temperature value of the battery. For example, the current temperature value of the battery acquired by the terminal is 22 ℃. Then, the terminal can read the preset correspondence table (i.e. table 2), and determine that the current temperature value 22 ℃ belongs to the preset temperature interval [0,25 ]. Then, the terminal may query the preset relationship table, and obtain the function expression y corresponding to the temperature interval [0,25] as 12x + 2700.
After the function expression y is obtained to be 12x +2700, the terminal may calculate the preset function expression y to be 12x +2700 by using the value 22 of the current temperature value 22 ℃ as an independent variable, and obtain a dependent variable to be 2964.
After the dependent variable 2964 is obtained through calculation, the terminal may replace the original battery capacity value with the dependent variable 2964, that is, update the battery capacity value to 2964 mAh. And, before the next update of the battery capacity value, the control terminal calculates the remaining capacity of the battery according to the updated battery capacity value 2964 mAh.
Referring to fig. 4, fig. 4 is a schematic flow chart illustrating a method for updating a battery capacity value according to an embodiment of the present invention, where the flow chart includes:
in step S301, the terminal detects an operating state.
In step S302, when the operating state of the terminal is detected as a charging state, the terminal acquires a remaining charge value of the battery when charging is started and an amount of charge charged in the battery when the battery is fully charged.
For example, steps S301 and S302 may include:
and the terminal detects the working state of the terminal. When it is detected that the user charges the terminal, that is, the working state of the terminal is a charging state, the terminal may be triggered to acquire the remaining charge value of the battery when the terminal starts to charge and the charge amount charged to the battery when the battery is fully charged (that is, the coulomb amount charged to the battery).
For example, when the operating state of the terminal is detected to be a charging state, the remaining electric quantity value of the battery at the time of starting charging acquired by the terminal is 50% of the total electric quantity of the battery. After a period of time, the terminal detects that the battery is fully charged, and the terminal stops charging. At this time, the amount of charge charged in the battery is acquired by the terminal. For example, the amount of charge charged in the battery when the terminal is fully charged, which is read by the electricity meter, is 1480 mAh.
In step S303, the terminal acquires a preset mathematical expression corresponding to the charging state.
In step S304, the terminal calculates the preset mathematical expression according to the residual electric quantity value and the electric charge amount to obtain a corresponding output value.
For example, steps S303 and S304 may include:
after the residual electric quantity value when the battery starts to be charged and the electric charge amount charged into the battery when the electric quantity is fully charged are obtained, the terminal can be triggered to obtain a preset mathematical expression corresponding to the charging state. The preset mathematical expression is an expression for calculating a battery capacity value.
In one possible implementation, the preset mathematical expression may be fcc ═ cc/(100% -d 0). In the preset mathematical expression, fcc represents a battery capacity value, cc represents an amount of charge charged in the battery when the battery is fully charged, and d0 represents a percentage of remaining capacity when the battery starts to be charged, that is, a percentage of the remaining capacity to the total capacity.
It should be noted that the preset mathematical expression is obtained by calculating the expression soc-d 0+ (cc/fcc) × 100% according to the power of the terminal system. In the system power calculation expression, soc represents a percentage of a remaining power of the system, d0 represents a percentage of an initial power of the system, cc represents a power added or consumed by the system, cc is a positive value when charging, cc is a negative value when discharging, and fcc represents a battery capacity value. Soc defaults to 100% when fully charged.
After the preset mathematical expression is obtained, the terminal may calculate the preset mathematical expression according to the remaining power value (remaining power percentage) obtained in step S302 when the battery starts to be charged and the amount of charge charged in the battery when the battery is fully charged, so as to obtain a corresponding output value.
For example, in step S302, if the percentage of the remaining charge obtained by the terminal at the time of starting charging is 50%, and the amount of charge charged into the battery at the time of full charge is 1480mAh, then the preset mathematical expression is calculated from these two values to obtain fcc 1480 mAh/(100% -50%): 2960 mAh.
In step S305, the terminal updates the battery capacity value in accordance with the output value, and calculates the remaining capacity of the battery based on the updated battery capacity value.
For example, after the preset mathematical expression is calculated to obtain the output value of the preset mathematical expression, the terminal may update the battery capacity value according to the output value, and control the terminal to calculate the remaining capacity of the battery according to the updated battery capacity value.
For example, if the battery capacity value fcc calculated by the terminal according to the preset mathematical expression is 2960mAh, the terminal may replace the original battery capacity value of the terminal with 2960 mAh. And, before the next update of the battery capacity value, the control terminal calculates the remaining capacity of the battery according to the updated battery capacity value 2960 mAh.
It is understood that the battery automatically stops charging when it is fully charged, to prevent overcharging. Therefore, the percentage of the electric quantity of the battery when the battery is fully charged can be defaulted to 100%, the percentage of the residual electric quantity of the battery when the battery starts to be charged is subtracted from 100%, the obtained percentage is the percentage of the electric quantity charged into the battery in the capacity value of the battery, the electric quantity charged into the battery can be accurately counted through an electric meter, and therefore the capacity value of the battery calculated according to the electric quantity charged into the battery is closer to the actual capacity value of the battery. Therefore, the remaining capacity calculated from the updated battery capacity value is also closer to the actual remaining capacity, i.e., the accuracy of calculating the remaining capacity of the battery can be improved in this way.
Referring to fig. 5, fig. 5 is a schematic view illustrating another scenario of the method for updating the battery capacity value according to the embodiment of the present invention.
For example, a user accesses a charging line to the terminal for charging, and at this time, the terminal detects that its own working state is a charging state. In this case, the terminal may be triggered to acquire the remaining charge value of the battery at the start of charging, and the charge amount (i.e., coulomb amount) charged to the battery at the full charge.
For example, when the operating state of the terminal is detected to be a charging state, the remaining electric quantity value of the battery at the time of starting charging acquired by the terminal is 50% of the total electric quantity of the battery. After a period of time, the terminal detects that the battery is fully charged, and the terminal stops charging. At this time, the amount of charge charged in the battery when the terminal is fully charged through the electricity meter is 1490 mAh.
After acquiring the remaining capacity percentage of the battery at the time of starting charging, and the amount of charge 1490mAh charged into the battery at the time of full charge, the terminal may acquire a preset mathematical expression corresponding to the state of charge, the preset mathematical expression being an expression for calculating the capacity value of the battery. In one possible implementation, the preset mathematical expression may be fcc ═ cc/(100% -d 0). In the preset mathematical expression, fcc represents a battery capacity value, cc represents an amount of charge charged in the battery when the battery is fully charged, and d0 represents a percentage of remaining capacity when the battery starts to be charged, that is, a percentage of the remaining capacity to the total capacity.
For example, when d0 is 50% and cc 1480mAh is substituted into the above-mentioned preset mathematical expression fcc/(100% -d0), fcc 2960mAh can be calculated.
After calculating an output value 2960mAh of a preset mathematical expression fcc ═ cc/(100% -d0), the terminal can replace the original battery capacity value of the terminal with 2960 mAh. And, before the next update of the battery capacity value, the control terminal calculates the remaining capacity of the battery according to the updated battery capacity value 2960 mAh.
It should be noted that, in the embodiment of the present invention, each time the terminal detects that the terminal enters the pre-marked power-on state or charging state, the terminal may be triggered to execute a corresponding step of updating the battery capacity value. Alternatively, when detecting that the operating state of the terminal is the pre-marked operating state, the terminal may first detect whether the update of the battery capacity value has been performed within a preset time range. If it is detected that the battery capacity value is not updated within the preset time range, the terminal may be triggered to execute a corresponding step of updating the battery capacity value. If it is detected that the battery capacity value has been updated within the preset time range, the terminal may not perform the corresponding step of updating the battery capacity value, but wait for the next update opportunity.
The embodiment of the invention also provides a device for updating the battery capacity value based on the method for updating the battery capacity value. The term is the same as that in the above-described method for updating the battery capacity value, and specific implementation details may refer to the description in the method embodiment.
Referring to fig. 6, fig. 6 is a schematic structural diagram of an apparatus for updating a battery capacity value according to an embodiment of the present invention. The apparatus 300 for updating the battery capacity value may include: a detection module 301, an acquisition module 302, a calculation module 303, and an update module 304.
A detecting module 301, configured to detect a working state of the terminal.
For example, the detection module 301 of the terminal may detect the working state of the terminal.
It should be noted that the working state of the terminal may include, for example, a power-on state, a power-off state, a charging state, a discharging state (not charging) during normal use, and the like, and this is by way of example and is not meant to limit the present invention.
The obtaining module 302 is configured to obtain a corresponding battery parameter value and a preset battery capacity calculation expression when it is detected that the terminal enters a pre-marked working state.
For example, in the process that the detection module 301 detects the operating state of the terminal, if the detection module 301 detects that the terminal enters the pre-marked operating state, the acquisition module 302 of the terminal may be triggered to acquire the battery parameter value corresponding to the pre-marked operating state and the preset battery capacity calculation expression. That is, when the terminal enters different pre-marked operating states, the obtaining module 302 needs to obtain parameter values of different parameter items and different preset battery capacity calculation expressions.
It should be noted that the terminal may mark some operation states in advance to make them into the operation states marked in advance. For example, the pre-marked operating states may include a power-on state, a charging state, and the like.
In a possible implementation manner, the terminal may generate a preset correspondence table in advance, where the preset correspondence table carries the operation states marked in advance, the parameter items to be acquired, and the preset battery capacity calculation expression.
For example, the preset correspondence table may include the contents in table 1:
table 1: corresponding relation table of pre-marked working state, parameter value and battery capacity calculation expression
Figure BDA0001199784200000131
Based on this, for example, when the detection module 301 detects that the operating state of the terminal is the pre-marked power-on state, the obtaining module 302 may be triggered to obtain the current temperature value of the battery corresponding to the power-on state and the preset function expression according to table 1. When the detecting module 301 detects that the operating state is the pre-marked charging state, the obtaining module 302 may be triggered to obtain, according to table 1, a remaining charge value when the battery starts to be charged, a charge amount charged into the battery when the battery is fully charged, and a preset mathematical expression, etc. corresponding to the charging state.
In one possible implementation, the obtaining module 302 may be configured to:
when detecting that the terminal enters a pre-marked working state, detecting whether the battery capacity value of the terminal is updated within a preset time range;
and if the battery capacity value of the terminal is not updated within the preset time range, acquiring a corresponding battery parameter value and a preset battery capacity calculation expression.
For example, when the detecting module 301 detects that its own operating state is the operating state marked in advance, the obtaining module 302 may first detect whether it has updated the battery capacity value within a preset time range. For example, the preset time range may be within the last 6 hours of the current time.
If it is detected that the terminal has not updated the battery capacity value of the terminal within the preset time range, the obtaining module 302 may be triggered to obtain the battery parameter value corresponding to the pre-marked operating state and the preset battery capacity calculation expression.
If it is detected that the terminal has updated the battery capacity value of the terminal within the preset time range, the terminal may not update the battery capacity value temporarily. For example, the detection module 301 detects that the user charges the terminal battery at time T1. At this point, the acquisition module 302 may be triggered to detect whether it has updated the battery capacity value within 6 hours prior to time T1. For example, the acquisition module 302 detects that it has updated the battery capacity value at time T0, which is 3 hours before time T1. In this case, the terminal may temporarily stop updating the battery capacity value, that is, the terminal does not need to obtain the remaining electric quantity value when the battery starts to be charged, the electric quantity charged into the battery when the electric quantity is fully charged, and the preset mathematical expression corresponding to the charging state during the charging process, and calculates the preset mathematical expression according to the remaining electric quantity value and the electric quantity to obtain the corresponding output value.
It can be understood that, when it is detected that the terminal enters the pre-marked operating state, it is further detected whether the terminal has updated the battery capacity value within the preset time range, and only when it is detected that the terminal has not updated the battery capacity value within the preset time range, the terminal is triggered to execute the step of updating the battery capacity value. That is, when it is detected that the terminal has already updated the battery capacity value within the preset time range, the terminal may cancel the step of updating the battery capacity value this time, thereby reducing the number of times of updating the battery capacity value. By the method, the occupation of the computing resources of the terminal can be reduced, and the burden of the terminal is lightened.
The calculating module 303 is configured to calculate the preset battery capacity calculation expression according to the battery parameter value, so as to obtain a corresponding output value.
For example, after the obtaining module 302 obtains the parameter value corresponding to the pre-marked working state where the terminal is currently located and the preset battery capacity calculation expression, the calculating module 303 may calculate the preset battery capacity calculation expression according to the parameter value to obtain the corresponding output value.
For example, after the obtaining module 302 obtains the current temperature value of the battery corresponding to the power-on state and a preset function expression, the calculating module 303 may calculate a dependent variable of the preset function expression, where the preset function expression takes the current temperature value as an independent variable. The dependent variable obtained by calculation is the corresponding output value.
And the updating module 304 is configured to update the battery capacity value according to the output value, and calculate the remaining capacity of the battery according to the updated battery capacity value.
For example, after the calculation module 303 calculates the preset battery capacity calculation expression and obtains the corresponding output value, the update module 304 of the terminal may update the battery capacity value according to the output value, and then calculate the remaining capacity of the battery according to the updated battery capacity value.
For example, after the calculating module 303 calculates the dependent variable of the preset function expression with the current temperature value of the battery as the independent variable, the updating module 304 may update the battery capacity value according to the dependent variable. After the battery capacity value is updated, the terminal can calculate the residual capacity of the battery by using the updated battery capacity value.
For example, in one possible implementation, the obtaining module 302 of the terminal may be configured to:
when the working state of the terminal is detected to be a charging state, acquiring a residual electric quantity value of the battery when the charging is started and an electric charge amount charged into the battery when the electric quantity is full;
and acquiring a preset mathematical expression corresponding to the charging state.
Based on this, the calculation module 303 may be configured to: and calculating the preset mathematical expression according to the residual electric quantity value and the electric charge quantity to obtain a corresponding output value.
For example, when the detection module 301 detects that the operating state of the terminal is a charging state, the acquisition module 302 may be triggered to acquire the remaining charge value of the battery when the terminal starts to be charged, and the charge amount (i.e., coulomb amount) charged in the battery when the terminal is fully charged.
For example, the obtaining module 302 obtains the remaining capacity value of the battery at the time of starting charging to be 50% of the total capacity of the battery. After a period of time, the terminal detects that the battery is fully charged, and the terminal stops charging. At this time, the amount of charge charged in the battery when the terminal is fully charged through the electricity meter is 1490 mAh.
After the obtaining module 302 obtains the remaining electric quantity value when the battery starts to be charged and the electric quantity charged into the battery when the electric quantity is fully charged, the obtaining module 302 may be triggered to obtain the preset mathematical expression corresponding to the charging state again. The preset mathematical expression is an expression for calculating a battery capacity value.
In one possible implementation, the preset mathematical expression may be fcc ═ cc/(100% -d 0). In the preset mathematical expression, fcc represents a battery capacity value, cc represents an amount of charge charged in the battery when the battery is fully charged, and d0 represents a percentage of remaining capacity when the battery starts to be charged, that is, a percentage of the remaining capacity to the total capacity.
It should be noted that the preset mathematical expression is obtained by calculating the expression soc-d 0+ (cc/fcc) × 100% according to the power of the terminal system. In the system power calculation expression, soc represents a percentage of a remaining power of the system, d0 represents a percentage of an initial power of the system, cc represents a power added or consumed by the system, cc is a positive value when charging, cc is a negative value when discharging, and fcc represents a battery capacity value. Soc defaults to 100% when fully charged.
After obtaining the preset mathematical expression, the calculating module 303 may calculate the preset mathematical expression according to the remaining power value (remaining power percentage) when the battery starts to be charged and the charge amount charged into the battery when the battery is fully charged, which are obtained by the obtaining module 302, to obtain a corresponding output value.
For example, if the percentage of remaining charge at the time of starting charging acquired by the acquisition module 302 is 50%, and the amount of charge charged into the battery at the time of full charge is 1490mAh, then the predetermined mathematical expression is calculated according to the percentage and the amount, so that fcc is 1480 mAh/(100% -50%) -2960 mAh.
After the preset mathematical expression is calculated to obtain the output value of the preset mathematical expression, the updating module 304 may update the battery capacity value according to the output value, and control the terminal to calculate the remaining capacity of the battery according to the updated battery capacity value.
For example, if the battery capacity value fcc calculated by the calculation module 303 according to the preset mathematical expression is 2960mAh, the update module 304 may replace the original battery capacity value of the terminal with 2960 mAh. And, before the next update of the battery capacity value, the control terminal calculates the remaining capacity of the battery according to the updated battery capacity value 2960 mAh.
It is understood that the battery automatically stops charging when it is fully charged, to prevent overcharging. Therefore, the percentage of the electric quantity of the battery when the battery is fully charged can be defaulted to 100%, the percentage of the residual electric quantity of the battery when the battery starts to be charged is subtracted from 100%, the obtained percentage is the percentage of the electric quantity charged into the battery in the capacity value of the battery, the electric quantity charged into the battery can be accurately counted through an electric meter, and therefore the capacity value of the battery calculated according to the electric quantity charged into the battery is closer to the actual capacity value of the battery. Therefore, the remaining capacity calculated from the updated battery capacity value is also closer to the actual remaining capacity, i.e., the accuracy of calculating the remaining capacity of the battery can be improved in this way.
Referring to fig. 7, fig. 7 is another schematic structural diagram of an apparatus for updating a battery capacity value according to an embodiment of the present invention. In an embodiment, the apparatus 300 for updating the battery capacity value may further include: a generation module 305.
A generating module 305, configured to obtain a plurality of battery temperature value samples and a battery capacity value sample corresponding to each of the battery temperature value samples; generating a temperature interval according to the battery temperature value sample, wherein the temperature interval comprises an upper temperature limit value and a lower temperature limit value; according to the battery capacity value sample, acquiring a battery capacity value corresponding to each temperature upper limit value and a battery capacity value corresponding to each temperature lower limit value; and generating a function expression corresponding to each temperature interval according to the upper temperature limit value and the lower temperature limit value of each temperature interval, the battery capacity value corresponding to the upper temperature limit value and the battery capacity value corresponding to the lower temperature limit value, and determining the function expression as a preset function expression.
For example, the generating module 305 of the terminal may obtain 4 battery temperature value samples and battery capacity value samples corresponding to the 4 battery temperature value samples. For example, the 4 battery temperature value samples acquired by the terminal are-10 ℃,0 ℃,25 ℃ and 50 ℃, and the battery capacity value samples corresponding to the 4 temperature value samples are 2500mAh, 2700mAh, 3000mAh and 2600mAh, respectively.
In one possible embodiment, the battery capacity value samples corresponding to each battery temperature value sample may be obtained as follows: and under the environment of a laboratory, controlling the temperature of the battery to be kept at a set temperature value, and fully charging the battery under the environment of the set temperature value. Then, the battery is discharged according to the set current magnitude until the battery stops discharging, and the discharge time length of the battery during the discharge time is recorded. And then multiplying the discharge current value by the discharge time to calculate the capacity value of the battery.
For example, the battery temperature is controlled to be kept at 25 ℃, and the battery is fully charged in this temperature environment. And then, discharging the battery at the current of 500mA in the temperature environment until the battery is discharged, recording that the discharge time of the battery is 6 hours, and multiplying the discharge current value of 500mA by the discharge time of 6 hours to obtain the battery capacity value of 3000 mAh. The battery has a control circuit for self-protection, and when it is detected that the voltage of the battery has dropped to a discharge cutoff voltage during discharge of the battery, the battery stops discharging, but a small amount of electricity remains in the battery at this time. Since this amount of power is small and does not participate in the battery discharge, it can be ignored when calculating the battery capacity value.
After the battery temperature value samples and the battery capacity value samples corresponding to the battery temperature value samples are counted, the sample values can be stored in a preset file of the terminal for the terminal to call.
After obtaining a plurality of battery temperature value samples and corresponding battery capacity value samples, the generating module 305 may generate temperature intervals according to the battery temperature value samples, where each generated temperature interval includes an upper temperature limit value and a lower temperature limit value.
For example, the generating module 305 generates the temperature ranges of [ -10,0], [0,25] and [25,50] according to the acquired 4 battery temperature value samples of-10 ℃,0 ℃,25 ℃ and 50 ℃.
After the temperature intervals are generated, the generation module 305 may acquire a battery capacity value corresponding to the upper temperature limit value and a battery capacity value corresponding to the lower temperature limit value of each temperature interval from the battery capacity value samples acquired previously. For example, in the temperature range [0,25], the battery capacity value corresponding to the temperature lower limit value of 0 ℃ is 2700mAh, and the battery capacity value corresponding to the temperature upper limit value of 25 ℃ is 3000 mAh.
Then, the generating module 305 may generate a function expression corresponding to each temperature interval according to the upper temperature limit value, the lower temperature limit value, the battery capacity value corresponding to the upper temperature limit value, and the battery capacity value corresponding to the lower temperature limit value of each temperature interval, and determine the function expression as a corresponding preset function expression.
In one possible implementation, the functional expression generated by the generation module 305 corresponding to each temperature interval may be a linear functional expression. For example, for the temperature interval [0,25], with (0,2700) and (25, 3000) as two points on the straight-line image of the corresponding linear function expression, then the linear function expression obtained by calculation is y equal to 12x + 2700. Similarly, for the temperature interval [ -10,0], the corresponding linear function expression generated is y ═ 20x + 2700. For the temperature interval [25,50], the corresponding linear function expression is generated as y ═ 16x + 3400.
After generating the function expression corresponding to each temperature zone, the terminal may determine the function expression as a preset function expression corresponding to each temperature zone. For example, the terminal may generate a correspondence table, as shown in table 2:
table 2: corresponding relation table of temperature interval and preset function expression
Temperature interval Corresponding preset function expression
[-10,0] y=20x+2700
[0,25] y=12x+2700
[25,50] y=-16x+3400
Based on this, in one possible implementation, the obtaining module 302 of the terminal may be configured to:
when the working state of the terminal is detected to be a starting state, acquiring the current temperature value of the battery;
and acquiring a corresponding preset function expression according to the current temperature value.
The calculation module 303 may be configured to: and calculating a dependent variable of the preset function expression, wherein the preset function expression takes the current temperature value as an independent variable.
The update module 304 may be configured to: and updating the battery capacity value according to the dependent variable, and calculating the residual capacity of the battery according to the updated battery capacity value.
For example, when the detecting module 301 detects that the working state of the terminal is the power-on state, the obtaining module 302 may be triggered to obtain a current temperature value of the battery, and obtain the corresponding preset function expression according to the current temperature value. For example, after the obtaining module 302 obtains the current temperature value of the battery, it may first determine a target temperature interval to which the current temperature value belongs, and then obtain a preset function expression corresponding to the target temperature interval.
For example, the current temperature value of the battery acquired by the acquiring module 302 is 22 ℃, and it is determined that the current temperature value belongs to the temperature interval [0,25], and then the acquiring module 302 acquires the preset function expression y corresponding to the temperature interval as 12x +2700 according to table 2.
After the obtaining module 302 obtains the current temperature value of the battery and the corresponding preset function expression, the calculating module 303 may calculate a dependent variable of the preset function expression, where the preset function expression takes the current temperature value as an independent variable.
For example, the calculation module 303 calculates a dependent variable in which the function expression y is 12x +2700, the function expression having the value 22 of the current temperature value as an argument, and the resultant dependent variable being 2964.
After the calculation module 303 calculates the dependent variable 2964, the update module 304 may replace the original battery capacity value with the dependent variable 2964. And, before the next update of the battery capacity value, the control terminal calculates the remaining capacity of the battery according to the updated battery capacity value 2964 mAh.
It can be understood that, because the remaining capacity of the battery needs to be calculated when the terminal is powered on, the battery capacity value is updated according to the battery temperature value when the terminal is powered on, so that the updated battery capacity value is closer to the actual capacity value, and the remaining capacity of the battery calculated according to the updated battery capacity value is also closer to the actual remaining capacity value, that is, the accuracy of calculating the remaining capacity of the terminal can be improved by the method.
As can be seen from the above, the apparatus for updating the battery capacity value according to the present embodiment first detects the operation state of the terminal itself. When the working state of the terminal is detected to be the pre-marked working state, the terminal can be triggered to acquire the battery parameter value corresponding to the pre-marked working state and the preset battery capacity calculation expression. Then, the terminal may calculate the preset battery capacity calculation expression according to the battery parameter value, and obtain a corresponding output value. Then, the terminal may update the battery capacity value according to the output value, and calculate the remaining capacity value of the battery according to the updated battery capacity value. Because the battery capacity value is updated when the terminal is in the pre-marked working state, and the updated battery capacity value is closer to the actual capacity value of the battery, the residual capacity value calculated according to the updated battery capacity value is also closer to the actual residual capacity of the battery, namely, the accuracy of calculating the residual capacity of the battery by the terminal can be improved.
The embodiment of the present invention further provides a terminal, which may include a memory, a processor, and a computer program stored in the memory and executable in the processor, where the processor implements the steps in the method for updating a battery capacity value provided in the embodiment of the present invention when executing the computer program.
For example, in one possible implementation, the terminal may be a mobile terminal, such as a tablet computer, a mobile phone, and the like. Referring to fig. 8, fig. 8 is a schematic structural diagram of a mobile terminal according to an embodiment of the present invention. The mobile terminal 500 may include components such as a memory 501 including one or more computer-readable storage media, an input unit 502, a display unit 503, a processor 504 including one or more processing cores, and a power supply 505. Those skilled in the art will appreciate that the mobile terminal architecture shown in fig. 8 is not intended to be limiting of mobile terminals and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The memory 501 may be used to store applications and data. The memory 501 stores applications containing executable code. The application programs may constitute various functional modules. The processor 504 executes various functional applications and data processing by running the application program stored in the memory 501.
The input unit 502 may be used to receive input numbers, character information, or user characteristic information, such as a fingerprint, and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control. In particular, in an embodiment, the input unit 502 may include a touch-sensitive surface as well as other input devices. The touch-sensitive surface, also referred to as a touch display screen or a touch pad, may collect touch operations by a user (e.g., operations by a user on or near the touch-sensitive surface using a finger, a stylus, or any other suitable object or attachment) thereon or nearby, and drive the corresponding connection device according to a predetermined program.
The display unit 503 may be used to display information input by or provided to the user and various graphical user interfaces of the mobile terminal, which may be configured by graphics, text, icons, video, and any combination thereof. The display unit 504 may include a display panel. In possible embodiments, the Display panel may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The processor 504 is a control center of the mobile terminal, connects various parts of the entire mobile terminal using various interfaces and lines, and performs various functions of the mobile terminal and processes data by running or executing an application program stored in the memory 501 and calling data stored in the memory 501, thereby integrally monitoring the mobile terminal.
The mobile terminal also includes a power supply 505 (such as a battery) for powering the various components. The power supply may be logically coupled to the processor 504 through a power management system to manage charging, discharging, and power consumption management functions through the power management system. The power supply 505 may also include any component of one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
Although not shown in fig. 8, the mobile terminal may further include a radio frequency circuit, an audio circuit, a camera, a bluetooth module, and the like, which are not described herein again.
In this embodiment, the processor 504 in the mobile terminal loads the executable code corresponding to the process of one or more application programs into the memory 501 according to the following instructions, and the processor 504 runs the application programs stored in the memory 501, thereby implementing various functions:
detecting the working state of the terminal; when the terminal is detected to enter a pre-marked working state, acquiring a corresponding battery parameter value and a preset battery capacity calculation expression; calculating the preset battery capacity calculation expression according to the battery parameter value to obtain a corresponding output value; and updating the battery capacity value according to the output value, and calculating the residual capacity of the battery according to the updated battery capacity value.
When the processor 504 executes the step of obtaining the corresponding battery parameter value and the preset battery capacity calculation expression when it is detected that the terminal enters the pre-marked operating state, the method may include: when the working state of the terminal is detected to be a starting state, acquiring the current temperature value of the battery; and acquiring a corresponding preset function expression according to the current temperature value.
Based on this, when the processor 504 executes the step of calculating the preset battery capacity calculation expression according to the battery parameter value to obtain the corresponding output value, the step may include: and calculating a dependent variable of the preset function expression, wherein the preset function expression takes the current temperature value as an independent variable.
When the processor 504 executes the steps of updating the battery capacity value according to the output value and calculating the remaining capacity of the battery according to the updated battery capacity value, the steps may include: and updating the battery capacity value according to the dependent variable, and calculating the residual capacity of the battery according to the updated battery capacity value.
In one possible implementation, the processor 504 is further configured to implement the following functions: obtaining a plurality of battery temperature value samples and battery capacity value samples corresponding to the battery temperature value samples; generating a temperature interval according to the battery temperature value sample, wherein the temperature interval comprises an upper temperature limit value and a lower temperature limit value; according to the battery capacity value sample, acquiring a battery capacity value corresponding to each temperature upper limit value and a battery capacity value corresponding to each temperature lower limit value; and generating a function expression corresponding to each temperature interval according to the upper temperature limit value and the lower temperature limit value of each temperature interval, the battery capacity value corresponding to the upper temperature limit value and the battery capacity value corresponding to the lower temperature limit value, and determining the function expression as a preset function expression.
Based on this, when the processor executes the step of obtaining the corresponding preset function expression according to the current temperature value, the method may include: and determining a target temperature interval to which the current temperature value belongs according to the current temperature value, and acquiring a preset function expression corresponding to the target temperature interval.
In a possible implementation, the processor 504, when performing the step of obtaining the corresponding battery parameter value and the preset battery capacity calculation expression when detecting that the terminal enters the pre-marked operating state, may include: when the working state of the terminal is detected to be a charging state, acquiring a residual electric quantity value of the battery when the charging is started and an electric charge amount charged into the battery when the electric quantity is full; and acquiring a preset mathematical expression corresponding to the charging state.
Based on this, when the processor 504 executes the step of calculating the preset battery capacity calculation expression according to the battery parameter value to obtain the corresponding output value, the step may include: and calculating the preset mathematical expression according to the residual electric quantity value and the electric charge quantity to obtain a corresponding output value.
In a possible implementation, the processor 504, when performing the step of obtaining the corresponding battery parameter value and the preset battery capacity calculation expression when detecting that the terminal enters the pre-marked operating state, may include: when detecting that the terminal enters a pre-marked working state, detecting whether the battery capacity value of the terminal is updated within a preset time range; and if the battery capacity value of the terminal is not updated within the preset time range, acquiring a corresponding battery parameter value and a preset battery capacity calculation expression.
In the above embodiments, the descriptions of the embodiments have respective emphasis, and parts that are not described in detail in a certain embodiment may refer to the above detailed description of the method for updating the battery capacity value, and are not described again here.
The apparatus for updating a battery capacity value provided in the embodiment of the present invention and the method for updating a battery capacity value in the above embodiments belong to the same concept, and any one of the methods provided in the method for updating a battery capacity value may be run on the apparatus for updating a battery capacity value.
It should be noted that, for the method for updating a battery capacity value according to the embodiment of the present invention, it may be understood by a person skilled in the art that all or part of the process for implementing the method for updating a battery capacity value according to the embodiment of the present invention may be implemented by controlling related hardware through a computer program, where the computer program may be stored in a computer-readable storage medium, such as a memory, and executed by at least one processor, and the process of the embodiment of the method for updating a battery capacity value may be included in the execution process. The storage medium may be a magnetic disk, an optical disk, a Read Only Memory (ROM), a Random Access Memory (RAM), or the like.
In the apparatus for updating a battery capacity value according to an embodiment of the present invention, each functional module may be integrated into one processing chip, or each module may exist alone physically, or two or more modules may be integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium, such as a read-only memory, a magnetic or optical disk, or the like.
The foregoing describes in detail a method, an apparatus, and a terminal for updating a battery capacity value according to an embodiment of the present invention, and a specific example is applied in the description to explain the principle and the implementation of the present invention, and the description of the foregoing embodiment is only used to help understand the method and the core idea of the present invention; meanwhile, for those skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (8)

1. A method for updating a battery capacity value, the method comprising:
obtaining a plurality of battery temperature value samples and battery capacity value samples corresponding to the battery temperature value samples; the method comprises the following steps of obtaining battery capacity value samples corresponding to the battery temperature value samples in the following mode: controlling the temperature of the battery to be kept at a set temperature value, and fully charging the battery in the environment of the set temperature value; discharging the battery according to the set current magnitude until the battery stops discharging, and recording the discharging duration of the battery; multiplying the discharge current value by the discharge duration to obtain a corresponding battery capacity value sample;
generating a temperature interval according to the battery temperature value sample, wherein the temperature interval comprises an upper temperature limit value and a lower temperature limit value;
according to the battery capacity value sample, acquiring a battery capacity value corresponding to each temperature upper limit value and a battery capacity value corresponding to each temperature lower limit value;
generating a function expression corresponding to each temperature interval according to the upper temperature limit value, the lower temperature limit value, the battery capacity value corresponding to the upper temperature limit value and the battery capacity value corresponding to the lower temperature limit value of each temperature interval, and determining the function expression as a preset function expression;
marking the starting state and the charging state in advance to obtain a pre-marked working state;
detecting the working state of the terminal;
when the terminal is detected to enter a pre-marked working state, acquiring a corresponding battery parameter value and a preset battery capacity calculation expression; when the working state of the terminal is detected to be a starting state, acquiring a current temperature value of a battery, determining a target temperature interval to which the current temperature value belongs according to the current temperature value, and acquiring a preset function expression corresponding to the target temperature interval;
calculating the preset battery capacity calculation expression according to the battery parameter value to obtain a corresponding output value; when the working state of the terminal is a starting state, calculating a dependent variable of the preset function expression, wherein the preset function expression takes the current temperature value as an independent variable;
and updating the battery capacity value according to the output value, and calculating the residual capacity of the battery according to the updated battery capacity value, wherein when the working state of the terminal is a starting state, the battery capacity value is updated according to the dependent variable.
2. The method for updating a battery capacity value according to claim 1, wherein the obtaining of the corresponding battery parameter value and the preset battery capacity calculation expression when the terminal is detected to enter the pre-marked operating state comprises:
when the working state of the terminal is detected to be a charging state, acquiring a residual electric quantity value of the battery when the charging is started and an electric charge amount charged into the battery when the electric quantity is full;
acquiring a preset mathematical expression corresponding to the charging state;
the calculating the preset battery capacity calculation expression according to the battery parameter value to obtain a corresponding output value comprises: and calculating the preset mathematical expression according to the residual electric quantity value and the electric charge quantity to obtain a corresponding output value.
3. The method for updating a battery capacity value according to claim 1, wherein the obtaining of the corresponding battery parameter value and the preset battery capacity calculation expression when the terminal is detected to enter the pre-marked operating state comprises:
when detecting that the terminal enters a pre-marked working state, detecting whether the battery capacity value of the terminal is updated within a preset time range;
and if the battery capacity value of the terminal is not updated within the preset time range, acquiring a corresponding battery parameter value and a preset battery capacity calculation expression.
4. An apparatus for updating a battery capacity value, the apparatus comprising:
the detection module is used for obtaining a plurality of battery temperature value samples and battery capacity value samples corresponding to the battery temperature value samples; the method comprises the following steps of obtaining battery capacity value samples corresponding to the battery temperature value samples in the following mode: controlling the temperature of the battery to be kept at a set temperature value, and fully charging the battery in the environment of the set temperature value; discharging the battery according to the set current magnitude until the battery stops discharging, and recording the discharging duration of the battery; multiplying the discharge current value by the discharge duration to obtain a corresponding battery capacity value sample; generating a temperature interval according to the battery temperature value sample, wherein the temperature interval comprises an upper temperature limit value and a lower temperature limit value; according to the battery capacity value sample, acquiring a battery capacity value corresponding to each temperature upper limit value and a battery capacity value corresponding to each temperature lower limit value; generating a function expression corresponding to each temperature interval according to the upper temperature limit value, the lower temperature limit value, the battery capacity value corresponding to the upper temperature limit value and the battery capacity value corresponding to the lower temperature limit value of each temperature interval, and determining the function expression as a preset function expression; marking the starting state and the charging state in advance to obtain a pre-marked working state; detecting the working state of the terminal;
the acquisition module is used for acquiring a corresponding battery parameter value and a preset battery capacity calculation expression when the terminal is detected to enter a pre-marked working state; when the working state of the terminal is detected to be a starting state, acquiring a current temperature value of a battery, determining a target temperature interval to which the current temperature value belongs according to the current temperature value, and acquiring a preset function expression corresponding to the target temperature interval;
the calculation module is used for calculating the preset battery capacity calculation expression according to the battery parameter value to obtain a corresponding output value; when the working state of the terminal is a starting state, calculating a dependent variable of the preset function expression, wherein the preset function expression takes the current temperature value as an independent variable;
and the updating module is used for updating the battery capacity value according to the output value and calculating the residual capacity of the battery according to the updated battery capacity value, wherein when the working state of the terminal is a starting state, the battery capacity value is updated according to the dependent variable.
5. The apparatus for updating a battery capacity value according to claim 4, wherein the obtaining module is configured to:
when the working state of the terminal is detected to be a charging state, acquiring a residual electric quantity value of the battery when the charging is started and an electric charge amount charged into the battery when the electric quantity is full;
acquiring a preset mathematical expression corresponding to the charging state;
the calculation module is configured to: and calculating the preset mathematical expression according to the residual electric quantity value and the electric charge quantity to obtain a corresponding output value.
6. The apparatus for updating a battery capacity value according to claim 4, wherein the obtaining module is configured to:
when detecting that the terminal enters a pre-marked working state, detecting whether the battery capacity value of the terminal is updated within a preset time range;
and if the battery capacity value of the terminal is not updated within the preset time range, acquiring a corresponding battery parameter value and a preset battery capacity calculation expression.
7. A terminal comprising a memory, a processor, and a computer program stored in said memory and executable in said processor, characterized in that said processor implements the steps of the method for updating a battery capacity value according to any one of claims 1 to 3 when executing said computer program.
8. A storage medium having stored thereon a computer program, characterized in that the computer program, when executed on a computer, causes the computer to execute the method according to any of claims 1 to 3.
CN201611260907.7A 2016-12-30 2016-12-30 Method and device for updating battery capacity value and terminal Expired - Fee Related CN106772091B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611260907.7A CN106772091B (en) 2016-12-30 2016-12-30 Method and device for updating battery capacity value and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611260907.7A CN106772091B (en) 2016-12-30 2016-12-30 Method and device for updating battery capacity value and terminal

Publications (2)

Publication Number Publication Date
CN106772091A CN106772091A (en) 2017-05-31
CN106772091B true CN106772091B (en) 2020-02-14

Family

ID=58954695

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611260907.7A Expired - Fee Related CN106772091B (en) 2016-12-30 2016-12-30 Method and device for updating battery capacity value and terminal

Country Status (1)

Country Link
CN (1) CN106772091B (en)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107422268B (en) * 2017-06-01 2019-10-01 金卡智能集团股份有限公司 Battery dump energy detection method
CN107436418B (en) * 2017-06-15 2020-05-19 捷开通讯(深圳)有限公司 Method, terminal and device for calibrating electric quantity attenuation of battery
CN107436410A (en) * 2017-07-19 2017-12-05 上海与德科技有限公司 A kind of electric quantity controlling method, device, equipment and storage medium
CN109103518B (en) * 2018-07-16 2020-12-22 深圳市沃特沃德股份有限公司 Battery capacity updating method and system
US11105858B2 (en) * 2018-10-03 2021-08-31 O2Micro Inc. Predicting a potential fault in a battery
CN112485677A (en) * 2019-09-12 2021-03-12 东莞新能德科技有限公司 Battery capacity updating method and device, electronic device and storage medium
CN111007412B (en) * 2019-12-25 2022-05-17 宜宾凯翼汽车有限公司 Method for updating actual available capacity of power battery
CN111239624B (en) * 2020-02-21 2022-10-11 中创新航科技股份有限公司 Battery capacity calibration method and device, electronic equipment and storage medium
CN113495213A (en) * 2020-03-20 2021-10-12 北京京东乾石科技有限公司 Electric quantity prediction model construction method, electric quantity prediction model carrying equipment deployment method and electric quantity prediction model carrying equipment deployment device
CN111679206B (en) * 2020-06-01 2022-09-06 Oppo(重庆)智能科技有限公司 Electric quantity detection method and device, and storage medium
CN111965548B (en) * 2020-09-27 2022-05-17 哈尔滨工业大学(威海) Battery system sensor fault diagnosis method based on state estimation method
CN112858938B (en) * 2021-02-20 2022-10-21 Oppo广东移动通信有限公司 Electric quantity calculation method and device, storage medium and electronic equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101206246A (en) * 2006-12-22 2008-06-25 明基电通股份有限公司 Method for preestimating battery residual capacity
CN102074984A (en) * 2010-12-21 2011-05-25 Tcl集团股份有限公司 Mobile terminal for detecting electric quantity of battery on line and detection method thereof
CN103176132A (en) * 2011-12-22 2013-06-26 联芯科技有限公司 Estimation method and terminal device of electricity quantity of battery
CN103675701A (en) * 2013-11-29 2014-03-26 宇龙计算机通信科技(深圳)有限公司 Battery state-of-charge correction method and device
CN104101837A (en) * 2013-04-03 2014-10-15 比亚迪股份有限公司 On-line calculation method for current total capacity of battery
CN104301499A (en) * 2013-07-15 2015-01-21 腾讯科技(深圳)有限公司 Method and device for analyzing battery capacity records of mobile terminal, platform and mobile terminal

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO1997002685A1 (en) * 1995-07-03 1997-01-23 Nippon Telegraph And Telephone Corporation Variable band communication network
KR20060109772A (en) * 2005-04-18 2006-10-23 엘지전자 주식회사 Methods and apparatus' of detecting battery capacity for mobile phone
CN101728588B (en) * 2008-10-10 2012-01-25 鸿富锦精密工业(深圳)有限公司 Wireless communication terminal and method for determining battery electric quantity thereof
CN105403835B (en) * 2014-08-29 2018-11-16 展讯通信(深圳)有限公司 A kind of system and method measuring battery capacity
CN106093780A (en) * 2016-05-31 2016-11-09 青岛海信移动通信技术股份有限公司 A kind of terminal residual electricity determines method and terminal

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101206246A (en) * 2006-12-22 2008-06-25 明基电通股份有限公司 Method for preestimating battery residual capacity
CN102074984A (en) * 2010-12-21 2011-05-25 Tcl集团股份有限公司 Mobile terminal for detecting electric quantity of battery on line and detection method thereof
CN103176132A (en) * 2011-12-22 2013-06-26 联芯科技有限公司 Estimation method and terminal device of electricity quantity of battery
CN104101837A (en) * 2013-04-03 2014-10-15 比亚迪股份有限公司 On-line calculation method for current total capacity of battery
CN104301499A (en) * 2013-07-15 2015-01-21 腾讯科技(深圳)有限公司 Method and device for analyzing battery capacity records of mobile terminal, platform and mobile terminal
CN103675701A (en) * 2013-11-29 2014-03-26 宇龙计算机通信科技(深圳)有限公司 Battery state-of-charge correction method and device

Also Published As

Publication number Publication date
CN106772091A (en) 2017-05-31

Similar Documents

Publication Publication Date Title
CN106772091B (en) Method and device for updating battery capacity value and terminal
CN106786958B (en) Charging method, device and terminal
CN106786962B (en) Charging control method and device and terminal
US20080082851A1 (en) Determining expected exceeding of maximum allowed power consumption of a mobile electronic device
US20170285722A1 (en) Method for reducing battery consumption in electronic device
US9438057B2 (en) Drive control device, drive control method and drive control program
CN112540304B (en) Battery power management method, electronic device and computer storage medium
EP2881838A1 (en) Adjustment method and boot method for power-off threshold voltage and electronic device thereof
CN103543405A (en) Method for performing power consumption management, and associated apparatus
US11699910B2 (en) Battery state estimation
WO2019119326A1 (en) Charging method, device, terminal apparatus, and computer readable storage medium
CN107302633B (en) Application control method, device, storage medium and electronic equipment
CN112858938B (en) Electric quantity calculation method and device, storage medium and electronic equipment
CN109040467A (en) Interface electricity determines method, apparatus, storage medium and mobile terminal
JP2020092593A (en) Method of predicting charging state of battery
CN103460063A (en) Battery voltage measurement
CN106791170B (en) Network processing method, device and terminal
CN113381479A (en) Charging method and device and electronic equipment
CN115327391B (en) Detection method and device based on echelon battery utilization
CN112924875B (en) Battery detection method and device and electronic equipment
CN114069803B (en) Portable emergency energy storage power supply detection method, device, equipment and storage medium
CN113156319B (en) Residual electric quantity determining method, device, vehicle, medium and program product
JP2013169062A (en) Charge control device, imaging apparatus, and charge control system
JP2019079580A (en) Electronic apparatus, calculation method and program
KR20150016044A (en) Method for reducing battery consumption in electronic device

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
CB02 Change of applicant information

Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20200214

CF01 Termination of patent right due to non-payment of annual fee