Battery electric quantity calculation method and device and electronic equipment

By detecting the battery voltage in the charging state and combining it with the power data in the shutdown state, the target initial power of the battery is determined, which solves the problem of inaccurate power initialization in the protection state of the battery protection board and achieves accurate power measurement.

CN120610183APending Publication Date: 2025-09-09ZHUHAI ISMARTWARE TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510810704.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-17
Publication Date
2025-09-09

AI Technical Summary

Technical Problem

In the prior art, when the battery protection board is in the protection state, it is impossible to accurately obtain the initial information of the battery voltage and current, resulting in inaccurate battery initialization power, which affects the accuracy of subsequent power measurement.

Method used

By detecting when the battery voltage exceeds a first voltage threshold and the duration exceeds a first duration threshold in the battery charging state, first power data is obtained, and combined with the power data in the shutdown state, the target initial power is determined, and the power data is calibrated using a difference algorithm to ensure the accuracy of power measurement.

Benefits of technology

The accuracy of real-time battery power calculation is improved, the error of power measurement is reduced, and an accurate basis for battery power information is provided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120610183A_ABST
    Figure CN120610183A_ABST
Patent Text Reader

Abstract

The invention discloses a method and device for calculating the electric quantity of a battery and electronic equipment, and belongs to the technical field of batteries. The battery electric quantity calculation method comprises the steps of obtaining first electric quantity data of a battery in response to the condition that the battery is in a charging state and the duration that the battery voltage of the battery exceeds a first voltage threshold exceeds a first duration threshold, and determining the target initial electric quantity of the battery based on the first electric quantity data; and calculating the real-time electric quantity of the battery based on the target initial electric quantity. Under the condition that the battery is in the charging state, when it is detected that the duration that the battery voltage of the battery exceeds the first voltage threshold exceeds the first duration threshold, it can be determined that the battery protection board is in the unprotected state after charging, and the obtained first electric quantity data is accurate electric quantity data and can serve as the target initial electric quantity; the real-time electric quantity of the battery calculated based on the target initial electric quantity is more accurate.
Need to check novelty before this filing date? Find Prior Art

Description

Battery power calculation method, device and electronic equipment Technical Field

[0001] The present application belongs to the field of battery technology, and in particular relates to a method and device for calculating battery power, and an electronic device. Background Art

[0002] Smartphones, tablets, and power banks, among other devices with integrated batteries, need to provide users with accurate power information and therefore typically require an integrated fuel gauge. This fuel gauge requires accurate initialization to provide an accurate basis for subsequent power measurement.

[0003] When the battery protection board is in the protection state, the initial voltage and current information of the battery cannot be accurately obtained, and the calculation of the initial battery power will be inaccurate, resulting in errors in the subsequent real-time power measurement. Summary of the Invention

[0004] The present application aims to solve at least one of the technical problems existing in the prior art. To this end, the present application proposes a battery power calculation method, device, and electronic device that can accurately obtain a target initial power level, thereby reducing the error in calculating the real-time battery power level based on the target initial power level.

[0005] In a first aspect, the present application provides a method for calculating battery power, the method comprising:

[0006] In response to the battery being in a charging state, if a battery voltage of the battery exceeds a first voltage threshold for a period exceeding a first duration threshold, obtaining first power data of the battery, and determining a target initial power of the battery based on the first power data;

[0007] The real-time power of the battery is calculated based on the target initial power.

[0008] According to the battery power calculation method of the present application, by continuously detecting the battery voltage when the battery is in a charging state, when it is detected that the battery voltage of the battery exceeds the first voltage threshold for a period of time exceeding the first time threshold, it can be determined that even if the battery protection board was in a protection state before, the battery protection board can be charged and is in an unprotected state after charging. The first power data obtained is accurate power data and can be used as the target initial power. The real-time power of the battery is calculated based on the target initial power more accurately.

[0009] According to one embodiment of the present application, the battery is in a shutdown state before being in the charging state, and the method further includes:

[0010] In response to the battery being in a power-off state, acquiring second power data of the battery;

