A terminal device hibernation wake-up electric quantity calibration method and device and a terminal device

By collecting and filtering voltage data in the sleep state of the terminal device, an accurate open-circuit voltage estimate is obtained, which solves the problem of inaccurate lithium battery power display and realizes high-precision power calibration. It is suitable for smartphones, tablets and wearable devices.

CN120820861BActive Publication Date: 2025-11-18XIAMEN UNISOC TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511314676.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-15
Publication Date
2025-11-18
Estimated Expiration
2045-09-15

AI Technical Summary

Technical Problem

Existing lithium battery power display solutions suffer from cumulative errors, resulting in inaccurate power display and affecting user usage time and battery safety.

Method used

When the terminal device is in sleep mode, voltage data is collected and filtered by monitoring current and time conditions to obtain an estimated value of open circuit voltage (OCV) close to the true value, and power calibration is performed based on this value.

Benefits of technology

It improves the accuracy of power display, meets user needs, avoids increased system power consumption due to calibration algorithms, ensures battery safety, and is suitable for a variety of terminal devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120820861B_ABST
    Figure CN120820861B_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of battery management, and discloses a terminal device hibernation wake-up electric quantity calibration method and device and a terminal device. The method comprises the following steps: monitoring the terminal device entering a hibernation state; in response to the battery of the terminal device being in a discharging state and the battery temperature being higher than a preset temperature threshold, obtaining a statistical time length after the discharging starts; if the statistical time length is greater than a first preset time threshold and a preset calibration condition is met, obtaining a plurality of battery voltage values sampled within the statistical time length; performing filtering processing on the plurality of battery voltage values to obtain an open circuit voltage (OCV) estimation value; determining a corresponding target electric quantity value according to the OCV estimation value and a corresponding relationship between a pre-stored OCV value and an electric quantity (SOC); and calibrating the display electric quantity of the terminal device based on the target electric quantity value. The application can obtain an OCV estimation value extremely close to a true value, and calibrate the electric quantity, so that the electric quantity percentage displayed by the terminal device can truly reflect the remaining capacity of the battery.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of battery management technology, and specifically relates to a method, device and terminal device for calibrating the power level during sleep and wake-up of a terminal device. Background Technology

[0002] The accuracy of battery level displays is always a major concern for end users, especially mobile phone users. Inaccurate battery levels prevent users from accurately estimating how long the phone will last, causing it to run out of power and shut down unexpectedly. Inaccurate battery levels can also cause the battery's shutdown voltage to drop, potentially leading to the system operating for extended periods in unexpectedly low-performance or unsafe low-voltage ranges. Furthermore, inaccurate battery levels can cause the phone to prematurely report 0% battery level and shut down, impacting the user's overall phone usage time.

[0003] One of the key existing technologies for lithium battery power estimation is the power display scheme based on coulomb counters and OCV (Open Circuit Voltage) curves. A problem with coulomb counters is the accumulation of errors; these errors accumulate over long periods of charging and discharging, leading to larger overall errors. The problem with OCV curves is that while the OCV curve is accurate, obtaining the OCV value in real time is very difficult. Calculating OCV using Ohm's law relies on a battery internal resistance model, which is extremely complex. Therefore, existing power estimation schemes based on coulomb counters and OCV cannot guarantee accurate power levels, resulting in low precision in battery power display. Summary of the Invention

[0004] The purpose of this invention is to overcome the problems of inaccurate battery level display and time-varying errors caused by the cumulative error of current integration in traditional coulomb counters. It cleverly utilizes the inherent sleep period of terminal devices, and by collecting voltage data and filtering it after meeting strict duration and current conditions, it can obtain an open-circuit voltage (OCV) estimate that is extremely close to the true value. Based on this OCV estimate, battery level calibration is performed, ensuring that the battery percentage displayed on the terminal device accurately reflects the remaining battery capacity.

[0005] In a first aspect, embodiments of the present invention provide a method for calibrating the power consumption of a terminal device during sleep / wake-up, the method comprising:

[0006] The monitoring terminal equipment enters sleep mode;

[0007] In response to the terminal device's battery being in a discharging state and the battery temperature being higher than a preset temperature threshold, the statistical duration after the start of self-discharge is obtained; wherein, the statistical duration is the duration of a single sleep cycle, or the sum of the cumulative duration of multiple sleep cycles and the cumulative duration of multiple wake-ups;

[0008] If the statistical duration is greater than the first preset time threshold and the preset calibration conditions are met, obtain multiple battery voltage values ​​sampled within a preset time period before the statistical duration ends and the current value corresponding to each battery voltage value.

[0009] From the plurality of battery voltage values, select a plurality of effective voltage values ​​whose current values ​​are less than a first preset current threshold, and perform filtering processing on the plurality of effective voltage values ​​to obtain an estimated value of open circuit voltage OCV;

[0010] Based on the estimated OCV value and the correspondence between the pre-stored OCV value and the SOC value, the corresponding target energy value is determined;

[0011] The displayed battery level of the terminal device is calibrated based on the target battery level value;

[0012] Wherein, if the statistical duration is the duration of a single hibernation, the preset calibration condition is that the average battery current within the statistical duration is less than a first preset current threshold.

[0013] If the statistical duration is the sum of the cumulative duration of multiple sleep cycles and the cumulative duration of multiple wake-ups, the preset calibration conditions are: the average battery current within the statistical duration is less than a first preset current threshold; the proportion of sleep duration within the statistical duration is greater than a preset duration threshold; the duration of the last sleep cycle is greater than the first preset duration and its average current is less than the sleep current threshold; the duration of the last wake-up is less than a second preset duration and its average current is less than the wake-up current threshold; and during each wake-up process, there is no situation where: the wake-up current is greater than the second preset current threshold and the duration of the wake-up current is greater than the target duration; the first preset duration is greater than the second preset duration; and the second preset current threshold is greater than the first preset current threshold.

[0014] Optionally, the filtering process is performed using a first-in-first-out (FIFO) queue.

[0015] The acquisition of multiple battery voltage values ​​sampled within a preset time period before the statistical duration ends, and the current value corresponding to each battery voltage value, includes:

[0016] The sampled battery voltage and current values ​​are stored in the FIFO queue in chronological order.

[0017] Accordingly, the step of selecting multiple effective voltage values ​​with current values ​​less than a first preset current threshold from the multiple battery voltage values, and filtering the multiple effective voltage values ​​to obtain the estimated open-circuit voltage (OCV) includes:

[0018] Filter out multiple valid voltage values ​​whose current values ​​are less than a first preset current threshold from the battery voltage values ​​in the FIFO queue;

[0019] Calculate the arithmetic mean of the multiple effective voltage values, and use the calculated arithmetic mean as the estimated OCV value.

[0020] Optionally, if the statistical duration is the duration of a single sleep cycle;

[0021] The calibration of the terminal device's displayed battery level based on the target battery value includes:

[0022] Based on a preset power range, determine whether the target power value is located in a first SOC range or a second SOC range; the first SOC range corresponds to the range in the OCV and SOC change curve where the rate of change of voltage with power is higher than a preset value, and the second SOC range corresponds to the range where the rate of change of voltage with power is lower than a preset value.

[0023] If the target battery level is within the first SOC range, the displayed battery level of the terminal device will be calibrated to the target battery level.

[0024] If the target battery level is within the second SOC range, then the following steps are performed:

[0025] The first calibration threshold is obtained by querying the temperature threshold mapping table based on the current temperature of the battery.

[0026] Calculate the first power difference between the target power value and the currently displayed power value;

[0027] If the first power difference is greater than the first calibration threshold, the current displayed power is calibrated based on the difference between the first power difference and the first calibration threshold;

[0028] If the first power difference is less than the first calibration threshold, the currently displayed power remains unchanged.

[0029] Optionally, the statistical duration may be the sum of the cumulative duration of multiple sleep cycles and the cumulative duration of multiple wake-ups;

[0030] The calibration of the terminal device's displayed battery level based on the target battery value includes:

[0031] Based on the magnitude of the hibernation / wake-up parameters, a target calibration level is determined from multiple preset calibration levels. The hibernation / wake-up parameters include the average battery current during the statistical period, the percentage of hibernation time during the statistical period, the duration and average current of the last hibernation, and the duration and average current of the last wake-up. The multiple preset calibration levels include at least a first calibration level and a second calibration level. The admission criteria for the first calibration level are stricter than those for the second calibration level, and the accuracy of the calibration strategy corresponding to the first calibration level is higher than that of the second calibration level.

[0032] The displayed battery level of the terminal device is calibrated based on the target battery level and the target calibration level.

[0033] Optionally, the first preset current threshold under the first calibration level is less than the first preset current threshold under the second calibration level, the preset duration threshold under the first calibration level is greater than the preset duration threshold under the second calibration level, the first preset duration under the first calibration level is greater than the first preset duration under the second calibration level, the sleep current threshold under the first calibration level is less than the sleep current threshold under the second calibration level, and the second preset duration under the first calibration level is less than the second preset duration under the second calibration level.

[0034] Optionally, calibrating the displayed battery level of the terminal device based on the target battery level and the target calibration level includes:

[0035] Based on a preset power range, determine whether the target power value is located in a first SOC range or a second SOC range; the first SOC range corresponds to the range in the OCV and SOC change curve where the rate of change of voltage with power is higher than a preset value, and the second SOC range corresponds to the range where the rate of change of voltage with power is lower than a preset value.

