A method, device, terminal device and storage medium for determining battery power
By calibrating the voltage when the battery capacity is determined, the problem of inaccurate battery capacity estimation is solved, and the accuracy of battery capacity estimation and the stability of voltage change are achieved.
Patent Information
- Application Number
- CN202210302693.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-25
- Publication Date
- 2025-06-13
- Estimated Expiration
- 2042-03-25
AI Technical Summary
In electronic devices without a Kulun battery meter, the battery capacity estimate is inaccurate, which leads to a jump in the power calculation and affects the user experience.
When the battery power is determined, the first calibration voltage of the battery at the previous sampling time and the voltage change amount in the subsequent sampling period are obtained, and the calibration is performed to determine the battery power of the battery at the current sampling time.
The sudden change in voltage is eliminated, and the voltage changes are stabilized, thereby stabilizing the battery power changes, improving the accuracy of battery estimation.
Smart Images

Figure CN114660465B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the technical field of power calibration, and particularly relates to a method, device, terminal device and storage medium for determining the battery power. Background Art
[0002] The power of a battery is a parameter for users to understand the battery usage. Currently, the battery power measured by a Coulomb coulombmeter is relatively accurate. However, due to the high cost of the Coulomb coulombmeter, in order to save costs, many electronic devices do not configure a Coulomb coulombmeter. In electronic devices without a Coulomb coulombmeter, the battery voltage is often used to estimate the battery power. When the voltage is high, the battery power is high, and when the voltage is low, the battery power is low. However, the voltage of the battery is prone to fluctuations. For example, when the electronic device is connected to an adapter, the voltage of the battery will suddenly increase, or when the electronic device is connected to a high-power electrical device, the voltage of the battery will suddenly decrease. Since the battery voltage will fluctuate significantly with external electrical devices, the battery power estimated using the battery voltage will also have a significant jump, resulting in inaccurate power estimation and inconvenience to users. Summary of the Invention
[0003] Embodiments of this application provide a method, device, terminal device and storage medium for determining the battery power, which can solve the problems of sudden power change and inaccurate calculation of battery power.
[0004] In a first aspect, embodiments of this application provide a method for determining the battery power, including:
[0005] When it is determined that there is a sampling period in the sampling period before the i-th sampling moment in which the absolute value of the voltage change amount of the battery is greater than or equal to a preset threshold, obtain the first calibrated voltage of the battery at the (i - 1)-th sampling moment, and the j-th voltage change amount of the battery within the j-th sampling period, where the first calibrated voltage is determined based on the j - n-th voltage change amount of the battery within the j - n-th sampling period, the j-th sampling period is the first sampling period after the j - n-th sampling period in which the absolute value of the voltage change amount is less than the preset threshold, i ≥ 2, j ≥ i, 1 ≤ n < j;
[0006] Based on the first calibrated voltage and the j-th voltage change amount, obtain the second calibrated voltage at the i-th sampling moment;
[0007] Based on the second calibrated voltage, determine the battery power of the battery at the i-th sampling moment.
[0008] In a second aspect, embodiments of this application provide a device for determining the battery power, including:
[0009] A voltage acquisition module, configured to obtain a first calibrated voltage of the battery at the (i - 1)-th sampling moment and a j-th voltage change amount of the battery within the j-th sampling period when it is determined that there is a sampling period in which the absolute value of the voltage change amount of the battery is greater than or equal to a preset threshold in the sampling period before the i-th sampling moment. Wherein, the first calibrated voltage is determined based on the j - n-th voltage change amount of the battery within the j - n-th sampling period, the j-th sampling period is the sampling period in which the absolute value of the voltage change amount first becomes less than the preset threshold among the sampling periods after the j - n-th sampling period, i≥2, j≥i, 1≤n<j;
[0010] A voltage calibration module, configured to obtain a second calibrated voltage of the battery at the i-th sampling moment based on the first calibrated voltage and the j-th voltage change amount;
[0011] A battery power determination module, configured to determine the battery power of the battery at the i-th sampling moment based on the second calibrated voltage.
[0012] In a third aspect, an embodiment of the present application provides a terminal device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the method for determining the battery power according to any one of the above first aspects is implemented.
[0013] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the method for determining the battery power according to any one of the above first aspects is implemented.
[0014] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product runs on a terminal device, the terminal device is caused to execute the method for determining the battery power according to any one of the above first aspects.
[0015] The beneficial effects of the first aspect of this application compared with the prior art are as follows: When it is determined that there is a sampling period in the sampling periods before the i-th sampling moment in which the voltage change amount of the battery is greater than or equal to the preset threshold, the first calibrated voltage of the battery at the (i - 1)-th sampling moment and the j-th voltage change amount of the battery within the j-th sampling period are obtained, where the first calibrated voltage is determined based on the (j - n)-th voltage change amount of the battery within the (j - n)-th sampling period, the j-th sampling period is the sampling period in which the voltage change amount is less than the preset threshold for the first time after the (j - n)-th sampling period, and i ≥ 2; based on the first calibrated voltage and the j-th voltage change amount, the second calibrated voltage at the i-th sampling moment is obtained; based on the second calibrated voltage, the battery power at the i-th sampling moment is determined; compared with the prior art method of directly using the sampling voltage to determine the battery power at any time, when it is determined that there is a mutation in the voltage value of the battery, this application uses the voltage change amount of the battery after the current sampling moment to calibrate the mutated voltage, and uses the calibrated voltage to determine the battery power, making the determination of the battery power more accurate. In addition, since this application eliminates the voltage mutation, the voltage change is stable, and thus the power mutation when the voltage changes can be eliminated, making the change of the battery power stable.
[0016] It can be understood that the beneficial effects of the second to fifth aspects can refer to the relevant descriptions in the first aspect above and will not be elaborated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of this application, the following will briefly introduce the drawings required for use in the embodiments or the description of the prior art. Obviously, the following drawings are only some embodiments of this application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0018] Figure 1 It is a schematic diagram of the application scenario of the method for determining the battery power provided by an embodiment of this application;
[0019] Figure 2 It is a schematic flowchart of the method for determining the battery power provided by an embodiment of this application;
[0020] Figure 3 It is a schematic diagram of the charge and discharge curve of the battery provided by an embodiment of this application;
[0021] Figure 4 It is a schematic flowchart of the method for determining that the absolute value of the voltage change amount in the sampling period is greater than or equal to the preset threshold provided by an embodiment of this application;
[0022] Figure 5It is a schematic flowchart of a method for determining a calibration voltage at the i-th sampling moment provided by an embodiment of the present application;
[0023] Figure 6 It is a schematic flowchart of a method for determining a calibration voltage at the first sampling moment provided by an embodiment of the present application;
[0024] Figure 7 It is a schematic diagram of a voltage acquisition curve and a voltage calibration curve provided by an embodiment of the present application;
[0025] Figure 8 It is a schematic structural diagram of a device for determining battery power provided by an embodiment of the present application;
[0026] Figure 9 It is a schematic structural diagram of a terminal device provided by an embodiment of the present application. Detailed implementation manners
[0027] It should be understood that when used in the specification and appended claims of the present application, the term "comprising" indicates the presence of the described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or their combinations.
[0028] As used in the specification and appended claims of the present application, the term "if" can be interpreted as "when", "once", "in response to determining" or "in response to detecting" according to the context. Similarly, the phrase "if determined" or "if [the described condition or event] is detected" can be interpreted as meaning "once determined", "in response to determining", "once [the described condition or event] is detected" or "in response to detecting [the described condition or event]" according to the context.
[0029] In addition, in the description of the specification and appended claims of the present application, the terms "first", "second", "third", etc. are only used for distinguishing descriptions and cannot be understood as indicating or implying relative importance.
[0030] The reference to "an embodiment" or "some embodiments" or the like described in the specification of the present application means that a specific feature, structure or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, the statements "in an embodiment", "in some embodiments", "in other some embodiments", "in still other embodiments" and the like that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "comprising", "including", "having" and their variants all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0031] When determining the battery power using the voltage of the battery in an electronic device, since the battery will vary with the power of the external power-consuming device, when the power of the external power-consuming device suddenly changes, the voltage will mutate, resulting in a jump in the battery power. When the user determines the battery power, the battery power will sometimes increase and sometimes decrease, making the user unsure of exactly how much the battery power is; in addition, since the battery power determined based on the mutated voltage is inaccurate, it affects the user's use.
[0032] For the above reasons, the method for determining the battery power proposed in this application calibrates the voltage, eliminates the mutation of the voltage, makes the voltage change smoothly, and then makes the battery power change smoothly, making the power more accurate.
[0033] Figure 1 FIG. 9 is a schematic diagram of an application scenario of the method for determining the battery power provided in an embodiment of this application. The above method for determining the battery power can be used to calibrate the battery power. Among them, the voltage acquisition device 10 is used to acquire the voltage value of the battery at preset time intervals, and the processor 20 is used to obtain the voltage value from the voltage acquisition device 20 and process the voltage value to obtain the battery power.
[0034] Figure 2 FIG. 13 shows a schematic flowchart of the method for determining the battery power provided in this application. Referring to Figure 2 , the details of this method are as follows:
[0035] S101, when it is determined that there is a sampling period in the sampling period before the i-th sampling moment in which the absolute value of the voltage change amount of the battery is greater than or equal to a preset threshold, obtain the first calibrated voltage of the battery at the (i - 1)-th sampling moment, and the j-th voltage change amount of the battery within the j-th sampling period.
[0036] In this embodiment, the first calibrated voltage is determined based on the j - n-th voltage change amount of the battery within the j - n-th sampling period. The j-th sampling period is the first sampling period after the j - n-th sampling period in which the absolute value of the voltage change amount is less than the preset threshold, i≥2, j≥i, 1≤n<j. The absolute value of the j - n-th voltage change amount is less than the preset threshold, and the preset threshold can be set as needed.
[0037] In this embodiment, the voltage value of the battery is acquired according to the acquisition period. The start time of each acquisition period is a sampling moment, and the end time of each acquisition period is a sampling moment. The voltage value of the battery is acquired using the voltage acquisition device at each sampling moment. The acquisition period is at the level of hundreds of milliseconds. For example, the acquisition period can be 200 milliseconds, 300 milliseconds, or 500 milliseconds, etc. The battery can be a lithium battery.
[0038] For example, the first sampling period is the time period between the first sampling moment and the second sampling moment. The second sampling period is the time period between the second sampling moment and the third sampling moment.
[0039] If i = 3, the sampling periods before the i-th sampling moment include the first sampling period and the second sampling period.
[0040] In this embodiment, the change in the voltage value of the battery within each sampling period is denoted as the voltage change amount of the battery within that sampling period.
[0041] In this embodiment, there is a calibration voltage at each sampling moment. The calibration voltage at each current sampling moment is determined based on the calibration voltage at the previous moment. If the current sampling moment is the i-th sampling moment, the previous moment is the (i - 1)-th sampling moment.
[0042] For example, if the first calibration voltage is determined based on the third voltage change amount of the battery within the third sampling period. If the absolute value of the voltage change amount in the fourth sampling period is less than a preset threshold, the fourth sampling period is the j-th sampling period. If the absolute value of the voltage change amount in the fourth sampling period is greater than the preset threshold, the fourth sampling period is not the j-th sampling period. If the absolute value of the voltage change amount in the fifth sampling period is less than the preset threshold, the fifth sampling period is the j-th sampling period.
[0043] S102. Obtain the second calibration voltage at the i-th sampling moment based on the first calibration voltage and the j-th voltage change amount.
[0044] Specifically, calculate the sum of the first calibration voltage and the j-th voltage change amount to obtain the second calibration voltage at the i-th sampling moment.
[0045] For example, if the first calibration voltage is 5V and the j-th voltage change amount is -0.2V, the second calibration voltage is: 5 - 0.2 = 4.8V.
[0046] S103. Determine the battery power of the battery at the i-th sampling moment based on the second calibration voltage.
[0047] In this embodiment, the battery power corresponding to the second calibration voltage is found from a preset table by looking up the table, and the battery power is displayed so that the user can determine the consumption situation of the battery based on the battery power.
[0048] Optionally, input the second calibration voltage into a power calculation model to obtain the battery power corresponding to the second calibration voltage.
[0049] For example, when i = 3, the absolute value of the voltage change amount within the sampling period between the second sampling moment and the third sampling moment is greater than a preset threshold. It is necessary to obtain the first calibration voltage V2' at the second sampling moment. V2' is determined based on the first voltage change amount of the battery within the first sampling period. After the first sampling period, if the absolute value of the voltage change amount in the third sampling period is less than the preset threshold, then obtain the voltage change amount in the third sampling period, and obtain the battery power at the third sampling moment based on V2' and the voltage change amount in the third sampling period.
[0050] As Figure 3 shown, there are six curves in the figure. The upper three are the charging curves with the adapter plugged in, which are the 0.2C charging curve, 0.5C charging curve, and 1.0C charging curve respectively. The lower three are the battery discharge curves, which are the 0.2C discharge curve, 0.5C discharge curve, and 1.0C discharge curve respectively. It can be seen from the figure that whether it is discharging or charging, the trend of the curves is basically the same. Therefore, when high precision is not required but the product experience requirements need to be met, the voltage jitter can be eliminated by the curve translation method. For example, if a larger power discharge occurs at point A, the discharge curve drops to become the 1.0C discharge curve. At the same time, the voltage at point A vertically jumps to point B, and the absolute value of the voltage change amount from A to B is greater than the preset threshold. The calibration voltage when the voltage B is collected is determined by using the voltage change amount between point C and point B, which is equivalent to translating the curve after B up to connect with point A.
[0051] In the embodiments of the present application, when it is determined that there is a sampling period in the sampling periods before the \(i\)th sampling moment in which the voltage change amount of the battery is greater than or equal to a preset threshold, the first calibrated voltage of the battery at the \((i - 1)\)th sampling moment and the \(j\)th voltage change amount of the battery within the \(j\)th sampling period are obtained, where the first calibrated voltage is determined based on the \(j - n\)th voltage change amount of the battery within the \((j - n)\)th sampling period, the \(j\)th sampling period is the first sampling period after the \((j - n)\)th sampling period in which the voltage change amount is less than the preset threshold, and \(i\geq2\); based on the first calibrated voltage and the \(j\)th voltage change amount, the second calibrated voltage at the \(i\)th sampling moment is obtained; based on the second calibrated voltage, the battery power at the \(i\)th sampling moment is determined; compared with the prior art method of directly using the sampling voltage to determine the battery power at any time, when it is determined in the present application that there is a mutation in the voltage value of the battery, the voltage change amount of the battery after the current sampling moment is used to calibrate the mutated voltage, and the calibrated voltage is used to determine the battery power, so that the battery power is determined more accurately. In addition, since the present application eliminates the voltage mutation and makes the voltage change stable, the power mutation when the voltage changes can be eliminated, and the battery power changes smoothly. The present application realizes accurate determination of the battery power without using a Coulomb coulombmeter, and makes the performance of the product better and the user experience better while maintaining the low cost of the electronic device.
[0052] As Figure 4 shown, in a possible implementation manner, the above method may further include:
[0053] S201, obtain the first sampling voltage of the battery at the \(m\)th sampling moment and the second sampling voltage of the battery at the \((m - 1)\)th sampling moment, where \(2\leq m\leq i\).
[0054] In this embodiment, if \(i = 3\), \(m\) may be 2 or 3.
[0055] S202, calculate a first difference between the first sampling voltage and the second sampling voltage.
[0056] In this embodiment, the first difference is the voltage change amount from the \((m - 1)\)th sampling moment to the \(m\)th sampling moment, that is, the voltage change amount of the battery in the sampling period from the \((m - 1)\)th sampling moment to the \(m\)th sampling moment.
[0057] S203, if the absolute value of the first difference is greater than or equal to the preset threshold, determine that there is a sampling period in the sampling periods before the \(i\)th sampling moment in which the absolute value of the voltage change amount of the battery is greater than or equal to the preset threshold.
[0058] In this embodiment, if the absolute value of the voltage change of the battery is greater than or equal to a preset threshold, it is determined that the voltage value of the battery has mutated within this sampling period, and the reason for the mutation may be the connection of a relay or a high-power device, etc.
[0059] As an example, if i = 3 and when m = 2, the absolute value of the first difference is less than the preset threshold, then the voltage change of the battery within the sampling period from the 1st sampling moment to the 2nd sampling moment is less than the preset threshold.
[0060] When m = 3, the absolute value of the first difference is greater than the preset threshold, then the voltage change of the battery within the sampling period from the 2nd sampling moment to the 3rd sampling moment is greater than the preset threshold.
[0061] It is determined that there is a sampling period within the sampling periods before the i-th sampling moment in which the absolute value of the voltage change of the battery is greater than or equal to the preset threshold.
[0062] S204, if the absolute value of the first difference is less than the preset threshold, it is determined that there is no sampling period within the sampling periods before the i-th sampling moment in which the absolute value of the voltage change of the battery is greater than or equal to the preset threshold.
[0063] In this embodiment, if the absolute value of the voltage change of the battery is less than the preset threshold, it is determined that the voltage value of the battery has not mutated within this sampling period.
[0064] As an example, if i = 3 and when m = 2, the absolute value of the first difference is less than the preset threshold, then the voltage change of the battery within the sampling period from the 1st sampling moment to the 2nd sampling moment is less than the preset threshold.
[0065] When m = 3, the absolute value of the first difference is less than the preset threshold, then the voltage change of the battery within the sampling period from the 2nd sampling moment to the 3rd sampling moment is less than the preset threshold.
[0066] It is determined that there is no sampling period within the sampling periods before the i-th sampling moment in which the absolute value of the voltage change of the battery is greater than or equal to the preset threshold.
[0067] In the embodiments of the present application, to determine whether the voltage value mutates within each sampling period, it needs to be determined according to the change situation of the voltage value within this sampling period. Therefore, it can be determined whether the voltage value mutates within this time period based on the difference in voltage change within the sampling period. The present application provides a method for judging whether the voltage value mutates, which can accurately judge whether the voltage value mutates.
[0068] Such as Figure 5 shown, in a possible implementation manner, the above method may further include:
[0069] S301, when it is determined that there is no sampling period in which the absolute value of the voltage change of the battery is greater than or equal to a preset threshold value in the sampling period before the i-th sampling moment, obtain the first calibration voltage of the battery at the i-1th sampling moment, the third sampling voltage at the i-th sampling moment, and the fourth sampling voltage at the i-1th sampling moment.
[0070] S302, calculating a second difference between the third sampling voltage and the fourth sampling voltage.
[0071] S303, calculating the sum of the first calibration voltage and the second difference to obtain the second calibration voltage at the i-th sampling moment.
[0072] In this embodiment, when it is determined that the voltage value before the i-th sampling moment has not changed suddenly, the calibration voltage at the current moment may be determined according to the calibration voltage at the previous moment and the voltage change between the current moment and the previous moment.
[0073] Specifically, the second calibration voltage is obtained according to the calculation model, and the calculation model includes: V i ′=V′ i-1 +(V i -V i-1 ), where V i ′ is the second calibration voltage at the i-th sampling moment, V′ i-1 is the first calibration voltage at the i-1th sampling moment, V i is the third sampling voltage at the i-th sampling moment, V i-1 is the fourth sampling voltage at the i-1th sampling moment.
[0074] For example, when i=3, if the second calibration voltage is 8V, the third sampling voltage is 4.8V, and the fourth sampling voltage is 5V, then the second calibration voltage is: 8-0.2=7.8V.
[0075] In this embodiment, when it is determined that the voltage value before the i-th sampling moment has not suddenly changed, a low-pass filter may be used to filter the sampled voltage to obtain a processed sampled voltage, and the processed sampled voltage may be used to calculate the calibration voltage.
[0076] In this embodiment, when it is determined that there is no sampling period in which the absolute value of the battery voltage change is greater than or equal to the preset threshold in the sampling period before the i-th sampling moment, the third sampling voltage at the i-th sampling moment is equivalent to the second calibration voltage at the i-th sampling moment.
[0077] like Figure 6 As shown, in a possible implementation, when i=1, the sampled voltage at the first sampling moment is the initial voltage. The method for determining the initial voltage includes:
[0078] S401, after obtaining the first signal, obtain the initial power of the battery, where the first signal indicates that the electronic device where the battery is located is powered on.
[0079] In this embodiment, after the electronic device is powered on, the initial power of the electronic device can be obtained.
[0080] S402, look up the voltage corresponding to the initial power in a preset table, where the voltage corresponding to the initial power is the third calibration voltage of the battery at the first sampling moment, and the corresponding relationship between voltage and power is stored in the preset table.
[0081] In this embodiment, after obtaining the initial power, by means of looking up a table, query the voltage corresponding to the initial power in a preset table. The voltage corresponding to the initial power is the initial voltage. The initial voltage is the calibration voltage at the first sampling moment. In this application, the calibration voltage at the first sampling moment is denoted as the third calibration voltage. By looking up the table, the initial voltage can be quickly determined, and the calibration voltages at subsequent sampling moments can be calculated based on the initial voltage, which can make the voltage calibration more accurate, and thus make the calibrated power more accurate.
[0082] In a possible implementation manner, the implementation process of step S101 may include:
[0083] S1011, obtain the fifth sampling voltage at the jth sampling moment and the sixth sampling voltage at the (j + 1)th sampling moment;
[0084] S1012, calculate the difference between the sixth sampling voltage minus the fifth sampling voltage to obtain the jth voltage change amount of the battery within the jth sampling period.
[0085] Specifically, the voltage change amount is obtained according to the voltage change calculation model, and the voltage change calculation model includes: ΔV j = V j+1 - V j , where ΔV j is the jth voltage change amount of the battery within the jth sampling period, V j+1 is the sixth sampling voltage at the (j + 1)th sampling moment, and V j is the fifth sampling voltage at the jth sampling moment.
[0086] As an example, if j = 3, the fifth sampling voltage at the 3rd sampling moment is 4V, the sixth sampling voltage at the 4th sampling moment is 2.9V, and the jth voltage change amount of the battery within the jth sampling period is: 2.9 - 3 = -0.1V.
[0087] In a possible implementation manner, such as Figure 7As shown, starting from the first sampling moment T1, the voltage value of the battery is collected. The collected voltage value is denoted as the sampled voltage, and the sampling moments are from T1 to T9. The voltage value at each sampling moment is calibrated to obtain the calibrated voltage at each sampling moment, and the battery power of the battery is determined based on the calibrated voltage. In the figure, the sampling period is denoted as S. The period between the first sampling time and the second sampling moment is the first sampling period, and so on. In the figure, the voltage value changes suddenly in the second sampling period S2 between T2 and T3, and the voltage value changes suddenly in the fifth sampling period S5 between T5 and T6, that is, the absolute value of the voltage change of the battery in S2 and S5 is greater than the preset threshold. The sampled voltage at T1 is V1, the sampled voltage at T2 is V2, and so on. The calibrated voltage at T1 is V1', the calibrated voltage at T2 is V2', and so on. The calibrated voltage at T9 is V9'.
[0088] 1) At T1, V1' = V1;
[0089] 2) At T2, |V2 - V1| is less than the preset threshold, V2' = V1' + (V2 - V1) ≈ V2;
[0090] 3) At T3, |V3 - V2| is greater than the preset threshold. There is a sampling period S2 before T3 in which the absolute value of the voltage change is greater than the preset threshold. Since V2' is determined based on the voltage change in sampling period S1, in the sampling periods after S1, sampling period S3 is the first sampling period in which the absolute value of the voltage change (V4 - V3) is less than the preset threshold. Therefore, V3' = V2' + (V4 - V3).
[0091] 4) At T4, there is a sampling period S2 before T4 in which the absolute value of the voltage change is greater than the preset threshold. Since V3' is determined based on the voltage change in sampling period S3, in the sampling periods after S3, sampling period S4 is the first sampling period in which the absolute value of the voltage change (V5 - V4) is less than the preset threshold. Therefore, V4' = V3' + (V5 - V4).
[0092] 5) At T5, there is a sampling period S2 before T5 in which the absolute value of the voltage change is greater than the preset threshold. Since V4' is determined based on the voltage change in sampling period S4, in the sampling periods after S4, sampling period S6 is the first sampling period in which the absolute value of the voltage change (V7 - V6) is less than the preset threshold. Therefore, V5' = V4' + (V7 - V6).
[0093] 6) At time T6, there are sampling periods S2 and S5 before T6 in which the absolute value of the voltage change amount is greater than the preset threshold. Since V5’ is determined based on the voltage change amount of sampling period S6, in the sampling periods after S6, sampling period S7 is the first sampling period in which the absolute value of the voltage change amount (V8 - V7) is less than the preset threshold. Therefore, V6’ = V5’ + (V8 - V7).
[0094] 7) At time T7, there are sampling periods S2 and S5 before T7 in which the absolute value of the voltage change amount is greater than the preset threshold. Since V6’ is determined based on the voltage change amount of sampling period S7, in the sampling periods after S7, sampling period S8 is the first sampling period in which the absolute value of the voltage change amount (V9 - V8) is less than the preset threshold. Therefore, V7’ = V6’ + (V9 - V8).
[0095] As can be seen from the above method, it is equivalent to moving the curves of V3 to V5 after V2’, and V3 coincides with V2’. Moving the curves of V6 to V9 after V4’, and V6 coincides with V4’.
[0096] It should be understood that the magnitudes of the sequence numbers of the steps in the above embodiments do not mean the order of execution. The order of execution of each process should be determined according to its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
[0097] Corresponding to the method for determining the battery power described in the above embodiments, Figure 8 The structural block diagram of the device for determining the battery power provided by the embodiments of the present application is shown. For the sake of convenience of description, only the parts related to the embodiments of the present application are shown.
[0098] Referring to Figure 8 , the device 500 may include: a voltage acquisition module 510, a voltage calibration module 520, and a power determination module 530.
[0099] Among them, the voltage acquisition module 510 is configured to obtain the first calibration voltage of the battery at the (i - 1)th sampling moment and the jth voltage change amount of the battery within the jth sampling period when it is determined that there is a sampling period in which the absolute value of the voltage change amount of the battery is greater than or equal to the preset threshold in the sampling periods before the ith sampling moment, where the first calibration voltage is determined based on the (j - n)th voltage change amount of the battery within the (j - n)th sampling period, the jth sampling period is the first sampling period after the (j - n)th sampling period in which the absolute value of the voltage change amount is less than the preset threshold, i ≥ 2, j ≥ i, 1 ≤ n < j;
[0100] A voltage calibration module 520, configured to obtain a second calibration voltage at the \(i\)th sampling moment based on the first calibration voltage and the \(j\)th voltage change amount;
[0101] A power determination module 530, configured to determine the battery power of the battery at the \(i\)th sampling moment based on the second calibration voltage.
[0102] In a possible implementation manner, the voltage calibration module 520 may specifically be configured to:
[0103] Calculate the sum of the first calibration voltage and the \(j\)th voltage change amount to obtain the second calibration voltage at the \(i\)th sampling moment.
[0104] In a possible implementation manner, the device 500 further includes:
[0105] A sampling voltage acquisition module, configured to acquire a first sampling voltage of the battery at the \(m\)th sampling moment and a second sampling voltage of the battery at the \((m - 1)\)th sampling moment, where \(2\leq m\leq i\);
[0106] A first difference calculation module, configured to calculate a first difference between the first sampling voltage and the second sampling voltage;
[0107] A first judgment module, configured to determine that there is a sampling period in which the absolute value of the voltage change amount of the battery is greater than or equal to a preset threshold in the sampling period before the \(i\)th sampling moment if the absolute value of the first difference is greater than or equal to the preset threshold.
[0108] In a possible implementation manner, the following is further connected to the first difference calculation module:
[0109] A second judgment module, configured to determine that there is no sampling period in which the absolute value of the voltage change amount of the battery is greater than or equal to a preset threshold in the sampling period before the \(i\)th sampling moment if the absolute value of the first difference is less than the preset threshold.
[0110] In a possible implementation manner, the device 500 further includes:
[0111] A data acquisition module, configured to acquire the first calibration voltage of the battery at the \((i - 1)\)th sampling moment, the third sampling voltage at the \(i\)th sampling moment, and the fourth sampling voltage at the \((i - 1)\)th sampling moment when it is determined that there is no sampling period in which the absolute value of the voltage change amount of the battery is greater than or equal to a preset threshold in the sampling period before the \(i\)th sampling moment;
[0112] A second difference calculation module, configured to calculate a second difference obtained by subtracting the fourth sampling voltage from the third sampling voltage;
[0113] A calibration voltage determination module, configured to calculate the sum of a first calibration voltage and a second difference to obtain a second calibration voltage at the i-th sampling moment.
[0114] In a possible implementation, the apparatus 500 further includes:
[0115] An initial battery charge acquisition module, configured to acquire an initial battery charge after acquiring a first signal, where the first signal indicates that the electronic device where the battery is located is powered on;
[0116] A fourth initial voltage determination module, configured to look up a voltage corresponding to the initial battery charge in a preset table, where the voltage corresponding to the initial battery charge is a third calibration voltage of the battery at the 1st sampling moment, and a corresponding relationship between voltage and battery charge is stored in the preset table.
[0117] In a possible implementation, the voltage acquisition module 510 may specifically be configured to:
[0118] Acquire a fifth sampling voltage at the j-th sampling moment and a sixth sampling voltage at the (j + 1)-th sampling moment;
[0119] Calculate a difference obtained by subtracting the fifth sampling voltage from the sixth sampling voltage to obtain a j-th voltage change amount of the battery within the j-th sampling period.
[0120] It should be noted that, for the information interaction, execution process, etc. between the above-mentioned apparatus / units, since they are based on the same concept as the method embodiment of the present application, for their specific functions and the technical effects brought, reference may be specifically made to the method embodiment part, and details are not described herein again.
[0121] Those skilled in the art can clearly understand that, for the sake of convenience and brevity of description, only the above-mentioned division of each functional unit and module is used as an example for illustration. In practical applications, the above functions may be allocated to different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above integrated units may be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of each functional unit and module are only for the convenience of mutual distinction and do not limit the protection scope of the present application. The specific working processes of the units and modules in the above system may refer to the corresponding processes in the foregoing method embodiment, and details are not described herein again.
[0122] The embodiment of the present application further provides a terminal device. Refer to Figure 9, the terminal device 600 may include: at least one processor 610, a memory 620, and a computer program stored in the memory 620 and executable on the at least one processor 610. When the processor 610 executes the computer program, it implements the steps in any of the above method embodiments, such as Figure 2 the steps S101 to S103 in the illustrated embodiment. Alternatively, when the processor 610 executes the computer program, it implements the functions of each module / unit in the above device embodiments, such as Figure 8 the functions of the illustrated modules 510 to 530.
[0123] Exemplarily, the computer program may be divided into one or more modules / units. One or more modules / units are stored in the memory 620 and executed by the processor 610 to complete the present application. The one or more modules / units may be a series of computer program segments capable of performing specific functions, and these program segments are used to describe the execution process of the computer program in the terminal device 600.
[0124] Those skilled in the art can understand that Figure 9 it is merely an example of the terminal device and does not constitute a limitation on the terminal device. It may include more or fewer components than shown in the figure, or combine certain components, or different components, such as input / output devices, network access devices, buses, etc.
[0125] The processor 610 may be a central processing unit (CPU), or may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0126] The memory 620 may be an internal storage unit of the terminal device or an external storage device of the terminal device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. The memory 620 is used to store the computer program and other programs and data required by the terminal device. The memory 620 may also be used to temporarily store data that has been output or is to be output.
[0127] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience in representation, the buses in the drawings of this application are not limited to only one bus or one type of bus.
[0128] The method for determining battery power provided by the embodiments of this application can be applied to terminal devices such as computers, tablet computers, laptop computers, netbooks, personal digital assistants (PDAs), etc. The embodiments of this application do not impose any restrictions on the specific types of terminal devices.
[0129] In the above embodiments, the descriptions of the respective embodiments have their own emphases. For parts not detailed or recorded in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0130] Those of ordinary skill in the art can realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.
[0131] In the embodiments provided by this application, it should be understood that the disclosed terminal devices, apparatuses, and methods can be implemented in other ways. For example, the terminal device embodiments described above are merely illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of the devices or units can be in an electrical, mechanical, or other forms.
[0132] The unit described as a separation component may or may not be physically separated. The component shown as a unit may or may not be a physical unit, that is, it may be located in one place or distributed over multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0133] In addition, in each embodiment of the present application, each functional unit may be integrated in a processing unit, may exist separately as individual physical units, or two or more units may be integrated in one unit. The above integrated units can be implemented in the form of hardware or in the form of software functional units.
[0134] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, to implement all or part of the processes in the above method embodiments of the present application, it can also be completed by instructing relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by one or more processors, the steps of the above method embodiments can be implemented.
[0135] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, to implement all or part of the processes in the above method embodiments of the present application, it can also be completed by instructing relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by one or more processors, the steps of the above method embodiments can be implemented.
[0136] Similarly, as a computer program product, when the computer program product runs on a terminal device, it enables the terminal device to execute and implement the steps in the above method embodiments.
[0137] Among them, the computer program includes computer program code, which may be in the form of source code, object code, executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disc, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium, etc. It should be noted that the content included in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice within the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include electrical carrier signals and telecommunication signals.
[0138] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A method for determining battery power, characterized in that, it includes: After obtaining the first signal, obtaining the initial power of the battery, where the first signal indicates that the electronic device where the battery is located is powered on; Looking up the voltage corresponding to the initial power in a preset table, and the voltage corresponding to the initial power is the calibration voltage of the battery at the 1st sampling moment, where the corresponding relationship between voltage and power is stored in the preset table; When it is determined that there is a sampling period in the sampling period before the i-th sampling moment in which the absolute value of the voltage change amount of the battery is greater than or equal to a preset threshold, obtaining the first calibration voltage of the battery at the (i - 1)-th sampling moment, and the j-th voltage change amount of the battery within the j-th sampling period, where the first calibration voltage is determined based on the j - n-th voltage change amount of the battery within the j - n-th sampling period, the j-th sampling period is the first sampling period after the j - n-th sampling period in which the absolute value of the voltage change amount is less than the preset threshold, i≥2, j≥i, 1≤n<j; Based on the sum of the first calibration voltage and the j-th voltage change amount, obtaining the second calibration voltage at the i-th sampling moment; Based on the second calibration voltage, determining the battery power of the battery at the i-th sampling moment.
2. The method for determining battery power according to claim 1, characterized in that, the method further includes: Obtaining the first sampling voltage of the battery at the m-th sampling moment, and the second sampling voltage of the battery at the (m - 1)-th sampling moment, 2≤m≤i; Calculating the first difference between the first sampling voltage and the second sampling voltage; If the absolute value of the first difference is greater than or equal to the preset threshold, determining that there is a sampling period in the sampling period before the i-th sampling moment in which the absolute value of the voltage change amount of the battery is greater than or equal to the preset threshold.
3. The method for determining battery power according to claim 2, characterized in that, After calculating the first difference between the first sampling voltage and the second sampling voltage, the method further includes: If the absolute value of the first difference is less than the preset threshold, determining that there is no sampling period in the sampling period before the i-th sampling moment in which the absolute value of the voltage change amount of the battery is greater than or equal to the preset threshold.
4. The method for determining battery power according to any one of claims 1 to 3, characterized in that, the method further includes: When it is determined that there is no sampling period in the sampling period before the i-th sampling moment in which the absolute value of the voltage change amount of the battery is greater than or equal to the preset threshold, obtaining the first calibration voltage of the battery at the (i - 1)-th sampling moment, the third sampling voltage at the i-th sampling moment, and the fourth sampling voltage at the (i - 1)-th sampling moment; Calculating the second difference between the third sampling voltage minus the fourth sampling voltage; Calculating the sum of the first calibration voltage and the second difference to obtain the second calibration voltage at the i-th sampling moment.
5. The method for determining battery power according to claim 1, characterized in that, The j-th voltage change amount of the battery within the j-th sampling period includes: Obtain a fifth sampled voltage at the j-th sampling moment and a sixth sampled voltage at the (j + 1)-th sampling moment; Calculate the difference between the sixth sampled voltage and the fifth sampled voltage to obtain the j-th voltage change amount of the battery within the j-th sampling period.
6. A device for determining battery power, Characterized in that, It includes: An initial power acquisition module, configured to acquire the initial power of the battery after acquiring a first signal, where the first signal indicates that the electronic device where the battery is located is powered on; An initial voltage determination module, configured to look up the voltage corresponding to the initial power from a preset table, and the voltage corresponding to the initial power is the third calibrated voltage of the battery at the 1st sampling moment, where the preset table stores the corresponding relationship between voltage and power; A voltage acquisition module, configured to, when it is determined that there is a sampling period in the sampling periods before the i-th sampling moment in which the absolute value of the voltage change amount of the battery is greater than or equal to a preset threshold, acquire the first calibrated voltage of the battery at the (i - 1)-th sampling moment, and the j-th voltage change amount of the battery within the j-th sampling period, where the first calibrated voltage is determined based on the j - n-th voltage change amount of the battery within the j - n-th sampling period, and the j-th sampling period is the first sampling period after the j - n-th sampling period in which the absolute value of the voltage change amount is less than the preset threshold, i≥2, j≥i, 1≤n<j; A voltage calibration module, configured to obtain the second calibrated voltage at the i-th sampling moment based on the sum of the first calibrated voltage and the j-th voltage change amount; A power determination module, configured to determine the battery power of the battery at the i-th sampling moment based on the second calibrated voltage.
7. A terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, Characterized in that, When the processor executes the computer program, it implements the method for determining battery power according to any one of claims 1 to 5.
8. A computer-readable storage medium storing a computer program, Characterized in that, When the computer program is executed by a processor, it implements the method for determining battery power according to any one of claims 1 to 5.
Citation Information
Patent Citations
Battery electric quantity display method and device of terminal device
CN108107374A
Battery electric quantity acquisition method and device, storage medium and electronic equipment
CN112748347A