[0011] The determining the target initial power of the battery based on the first power data includes:

[0012] The target initial power is determined based on the first power data and the second power data.

[0013] According to one embodiment of the present application, determining the target initial power based on the first power data and the second power data includes:

[0014] Calculating an absolute value of a difference between the first power data and the second power data;

[0015] When the absolute value of the difference is greater than or equal to a first difference threshold, using the first power data as the target initial power;

[0016] Alternatively, when the absolute value of the difference is smaller than the first difference threshold, the second power data is used as the target initial power.

[0017] According to one embodiment of the present application, determining the target initial power of the battery based on the first power data includes:

[0018] The first power data is determined as the target initial power.

[0019] According to one embodiment of the present application, the method further includes:

[0020] In response to the battery being in a discharging state, third power data of the battery is acquired, and the third power data is determined as the target initial power.

[0021] According to one embodiment of the present application, the method further includes:

[0022] In response to the battery being in a power-off state, acquiring second power data of the battery;

[0023] In response to the battery being switched from the shutdown state to the discharge state, the second power data is determined as the target initial power.

[0024] According to one embodiment of the present application, the first power data is obtained by the following steps:

[0025] obtaining a battery voltage and a battery current of the battery;

[0026] determining a battery terminal voltage of the battery based on the battery voltage and the battery current;

[0027] The first power data is determined based on the battery terminal voltage.

[0028] According to one embodiment of the present application, determining the power data based on the battery terminal voltage includes:

[0029] Substitute the battery terminal voltage into the voltage-to-electricity mapping curve to obtain the electrical quantity data.

[0030] In a second aspect, the present application provides a battery power calculation device, the device comprising:

[0031] a first processing module, configured to, in response to the battery being in a charging state, obtain first power data of the battery when a battery voltage of the battery exceeds a first voltage threshold for a period exceeding a first duration threshold, and determine a target initial power of the battery based on the first power data;

[0032] The second processing module is configured to calculate the real-time power of the battery based on the target initial power.

[0033] According to the battery power calculation device of the present application, by continuously detecting the battery voltage when the battery is in a charging state, when it is detected that the battery voltage of the battery exceeds the first voltage threshold for a period of time exceeding the first time threshold, it can be determined that even if the battery protection board was previously in a protection state, the battery protection board can be charged and is in an unprotected state after charging. The first power data obtained is accurate power data and can be used as the target initial power. The real-time power of the battery calculated based on the target initial power is more accurate.

[0034] In a third aspect, the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for calculating the battery power as described in the first aspect above is implemented.

[0035] In a fourth aspect, the present application provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for calculating the battery power as described in the first aspect above.

[0036] In a fifth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the battery power calculation method as described in the first aspect above.

[0037] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become obvious from the description below, or will be learned through practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:

[0039] FIG1 is a flow chart of a method for calculating battery power provided in an embodiment of the present application;

[0040] FIG2 is a second flow chart of a method for calculating battery power provided in an embodiment of the present application;

[0041] FIG3 is a schematic structural diagram of a battery provided in an embodiment of the present application;

[0042] FIG4 is a schematic diagram of the structure of a battery power calculation device provided in an embodiment of the present application;

[0043] FIG5 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0044] The following will be combined with the accompanying drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the embodiments described are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field are within the scope of protection of this application.

[0045] The terms "first," "second," and the like in the specification and claims of this application are used to distinguish similar objects, and are not used to describe a specific order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of this application can be implemented in an order other than that illustrated or described herein, and that the objects distinguished by "first," "second," and the like are generally of the same type, and do not limit the number of objects; for example, the first object can be one or more. In addition, the term "and / or" in the specification and claims refers to at least one of the connected objects, and the character " / " generally indicates that the objects connected are in an "or" relationship.

[0046] The following, in conjunction with the accompanying drawings, describes in detail the battery power calculation method, battery power calculation device, electronic device and readable storage medium provided in the embodiments of the present application through specific embodiments and their application scenarios.