[0036] If the target battery value is located in the first SOC range, obtain the second calibration threshold corresponding to the first SOC range under the target calibration level, and calculate the second battery difference between the target battery value and the currently displayed battery value.

[0037] If the second power difference is less than the second calibration threshold, the current displayed power remains unchanged; if the second power difference is greater than the second calibration threshold, the current displayed power is calibrated based on the difference between the second power difference and the second calibration threshold.

[0038] Optionally, calibrating the displayed battery level of the terminal device based on the target battery level and the target calibration level includes:

[0039] If the target battery level is within the second SOC range, obtain the third calibration threshold corresponding to the second SOC range under the target calibration level, and calculate the third battery level difference between the target battery level and the currently displayed battery level; the third calibration threshold is greater than the second calibration threshold.

[0040] If the third power difference is less than the third calibration threshold, the current displayed power level remains unchanged; if the third power difference is greater than the third calibration threshold, the current displayed power level is calibrated based on the difference between the third power difference and the third calibration threshold.

[0041] Optionally, the second calibration threshold corresponding to the first SOC interval under the first calibration level is less than the second calibration threshold corresponding to the first SOC interval under the second calibration level, and the third calibration threshold corresponding to the first SOC interval under the first calibration level is less than the third calibration threshold corresponding to the first SOC interval under the second calibration level.

[0042] Secondly, embodiments of the present invention provide a terminal device sleep / wake-up power calibration device, the device comprising:

[0043] The sleep state monitoring module is used to monitor when the terminal device enters the sleep state;

[0044] The statistical duration acquisition module is used to acquire the statistical duration after the start of self-discharge in response to the terminal device's battery being in a discharging state and the battery temperature being higher than a preset temperature threshold; wherein, the statistical duration is the duration of a single sleep cycle, or the sum of the cumulative duration of multiple sleep cycles and the cumulative duration of multiple wake-ups;

[0045] The voltage and current value acquisition module is used to acquire multiple battery voltage values ​​and the current value corresponding to each battery voltage value within a preset time period before the statistical duration ends, if the statistical duration is greater than a first preset time threshold and the preset calibration conditions are met.

[0046] The OCV estimation calculation module is used to filter out multiple effective voltage values ​​with current values ​​less than a first preset current threshold from the multiple battery voltage values, and to filter the multiple effective voltage values ​​to obtain the open circuit voltage OCV estimation value.

[0047] The target power value determination module is used to determine the corresponding target power value based on the estimated OCV value and the pre-stored correspondence between OCV value and power SOC.

[0048] A power calibration module is used to calibrate the displayed power level of the terminal device based on the target power level value;

[0049] Wherein, if the statistical duration is the duration of a single hibernation, the preset calibration condition is that the average battery current within the statistical duration is less than a first preset current threshold.

[0050] If the statistical duration is the sum of the cumulative duration of multiple sleep cycles and the cumulative duration of multiple wake-ups, the preset calibration conditions are: the average battery current within the statistical duration is less than a first preset current threshold; the proportion of sleep duration within the statistical duration is greater than a preset duration threshold; the duration of the last sleep cycle is greater than the first preset duration and its average current is less than the sleep current threshold; the duration of the last wake-up is less than a second preset duration and its average current is less than the wake-up current threshold; and during each wake-up process, there is no situation where: the wake-up current is greater than the second preset current threshold and the duration of the wake-up current is greater than the target duration; the first preset duration is greater than the second preset duration; and the second preset current threshold is greater than the first preset current threshold.

[0051] Thirdly, embodiments of the present invention provide a terminal device, including:

[0052] At least one processor;

[0053] Memory for storing the at least one processor-executable instruction;

[0054] The at least one processor is configured to execute the instructions to implement the method described in the first aspect.

[0055] Fourthly, embodiments of the present invention provide a computer-readable storage medium that, when instructions in the computer-readable storage medium are executed by a processor of a terminal device, enables the terminal device to perform the method described in the first aspect.

[0056] Fifthly, embodiments of the present invention provide a computer program product, including a computer program that, when executed by a processor, implements the method described in the first aspect.

[0057] The technical solution provided by this invention cleverly utilizes the inherent sleep time period of terminal devices. By collecting voltage data and filtering it after meeting strict duration and current conditions, an open-circuit voltage (OCV) estimate that is extremely close to the true value can be obtained. Based on this OCV estimate, power calibration is performed, fundamentally overcoming the problems of inaccurate power display and drift over time caused by the cumulative error of current integration in traditional coulomb counters. This ensures that the power percentage seen by the user accurately reflects the remaining battery capacity, greatly improving the user experience.

[0058] Furthermore, it effectively utilizes user habits, achieving a high calibration success rate and seamless operation: the calibration triggering conditions proposed in this invention closely align with the daily usage habits of most users (who engage in multiple screen-off standby actions of varying lengths each day). Without requiring active user intervention or the creation of a special calibration environment, the system can automatically and seamlessly capture numerous calibration opportunities in the background, thereby achieving continuous, dynamic, and high-precision power maintenance throughout the entire lifecycle of the terminal device.

[0059] Moreover, the core data acquisition and judgment of the entire calibration process are completed in the system's sleep state. The sleep state itself is a low-power state, and this invention ensures that calibration is only performed when the system is truly in a deep sleep state with low power consumption by setting a strict average current threshold, thus avoiding the risk of additional system power consumption due to the execution of the calibration algorithm. At the same time, the pre-emptive battery temperature and discharge state checks effectively prevent incorrect calibration under unfavorable conditions such as low temperature or charging, ensuring the safety of battery use.

[0060] Furthermore, this invention does not simply trigger calibration after sleep mode, but introduces a comprehensive "preset calibration condition" judgment logic. This logic comprehensively considers the total duration, overall average current, sleep mode percentage, and the last sleep / wake-up behavior, and monitors each wake-up process to determine if there are abnormally high power consumption conditions, such as a current value continuously exceeding a second preset current threshold for a duration reaching the target duration. It intelligently identifies the highest quality and most reliable calibration opportunities. This mechanism ensures that system resources are only used for calibration operations with the highest probability of success, avoiding invalid calculations and optimizing system performance. Moreover, this invention is mainly implemented based on software algorithms, with low dependence on hardware platforms. It does not require the addition of new hardware sensors or circuits and can be widely applied to various terminal devices using lithium batteries, such as smartphones, tablets, and wearable devices, possessing high industrial application value and versatility. Attached Figure Description

[0061] Figure 1 A flowchart of a terminal device sleep / wake-up power calibration method provided in an embodiment of the present invention;

[0062] Figure 2 for Figure 1 A flowchart of one implementation of S160 in the illustrated embodiment;

[0063] Figure 3 for Figure 1 A flowchart of another implementation of S160 in the illustrated embodiment;

[0064] Figure 4 for Figure 3 A flowchart of one implementation of S162b in China;

[0065] Figure 5 This is a statistical diagram illustrating the key parameters of a single hibernation process in an embodiment of the present invention;

[0066] Figure 6 This is a statistical diagram illustrating the key parameters of the multiple sleep-wake processes in an embodiment of the present invention;

[0067] Figure 7 This is a comparative diagram of multiple calibration strategies in an embodiment of the present invention;

[0068] Figure 8 This is a schematic diagram of a terminal device sleep / wake-up power calibration device provided in an embodiment of the present invention;

[0069] Figure 9 This is a schematic diagram of a terminal device sleep / wake-up power calibration device provided in an embodiment of the present invention. Detailed Implementation

[0070] The present invention will be described in detail below through embodiments.

[0071] The accuracy of battery level displays is always a major concern for end users, especially mobile phone users. Inaccurate battery level displays prevent users from accurately estimating how long the phone will last, causing it to run out of battery and shut down unexpectedly. Inaccurate battery level displays can also cause the battery's shutdown voltage to drop, potentially leading to the system operating for extended periods in unexpectedly low-performance or unsafe voltage ranges. Furthermore, inaccurate battery level displays can cause the phone to prematurely report 0% battery and shut down, further reducing the user's phone's usability.

[0072] One of the key existing technologies for lithium battery power estimation is the power display scheme based on coulomb counters and OCV (Open Circuit Voltage) curves. A problem with coulomb counters is the accumulation of errors; these errors accumulate over long periods of charging and discharging, leading to larger overall errors. The problem with OCV curves is that while the OCV curve is accurate, obtaining the OCV value in real time is very difficult. Calculating OCV using Ohm's law relies on a battery internal resistance model, which is extremely complex. Therefore, existing power estimation schemes based on coulomb counters and OCV cannot guarantee accurate power levels, resulting in low precision in battery power display.

[0073] The research revealed that mobile terminals are primarily powered by lithium batteries, and the correlation curve between the open temperature (OCV) and state of charge (SOC) of lithium batteries at different temperatures is one of the most accurate and reliable fundamental methods for estimating lithium battery capacity. By finding the accurate OCV value during the operation of the mobile phone system, the accurate battery value can be obtained by looking up a table of pre-calibrated OCV-SOC capacity curves at different temperatures, thus ensuring the accuracy of the phone's battery display.

[0074] Specifically, it involves two fundamental principles, namely Fundamental Principle 1 and Fundamental Principle 2.

[0075] The first basic principle is that the OCV value stabilizes approximately within half an hour in a scenario where there is current (IBAT>0 or IBAT<0) to no current (IBAT=0). Here, IBAT represents the charging current into the battery. However, most mobile phone users are highly likely to leave their phones on standby with the screen off for more than 30 minutes.