[0047] The battery power calculation method provided in the embodiment of the present application can be executed by an electronic device or a functional module or functional entity in the electronic device that can implement the battery power calculation method. The battery power calculation method provided in the embodiment of the present application is described below using an electronic device as an example of the execution entity.

[0048] As shown in FIG3 , the battery can be used as a system, which may include a battery module, a battery protection board and corresponding protection metal-oxide-semiconductor (MOS), a power metering module, a sampling resistor, a charging module, and a discharging module.

[0049] Among them, the battery module is a module for storing electricity.

[0050] The function of the battery protection board and the corresponding protection MOS is to protect the battery module. When the battery module is in an abnormal state such as overcharge, over-discharge, overcurrent and short circuit, the protection MOS will be turned off, cutting off the path from the charging module and the discharging module to the battery module, thereby protecting the battery module.

[0051] The power measurement module obtains the battery voltage and battery current and calculates the battery power, including power initialization and power measurement at other times.

[0052] The charging module charges the battery module, and the discharging module draws power from the battery module to supply power to other modules.

[0053] The battery operating state may include a shutdown state and a charge and discharge state, and the charge and discharge state may include a charge state and a discharge state.

[0054] The battery operating status can be determined by detecting the status of the charging module and the discharging module. When the charging module is operating, the battery is determined to be in the charging state; when the discharging module is operating, the battery is determined to be in the discharging state; and when both the charging module and the discharging module are not operating, the battery is determined to be in the off state. The battery power calculation method provided in the embodiment of the application can be applied to a power meter module to calculate the battery power.

[0055] As shown in FIG1 , the method for calculating battery power includes steps 110 and 120 .

[0056] Step 110 : In response to the battery being in a charging state, when the battery voltage of the battery exceeds a first voltage threshold for a period exceeding a first duration threshold, obtaining first power data of the battery, and determining a target initial power of the battery based on the first power data.

[0057] The battery voltage is the actual output voltage of the battery when it is loaded, which is affected by the internal resistance of the battery.

[0058] The first voltage threshold is a preset voltage value, which may be the over-discharge release voltage of the battery protection board. The first time threshold is a preset time, which may be the over-discharge detection delay time of the battery protection board.

[0059] The power data is data obtained by calculating the battery voltage and battery current obtained in real time and used to represent the remaining storage capacity of the battery.

[0060] The first power data is power data obtained when the battery is in a charging state and the duration for which the battery voltage exceeds a first voltage threshold exceeds a first duration threshold.

[0061] In this embodiment, when the battery is in a charging state, it cannot be determined whether the battery protection board is in a protection state. In the charging state, the battery voltage is continuously detected. When it is detected that the battery voltage exceeds the first voltage threshold for a period of time exceeding the first time threshold, it can be determined that even if the battery protection board is in a protection state when the power is off, the battery protection board can be charged and turned on after charging and is in an unprotected state.

[0062] After the battery voltage of the battery exceeds the first voltage threshold for a period longer than the first time threshold, the acquired first power data is accurate power data.

[0063] In this embodiment, the target initial power is an accurate power, and the target initial power can be used as a benchmark for the power metering module, providing a basis for subsequent accurate real-time power metering.

[0064] The first power data may be used as the target initial power, or the target initial power may be obtained by calibrating the first power data.

[0065] Step 120: Calculate the real-time battery capacity based on the target initial capacity.

[0066] In this step, the battery's charge and discharge current and duration can be detected, and the battery's consumed or increased power can be calculated using the ampere-hour integration method. The battery's real-time power can be obtained by subtracting the consumed power from the target initial power or adding the increased power.

[0067] According to the battery power calculation method provided in the embodiment of the present application, by continuously detecting the battery voltage when the battery is in a charging state, when it is detected that the battery voltage of the battery exceeds the first voltage threshold for a period of time exceeding the first time threshold, it can be determined that even if the battery protection board was previously in a protection state, the battery protection board can be charged and is in an unprotected state after charging. The first power data obtained is accurate power data and can be used as the target initial power. The real-time power of the battery calculated based on the target initial power is more accurate.