[0076] Basic principle 2 is as follows: In the lithium battery OCV calculation scheme: OCV = VBAT – IBAT * RBAT. As long as IBAT is very small, for example, less than 30... At this point, the effect of IBAT*RBAT is very small, and it can be approximated as OCV≈VBAT. VBAT can then be used to calibrate the battery capacity. Here, VBAT is the battery terminal voltage.

[0077] The two fundamental principles described above together constitute the feasibility demonstration of the sleep-wake power calibration method in this embodiment of the invention. Specifically, it includes the following two aspects:

[0078] Firstly, the embodiment of the present invention selects to calibrate the power when the terminal device enters a sleep state because only when the terminal device enters a sleep state is the current (IBAT) small enough (satisfying the condition of principle 2), at which time VBAT≈OCV.

[0079] Secondly, in this embodiment of the invention, the sleep time of the terminal device needs to reach a time threshold (for example, the time threshold is 30 minutes). This is because it is necessary to wait for the voltage to stabilize (satisfying the condition of principle 1) to ensure that the measured VBAT is a stable value that is infinitely close to the real OCV.

[0080] The two principles mentioned above demonstrate, from both theoretical (electrochemical characteristics) and practical (user habits) perspectives, that it is feasible, reliable, and efficient to perform power calibration during the phone's sleep state.

[0081] Therefore, embodiments of the present invention provide a method, apparatus, and terminal device for calibrating battery power during sleep / wake-up in a terminal device. The following will describe in detail the method for calibrating battery power during sleep / wake-up in a terminal device provided by embodiments of the present invention.

[0082] like Figure 1 As shown in the figure, a terminal device sleep / wake-up power calibration method provided by an embodiment of the present invention may include the following steps:

[0083] S110, the monitoring terminal device has entered sleep mode.

[0084] The operating system or power management unit of a terminal device sends an interrupt signal or broadcast indicating a system state transition to the fuel gauge chip or main processor. This invention, by monitoring this signal in real time, can accurately detect when the system transitions from a screen-on wake-up state to a screen-off sleep state. This step is a prerequisite for triggering all subsequent power calibration logic.

[0085] S120, in response to the terminal device's battery being in a discharging state and the battery temperature being higher than a preset temperature threshold, obtains the statistical duration after the start of self-discharge.

[0086] The statistical duration is either the duration of a single sleep cycle or the sum of the cumulative duration of multiple sleep cycles and the cumulative duration of multiple wake-ups.

[0087] This step involves two important prerequisites and initial judgments for performing calibration:

[0088] Condition one is the discharge state. This is determined by checking if the terminal device is connected to a charger. If the terminal device is charging, the calibration process is terminated to avoid interference with battery voltage stability and the accuracy of the calibration results caused by switching between charge and discharge states.

[0089] Condition two requires the battery temperature to be above a preset temperature threshold (e.g., -10°C). This is because the electrochemical characteristics of lithium batteries change significantly in low-temperature environments (especially below 0°C), manifesting as a sharp increase in internal resistance. This causes even a small current to induce significant voltage fluctuations, severely affecting the accuracy of the open-circuit voltage (OCV) estimate and consequently reducing the accuracy of the charge calibration. Furthermore, under extreme low-temperature conditions, the battery's own charge estimation error increases significantly, rendering calibration operations meaningless and potentially introducing substantial deviations. Therefore, the battery temperature must be maintained within a reliable operating range to ensure the validity of the calibration results.

[0090] The system will only begin executing subsequent operations if both of the above conditions are met simultaneously. Subsequently, the system will read from memory or begin accumulating the total time elapsed since the start of the current discharge cycle, i.e., the statistical duration.

[0091] Based on users' usage patterns of terminal devices, the statistical duration can be divided into two categories:

[0092] The first category is the duration of a single sleep cycle. This refers to the continuous time from when the terminal device enters sleep mode until it is woken up again.

[0093] The second type of statistical duration can be the sum of the cumulative duration of multiple sleep cycles and the cumulative duration of multiple wake-ups. This refers to the total time obtained by adding the sum of the times of all sleep segments and the sum of the times of all wake-ups within a relatively long observation window (e.g., starting from the first sleep cycle).

[0094] S130, if the statistical duration is greater than the first preset time threshold and the preset calibration conditions are met, obtain multiple battery voltage values ​​sampled within a preset time period before the statistical duration ends and the current value corresponding to each battery voltage value.

[0095] If the statistical duration is the duration of a single hibernation, the preset calibration condition is that the average battery current within the statistical duration is less than a first preset current threshold.

[0096] If the statistical duration is the sum of the cumulative duration of multiple sleep cycles and the cumulative duration of multiple wake-ups, the preset calibration conditions are: the average battery current within the statistical duration is less than the first preset current threshold, the proportion of sleep duration within the statistical duration is greater than the preset duration threshold, the duration of the last sleep cycle is greater than the first preset duration and its average current is less than the sleep current threshold, the duration of the last wake-up is less than the second preset duration and its average current is less than the wake-up current threshold, and there is no situation in each wake-up process where: the wake-up current is greater than the second preset current threshold and the duration of the wake-up current is greater than the target duration, the first preset duration is greater than the second preset duration, and the second preset current threshold is greater than the first preset current threshold.

[0097] The length of the preset time period can be determined according to the actual situation. After a long period of rest, the battery voltage is most stable in the final stage. Sampling within this time period ensures that the obtained voltage value is closest to the true OCV.

[0098] Specifically, this step is the core judgment logic of the calibration. Voltage and current data will only be collected when the duration is long enough and the electrical activity is sufficiently static.

[0099] For determining the duration, the statistical duration must be greater than a first preset time threshold. This first preset time threshold (e.g., 30 minutes) is set based on the physical characteristics of lithium batteries. It ensures that after the current flows from the current-carrying state to zero, the polarization reaction inside the battery has sufficient time (usually about 30 minutes) to fully relax, allowing the battery terminal voltage (VBAT) to stably recover to near the true open-circuit voltage (OCV).

[0100] The determination of preset calibration conditions. This condition is used to ensure that the power consumption behavior of the terminal device meets the "quasi-OCV" measurement requirements within the statistical duration. The preset calibration conditions vary depending on the different sleep scenarios. In this embodiment of the invention, they can be roughly divided into the following two sleep scenarios:

[0101] The first hibernation scenario is: single hibernation. In this case, the preset calibration condition is that the average battery current over the statistical period is less than a first preset current threshold (e.g., 30). This is because, according to the formula OCV = VBAT - IBAT * RBAT, if the average current during the entire sleep period is extremely small, then the IBAT * RBAT term can be ignored, and in this case, VBAT ≈ OCV. This condition ensures that the entire sleep period is in a deep sleep state with ultra-low power consumption, without abnormal wake-ups or interference from high-power background tasks.

[0102] The second hibernation scenario is: multiple hibernation wake-ups. In this case, the preset calibration conditions include the following four sub-conditions.

[0103] The first sub-condition is: the average battery current during the statistical period is less than a first preset current threshold. This ensures that the overall power consumption rate is very slow throughout the entire cycle.

[0104] The second sub-condition is: the percentage of sleep time within the statistical period is greater than the preset time threshold (e.g., 80%): this ensures that the device is in a measurable state rather than an interfered state for the vast majority of the time from a time distribution perspective.

[0105] The third sub-condition is: the duration of the last sleep cycle is greater than the first preset duration (e.g., 5 minutes) and its average current is less than the sleep current threshold (e.g., 30). This ensures that, as calibration approaches, the terminal equipment has undergone a sufficiently long and stable resting period, and the voltage has been fully stabilized.

[0106] The fourth sub-condition is: the duration of the last wake-up is less than the second preset duration (e.g., 2 minutes) and its average current is less than the wake-up current threshold (e.g., battery rated capacity / 25): This ensures that user usage is brief and lightweight before entering the last stable sleep state. This prevents calibration errors caused by the voltage not yet stabilizing after prolonged, high-load use.

[0107] The fifth sub-condition is that during each wake-up process, there must be no situation where the wake-up current exceeds the second preset current threshold and the duration of this wake-up current exceeds the target duration. This sub-condition ensures that the voltage data used for calibration is acquired from a stable environment free from severe interference by prohibiting any prolonged high-power wake-ups, thereby improving the final calibration accuracy. The second preset current threshold can be set according to actual conditions, for example, it can be 200. Furthermore, the duration of the target can be set according to the actual situation, for example, it can be 90 seconds.

[0108] Only when all the above sub-conditions are met will the system determine that this is a high-quality and reliable calibration opportunity and perform voltage sampling.

[0109] It should be noted that the values ​​of the first preset current threshold, preset duration threshold, first preset duration, sleep current threshold, second preset duration, and wake-up current threshold can be set according to actual conditions. This embodiment of the invention does not impose specific limitations on the value of the thresholds.

[0110] S140: Select multiple effective voltage values ​​from multiple battery voltage values ​​whose current values ​​are less than the first preset current threshold, filter the multiple effective voltage values, and obtain the estimated value of open circuit voltage OCV.

[0111] Specifically, the system does not directly use all sampled battery voltage values. Instead, it first performs a data cleaning procedure to remove invalid voltage values ​​that are severely affected by load current interference from the raw battery voltage values, thereby obtaining multiple valid voltage values ​​and ensuring the basic reliability of the data used in subsequent processing. Furthermore, directly using any instantaneous voltage value may introduce errors due to small fluctuations. Therefore, the valid voltage values ​​need to be filtered. For example, the arithmetic mean is calculated to eliminate random fluctuations; the median is calculated to eliminate interference from individual outliers; and digital filtering (such as a first-order low-pass filter) is performed to smooth the data. The filtered output is the final, reliable estimate of the open-circuit voltage (OCV).

[0112] S150: Determine the corresponding target energy value based on the estimated OCV value and the correspondence between the pre-stored OCV value and the energy SOC.

[0113] Specifically, before the terminal device leaves the factory, a complete OCV-SOC relationship curve calibration has been performed at different temperature points (such as 0°C, 10°C, or 25°C) for the battery model it uses, and this data is pre-stored in the device's memory in the form of a lookup table. In this step, the real-time temperature of the battery is obtained; based on this real-time temperature, the target OCV-SOC relationship curve corresponding to the real-time temperature is calculated by interpolation using multiple pre-stored OCV-SOC curves at different temperatures. The OCV estimate obtained in step S140 is used as input, and a lookup table or interpolation calculation is performed on the selected curve to obtain an accurate target capacity value.

[0114] S160 calibrates the displayed battery level of the terminal device based on the target battery level value.

[0115] Specifically, the system updates the currently displayed battery level (UISOC) to the target battery level calculated in step S150. In practical applications, for high-quality calibration opportunities (such as a single long sleep cycle), the displayed battery level is directly replaced with the target battery level. For opportunities with slightly lower data quality (such as multiple sleep-wake cycles), a calibration threshold can be set. Only when the difference between the target battery level and the currently displayed value exceeds this calibration threshold will the displayed battery level of the terminal device be calibrated using the portion of the battery level exceeding the calibration threshold. To clarify the solution, the battery calibration strategy will be described in detail in the following embodiments.

[0116] The technical solution provided by this invention cleverly utilizes the inherent sleep time period of terminal devices. By collecting voltage data and filtering it after meeting strict duration and current conditions, an open-circuit voltage (OCV) estimate that is extremely close to the true value can be obtained. Based on this OCV estimate, power calibration is performed, fundamentally overcoming the problems of inaccurate power display and drift over time caused by the cumulative error of current integration in traditional coulomb counters. This ensures that the power percentage seen by the user accurately reflects the remaining battery capacity, greatly improving the user experience.

[0117] Furthermore, it effectively utilizes user habits, achieving a high calibration success rate and seamless operation: the calibration triggering conditions proposed in this invention closely align with the daily usage habits of most users (who engage in multiple screen-off standby actions of varying lengths each day). Without requiring active user intervention or the creation of a special calibration environment, the system can automatically and seamlessly capture numerous calibration opportunities in the background, thereby achieving continuous, dynamic, and high-precision power maintenance throughout the entire lifecycle of the terminal device.

[0118] Moreover, the core data acquisition and judgment of the entire calibration process are completed in the system's sleep state. The sleep state itself is a low-power state, and this invention ensures that calibration is only performed when the system is truly in a deep sleep state with low power consumption by setting a strict average current threshold, thus avoiding the risk of additional system power consumption due to the execution of the calibration algorithm. At the same time, the pre-emptive battery temperature and discharge state checks effectively prevent incorrect calibration under unfavorable conditions such as low temperature or charging, ensuring the safety of battery use.

[0119] Furthermore, this invention does not simply trigger calibration after sleep mode, but introduces a comprehensive "preset calibration condition" judgment logic. This logic comprehensively considers the total duration, overall average current, sleep mode percentage, and the last sleep / wake-up behavior, and monitors each wake-up process to determine if there are abnormally high power consumption conditions, such as a current value continuously exceeding a second preset threshold for a duration reaching the target duration. It intelligently identifies the highest quality and most reliable calibration opportunities. This mechanism ensures that system resources are only used for calibration operations with the highest probability of success, avoiding invalid calculations and optimizing system performance. Moreover, this invention is mainly implemented based on software algorithms, with low dependence on hardware platforms. It does not require the addition of new hardware sensors or circuits and can be widely applied to various terminal devices using lithium batteries, such as smartphones, tablets, and wearable devices, possessing high industrial application value and versatility.

[0120] In summary, the technical solution provided by the embodiments of the present invention effectively solves the problem of power display accuracy mentioned in the background art, and provides a power calibration method with high precision, high reliability, low power consumption and user-friendly experience.

[0121] exist Figure 1 Based on the illustrated embodiment, as one implementation of the present invention, the filtering process is performed using a first-in-first-out (FIFO) queue.

[0122] At this time, S130, acquiring multiple battery voltage values ​​sampled within a preset time period before the statistical duration exits, and the current value corresponding to each battery voltage value, may include the following steps:

[0123] The sampled battery voltage and current values ​​are stored in a FIFO queue in chronological order.

[0124] Correspondingly, in S140, multiple effective voltage values ​​with current values ​​less than a first preset current threshold are selected from multiple battery voltage values, and the multiple effective voltage values ​​are filtered to obtain an estimated open-circuit voltage (OCV) value, including:

[0125] Select multiple valid voltage values ​​from the battery voltage values ​​in the FIFO queue whose current values ​​are less than a first preset current threshold.

[0126] Calculate the arithmetic mean of multiple effective voltage values ​​and use the calculated arithmetic mean as the OCV estimate.

[0127] Specifically, the filtering process described in step S140 is performed using a FIFO (First-In-First-Out) queue. This is a classic data management method that is efficient, reliable, and resource-efficient in embedded systems, and is particularly suitable for the need to smooth continuous voltage data in this application scenario.

[0128] The specific implementation process includes the following three sub-steps:

[0129] The first sub-step is data caching. The sampled battery voltage values ​​are stored in a FIFO queue in chronological order. The system allocates a fixed-length array in memory as the FIFO queue and initializes the head and tail pointers. The length N of the FIFO queue is preset based on the sampling frequency and the desired filtering window time. For example, if the filtering window time is set to 10 minutes and the sampling interval is 1 minute, then the queue length N = 10, used to store the voltage data for the most recent 10 minutes.

[0130] Within the statistical duration determined in step S130, the power management unit or fuel gauge collects the instantaneous terminal voltage (VBAT_NOW) of the battery at a fixed sampling frequency (e.g., once per minute). Each time a new voltage value is collected, it is stored in chronological order at the tail of the FIFO queue. When the queue is full, the latest collected data overwrites the oldest data (i.e., the data at the head of the queue), thus ensuring that the queue always stores the most recent voltage sample values ​​arranged in chronological order.

[0131] The advantage of this step is that it automatically creates a dynamically updated data sliding window that always focuses on the latest voltage information, providing a high-quality data source for subsequent filtering calculations.

[0132] The second sub-step is: data filtering. Multiple valid voltage values ​​with current values ​​lower than a first preset current threshold are filtered from the battery voltage values ​​in the FIFO queue.

[0133] The third sub-step is: data processing. The arithmetic mean of the selected battery voltage values ​​is calculated and used as the OCV estimate. When the system meets all calibration conditions and triggers calibration, the processor performs the following operations: reads all N valid battery voltage values ​​in the current FIFO queue; calculates the arithmetic mean: adds these N voltage values ​​together and then divides by N to obtain their arithmetic mean; and uses the calculated arithmetic mean as the final open-circuit voltage (OCV) estimate, outputting it to subsequent steps for table lookup calculation of the target charge value.

[0134] Using the arithmetic mean method can bring at least the following benefits:

[0135] 1. Effectively suppresses random fluctuations: It can effectively smooth out random voltage fluctuations caused by measurement noise and instantaneous small load fluctuations, and the obtained OCV estimate is more stable and reliable than any single-point sample value.

[0136] 2. Simple and efficient calculation. Arithmetic average calculation has extremely low requirements for processor computing resources, requiring only simple addition and division operations. It is very suitable for fast execution in resource-constrained embedded systems (such as mobile phone main coprocessors) without incurring significant power consumption overhead.

[0137] 3. The algorithm outputs the DC component of the voltage within the filtering time window, and its physical meaning is consistent with the "average voltage after resting", which is very close to the ideal open circuit voltage (OCV) value.

[0138] In summary, by combining FIFO queue caching with arithmetic average calculation, this invention can extract a highly accurate and stable OCV estimate from a series of perturbed voltage samples with minimal system resource consumption. This provides a solid data foundation for subsequent power calibration and is an implementation scheme that balances reliability, accuracy, and low power consumption.

[0139] The calibration strategies of the present invention in different scenarios will be described in detail below.

[0140] exist Figure 1 Based on the illustrated embodiment, as one implementation of the present invention, if the statistical duration is the duration of a single sleep cycle.

[0141] S160 calibrates the displayed battery level of the terminal device based on the target battery level value, such as Figure 2 As shown, it may include the following steps:

[0142] S161a, based on the preset power range, determine whether the target power value is located in the first SOC range or the second SOC range.

[0143] The first SOC interval corresponds to the interval in the OCV and SOC change curve where the rate of change of voltage with charge is higher than a preset value, and the second SOC interval corresponds to the interval where the rate of change of voltage with charge is lower than a preset value.

[0144] This step forms the basis for making differentiated calibration strategy decisions. Its core basis is the inherent electrochemical characteristics of lithium batteries: the slope (i.e., rate of change) of the open-circuit voltage (OCV) versus state-of-charge (SOC) curve varies significantly across different ranges. The state-of-charge range is pre-calibrated at the factory based on the battery's OCV-SOC curve characteristics and stored in the device.