[0068] In some embodiments, the battery is in a powered-off state before being in a charging state, and the method further comprises:

[0069] In response to the battery being in a power-off state, obtaining second battery power data;

[0070] Determining a target initial battery capacity based on the first battery capacity data includes:

[0071] The target initial power level is determined based on the first power level data and the second power level data, wherein the second power level data is power level data obtained when the battery is in a powered-off state.

[0072] It should be noted that when the battery is in the off state, no charging or discharging actions are performed, and it cannot be determined whether the battery protection board is in the protection state. If the battery protection board is in the unprotected state, the second power data is accurate data and can be used as the target initial power. If the battery protection board is in the protection state, the current battery voltage is only the floating charge accumulated, not the actual voltage of the battery. The calculated second power data is inaccurate and cannot be used as the target initial power.

[0073] A second initialization is performed according to the charge and discharge state after the shutdown state is converted, and the second power data is verified to determine whether the second power data is accurate. When the second power data is determined to be accurate, it can be used as the target initial power. When it is determined that the second power data is not accurate, the second power data can be calibrated or replaced with other accurate power data as the target initial power.

[0074] In this embodiment, when the battery is switched from a shutdown state to a charging state, it cannot be determined whether the battery protection board is in a protection state in the shutdown state. In the charging state, the battery voltage is continuously detected. When it is detected that the battery voltage exceeds the first voltage threshold for a time period exceeding the first time threshold, it can be determined that even if the battery protection board is in a protection state in the shutdown state, the battery protection board can be charged and turned on after charging and is in an unprotected state.

[0075] After the battery voltage of the battery exceeds the first voltage threshold for a period of time that exceeds the first time threshold, the first power data obtained is accurate power data. By comparing the first power data with the second power data, it can be determined whether the battery protection board is in a protection state in the shutdown state and whether the second power data is accurate, thereby determining whether the second power data is determined as the target initial power or the first power data is determined as the target initial power.

[0076] In some embodiments, determining the target initial power based on the first power data and the second power data includes:

[0077] Calculating the absolute value of the difference between the first power data and the second power data;

[0078] When the absolute value of the difference is greater than or equal to the first difference threshold, taking the first power data as the target initial power;

[0079] Alternatively, when the absolute value of the difference is smaller than the first difference threshold, the second power data is used as the target initial power.

[0080] Among them, the first difference threshold is a preset value, which can be comprehensively considered according to the errors of the battery internal resistance in the shutdown state, charging state and discharging state, and can be set to 5%, 10%, 20%, etc.

[0081] For example, the second power data is Pinit1, the first power data is Pinit2, and the absolute value of the difference Pinit_delta between the first power data and the second power data is calculated

[0082] Pinit_delta = |Pinit1 - Pinit2|

[0083] The first difference threshold is Pinit_threshold. If Pinit_delta >= Pinit_threshold, it is considered that the battery protection board in the shutdown state is in the protection state, and the calculated second power data Pinit1 is inaccurate, while the first power data Pinit2 is accurate. The first power data Pinit2 is used as the target initial power Pinit_final.

[0084] If Pinit_delta < Pinit_threshold, it is considered that the battery protection board in the shutdown state is not in the protection state, and the calculated second power data Pinit1 is accurate. Therefore, the second power data Pinit1 is used as the target initial power Pinit_final.

[0085] It should be noted that the battery internal resistance may introduce errors in the charging state, and the calculated first power data may have errors. If the difference between the first power data and the second power data is small, it means that the battery protection board is in the unprotected state in the shutdown state, and the second power data calculated in the shutdown state is accurate. At the same time, in the shutdown state, since the battery current is zero, the battery voltage is the battery terminal voltage, and the battery internal resistance does not need to be introduced, and the error of the battery internal resistance will not be introduced. Compared with the first power data, the second power data is more accurate, and the second power data is used as the target initial power.

[0086] In some embodiments, determining the target initial power of the battery based on the first power data includes:

[0087] Determining the first power data as the target initial power.

[0088] In this embodiment, when the battery is initially in the charging state, the first power data can be directly determined as the target initial power.