[0145] Within the first SOC range, the OCV-SOC curve has a steep slope, and the rate of change of voltage with charge is higher than the preset value. This means that a small change in charge corresponds to a significant change in voltage. Therefore, within this range, estimating charge based on OCV has high sensitivity and accuracy.

[0146] Within the second SOC range, the OCV-SOC curve becomes very flat, and the rate of change of voltage with charge is lower than the preset value. This means that a significant change in charge is required for even a slight change in voltage. Therefore, within this range, even small measurement errors in voltage can be amplified into huge errors in charge calculation, resulting in low reliability.

[0147] The system determines which calibration strategy to use by judging which range the target power value obtained in step S150 falls into.

[0148] S162a, if the target battery level is within the first SOC range, calibrate the displayed battery level of the terminal device to the target battery level.

[0149] For the first SOC range, since the OCV estimates battery level with very high accuracy, this invention adopts the most direct calibration strategy. The system directly updates the battery level value (UISOC) currently displayed to the user to the target battery level value calculated in step S150. This strategy can quickly and effectively correct the battery level display error within this range, ensuring display accuracy within the primary usage range.

[0150] If the target charge value is within the second SOC range, then execute the conservative calibration strategy in steps S163 to S166:

[0151] S163a: Query the temperature threshold mapping table based on the current temperature of the battery to obtain the first calibration threshold.

[0152] Specifically, this is the first step in conservative calibration and a key aspect of the invention's refinement. In the second SOC range, the calibration threshold is not a fixed value. Because battery characteristics are significantly affected by temperature, at high or low temperatures, the internal resistance changes considerably, causing even a small current to cause significant voltage fluctuations. This severely impacts the accuracy of the open-circuit voltage (OCV) estimate, thus reducing the accuracy of the charge calibration. This invention establishes a temperature-calibration threshold mapping table beforehand through experimental calibration. This table stores the optimized calibration thresholds corresponding to different temperatures.

[0153] The system first reads the battery's current temperature, and then obtains a dynamic calibration threshold that matches the current temperature by querying this mapping table (for clarity, this calibration threshold will be referred to as the first calibration threshold). This threshold may be set larger at higher or lower temperatures to address greater uncertainty under extreme temperatures.

[0154] S164a, calculate the first power difference between the target power value and the currently displayed power value.

[0155] The absolute difference between the target power value obtained in system calculation step S150 and the power value currently displayed on the terminal before calibration represents the degree of deviation between the old and new power data.

[0156] S165a, if the first power difference is greater than the first calibration threshold, the current displayed power calibration is calibrated based on the difference between the first power difference and the first calibration threshold.

[0157] Specifically, this is a cautious, gradual calibration strategy. Only when the first battery level deviation ΔSOC is greater than the dynamic first calibration threshold obtained in step S163 is the current battery level display considered to have a significant error and requires correction.

[0158] This invention does not simply jump the displayed battery level to the target battery level, but rather performs calibration based on the aforementioned difference. A preferred embodiment is to calculate the required calibration range (e.g., calibration range = ΔSOC - first calibration threshold or calculated proportionally), and then adjust the currently displayed battery level towards the target battery level. This method avoids abrupt jumps in the battery level display, providing a smoother calibration process with a better user experience.

[0159] S166a, if the first power difference is less than the first calibration threshold, keep the current displayed power unchanged.

[0160] If the calculated first power deviation ΔSOC is less than the first calibration threshold, it indicates that although the current displayed power value may differ from the calculated OCV value, the difference is within the allowable error range, or it may be due to inherent measurement noise in the second SOC range. In this case, the safest and most reasonable strategy is to reject the calibration and keep the current displayed power value unchanged. This effectively prevents the introduction of new, erroneous calibrations when the data is unreliable, ensuring system stability and consistent user experience.

[0161] This implementation can automatically select the optimal strategy based on the inherent characteristics of the battery (OCV-SOC curve slope). In the power range where the rate of voltage change with charge is lower than a preset value and difficult to calibrate, a dynamic threshold mechanism with temperature compensation is introduced. Through threshold judgment and progressive calibration mechanisms, erroneous calibration and power display jumps are effectively prevented, improving the accuracy of power calibration.

[0162] exist Figure 1 Based on the illustrated embodiment, as an implementation of the present invention, if the statistical duration is the sum of the cumulative duration of multiple sleep cycles and the cumulative duration of multiple wake-ups, then in the case of multiple sleep-wake-ups, the present invention does not adopt a single, fixed calibration strategy, but introduces an advanced, multi-parameter collaborative hierarchical decision-making mechanism.

[0163] S160 calibrates the displayed battery level of the terminal device based on the target battery level value, such as Figure 3 As shown, it may include the following steps:

[0164] S161b determines the target calibration level from multiple preset calibration levels based on the magnitude of the sleep / wake-up parameters.

[0165] The sleep / wake-up parameters include the average battery current during the statistical period, the percentage of sleep time during the statistical period, the duration and average current of the last sleep period, and the duration and average current of the last wake-up. Multiple preset calibration levels include at least a first calibration level and a second calibration level. The admission criteria for the first calibration level are stricter than those for the second calibration level, and the calibration strategy corresponding to the first calibration level has higher accuracy than that of the second calibration level.

[0166] In one implementation of this invention, the first preset current threshold under the first calibration level is less than the first preset current threshold under the second calibration level, the preset duration threshold under the first calibration level is greater than the preset duration threshold under the second calibration level, the first preset duration under the first calibration level is greater than the first preset duration under the second calibration level, the sleep current threshold under the first calibration level is less than the sleep current threshold under the second calibration level, and the second preset duration under the first calibration level is less than the second preset duration under the second calibration level.

[0167] The purpose of this step is to rate the quality of each captured calibration opportunity, thereby setting a strict or lenient tone for subsequent calibration operations.

[0168] The system provides a comprehensive profile of multiple sleep-wake cycles, and the evaluation parameters include:

[0169] The average battery current over the statistical period reflects the overall power consumption level during the entire monitoring window.

[0170] The percentage of time the device remains dormant within the statistical period reflects the proportion of time the terminal device is in a silent state. The higher the percentage, the better the data quality is generally.

[0171] The duration and average current of the last sleep period reflect the quality of the resting state before trigger calibration, and directly determine whether the voltage has been sufficiently stabilized.

[0172] The duration of the last wake-up and the average current reflect the intensity of equipment activity before entering the final resting state, and are used to determine whether the initial voltage state is good.

[0173] For the classification of levels, the system compares the above parameters with the preset calibration levels. The preset calibration levels include at least a first calibration level (such as LVL1) and a second calibration level (such as LVL2), wherein the admission criteria for the first calibration level are stricter than those for the second calibration level in all parameters.

[0174] As a preferred implementation method, the parameter thresholds for different levels are set as follows:

[0175] 1. The first preset current threshold (the requirement for overall average current) under the first calibration level is less than the corresponding threshold under the second calibration level. This means that LVL1 requires the terminal device to have lower overall power consumption during sleep.

[0176] 2. The preset duration threshold under the first calibration level (such as the requirement for the duration of the presidential time) is greater than the corresponding threshold under the second calibration level. At the same time, the first preset duration under the first calibration level (such as the requirement for the duration of the last sleep period) is also greater than the requirement under the second calibration level. This means that LVL1 requires a longer settling time and total observation time.

[0177] 3. The sleep current threshold (the requirement for the average current of the last sleep cycle) under the first calibration level is less than the corresponding threshold under the second calibration level. This means that LVL1 requires the quiescent state to be in deep sleep before calibration.

[0178] 4. The second preset duration (requirement for the last wake-up duration) under the first calibration level is less than the corresponding threshold under the second calibration level. This means that LVL1 requires that the use before calibration must be brief.

[0179] With the above settings, the system can automatically distinguish between high-quality (LVL1) and normal-quality (LVL2) calibration opportunities.

[0180] S162b calibrates the displayed battery level of the terminal device based on the target battery level and the target calibration level.

[0181] This step is the execution unit of the graded calibration strategy. Based on the grade determined in S161b, it invokes the matching calibration strategy to achieve an optimal balance between accuracy and safety. As a refined implementation method, this calibration process is as follows: Figure 4 As shown, this further incorporates the characteristics of the SOC interval, including the following steps:

[0182] S410 determines whether the target power value is in the first SOC range or the second SOC range based on the preset power range.

[0183] The first SOC interval corresponds to the interval in the OCV and SOC change curve where the rate of change of voltage with charge is higher than a preset value, and the second SOC interval corresponds to the interval where the rate of change of voltage with charge is lower than a preset value.

[0184] Specifically, the system determines whether the target energy value is located in the first SOC range (with a steep curve slope and voltage sensitive to changes in energy level) or the second SOC range (with a shallow curve slope and voltage less sensitive to changes in energy level) based on the pre-calibrated OCV-SOC curve characteristics. This forms the basis for subsequent selection of differentiated thresholds.

[0185] S420, if the target battery value is within the first SOC range, obtain the second calibration threshold corresponding to the first SOC range under the target calibration level, and calculate the second battery difference between the target battery value and the currently displayed battery value.

[0186] S430: If the second power difference is less than the second calibration threshold, keep the current displayed power unchanged; if the second power difference is greater than the second calibration threshold, calibrate the current displayed power based on the difference between the second power difference and the second calibration threshold.

[0187] Specifically, if the target battery level is within the first SOC range, the system first obtains the second calibration threshold corresponding to that range under the current target calibration level. Then, it calculates the second battery level difference between the target battery level and the currently displayed battery level. If the second battery level difference is less than the second calibration threshold, it indicates the change is within the allowable error range, and the currently displayed battery level remains unchanged to prevent unnecessary disturbances. If the second battery level difference is greater than the second calibration threshold, it indicates a significant deviation, and calibration is performed based on this second battery level difference. The above embodiments have already described how to perform battery calibration based on the first battery level difference; therefore, the specific method for calibration based on the second battery level difference will not be described further here, but can be referred to the above embodiments.

[0188] S440, if the target battery level is within the second SOC range, obtain the third calibration threshold corresponding to the second SOC range under the target calibration level, and calculate the third battery level difference between the target battery level and the currently displayed battery level; the third calibration threshold is greater than the second calibration threshold.

[0189] S450: If the third power difference is less than the third calibration threshold, keep the current displayed power unchanged; if the third power difference is greater than the third calibration threshold, calibrate the current displayed power based on the difference between the third power difference and the third calibration threshold.

[0190] Specifically, if the target battery level is within the second SOC range, the system first obtains the third calibration threshold corresponding to that range under the current target calibration level (note: the third calibration threshold is greater than the second calibration threshold). Then, it calculates the third battery level difference. If the third battery level difference is less than the larger third calibration threshold, the currently displayed battery level remains unchanged. Due to the high uncertainty of this range, a higher trigger threshold is set, greatly reducing the risk of miscalibration. If the third battery level difference is greater than the third calibration threshold, it indicates a significant deviation in the battery level display, requiring correction. In this case, calibration is performed based on the third battery level difference.

[0191] exist Figure 4 Based on the embodiment shown, the second calibration threshold corresponding to the first SOC interval under the first calibration level is less than the second calibration threshold corresponding to the first SOC interval under the second calibration level, and the third calibration threshold corresponding to the first SOC interval under the first calibration level is less than the third calibration threshold corresponding to the first SOC interval under the second calibration level.

[0192] Specifically, the calibration threshold of this invention is not fixed, but is linked to the calibration level. This is manifested in the following ways:

[0193] The second calibration threshold corresponding to the first SOC interval under the first calibration level (LVL1) is less than the second calibration threshold corresponding to the first SOC interval under the second calibration level (LVL2).

[0194] The third calibration threshold corresponding to the second SOC interval under the first calibration level (LVL1) is less than the third calibration threshold corresponding to the second SOC interval under the second calibration level (LVL2).

[0195] This means that for the same SOC range, higher-level (LVL1) calibration opportunities, due to their superior data quality, are granted "more aggressive" permissions by the system, meaning they use smaller thresholds, making calibration easier to trigger and thus more sensitive to error correction. For lower-level (LVL2) opportunities, the system adopts a "more cautious" strategy, using larger thresholds and only performing calibration when very significant errors occur.

[0196] To ensure clarity, the technical solutions of the embodiments of the present invention will be described in detail below with specific examples.

[0197] like Figure 5 The diagram shown is a statistical illustration of key parameters for a single hibernation process in an embodiment of the present invention. Figure 5 The following illustrates how the system monitors and processes data during the hibernation period in a single hibernation calibration scenario:

[0198] 1. Time Recording. The system records a timestamp T0 at the moment when it detects that the device has entered a sleep state, which serves as the starting point for this sleep state statistics.

[0199] The system records another timestamp T1 at the moment when it detects that the device has exited hibernation (i.e., been woken up), which serves as the end point of this hibernation statistics.

[0200] The total sleep time (SLEEP_TIME) for this sleep period is the difference between these two time points, and the calculation formula is: SLEEP_TIME=T1-T0.

[0201] 2. Coulomb Counter (CC) Reading Recording. At the start of hibernation (T0), the system reads and records the current coulomb counter reading, WCC0. At the end of hibernation (T1), the system reads and records the current coulomb counter reading, SCC1.

[0202] 3. Average current calculation. The difference in coulomb readings reflects the total amount of charge (ΔQ) flowing out of the battery during the time period [T0, T1]. That is, ΔQ = SCC1 - WCC0.

[0203] The average current during this sleep period (which can be called Sleep_Current) can be calculated by dividing the total power consumption by the total time, using the following formula:

[0204] Sleep_Current=ΔQ / SLEEP_TIME=(SCC1-WCC0) / (T1-T0).

[0205] The average current is calculated by measuring the total power consumption ΔQ, which is an integral method. Compared with directly sampling and averaging instantaneous current, it has higher accuracy and can more realistically reflect the actual power consumption level throughout the entire sleep period.

[0206] Obtaining the average current parameter is the key basis for determining whether the current sleep mode meets the calibration conditions (e.g., whether the average current is less than the first preset current threshold).

[0207] Obtaining the total sleep time parameter is the key basis for determining whether the current sleep meets the calibration conditions (e.g., whether the sleep time is greater than the preset time threshold).

[0208] In summary, this figure reveals the specific implementation method of the underlying parameter measurement of the present invention, providing an accurate data basis for determining whether a single sleep scenario triggers calibration.

[0209] Reference Figure 6The figure illustrates a statistical diagram of key parameters in multiple sleep-wake cycles in an embodiment of the present invention. The figure depicts segments of the terminal device alternating between "sleep (S)" and "wake (W)" on a timeline, and marks the measurement and calculation methods for each key parameter.

[0210] like Figure 6 As shown, in a multi-sleep wake-up calibration scenario, the system performs monitoring and data processing within a continuous statistical period (from absolute time T0 to TN), as detailed below:

[0211] 1. Time segment recording.

[0212] The system records the absolute time point (T0, T1, T2, ..., TN) for each state transition.

[0213] The duration of each independent "sleep" or "wake-up" segment is obtained by subtracting adjacent time points.

[0214] Among them, the duration of the dormant segment. For example, S1=T1-T0, S2=T3-T2, ..., SN=TN-TN-1.

[0215] The duration of the wake-up segment. For example, W1=T2-T1, W2=T4-T3, ..., WN-1=TN-1-TN-2.

[0216] 2. Calculation of key cumulative parameters:

[0217] The system accumulates the aforementioned fragmented time segments to obtain global parameters used to determine calibration conditions, as follows:

[0218] Total statistical period (T): This is the absolute duration of the entire monitoring window. The calculation formula is: T = TN - T0.

[0219] Total wake-up time (WAKEUP_TIME) over a statistical period: the sum of the durations of all wake-up segments. The calculation formula is: WAKEUP_TIME = W1 + W2 + ... + WN-1.

[0220] Total sleep time during the statistical period (SLEEP_TIME): The sum of the durations of all sleep segments. The calculation formula is: SLEEP_TIME = S1 + S2 + ... + SN.

[0221] Statistical Periodic Sleep Time Percentage (SRATIO): The proportion of total sleep time to total time, used to measure the quietness of the device during the monitoring period. The calculation formula is: SRATIO = SLEEP_TIME / T = SLEEP_TIME / (SLEEP_TIME + WAKEUP_TIME).

[0222] It also calculates the duration of the last hibernation.

[0223] 3. Coulomb (CC) readings and average current calculation.

[0224] At the start of the statistical period, T0, the system reads and records the coulomb counter reading WCC0.

[0225] At the end of the statistical period TN, the system reads and records the coulomb counter reading SCCN again.

[0226] The total power consumption (ΔQ) during the statistical period is: ΔQ = SCCN - WCC0.

[0227] The average current (Sleep_cur) during the statistical period can be calculated by dividing the total power consumption by the total time, using the formula: Sleep_cur = ΔQ / T = (SCCN - WCC0) / (TN - T0). This parameter reflects the overall power consumption level throughout the entire statistical period.

[0228] Using a similar method, the average current during the last sleep period and the average current during the last sleep period can be calculated.

[0229] This figure and the calculation method described reveal the core innovation of this invention in addressing fragmented usage scenarios:

[0230] Cumulative calculation: By accumulating sleep and wake-up times, this invention cleverly solves the problem of "fragmented idle time" caused by intermittent user use of the device. This greatly improves the probability of capturing calibration opportunities.

[0231] The evaluation was explained from multiple dimensions: The parameters shown in the figure (SLEEP_TIME, WAKEUP_TIME, SRATIO, Sleep_cur) are the core inputs for determining the calibration level (such as LVL1, LVL2) in the graded calibration strategy of this invention. For example, high SRATIO and low Sleep_cur are important conditions for triggering high-quality calibration (LVL1).

[0232] Furthermore, the average current was calculated again using the coulomb counter reading difference as an integral method, ensuring the accuracy and reliability of the data.

[0233] In summary, the figure clearly illustrates how this invention provides solid data support for achieving high-precision power calibration in complex real-world usage scenarios through refined measurement and cumulative calculation of fragmentation behavior.

[0234] The calibration strategy is illustrated below with examples. Based on information such as the average current during hibernation / wake-up, the percentage of hibernation time, the duration of the last hibernation, and the duration of the last wake-up, hibernation / wake-up calibration is divided into different levels.

[0235] 1. LVL0 is the most stringent, yielding the highest OCV accuracy, calibration accuracy, and calibration priority.

[0236] The single-time sleep trigger calibration conditions are as follows: the duration of the last sleep session exceeds a set threshold (generally set to 15-30 minutes), and the average current during this sleep session is less than a set threshold (generally set to 15-50 minutes). ).