[0089] In some embodiments, the method further includes:

[0090] In response to the battery being in a discharging state, third power data of the battery is acquired, and the third power data is determined as the target initial power.

[0091] The third power data is power data obtained when the battery is in a discharging state.

[0092] In this embodiment, when the battery is in the discharging state, the discharge module will detect the battery voltage before turning on. The discharge module can only be turned on normally if the battery voltage is higher than the undervoltage threshold of the discharge module. In addition, the undervoltage threshold of the discharge module is generally higher than the protection voltage of the battery protection board. The fact that the discharge module is in the turned-on state indicates that the battery protection board is not in the protection state. The third power data directly obtained is accurate power data and can be used as the target initial power.

[0093] In some embodiments, the method further comprises:

[0094] In response to the battery being in a power-off state, obtaining second battery power data;

[0095] In response to the battery being switched from a shutdown state to a discharge state, the second power data is determined as the target initial power.

[0096] When the battery switches from the shutdown state to the discharge state, the discharge module will detect the battery voltage before turning on. The discharge module can only be turned on normally if the battery voltage is higher than the undervoltage threshold of the discharge module. In addition, the undervoltage threshold of the discharge module is generally higher than the protection voltage of the battery protection board. If the discharge module is in the turned-on state, it means that the battery protection board is not in the protection state. The second power data obtained in the shutdown state is accurate, and the second power data can be determined as the target initial power.

[0097] In some embodiments, the first power data is obtained by the following steps:

[0098] Get the battery voltage and battery current of the battery;

[0099] determining a battery terminal voltage of the battery based on the battery voltage and the battery current;

[0100] Based on the battery terminal voltage, first power data is determined.

[0101] Among them, the battery voltage is the actual output voltage of the battery when it is loaded, which is affected by the internal resistance of the battery. The battery current is the charging current or discharging current of the battery. The battery terminal voltage is the voltage of the battery when it is unloaded, reflecting the true electromotive force of the battery and is not affected by the battery current.

[0102] In this embodiment, the current flowing through the sampling resistor can be collected as the battery current, and the voltage on the side of the sampling resistor close to the battery module can be collected as the battery voltage. The battery voltage, battery current and battery internal resistance are calculated to obtain the battery terminal voltage.

[0103] For example, the battery voltage is Vbat, the battery current is Ibat, and the battery internal resistance is Rdc. The battery terminal voltage Vocv is calculated as Vocv=Vbat-Ibat*Rdc.

[0104] In this embodiment, a mapping relationship between the battery terminal voltage and the battery power level may be preset, and the obtained battery terminal voltage is substituted into the preset mapping relationship to obtain the first power level data.

[0105] In some embodiments, determining the first power data based on the battery terminal voltage includes:

[0106] Substitute the battery terminal voltage into the voltage-to-electricity mapping curve to obtain first electric quantity data.

[0107] The voltage-to-capacity mapping curve is a curve that describes the relationship between the battery terminal voltage and the battery capacity.

[0108] In this embodiment, the battery terminal voltage is substituted into the voltage-to-capacity mapping curve, and the corresponding first power data is calculated using a difference algorithm. A specific embodiment of a battery power calculation method is described below.

[0109] Under different battery operating conditions, power data is acquired in different ways or at different times, and a target initial power level is determined based on the power data in different ways under different battery operating conditions to ensure that the target initial power level is the accurate power level of the battery when it is not in a protection state. In this embodiment, the battery power calculation method is applied to the power meter module, which can achieve power initialization during the process of assembling the battery into the corresponding equipment.

[0110] As shown in Figure 2, when the power metering module is powered on for the first time, the battery working status of the battery is obtained. When the charging module is working, it can be determined that the battery is in the charging state. When the discharging module is working, it can be determined that the battery is in the discharging state. When both the charging module and the discharging module are not working, it can be determined that the battery is in the shutdown state.

[0111] If the battery is in the off state when the power meter module is powered on for the first time, obtain the battery voltage Vbat and battery current Ibat, and calculate the battery terminal voltage Vocv as follows:

[0112] Vocv=Vbat+Ibat*Rdc

[0113] Wherein Rdc is the internal resistance of the battery, and the value of the internal resistance of the battery is pre-stored in the power metering module. Since the charging module and the discharging module are not working, Ibat is zero at this time, and Vocv is equal to Vbat.

[0114] Substitute the battery terminal voltage Vocv into the voltage-to-energy mapping curve, and use the difference algorithm to calculate the corresponding energy Pinit1 as the second energy data of the energy metering module.

[0115] When the battery is powered off, the discharge module is never turned on, so it cannot be determined whether the battery protection board is in a protected state. If the battery protection board is in an unprotected state, the second power data is accurate and can be used as the target initial power. If the battery protection board is in a protected state, the current battery voltage is only the floating charge of accumulated charge, not the actual battery voltage. The calculated second power data is inaccurate and cannot be used as the target initial power.

[0116] A second initialization is performed according to the charge and discharge state after the shutdown state is converted, and the second power data is verified to determine whether the second power data is accurate data.

[0117] When the battery is converted from the shutdown state to the discharge state, the discharge module will detect the battery voltage before turning on. The discharge module can only be turned on normally if the battery voltage is higher than the undervoltage threshold of the discharge module. The undervoltage threshold of the discharge module is generally higher than the protection voltage of the battery protection board. The discharge module is in the turned-on state, which means that the battery protection board is not in the protection state. The second power data Pinit1 obtained in the shutdown state is accurate. The second power data Pinit1 can be determined as the target initial power Pinit_final, and the initialization process ends.

[0118] When the battery is switched from the shutdown state to the charging state, it cannot be determined whether the battery protection board is in the protection state in the shutdown state. In the charging state, the battery voltage is continuously detected. When it is detected that the battery voltage exceeds the first voltage threshold for a time period exceeding the first time threshold, it can be determined that even if the battery protection board is in the protection state in the shutdown state, the battery protection board can be charged and opened after charging and is in the unprotected state. At this time, the battery voltage Vbat and the battery current Ibat are obtained, and the battery terminal voltage Vocv is calculated as follows:

[0119] Vocv=Vbat-Ibat*Rdc

[0120] Substitute the battery terminal voltage Vocv into the voltage-to-electricity mapping curve, and use the difference algorithm to calculate the corresponding electric quantity Pinit2 as the first electric quantity data of the electric quantity measurement module.

[0121] Calculate the absolute value of the difference between the first power data and the second power data Pinit_delta

[0122] Pinit_delta=|Pinit1-Pinit2|

[0123] The first difference threshold is Pinit_threshold. If Pinit_delta >= Pinit_threshold, it is considered that the battery protection board is in a protected state under the shutdown state, and the calculated second power data Pinit1 is inaccurate. Only the first power data Pinit2 is accurate. The first power data Pinit2 is used as the target initial power Pinit_final.

[0124] If Pinit_delta < Pinit_threshold, it is considered that the battery protection board is not in a protected state under the shutdown state, and the calculated second power data Pinit1 is accurate. Therefore, the second power data Pinit1 is used as the target initial power Pinit_final, and the initialization process ends.

[0125] If the battery is in a discharging state when the power measurement module is powered on for the first time, the discharging module will detect the battery voltage before it is turned on. Only when the battery voltage is higher than the undervoltage threshold of the discharging module can the discharging module be normally turned on. Generally, the undervoltage threshold of the discharging module is higher than the protection voltage of the battery protection board. The fact that the discharging module is in an open state indicates that the battery protection board is not in a protected state. Obtain the battery voltage Vbat and the battery current Ibat, and calculate the battery terminal voltage Vocv as

[0126] Vocv = Vbat + Ibat * Rdc

[0127] Substitute the battery terminal voltage Vocv into the voltage-power mapping curve, and use the difference algorithm to calculate the corresponding power Pinit3 as the third power data of the power measurement module.

[0128] Since the discharging module can be normally turned on, it indicates that the battery protection board is not in a protected state, and the third power data Pinit3 is accurate. At this time, the third power data Pinit3 can be used as the target initial power Pinit_final of the power measurement module, and the initialization process ends.

[0129] If the battery is in a charging state when the power measurement module is powered on for the first time, continuously detect the battery voltage. When the duration for which the detected battery voltage exceeds the first voltage threshold exceeds the first duration threshold, it can be determined that even if the battery protection board is in a protected state when the device is shutdown, the battery protection board can be charged and opened after charging and is in an unprotected state. Obtain the battery voltage Vbat and the battery current Ibat, and calculate the battery terminal voltage Vocv as

[0130] Vocv = Vbat + Ibat * Rdc

[0131] Substitute the battery terminal voltage Vocv into the voltage-to-energy mapping curve, and use the difference algorithm to calculate the corresponding energy Pinit2, which is used as the first energy data Pinit2 of the energy metering module. At this time, the first energy data Pinit2 can be used as the target initial energy Pinit_final of the energy metering module, and the initialization process ends. The battery power calculation method provided in the embodiment of the present application can be executed by a battery power calculation device. In the embodiment of the present application, the battery power calculation method provided in the embodiment of the present application is described by taking the battery power calculation device executing the battery power calculation method as an example.

[0132] An embodiment of the present application also provides a battery power calculation device.

[0133] As shown in FIG4 , the battery power calculation device includes:

[0134] a first processing module 410, configured to, in response to the battery being in a charging state, obtain first power data of the battery when a battery voltage of the battery exceeds a first voltage threshold for a duration exceeding a first duration threshold, and determine a target initial power of the battery based on the first power data;

[0135] The second processing module 420 is configured to calculate the real-time power level of the battery based on the target initial power level.

[0136] According to the battery power calculation device provided in the embodiment of the present application, by continuously detecting the battery voltage when the battery is in a charging state, when it is detected that the battery voltage of the battery exceeds the first voltage threshold for a period of time exceeding the first time threshold, it can be determined that even if the battery protection board was previously in a protection state, the battery protection board can be charged and is in an unprotected state after charging. The first power data obtained is accurate power data and can be used as the target initial power. The real-time power of the battery calculated based on the target initial power is more accurate.

[0137] In some embodiments, the first processing module 410 is further configured to obtain second power data of the battery in response to the battery being in a shutdown state;

[0138] The target initial power is determined based on the first power data and the second power data.

[0139] In some embodiments, the first processing module 410 is configured to calculate an absolute value of a difference between the first power data and the second power data;

[0140] When the absolute value of the difference is greater than or equal to a first difference threshold, using the first power data as the target initial power;

[0141] Alternatively, when the absolute value of the difference is smaller than the first difference threshold, the second power data is used as the target initial power.

[0142] In some embodiments, the first processing module 410 is configured to determine the first power data as the target initial power.

[0143] In some embodiments, the first processing module 410 is further configured to obtain third power data of the battery in response to the battery being in a discharging state, and determine the third power data as the target initial power.

[0144] In some embodiments, the first processing module 410 is further configured to obtain second power data of the battery in response to the battery being in a shutdown state;

[0145] In response to the battery being switched from the shutdown state to the discharge state, the second power data is determined as the target initial power.

[0146] In some embodiments, the first processing module 410 is further configured to obtain a battery voltage and a battery current of the battery;

[0147] determining a battery terminal voltage of the battery based on the battery voltage and the battery current;

[0148] The first power data is determined based on the battery terminal voltage.

[0149] In some embodiments, the first processing module 410 is configured to substitute the battery terminal voltage into a voltage-to-electricity mapping curve to obtain the electric quantity data.

[0150] The battery power calculation device in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip.

[0151] The battery charge calculation device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0152] The battery power calculation device provided in the embodiment of the present application can implement each process implemented in the method embodiments of Figures 1 and 2. To avoid repetition, they are not described here.

[0153] In some embodiments, as shown in Figure 5, an embodiment of the present application also provides an electronic device 500, including a processor 501, a memory 502, and a computer program stored on the memory 502 and executable on the processor 501. When the program is executed by the processor 501, each process of the above-mentioned battery power calculation method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0154] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.