[0237] Multiple sleep-triggered calibration conditions:

[0238] (1) The duration of the last sleep exceeded the set threshold (usually set to 3-5 minutes).

[0239] (2) The last wake-up duration is less than the set threshold (generally set to 0.5~2 minutes) and the average wake-up current is less than the set threshold (generally the battery rated capacity / 25), and there is no wake-up current greater than the second preset current threshold (e.g., 200) during each wake-up process. And the duration of the wake-up current is longer than the duration of the target (e.g., 90 seconds).

[0240] (3) The percentage of sleep time in SRATIO is greater than the set threshold (generally set to 80%~95%).

[0241] (4) During this calibration period, the average current is less than the set threshold (generally set to 15%~50%). ).

[0242] (5) The last sleep current is less than the set threshold (generally set to 15%~50%). ).

[0243] For the LVL0 calibration strategy, the low energy density range (i.e., the first SOC range in the above embodiment) is directly calibrated; the high energy density range (i.e., the second SOC range in the above embodiment) is calibrated with different calibration thresholds set according to different temperatures. The calibration threshold can be represented as SOC_ADJ_THD, the battery temperature can be represented as TBAT, and the battery level displayed on the terminal device can be represented as RM_SOC.

[0244] For example, when TBAT >= 25 degrees, SOC_ADJ_THD = 3%; when 25 degrees > TBAT >= 15 degrees, SOC_ADJ_THD = 5%; when 15 degrees > TBAT >= 0 degrees, SOC_ADJ_THD = 7%; when 0 degrees > TBAT >= -20 degrees, SOC_ADJ_THD = 9%.

[0245] 1. When RM_SOC > OCV_SOC + SOC_ADJ_THD, RM_SOC is corrected to: RM_SOC = OCV_SOC + SOC_ADJ_THD.

[0246] 2. When RM_SOC < OCV_SOC - SOC_ADJ_THD, RM_SOC is corrected to: RM_SOC = OCV_SOC - SOC_ADJ_THD.

[0247] For the LVL1 calibration strategy, the calibration access conditions are wider than those of LVL0, the calibration accuracy is lower than that of LVL0, the calibration priority is lower than that of LVL0, and the opportunities are more than those of LVL0.

[0248] (1). The duration of the last sleep exceeds the set threshold (usually set to 3 - 5 minutes, less than or equal to LVL0).

[0249] (2). The duration of the last wake-up is less than the set threshold (usually set to 0.5 - 2 minutes, greater than or equal to LVL0) and the average wake-up current is less than the set threshold (usually battery calibrated capacity / 25).

[0250] (3). The ratio of sleep duration SRATIO is greater than the set threshold (usually set to 60% - 85%, less than or equal to LVL0).

[0251] (4). During this calibration period, the average current is less than the set threshold (usually set to 30% - 100 , greater than or equal to LVL0).

[0252] (5). The current of the last sleep is less than the set threshold (usually set to 30 - 100 , greater than or equal to LVL0).

[0253] For the LVL1 calibration strategy, in both the low energy density interval (i.e., the first SOC interval in the above embodiments) and the high energy density interval (i.e., the second SOC interval in the above embodiments), different calibration thresholds are set according to different temperatures. The calibration strategy adopts the same calibration logic as the high energy density interval in the LVL0 level, specifically including conservative calibration rules such as querying dynamic thresholds according to temperature and judging the difference in battery power. This has been elaborated in detail in the above embodiments and will not be repeated here.

[0254] For the LVL2 calibration strategy, the calibration admission criteria are wider than those for LVL1, the calibration accuracy is lower than that for LVL1, the calibration priority is lower than that for LVL1, and there are more opportunities for calibration than for LVL1. Figure 7 As shown.

[0255] (1) The duration of the last sleep exceeds the set threshold (generally set to 10S~60S, less than or equal to LVL1).

[0256] (2) The percentage of sleep time in SRATIO is greater than the set threshold (generally set to 10%~60%, less than or equal to LVL1).

[0257] (3) During this calibration period, the average current is less than the set threshold (generally set to 100%~200%). (greater than or equal to LVL1).

[0258] (4) The last sleep current is less than the set threshold (generally set to 100~200). (greater than or equal to LVL1).

[0259] For the LVL2 calibration strategy, different calibration thresholds are set for both the low energy density range (i.e., the first SOC range in the above embodiments) and the high energy density range (i.e., the second SOC range in the above embodiments) based on different temperatures. The calibration strategy adopts the same calibration logic as the high energy density range in the LVL0 level, specifically including conservative calibration rules such as querying dynamic thresholds based on temperature and judging the charge difference. This has been described in detail in the above embodiments and will not be repeated here.

[0260] It should be noted that the calibration strategy is managed according to priority levels. After a higher-priority calibration (such as LVL0) is successful, the system will initiate a calibration suppression window of a preset duration (e.g., 2 hours). During this window, the system determines that the current power accuracy is within a reliable range, and therefore will suspend triggering lower-priority calibrations (such as LVL1 and LVL2), but can still respond to LVL0 calibration events that meet the highest-level access conditions.

[0261] Secondly, embodiments of the present invention provide a terminal device sleep / wake-up power calibration device 80, such as... Figure 8 As shown, the device includes:

[0262] The sleep state monitoring module 810 is used to monitor when the terminal device enters the sleep state.

[0263] The statistical duration acquisition module 820 is used to acquire the statistical duration after the start of self-discharge in response to the terminal device's battery being in a discharging state and the battery temperature being higher than a preset temperature threshold; wherein, the statistical duration is the duration of a single sleep cycle, or the sum of the cumulative duration of multiple sleep cycles and the cumulative duration of multiple wake-ups;

[0264] The voltage and current value acquisition module 830 is used to acquire multiple battery voltage values ​​and the current value corresponding to each battery voltage value within a preset time period before the statistical time period ends, if the statistical duration is greater than a first preset time threshold and the preset calibration conditions are met.

[0265] The OCV estimation calculation module 840 is used to filter out multiple effective voltage values ​​with current values ​​less than a first preset current threshold from the multiple battery voltage values, and to filter the multiple effective voltage values ​​to obtain the open circuit voltage OCV estimation value.

[0266] The target power value determination module 850 is used to determine the corresponding target power value based on the estimated OCV value and the pre-stored correspondence between OCV value and power SOC.

[0267] A power calibration module 860 is used to calibrate the displayed power level of the terminal device based on the target power level value;

[0268] Wherein, if the statistical duration is the duration of a single hibernation, the preset calibration condition is that the average battery current within the statistical duration is less than a first preset current threshold.

[0269] If the statistical duration is the sum of the cumulative duration of multiple sleep cycles and the cumulative duration of multiple wake-ups, the preset calibration conditions are that the average battery current within the statistical duration is less than a first preset current threshold, the proportion of sleep duration within the statistical duration is greater than a preset duration threshold, the duration of the last sleep cycle is greater than the first preset duration and its average current is less than the sleep current threshold, the duration of the last wake-up is less than the second preset duration and its average current is less than the wake-up current threshold, and the first preset duration is greater than the second preset duration.

[0270] Thirdly, embodiments of the present invention provide a terminal device 900, such as... Figure 9 As shown, it includes:

[0271] At least one processor 901;

[0272] Memory 902 for storing the at least one processor-executable instruction;

[0273] The at least one processor is configured to execute the instructions to implement the method described in the first aspect.

[0274] Fourthly, embodiments of the present invention provide a computer-readable storage medium that, when instructions in the computer-readable storage medium are executed by a processor of a terminal device, enables the terminal device to perform the method described in the first aspect.

[0275] Fifthly, embodiments of the present invention provide a computer program product, including a computer program that, when executed by a processor, implements the method described in the first aspect.

[0276] The technical solution provided by this invention cleverly utilizes the inherent sleep time period of terminal devices. By collecting voltage data and filtering it after meeting strict duration and current conditions, an open-circuit voltage (OCV) estimate that is extremely close to the true value can be obtained. Based on this OCV estimate, power calibration is performed, fundamentally overcoming the problems of inaccurate power display and drift over time caused by the cumulative error of current integration in traditional coulomb counters. This ensures that the power percentage seen by the user accurately reflects the remaining battery capacity, greatly improving the user experience.

[0277] Furthermore, it effectively utilizes user habits, achieving a high calibration success rate and seamless operation: the calibration triggering conditions proposed in this invention closely align with the daily usage habits of most users (who engage in multiple screen-off standby actions of varying lengths each day). Without requiring active user intervention or the creation of a special calibration environment, the system can automatically and seamlessly capture numerous calibration opportunities in the background, thereby achieving continuous, dynamic, and high-precision power maintenance throughout the entire lifecycle of the terminal device.

[0278] Moreover, the core data acquisition and judgment of the entire calibration process are completed in the system's sleep state. The sleep state itself is a low-power state, and this invention ensures that calibration is only performed when the system is truly in a deep sleep state with low power consumption by setting a strict average current threshold, thus avoiding the risk of additional system power consumption due to the execution of the calibration algorithm. At the same time, the pre-emptive battery temperature and discharge state checks effectively prevent incorrect calibration under unfavorable conditions such as low temperature or charging, ensuring the safety of battery use.

[0279] Furthermore, this invention does not simply trigger calibration after sleep mode, but introduces a comprehensive "preset calibration condition" judgment logic. This logic comprehensively considers the total duration, overall average current, sleep mode percentage, and the last sleep / wake-up behavior, and monitors each wake-up process to determine if there are abnormally high power consumption conditions, such as a current value continuously exceeding a second preset current threshold for a duration reaching the target duration. It intelligently identifies the highest quality and most reliable calibration opportunities. This mechanism ensures that system resources are only used for calibration operations with the highest probability of success, avoiding invalid calculations and optimizing system performance. Moreover, this invention is mainly implemented based on software algorithms, with low dependence on hardware platforms. It does not require the addition of new hardware sensors or circuits and can be widely applied to various terminal devices using lithium batteries, such as smartphones, tablets, and wearable devices, possessing high industrial application value and versatility.

[0280] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention without departing from the principles and spirit of the present invention.

Claims

1. A method for calibrating the power consumption of a terminal device during sleep / wake-up, characterized in that, The method comprises: monitoring terminal device entering sleep state; in response to the battery of the terminal device being in discharging state and the battery temperature being higher than a preset temperature threshold, obtaining a statistical duration since the discharging starts; wherein the statistical duration is the duration of single sleep, or the sum of the cumulative duration of multiple sleeps and the cumulative duration of multiple wakes; if the statistical duration is greater than a first preset time threshold and a preset calibration condition is met, obtaining a plurality of battery voltage values sampled within a preset time period before the statistical duration exits and a current value corresponding to each battery voltage value; selecting a plurality of effective voltage values with current values less than a first preset current threshold from the plurality of battery voltage values, filtering the plurality of effective voltage values to obtain an open circuit voltage (OCV) estimation value; determining a corresponding target power value according to the OCV estimation value and a pre-stored corresponding relationship between OCV value and state of charge (SOC); calibrating the display power of the terminal device based on the target power value; wherein, if the statistical duration is the duration of single sleep, the preset calibration condition is that the average current of the battery within the statistical duration is less than the first preset current threshold; if the statistical duration is the sum of the cumulative duration of multiple sleeps and the cumulative duration of multiple wakes, the preset calibration condition is that the average current of the battery within the statistical duration is less than the first preset current threshold, the sleep duration ratio within the statistical duration is greater than a preset duration threshold, the duration of the last sleep is greater than a first preset duration, the average current thereof is less than a sleep current threshold, the duration of the last wake is less than a second preset duration, the average current thereof is less than a wake current threshold, and there is no situation in each wake process that the wake current is greater than a second preset current threshold and the duration of the wake current is greater than a target duration, the first preset duration is greater than the second preset duration, and the second preset current threshold is greater than the first preset current threshold.

2. The method of claim 1, wherein, The filtering process is processed using a first-in-first-out (FIFO) queue; the method comprises: storing the sampled battery voltage values and current values in the FIFO queue in chronological order; correspondingly, the method comprises: selecting a plurality of effective voltage values with current values less than a first preset current threshold from the battery voltage values in the FIFO queue; calculating the arithmetic mean of the plurality of effective voltage values, and taking the calculated arithmetic mean as the OCV estimation value.

3. The method according to claim 1 or 2, characterized in that, if the statistical duration is the duration of single sleep; the calibration of the display power of the terminal device based on the target power value comprises: determining, according to the preset power range, whether the target power value is located in a first SOC interval or a second SOC interval; the first SOC interval corresponds to an interval in which a voltage change rate with respect to power in an OCV and SOC change curve is higher than a preset value, and the second SOC interval corresponds to an interval in which the voltage change rate with respect to power is lower than the preset value; if the target power value is located in the first SOC interval, calibrating the display power of the terminal device to the target power value; if the target power value is located in the second SOC interval, performing the following steps: querying a temperature threshold mapping table according to a current temperature of the battery to obtain a first calibration threshold; calculating a first power difference value between the target power value and the current display power; if the first power difference value is greater than the first calibration threshold, calibrating the current display power based on a difference between the first power difference value and the first calibration threshold; if the first power difference value is less than the first calibration threshold, keeping the current display power unchanged.

4. The method according to claim 1 or 2, characterized in that, if the statistical duration is a sum of a plurality of sleep cumulative durations and a plurality of wake-up cumulative durations; the calibration of the display power of the terminal device based on the target power value includes: determining a target calibration level from a plurality of preset calibration levels based on a size of a sleep-wake parameter; the sleep-wake parameter includes a battery average current in the statistical duration, a sleep duration proportion in the statistical duration, a last sleep duration and average current, and a last wake-up duration and average current; the plurality of preset calibration levels at least include a first calibration level and a second calibration level, an access condition of the first calibration level is stricter than that of the second calibration level, and an accuracy of a calibration strategy corresponding to the first calibration level is higher than that of the second calibration level; calibrating the display power of the terminal device according to the target power value and the target calibration level.

5. The method of claim 4, wherein, a first preset current threshold in the first calibration level is less than a first preset current threshold in the second calibration level, a preset duration threshold in the first calibration level is greater than a preset duration threshold in the second calibration level, a first preset duration in the first calibration level is greater than a first preset duration in the second calibration level, a sleep current threshold in the first calibration level is less than a sleep current threshold in the second calibration level, and a second preset duration in the first calibration level is less than a second preset duration in the second calibration level.

6. The method of claim 4, wherein, the calibration of the display power of the terminal device according to the target power value and the target calibration level includes: determining, according to the preset power range, whether the target power value is located in a first SOC interval or a second SOC interval; the first SOC interval corresponds to an interval in which a voltage change rate with respect to power in an OCV and SOC change curve is higher than a preset value, and the second SOC interval corresponds to an interval in which the voltage change rate with respect to power is lower than the preset value; If the target electric quantity value is located in the first SOC interval, a second calibration threshold corresponding to the first SOC interval under the target calibration level is obtained, and a second electric quantity difference between the target electric quantity value and the current display electric quantity is calculated; If the second electric quantity difference is less than the second calibration threshold, the current display electric quantity is kept unchanged; if the second electric quantity difference is greater than the second calibration threshold, the current display electric quantity is calibrated based on a difference between the second electric quantity difference and the second calibration threshold.

7. The method of claim 6, wherein, The calibration of the display electric quantity of the terminal device according to the target electric quantity value and the target calibration level comprises: If the target electric quantity value is located in the second SOC interval, a third calibration threshold corresponding to the second SOC interval under the target calibration level is obtained, and a third electric quantity difference between the target electric quantity value and the current display electric quantity is calculated; the third calibration threshold is greater than the second calibration threshold; If the third electric quantity difference is less than the third calibration threshold, the current display electric quantity is kept unchanged; if the third electric quantity difference is greater than the third calibration threshold, the current display electric quantity is calibrated based on a difference between the third electric quantity difference and the third calibration threshold.

8. The method of claim 7, wherein, The second calibration threshold corresponding to the first SOC interval under the first calibration level is less than the second calibration threshold corresponding to the first SOC interval under the second calibration level, and the third calibration threshold corresponding to the first SOC interval under the first calibration level is less than the third calibration threshold corresponding to the first SOC interval under the second calibration level.

9. A terminal device sleep-wake-up electric quantity calibration apparatus, characterized in that, The apparatus comprises: a hibernation state monitoring module configured to monitor that a terminal device enters a hibernation state; a statistical duration obtaining module configured to, in response to that a battery of the terminal device is in a discharging state and a battery temperature is higher than a preset temperature threshold, obtain a statistical duration since discharging starts; wherein the statistical duration is a duration of single hibernation, or a sum of a cumulative duration of multiple hibernations and a cumulative duration of multiple awakenings; a voltage value and current value obtaining module configured to, if the statistical duration is greater than a first preset time threshold and a preset calibration condition is met, obtain a plurality of battery voltage values and current values corresponding to each battery voltage value sampled in a preset time period before the statistical duration exits; an OCV estimation value calculating module configured to select a plurality of effective voltage values with current values less than a first preset current threshold from the plurality of battery voltage values, and perform filtering processing on the plurality of effective voltage values to obtain an open circuit voltage (OCV) estimation value; a target electric quantity value determining module configured to determine a corresponding target electric quantity value according to the OCV estimation value and a corresponding relationship between a preset OCV value and an electric quantity (SOC); an electric quantity calibration module configured to calibrate a display electric quantity of the terminal device based on the target electric quantity value; wherein, if the statistical duration is a duration of single hibernation, the preset calibration condition is that an average current of the battery in the statistical duration is less than the first preset current threshold. If the statistical duration is the sum of the cumulative duration of multiple sleep cycles and the cumulative duration of multiple wake-ups, the preset calibration conditions are: the average battery current within the statistical duration is less than a first preset current threshold; the proportion of sleep duration within the statistical duration is greater than a preset duration threshold; the duration of the last sleep cycle is greater than the first preset duration and its average current is less than the sleep current threshold; the duration of the last wake-up is less than a second preset duration and its average current is less than the wake-up current threshold; and during each wake-up process, there is no situation where: the wake-up current is greater than the second preset current threshold and the duration of the wake-up current is greater than the target duration; the first preset duration is greater than the second preset duration; and the second preset current threshold is greater than the first preset current threshold.

10. A terminal device, comprising: include: At least one processor; Memory for storing the at least one processor-executable instruction; The at least one processor is configured to execute the instructions to implement the method as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Charge state determination method and device, electronic equipment, medium and program product

    CN118073688A

  • Electricity meter monitoring method and device, electronic equipment and storage medium

    CN119557157A