[0155] An embodiment of the present application also provides a non-transitory computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the various processes of the above-mentioned battery power calculation method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0156] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0157] An embodiment of the present application also provides a computer program product, including a computer program, which implements the above-mentioned battery power calculation method when executed by a processor.

[0158] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0159] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned battery power calculation method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0160] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0161] It should be noted that, in this article, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element. In addition, it should be noted that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in the opposite order according to the functions involved. For example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0162] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), including a number of instructions for enabling a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0163] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of this application, ordinary technicians in this field can also make many forms without departing from the purpose of this application and the scope of protection of the claims, all of which are within the protection of this application.

[0164] Throughout this specification, reference to terms such as "one embodiment," "some embodiments," "illustrative embodiments," "examples," "specific examples," or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.

[0165] Although the embodiments of the present application have been shown and described, those skilled in the art will appreciate that various changes, modifications, substitutions, and variations may be made to the embodiments without departing from the principles and intent of the present application, and that the scope of the present application is defined by the claims and their equivalents.

Claims

1. A method for calculating battery power, characterized in that: include: In response to the battery being in a charging state, if a battery voltage of the battery exceeds a first voltage threshold for a period exceeding a first duration threshold, obtaining first power data of the battery, and determining a target initial power of the battery based on the first power data; The real-time power of the battery is calculated based on the target initial power.

2. The method for calculating battery power according to claim 1, wherein: The battery is in a shutdown state before being in the charging state, and the method further includes: In response to the battery being in a power-off state, acquiring second power data of the battery; The determining the target initial power of the battery based on the first power data includes: The target initial power is determined based on the first power data and the second power data.

3. The method for calculating battery power according to claim 2, wherein: The determining the target initial power based on the first power data and the second power data includes: Calculating an absolute value of a difference between the first power data and the second power data; When the absolute value of the difference is greater than or equal to a first difference threshold, using the first power data as the target initial power; Alternatively, when the absolute value of the difference is smaller than the first difference threshold, the second power data is used as the target initial power.

4. The method for calculating battery power according to claim 1, wherein: The determining the target initial power of the battery based on the first power data includes: The first power data is determined as the target initial power.

5. The method for calculating battery power according to any one of claims 1 to 4, characterized in that: The method further comprises: In response to the battery being in a discharging state, third power data of the battery is acquired, and the third power data is determined as the target initial power.

6. The method for calculating battery power according to any one of claims 1 to 4, characterized in that: The method further comprises: In response to the battery being in a power-off state, acquiring second power data of the battery; In response to the battery being switched from the shutdown state to the discharge state, the second power data is determined as the target initial power.

7. The method for calculating battery power according to any one of claims 1 to 4, characterized in that: The first power data is obtained by the following steps: obtaining a battery voltage and a battery current of the battery; determining a battery terminal voltage of the battery based on the battery voltage and the battery current; The first power data is determined based on the battery terminal voltage.

8. The method for calculating battery power according to claim 7, wherein: The determining the first power data based on the battery terminal voltage includes: Substitute the battery terminal voltage into the voltage-to-electricity mapping curve to obtain the first electric quantity data.

9. A battery power calculation device, characterized in that: include: a first processing module, configured to, in response to the battery being in a charging state, obtain first power data of the battery when a battery voltage of the battery exceeds a first voltage threshold for a period exceeding a first duration threshold, and determine a target initial power of the battery based on the first power data; The second processing module is configured to calculate the real-time power of the battery based on the target initial power.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method for calculating the battery power according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Method and device for obtaining electric quantity of battery, and electronic equipment

    CN106556801A

  • Battery power detecting method and apparatus, and terminal device

    CN109991554A

  • Battery remaining capacity estimation method and device, electronic equipment and computer readable storage medium

    CN110927590A

  • Battery electric quantity detection method and device and storage medium

    CN111766521A

  • Charge and discharge control apparatus and electronic device

    US20210296920A1