Electricity meter calibration method and device, electronic equipment and storage medium

By sending algorithm control instructions to clear the Coulomb integral and reset the initial value when the SOC reported on the battery meter meets the conditions, the problem of inaccurate battery remaining battery power caused by the battery meter error is solved, and the accuracy and user experience of the battery meter are improved.

CN120385970APending Publication Date: 2025-07-29GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510570551.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-30
Publication Date
2025-07-29

AI Technical Summary

Technical Problem

In the prior art, the battery capacity of the battery is inaccurate due to error factors, which affects the battery life.

Method used

When the remaining power SOC reported on the meter meets the calibration conditions, the algorithm control command is sent, and the meter is triggered to restart the algorithm function, clear the Coulomb integral, and determine the discharge depth value based on the battery voltage and current, and reset the initial value of the Coulomb integral.

Benefits of technology

The accuracy of the battery meter to determine the remaining battery capacity is improved, avoiding frequent calibrations affecting normal work, and improving user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120385970A_ABST
    Figure CN120385970A_ABST
Patent Text Reader

Abstract

The embodiment of the invention relates to the technical field of batteries, and discloses a voltameter calibration method and device, electronic equipment and a storage medium, and the method comprises the steps: sending an algorithm control instruction to a voltameter under the condition that the residual electric quantity SOC reported by the voltameter of a battery meets a calibration condition, the algorithm control instruction being used for triggering the voltameter to restart an algorithm function, the coulomb integral is used for determining the SOC of the battery; and determining the discharge depth value of the battery according to the battery voltage and the battery current of the battery through the algorithm function of the voltameter, and re-determining the initial value of the coulomb integral according to the discharge depth value. According to the embodiment of the invention, forced calibration can be carried out on the voltameter, so that the accuracy of the residual electric quantity of the battery determined by the voltameter is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of batteries, and particularly to a calibration method and device for a fuel gauge, an electronic device, and a storage medium. Background Art

[0002] Currently, the battery in an electronic device can determine the remaining battery power according to a built-in fuel gauge, so as to provide a reference for the battery's endurance.

[0003] However, it is found in practice that due to various error factors, the remaining battery power determined by the fuel gauge may be inaccurate, thus affecting the determination of the battery's endurance. Summary of the Invention

[0004] Embodiments of the present application disclose a calibration method and device for a fuel gauge, an electronic device, and a storage medium, which can perform forced calibration on the fuel gauge to improve the accuracy of the remaining battery power determined by the fuel gauge.

[0005] A first aspect of an embodiment of the present application discloses a calibration method for a fuel gauge. The method includes:

[0006] When the remaining state of charge (SOC) reported by the fuel gauge of the battery meets the calibration condition, sending an algorithm control instruction to the fuel gauge. The algorithm control instruction is used to trigger the fuel gauge to restart the algorithm function to clear the Coulomb integral of the fuel gauge, and the Coulomb integral is used to determine the SOC of the battery;

[0007] According to the battery voltage and battery current of the battery, determining a discharge depth value of the battery through the algorithm function of the fuel gauge, and re-determining an initial value of the Coulomb integral according to the discharge depth value.

[0008] A second aspect of an embodiment of the present application discloses a calibration device for a fuel gauge. The device includes:

[0009] A sending unit, configured to send an algorithm control instruction to the fuel gauge when the remaining SOC reported by the fuel gauge of the battery meets the calibration condition. The algorithm control instruction is used to trigger the fuel gauge to restart the algorithm function to clear the Coulomb integral of the fuel gauge, and the Coulomb integral is used to determine the SOC of the battery;

[0010] A determining unit, configured to determine a discharge depth value of the battery according to the battery voltage and battery current of the battery through the algorithm function of the fuel gauge, and re-determine an initial value of the Coulomb integral according to the discharge depth value.

[0011] A third aspect of an embodiment of the present application discloses an electronic device, including: a memory storing executable program code; a processor coupled to the memory;

[0012] The processor calls the executable program code stored in the memory and executes the calibration method of the coulometer disclosed in the first aspect of the embodiments of the present application.

[0013] The fourth aspect of the embodiments of the present application discloses a computer-readable storage medium storing a computer program, wherein the computer program causes a computer to execute the calibration method of the coulometer disclosed in the first aspect of the embodiments of the present application.

[0014] The fifth aspect of the embodiments of the present application discloses a computer program product, which, when running on a computer, causes the computer to execute some or all of the steps of any one of the methods disclosed in the first aspect of the embodiments of the present application.

[0015] The sixth aspect of the embodiments of the present application discloses an application publishing platform for publishing a computer program product, which, when running on a computer, causes the computer to execute some or all of the steps of any one of the methods disclosed in the first aspect of the embodiments of the present application.

[0016] Compared with the related art, the embodiments of the present application have the following beneficial effects:

[0017] In the embodiments of the present application, when the remaining battery SOC reported by the coulometer of the battery meets the calibration condition, an algorithm control instruction can be sent to the coulometer. The algorithm control instruction is used to trigger the coulometer to restart the algorithm function to clear the coulomb integral of the coulometer. Furthermore, the algorithm function of the coulometer can determine the discharge depth value of the battery according to the battery voltage and battery current of the battery, and re-determine the initial value of the coulomb integral according to the discharge depth value, where the coulomb integral is used to determine the SOC of the battery. It can be seen that in the embodiments of the present application, the algorithm control instruction can be used to trigger the coulometer to restart the algorithm function to force the coulometer to calibrate the coulomb integral of the coulometer through the algorithm function, so that the calibrated coulomb integral can more accurately determine the remaining battery power, thereby improving the accuracy of the remaining battery power determined by the coulometer. In addition, in the embodiments of the present application, when the remaining battery SOC reported by the coulometer of the battery meets the calibration condition, the coulometer is calibrated, which can avoid frequent calibration of the coulometer and affect the normal operation of the coulometer. Description of the Drawings

[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0019] Figure 1 It is a schematic structural diagram of a battery pack disclosed in an embodiment of the present application;

[0020] Figure 2 It is a schematic flowchart of a calibration method for a coulomb counter disclosed in an embodiment of the present application;

[0021] Figure 3 It is a schematic flowchart of another calibration method for a coulomb counter disclosed in an embodiment of the present application;

[0022] Figure 4 It is a schematic flowchart of yet another calibration method for a coulomb counter disclosed in an embodiment of the present application;

[0023] Figure 5 It is a schematic flowchart disclosed in an embodiment of the present application;

[0024] Figure 6 It is a schematic structural diagram of a calibration device for a coulomb counter disclosed in an embodiment of the present application;

[0025] Figure 7 It is a schematic structural diagram of an electronic device disclosed in an embodiment of the present application. Detailed implementation manners

[0026] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

[0027] It should be noted that the terms "first", "second", "third", and "fourth", etc. in the specification and claims of the present application are used to distinguish different objects, rather than to describe a specific order. The terms "including" and "having" in the embodiments of the present application and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units does not necessarily have to be limited to those clearly listed steps or units, but may include other steps or units that are not clearly listed or are inherent to these processes, methods, products, or devices.

[0028] The embodiments of the present application disclose a calibration method and device for a coulomb counter, an electronic device, and a storage medium, which can perform forced calibration on the coulomb counter to improve the accuracy of the remaining battery power determined by the coulomb counter.

[0029] Next, the technical solutions of the present application will be described in detail in conjunction with specific embodiments.

[0030] To introduce the method disclosed in the embodiments of the present application more clearly, the batteries in the related art will be introduced first.

[0031] An integrated circuit with a fuel gauge is usually provided in a mobile terminal to manage the power of the mobile terminal. Optionally, the battery pack architecture integrated with a fuel gauge can be as Figure 1 shown. Figure 1 It is a schematic structural diagram of a battery pack disclosed in the embodiments of the present application.

[0032] Optionally, the battery pack may include: a battery cell 110, a fuel gauge 120, a primary protection integrated circuit 130, a secondary protection integrated circuit 140, a fuse 150, a charging switch 160, a discharging switch 170, a thermistor 180, a current detection resistor 190, etc., which are not limited herein.

[0033] Among them, the fuel gauge 120 is used to manage the battery cell 110. Its main tasks include: collecting data such as battery voltage, battery current, and battery temperature, and estimating the remaining battery power (State Of Charge, SOC) based on the collected data through algorithms. The fuel gauge 120 has the functions of achieving high-precision sampling, low-power operation, communication, and data processing at the hardware end, and has the ability to accurately model the battery algorithmically and implement algorithm programming, data processing, and calculation of effective information in the form of firmware.

[0034] The fuel gauge calculating the SOC of the battery can include two parts: open-circuit voltage OCV - depth of discharge DOD calibration, and Coulomb integration. Among them, the open-circuit voltage OCV refers to the terminal voltage of the battery when it is not connected to an external load (i.e., no current flows through); the depth of discharge DOD is the proportion of the discharged power of the battery to the total capacity of the battery, and the depth of discharge DOD and the remaining current SOC are opposite in size. There is a corresponding relationship table between OCV and DOD. The relationship table records the DOD corresponding to one or more calibrated OCVs. In this case, knowing the OCV, the corresponding DOD can be obtained by looking up the table.

[0035] Coulomb integration is the result of the fuel gauge sampling the voltage difference across a precision resistor to calculate the current and performing Coulomb integration through a Coulomb Counting Analog-to-Digital Converter (CCADC). The precision resistor (Shunt Resistor) is a resistor connected in series in the charging and discharging circuit of the battery. Its resistance value is extremely small (usually in the milliohm level, such as 1mΩ), but its accuracy and temperature stability are extremely high. When current flows through the precision resistor, a voltage difference will be generated across the resistor; and then, knowing the voltage difference and the resistance value of the resistor, the current in the charging and discharging circuit can be determined.

[0036] Further, the principle of Coulomb integration is introduced. Coulomb integration may include: charge quantity calculation. The charge quantity is the integral of current over time, i.e., Q = ∫Idt. Wherein, I is the current; dt is the duration; and Q is the charge quantity. Exemplarily, assuming the current I = 1A and the duration is 1 hour, then the charge quantity Q = 1A × 3600s = 3600 C (Coulomb).

[0037] During the charging and discharging process of the battery, the CCADC continuously accumulates the change in charge quantity based on the initial DOD to obtain the Coulomb integration, and then the SOC of the battery can be calculated according to the Coulomb integration. Among them, the Coulomb integration is equivalent to the accumulated DOD, and the depth of discharge DOD and the remaining current SOC are of opposite magnitudes. Therefore, the fuel gauge can calculate the SOC of the battery based on the Coulomb integration. The initial DOD can be determined by the measured OCV and the OCV-DOD relationship table.

[0038] In practice, it is found that there are error factors such as board offset and cadc offset in the Coulomb integration of the fuel gauge, resulting in the Coulomb integration not being cleared to zero for a long time, and the integration error will accumulate, thereby affecting the accuracy of the calculated SOC.

[0039] The embodiment of the present application discloses a calibration method for a fuel gauge. When the remaining power SOC reported by the fuel gauge of the battery meets the calibration condition, an algorithm control instruction can be sent to the fuel gauge. The algorithm control instruction is used to trigger the fuel gauge to restart the algorithm function to clear the Coulomb integration of the fuel gauge; furthermore, the algorithm function of the fuel gauge can be used to determine the depth of discharge value of the battery according to the battery voltage and battery current of the battery, and re-determine the initial value of the Coulomb integration according to the depth of discharge value. Among them, the Coulomb integration is used to determine the SOC of the battery. It can be seen that in the embodiment of the present application, the algorithm control instruction can be used to trigger the fuel gauge to restart the algorithm function to force the fuel gauge to calibrate the Coulomb integration of the fuel gauge through the algorithm function, so that the calibrated Coulomb integration can more accurately determine the remaining power of the battery, thereby improving the accuracy of the remaining power of the battery determined by the fuel gauge. In addition, when the remaining power SOC reported by the fuel gauge of the battery meets the calibration condition, the embodiment of the present application calibrates the fuel gauge, which can avoid frequently calibrating the fuel gauge and affecting the normal operation of the fuel gauge.

[0040] Moreover, for electronic devices with a long usage time, a low calibration frequency of the fuel gauge, and frequent SOC jump situations reported by the fuel gauge, the calibration method of the fuel gauge can be used to perform calibration without replacing firmware such as the fuel gauge, and the implementation method is simple and efficient; especially for electronic devices that have been delivered to users on the market, it can also be implemented, thereby expanding the implementation scenario of the method.

[0041] Based on this, the calibration method and device for the coulometer, electronic device, and storage medium disclosed in the present embodiment will be introduced below.

[0042] Please refer to Figure 2 , Figure 2 which is a schematic flowchart of a calibration method for a coulometer disclosed in an embodiment of the present application. Optionally, this method can be applied to an electronic device including the battery pack introduced above, or other execution entities, which are not limited herein. Optionally, this method may include the following steps:

[0043] 202. When the remaining state of charge (SOC) reported by the coulometer of the battery meets the calibration condition, send an algorithm control instruction to the coulometer. The algorithm control instruction is used to trigger the coulometer to restart the algorithm function to clear the Coulomb integral of the coulometer, and the Coulomb integral is used to determine the SOC of the battery.

[0044] In an embodiment of the present application, the coulometer in the battery can report the remaining SOC of the battery to the electronic device (for example, the central processing unit of the electronic device). Then the electronic device can determine whether the reported SOC meets the calibration condition.

[0045] Optionally, the calibration method for the coulometer in an embodiment of the present application may include: determining the depth of discharge value (i.e., the DOD introduced above) of the battery according to the battery voltage and battery current of the battery, and re-determining the initial value of the Coulomb integral according to the depth of discharge value. For this, stable and accurate battery voltage and battery current need to be collected to determine the accurate depth of discharge value.

[0046] Optionally, the calibration condition may include: the battery current of the battery is less than the second current threshold, and the battery voltage is within the target voltage range within the second time period.

[0047] Implementing the above method can determine that the calibration condition is met when the battery current is small and the battery voltage is stable, because stable and accurate battery voltage and battery current can be collected when the battery current is small and the battery voltage is stable. For this, a more accurate depth of discharge value can be determined, and thus the calibration effect of the coulometer can be improved.

[0048] However, it is found in practice that due to the increasing number of functions and power consumption of current electronic devices, various application programs have been in a relatively active state, resulting in no relatively stable period of current and voltage to calibrate the coulometer. For this, the embodiment of the present application can forcibly calibrate the coulometer by restarting the algorithm function, and the current and voltage may be unstable during the forced calibration process, resulting in inaccurate determination of the depth of discharge value of the battery according to the battery voltage and battery current, and thus other additional errors may be introduced.

[0049] In an alternative embodiment, the calibration condition may include: the SOC reported by the battery is an end-point value corresponding to the battery capacity. Optionally, the end-point value may include a first end-point value or a second end-point value; wherein, the first end-point value is the SOC corresponding to the battery in the fully discharged state, and the second end-point value is the SOC corresponding to the battery in the fully charged state.

[0050] It should be noted that the SOC corresponding to the battery in the fully discharged state may be: 0% of the battery capacity; the SOC corresponding to the battery in the fully charged state may be: 100% of the battery capacity. The battery capacity of the battery is affected by the ambient temperature. Exemplarily, for a battery with a normal temperature design capacity of 5000 mAh, the available capacity in the 0-5°C range may be only 4000 mAh, which is not limited herein. Optionally, the battery capacity may be: the current available capacity of the battery.

[0051] It should be noted that when calibrating the fuel gauge when the SOC reported by the battery is an end-point value, even if additional errors are introduced, it will not affect the currently displayed battery level. Exemplarily, the SOC reported by the battery is the second end-point value corresponding to the fully charged state, and the currently displayed battery level is "100%". Since the displayed battery level has reached the maximum, even if additional errors are introduced during calibration at this time, it will not cause a deviation in the displayed battery level. Similarly, when the SOC reported by the battery is the first end-point value corresponding to the fully discharged state, the currently displayed battery level is "0%", and even if additional errors are introduced during calibration at this time, it will not cause a deviation in the displayed battery level.

[0052] By implementing the above method, the electronic device can calibrate the fuel gauge when the SOC reported by the battery is the end-point value of full discharge or full charge. Even if additional errors are introduced during the calibration process, it will not cause a deviation in the displayed battery level, so that the fuel gauge can be calibrated without the user noticing, improving the user experience.

[0053] In an alternative embodiment, the calibration condition may include: the SOC reported by the battery is the first end-point value, and one or more of the following conditions:

[0054] (1) The SOC reported by the battery last time is greater than the first power threshold.

[0055] As introduced above, when there is a cumulative error in the Coulomb integration of the fuel gauge, it may cause the SOC reported by the fuel gauge to be falsely high. Exemplarily, the SOC of the battery reported by the fuel gauge is falsely high, with a value greater than 5%, but the battery voltage is lower than the set discharge cut-off voltage threshold of the fuel gauge. At this time, the SOC of the battery reported by the fuel gauge will be forced to jump to zero (0%), and the displayed battery level will drop rapidly, which will make the user feel that the battery power is not durable.

[0056] In this case, when the SOC reported by the battery last time is greater than the first power threshold and the currently reported SOC is the first endpoint value, it is determined that the SOC reported by the fuel gauge jumps to zero forcibly. This situation may be caused by the cumulative error of the Coulomb integration of the fuel gauge. In this regard, it can be determined that the calibration condition is satisfied.

[0057] Optionally, the first power threshold can be set by developers based on a large amount of development experience. Typical values can include 5%, 6%, etc., which are not limited here.

[0058] It can be seen that by implementing the above method, the electronic device can determine that the reported SOC meets the calibration condition when the SOC reported by the fuel gauge jumps to zero forcibly, and then can calibrate the fuel gauge to avoid the situation where the SOC reported by the fuel gauge jumps to zero forcibly again later.

[0059] (2) The battery current corresponding to the battery is less than the first current threshold.

[0060] As introduced above, during the calibration process of the fuel gauge, it is necessary to determine the depth of discharge value of the battery according to the battery voltage and battery current of the battery, and a stable battery power will improve the accuracy of the determined depth of discharge value.

[0061] In this regard, the battery current corresponding to the battery can be restricted to be less than the first current threshold to ensure that there is no large fluctuation in the battery current, so as to improve the accuracy of the determined depth of discharge value, and further improve the calibration effect of the fuel gauge.

[0062] Optionally, the first current threshold can be set by developers based on a large amount of development experience. Typical values can include 350 mA, 400 mA, etc., which are not limited here.

[0063] In another alternative embodiment, the calibration condition may include: the SOC reported by the battery is the second endpoint value, and the battery is in the charging state and not in the target charging mode. Among them, the target charging mode is the charging mode for communication between the electronic device corresponding to the battery and the fuel gauge.

[0064] In the embodiments of the present application, the process of calibrating the fuel gauge involves reading and writing the parameters of the fuel gauge. In this case, if the electronic device is currently in the target charging mode, the parameters in the fuel gauge are already being read and written. To avoid mutual influence, it is not suitable to calibrate the fuel gauge. Therefore, the fuel gauge can be calibrated when the battery is not in the target charging mode.

[0065] Optionally, the target charging mode may include the fast charging mode. In the fast charging mode, the fuel gauge acts as a "sensor" to provide high-frequency sampling of the battery state, and the electronic device acts as a "controller" to calculate and output the optimal charging parameters in real time. In this regard, in the fast charging mode, communication will occur between the electronic device and the fuel gauge.

[0066] When implementing the above method, the electronic device can determine that the calibration condition is met when the battery is in a charging state and not in the target charging mode, so as to avoid conflicts between the parameter reading and writing operations of the electronic device on the coulomb meter in the target charging mode and the parameter reading and writing operations of the coulomb meter during the calibration process, thereby ensuring the calibration effect of the coulomb meter.

[0067] In the embodiments of the present application, the algorithm function includes: clearing the coulomb integral of the coulomb meter, determining the discharge depth value of the battery according to the battery voltage and battery current of the battery, and calibrating to re-determine the initial value of the coulomb integral according to the discharge depth value.

[0068] Optionally, the algorithm function can, in the case of a restart, execute the above steps of clearing the coulomb integral of the coulomb meter, determining the discharge depth value of the battery according to the battery voltage and battery current of the battery, and calibrating to re-determine the initial value of the coulomb integral according to the discharge depth value. And the restart trigger calibration step does not need to meet the conditions of stable battery voltage and battery current introduced above, and this can be used for forced calibration of the coulomb meter.

[0069] In the embodiments of the present application, the SOC reported by the battery may include: the SOC reported by the coulomb meter of the battery.

[0070] 204. Determine the discharge depth value of the battery according to the battery voltage and battery current of the battery through the algorithm function of the coulomb meter, and re-determine the initial value of the coulomb integral according to the discharge depth value.

[0071] In the embodiments of the present application, the electronic device can obtain the battery resistance of the battery. Optionally, the electronic device can calculate the first calculation result of multiplying the battery current and the battery resistance of the battery, and then calculate the sum of the first calculation result and the battery voltage to obtain the open-circuit voltage.

[0072] Further, the electronic device can determine the discharge depth value according to the open-circuit voltage. Optionally, the electronic device can determine the corresponding discharge depth value according to the open-circuit voltage and the relationship table.

[0073] Optionally, the relationship table includes one or more open-circuit voltages and the respective corresponding discharge depth values. Optionally, the relationship table can be set by developers based on a large amount of development experience, and is not limited herein.

[0074] In the embodiments of the present application, the manner in which the electronic device re-determines the initial value of the coulomb integral according to the discharge depth value may include: the electronic device can determine the discharge depth value of the battery as the initial value of the coulomb integral.

[0075] When implementing the method disclosed in the embodiments of the present application, when the remaining battery power SOC reported by the battery fuel gauge meets the calibration condition, an algorithm control instruction can be sent to the fuel gauge. The algorithm control instruction is used to trigger the fuel gauge to restart the algorithm function to clear the Coulomb integration of the fuel gauge. Furthermore, the discharge depth value of the battery can be determined according to the battery voltage and battery current of the battery through the algorithm function of the fuel gauge, and the initial value of the Coulomb integration can be re-determined according to the discharge depth value, where the Coulomb integration is used to determine the SOC of the battery. It can be seen that in the embodiments of the present application, the algorithm control instruction can be used to trigger the fuel gauge to restart the algorithm function, so as to force the fuel gauge to calibrate the Coulomb integration of the fuel gauge through the algorithm function, so that the calibrated Coulomb integration can more accurately determine the remaining battery power, thereby improving the accuracy of the remaining battery power determined by the fuel gauge. In addition, in the embodiments of the present application, when the remaining battery power SOC reported by the battery fuel gauge meets the calibration condition, the fuel gauge is calibrated, which can avoid frequently calibrating the fuel gauge and affecting the normal operation of the fuel gauge.

[0076] Please refer to Figure 3 , Figure 3 FIG. is a schematic flowchart of another method for calibrating a fuel gauge disclosed in the embodiments of the present application. Optionally, this method can be applied to an electronic device including the battery pack described above, or other execution entities, which are not limited herein. Optionally, the method may include the following steps:

[0077] 302. When the remaining battery power SOC reported by the battery fuel gauge meets the calibration condition and the time interval between the current calibration and the last calibration of the fuel gauge is greater than the time threshold, send an algorithm control instruction to the fuel gauge.

[0078] In the embodiments of the present application, when the electronic device determines that the remaining battery power SOC reported by the fuel gauge meets the calibration condition, it can also determine whether the time interval between the current calibration and the last calibration of the fuel gauge is greater than the calibration time threshold. If the time interval between the current calibration and the last calibration of the fuel gauge is greater than the time threshold, an algorithm control instruction can be sent to the fuel gauge to trigger the calibration of the fuel gauge.

[0079] Optionally, the calibration time threshold can be set by developers based on a large amount of development experience. Typical values can include: 3 days, 5 days, etc., which are not limited herein.

[0080] It should be noted that after the fuel gauge is calibrated once, the Coulomb integration will not accumulate errors again in a short time. Therefore, it is not necessary to frequently calibrate the fuel gauge, and the calibration can be triggered only when the calibration interval is greater than the time threshold, thereby saving the power consumption of the electronic device.

[0081] Optionally, after the fuel gauge is calibrated, the fuel gauge can update the first DOD obtained by re-looking up the table according to the OCV to the register corresponding to its Coulomb integration, so as to use the first DOD as a new starting point for Coulomb integration. That is, if the DOD parameter in the register corresponding to Coulomb integration changes, it means that the fuel gauge has been calibrated.

[0082] Optionally, the electronic device can determine the duration during which the DCD in the register corresponding to Coulomb integration has not changed as the interval duration since the last calibration of the fuel gauge.

[0083] In an alternative embodiment, when the electronic device reads the first DOD value of the register for the first time, it can update the interval duration to a unit duration (e.g., 1 day, 1 week, etc.), and store the currently read first DOD and the interval duration.

[0084] After waiting for the unit duration, read the second DOD in the register again; if the second DOD matches the stored first DOD, increase the interval duration by the unit duration, and store the currently read second DOD and the latest interval duration; if the second DOD does not match the stored first DOD, update the calibration time to a unit duration (e.g., 1 day, 1 week, etc.).

[0085] By implementing the above method, the electronic device can trigger the calibration of the fuel gauge only when it determines that the interval duration since the last calibration of the fuel gauge exceeds the calibration duration threshold, thereby avoiding frequent calibration of the fuel gauge and saving the power consumption of the electronic device.

[0086] Optionally, the algorithm control instruction can include: an algorithm shutdown instruction and an algorithm enable instruction; wherein, the algorithm shutdown instruction is used to trigger the shutdown of the algorithm function of the fuel gauge; the algorithm enable instruction is used to trigger the activation of the algorithm function of the fuel gauge.

[0087] Optionally, the electronic device can send an algorithm shutdown instruction to the fuel gauge to trigger the fuel gauge to turn off the algorithm function; when the fuel gauge turns off the algorithm function, send an algorithm enable instruction to the fuel gauge to trigger the fuel gauge to turn on the algorithm function.

[0088] By implementing the above method, the electronic device can send an algorithm shutdown instruction and an algorithm enable instruction to the fuel gauge in sequence to restart the algorithm function, thereby triggering the restarted algorithm function to calibrate the fuel gauge, so that the Coulomb integration after calibration can more accurately determine the remaining battery power, thereby improving the accuracy of the remaining battery power determined by the fuel gauge.

[0089] In the embodiments of the present application, before the electronic device sends an algorithm control instruction to the fuel gauge, the fuel gauge may be in a locked state. Herein, the locked state is a state that does not support reading / writing of target parameters in the fuel gauge. The target parameters are parameters related to algorithm functions, such as battery current, battery voltage, etc., which are not limited herein.

[0090] Among them, the fuel gauge being in the locked state can avoid interference to the fuel gauge, thereby improving the accuracy of the SOC of the battery determined by the fuel gauge. Correspondingly, the fuel gauge also includes an unlocked state, which is a state that supports reading / writing of target parameters in the fuel gauge.

[0091] It can be understood that to calibrate the fuel gauge, it is necessary to read parameters including target parameters in the fuel gauge. As an alternative implementation, before the electronic device sends an algorithm control instruction to the fuel gauge, it can control the fuel gauge to switch to the unlocked state; then, when it is determined that the fuel gauge is in the unlocked state, the electronic device can send an algorithm control instruction to the fuel gauge.

[0092] By implementing the above method, the electronic device can send an algorithm control instruction to the fuel gauge only when it is determined that the fuel gauge is unlocked, so as to ensure that the electronic device can successfully read and write the target parameters of the fuel gauge, and to ensure that the fuel gauge can be successfully calibrated subsequently.

[0093] In an alternative embodiment, the fuel gauge may include status information for characterizing the status of the fuel gauge. Optionally, the status information may include a custom byte Block C[0].

[0094] The status information may include: a first flag, a second flag, and a third flag. Among them, the first flag indicates that the fuel gauge cannot respond to the algorithm shutdown instruction; the second flag indicates that the fuel gauge is in an abnormal state; the third flag indicates that the fuel gauge supports switching to the unlocked state.

[0095] Optionally, the electronic device can read the status information of the fuel gauge. If the status information of the fuel gauge is the third flag, the electronic device can control the fuel gauge to switch to the unlocked state.

[0096] In an alternative embodiment, the initial value of the status information of the fuel gauge may be the third flag. The electronic device can update the status information of the fuel gauge to the third flag when the algorithm function of the fuel gauge is successfully restarted. Optionally, when the electronic device determines that the fuel gauge cannot respond to the algorithm shutdown instruction, it can update the status information of the fuel gauge to the first flag. Optionally, when the electronic device determines that the fuel gauge is in an abnormal state, it can update the status of the fuel gauge to the second flag, which is not limited herein.

[0097] In an alternative embodiment, after the electronic device re-determines the initial value of the Coulomb integral according to the depth of discharge value, or when the status information of the fuel gauge is the first flag or the second flag, the electronic device may control the fuel gauge to switch to the locked state.

[0098] It should be noted that after the electronic device re-determines the initial value of the Coulomb integral according to the depth of discharge value, that is, after calibrating the fuel gauge, it is not necessary to read and write the parameters of the fuel gauge in a short time. Therefore, the fuel gauge can be switched to the locked state to avoid interference to the fuel gauge, thereby improving the accuracy of the SOC of the battery determined by the fuel gauge.

[0099] Similarly, when the status information of the fuel gauge is the first flag or the second flag, it indicates that the fuel gauge is in an abnormal state and cannot be calibrated normally. In this case, to avoid further damage to the fuel gauge caused by interference, the electronic device can control the fuel gauge to switch to the locked state.

[0100] By implementing the above method, the electronic device can switch the fuel gauge to the locked state after calibrating the fuel gauge to avoid interference to the fuel gauge; and when it is determined that the fuel gauge is in an abnormal state and cannot be calibrated normally, control the fuel gauge to switch to the locked state to avoid further damage to the fuel gauge caused by interference.

[0101] 304. Determine the depth of discharge value of the battery according to the battery voltage and battery current of the battery through the algorithm function of the fuel gauge, and re-determine the initial value of the Coulomb integral according to the depth of discharge value.

[0102] By implementing the methods disclosed in the above embodiments, the algorithm control instruction can be used to trigger the fuel gauge to restart the algorithm function, so as to force the fuel gauge to calibrate the Coulomb integral of the fuel gauge through the algorithm function, so that the calibrated Coulomb integral can more accurately determine the remaining power of the battery, thereby improving the accuracy of the remaining power of the battery determined by the fuel gauge. In addition, in the embodiments of the present application, when the remaining power SOC reported by the fuel gauge of the battery meets the calibration conditions, the fuel gauge is calibrated, which can avoid frequent calibration of the fuel gauge and affect the normal operation of the fuel gauge; and the electronic device can trigger the calibration of the fuel gauge only when it is determined that the interval time since the last calibration of the fuel gauge exceeds the calibration time threshold, thereby avoiding frequent calibration of the fuel gauge, and further saving the power consumption of the electronic device;

[0103] Moreover, the electronic device can send an algorithm shutdown instruction and an algorithm enable instruction to the coulomb counter in sequence to restart the algorithm function, thereby triggering the restarted algorithm function to calibrate the coulomb counter, so that the calibrated coulomb integral can more accurately determine the remaining power of the battery, thereby improving the accuracy of the remaining power of the battery determined by the coulomb counter; moreover, the electronic device can send an algorithm control instruction to the coulomb counter only when it is determined that the coulomb counter is unlocked, so as to ensure that the electronic device can successfully read and write the target parameters of the coulomb counter, so as to ensure that the coulomb counter can be successfully calibrated subsequently; moreover, the electronic device can switch the coulomb counter to the locked state after completing the calibration of the coulomb counter to avoid interference to the coulomb counter; moreover, when it is determined that the coulomb counter is in an abnormal state and cannot be normally calibrated, the coulomb counter is controlled to switch to the locked state to avoid further damage caused by interference to the coulomb counter.

[0104] Please refer to Figure 4 , Figure 4 FIG. is a schematic flowchart of another method for calibrating a coulomb counter disclosed in an embodiment of the present application. Optionally, this method can be applied to an electronic device including the battery pack described above, or other execution entities, which are not limited herein. Optionally, this method may include the following steps:

[0105] 402. When the remaining power SOC reported by the coulomb counter of the battery meets the calibration condition, send an algorithm control instruction to the coulomb counter. The algorithm control instruction is used to trigger the coulomb counter to restart the algorithm function to clear the coulomb integral of the coulomb counter, and the coulomb integral is used to determine the SOC of the battery.

[0106] 404. Obtain the enable information of the algorithm function at intervals of a first duration. The enable information indicates whether the algorithm function is in an enabled state or a disabled state.

[0107] In an embodiment of the present application, the algorithm function of the coulomb counter may correspond to enable information, and the enable information indicates whether the algorithm function is in an enabled state or a disabled state. Optionally, the enable information may include two different characters, respectively indicating the enabled state or the disabled state. Exemplarily, the character "1" may indicate the enabled state, and "0" indicates the disabled state, which are not limited herein.

[0108] It should be noted that after the electronic device sends an algorithm control instruction to the coulomb counter, it takes a certain reaction time for the coulomb counter to control the enabling of the algorithm function according to the algorithm control instruction. For this, the electronic device can obtain the enable information of the algorithm function at intervals of a first duration, so as to determine whether the algorithm function can be enabled according to the algorithm control instruction through multiple queries as much as possible.

[0109] Exemplarily, after the electronic device sends an algorithm shutdown instruction to the fuel gauge, it can obtain the enabling information of the algorithm function at intervals of a first duration to determine whether the algorithm function is in the shutdown state. Optionally, the first duration can be set by developers based on a large amount of development experience, and typical values can include 50 ms, 60 ms, etc., which are not limited herein.

[0110] Implementing the above method, after the electronic device sends an algorithm control instruction to the fuel gauge, it can obtain the enabling information of the algorithm function at intervals of a first duration to reserve a certain enabling response duration for the fuel gauge, so as to ensure that the electronic device can obtain accurate enabling information when the algorithm function is successfully enabled.

[0111] 406. If it is determined that the algorithm control instruction has not taken effect based on the enabling information obtained within the first cumulative duration, or if it is determined that the algorithm control instruction has not taken effect based on the enabling information obtained multiple times, the status information of the fuel gauge is updated to the target flag.

[0112] In the embodiments of the present application, if the on or off state corresponding to the algorithm function included in the enabling information matches the on or off state indicated by the algorithm control instruction, it is determined that the algorithm control instruction has taken effect. If the on or off state corresponding to the algorithm function included in the enabling information does not match the on or off state indicated by the algorithm control instruction, it is determined that the algorithm control instruction has not taken effect.

[0113] Exemplarily, when the algorithm control instruction is an algorithm shutdown instruction, if the enabling information indicates that the algorithm function is in the shutdown state, it is determined that the algorithm control instruction has taken effect; if the enabling information indicates that the algorithm function is in the on state, it is determined that the algorithm control instruction has not taken effect.

[0114] In the embodiments of the present application, the first cumulative duration is the cumulative duration from the sending moment of the algorithm control instruction to the current moment. The first cumulative duration can be set by developers based on a large amount of development experience, and typical values can include: 500 ms, 600 ms, etc., which are not limited herein.

[0115] The enabling information obtained multiple times can include the enabling information obtained a target number of times. Among them, the target number is less than or equal to the second number threshold. The second number threshold can be set by developers based on a large amount of development experience, and typical values can include 10 times, 12 times, etc., which are not limited herein.

[0116] Implementing the above method can set an upper limit value for repeatedly obtaining the enabling information of the algorithm function, thereby avoiding the electronic device from falling into a loop of repeatedly obtaining the enabling information and improving the controllability of the method.

[0117] In an alternative embodiment, the electronic device obtains the enabling information of the algorithm function every first time period; if it is determined according to the enabling information obtained within the second cumulative time period that the algorithm control instruction is not effective, the electronic device may resend the algorithm control instruction to the fuel gauge; if the number of times of resending the algorithm control instruction to the fuel gauge is greater than or equal to the first number threshold, the electronic device updates the status information of the fuel gauge to a target flag, where the target flag indicates that the fuel gauge cannot respond to the algorithm control instruction, or the fuel gauge is in an abnormal state.

[0118] Wherein, the second cumulative time period may be the cumulative time period between the sending time of the algorithm control instruction and the current time. The second cumulative time period can be set by developers based on a large amount of development experience, and typical values can include: 500ms, 550ms, etc., which are not limited herein. Optionally, the second cumulative time period may be the same as or different from the first cumulative time period, which is not limited herein.

[0119] In the embodiments of the present application, in order to avoid the algorithm control instruction from not taking effect due to reasons such as abnormal transmission of the algorithm control instruction or abnormal response of the algorithm control instruction, when the electronic device determines that the algorithm control instruction is not effective according to the enabling information obtained within the second cumulative time period, the electronic device may resend the algorithm control instruction to the fuel gauge to ensure as much as possible that the algorithm control instruction can take effect.

[0120] Optionally, when the number of times of resending the algorithm control instruction to the fuel gauge by the electronic device is less than the first number threshold, the electronic device may resend the algorithm control instruction to the fuel gauge.

[0121] If the number of times of resending the algorithm control instruction to the fuel gauge is greater than or equal to the first number threshold, the electronic device may no longer send the algorithm control instruction to the fuel gauge, but update the status information of the fuel gauge to a target flag to indicate that the fuel gauge is in an abnormal state.

[0122] Optionally, the first number threshold can be set by developers based on a large amount of development experience, and typical values can include: 3 times, 5 times, etc., which are not limited herein.

[0123] Implementing the above method, when the electronic device determines that the algorithm control instruction is not effective according to multiple enabling information, it can repeatedly send the algorithm control instruction to the fuel gauge to ensure as much as possible that the algorithm control instruction can take effect; in addition, an upper limit value can be set for the number of times of repeatedly sending the algorithm control instruction to the fuel gauge, so as to avoid the electronic device from falling into a loop of repeatedly sending the algorithm control instruction to the fuel gauge, and improve the controllability of the method.

[0124] In the embodiments of the present application, if it is determined according to the enabling information that the algorithm function is not effective, it indicates that the algorithm function has not been successfully restarted. Then, the electronic device can update the status information of the fuel gauge to a target flag. The target flag is used to indicate the reason why the algorithm function is not effective. Optionally, the target flag can indicate that the fuel gauge cannot respond to the algorithm control instruction, or the fuel gauge is in an abnormal state.

[0125] In an alternative embodiment, the algorithm control instruction may include: an algorithm shutdown instruction and an algorithm enabling instruction. The target flag may include: a first flag and a second flag. The first flag indicates that the fuel gauge cannot respond to the algorithm shutdown instruction; the second flag indicates that the fuel gauge is in an abnormal state. Optionally, when the algorithm control instruction is the algorithm shutdown instruction, the target flag may be the first flag; when the algorithm control instruction is the algorithm enabling instruction, the target flag may be the second flag.

[0126] It should be noted that if the algorithm shutdown instruction is not effective, it indicates that the fuel gauge cannot respond to the algorithm shutdown instruction. However, the algorithm function of the fuel gauge can still execute normally and will not affect the functions such as the fuel gauge calculating the SOC of the battery. In this case, the status information of the fuel gauge can be updated to the first flag.

[0127] If the algorithm enabling instruction is not effective, it indicates that the algorithm function has not been successfully restarted, that is, the algorithm function is currently in a closed state. At this time, the fuel gauge cannot work properly. In this case, the electronic device can update the status information of the fuel gauge to the second flag to indicate that the fuel gauge is in an abnormal state.

[0128] Implementing the above method, for the case where the algorithm shutdown instruction is not effective, since it will not affect the normal function of the fuel gauge, the status information can be updated to the first flag to indicate that the fuel gauge cannot respond to the algorithm shutdown instruction. If the algorithm enabling instruction is not effective, at this time the fuel gauge is in a closed state and cannot work properly, which affects the normal use of the user. In this case, the status information of the fuel gauge needs to be updated to the more serious second flag so that the electronic device can know that the fuel gauge is in an abnormal state, thereby improving the intelligence level of the method.

[0129] Optionally, when the electronic device updates the status information of the fuel gauge to the second flag, it can also output a reminder message, which is used to remind that the fuel gauge of the battery is in an abnormal state so that the user can repair the fuel gauge.

[0130] Implementing the above method, when the electronic device determines that the status information of the fuel gauge is updated to the second flag, it can output a reminder message to remind the user to repair the fuel gauge to ensure that the fuel gauge can resume normal functions as soon as possible, thereby ensuring the normal use of the electronic device and further improving the user experience.

[0131] 408. If it is determined that the algorithm control instruction has taken effect according to the enabling information of the algorithm function, the coulomb integration of the fuel gauge is cleared through the algorithm function of the fuel gauge, and the discharge depth value of the battery is determined based on the battery voltage and battery current of the battery, and the initial value of the coulomb integration is re-determined according to the discharge depth value.

[0132] By implementing the methods disclosed in the above embodiments, the algorithm control instruction can be used to trigger the fuel gauge to re-enable the algorithm function, so as to force the fuel gauge to calibrate the coulomb integration of the fuel gauge through the algorithm function, so that the calibrated coulomb integration can more accurately determine the remaining power of the battery, thereby improving the accuracy of the remaining power of the battery determined by the fuel gauge. In addition, in the case where the remaining power SOC reported by the fuel gauge of the battery meets the calibration conditions, the present application embodiment calibrates the fuel gauge, which can avoid frequently calibrating the fuel gauge and affecting the normal operation of the fuel gauge; and, after the electronic device sends the algorithm control instruction to the fuel gauge, it can obtain the enabling information of the algorithm function every first time interval, so as to reserve a certain enabling response time for the fuel gauge, so as to ensure that the electronic device can obtain accurate enabling information when the algorithm function is successfully enabled; and, when the electronic device determines that the algorithm control instruction has not taken effect according to multiple enabling information, it can repeatedly send the algorithm control instruction to the fuel gauge to ensure as much as possible that the algorithm control instruction can take effect; in addition, an upper limit value can be set for the number of times of repeatedly sending the algorithm control instruction to the fuel gauge, so as to avoid the electronic device falling into a loop of repeatedly sending the algorithm control instruction to the fuel gauge, and improve the controllability of the method;

[0133] And, for the case where the algorithm shutdown instruction fails to take effect, since it does not affect the normal function implementation of the fuel gauge, the status information can be updated to the first flag to indicate that the fuel gauge cannot respond to the algorithm shutdown instruction; and if the algorithm enabling instruction fails to take effect, at this time the fuel gauge is in the shutdown state and cannot work normally, which affects the normal use of the user. In this regard, the status information of the fuel gauge needs to be updated to a more serious second flag, so that the electronic device knows that the fuel gauge is in an abnormal state, thereby improving the intelligence of the method; and, when the electronic device determines that the status information of the fuel gauge is updated to the second flag, it can output a reminder message to remind the user to repair the fuel gauge to ensure that the fuel gauge can resume normal function as soon as possible, thereby ensuring the normal use of the electronic device and further improving the user experience;

[0134] Please refer to Figure 5 , Figure 5 which is a schematic flowchart disclosed in the embodiments of the present application. Among them:

[0135] 500. The remaining power SOC reported by the fuel gauge of the battery meets the calibration conditions.

[0136] 502. Determine whether the elapsed time since the last calibration of the fuel gauge is greater than the calibration duration threshold. If so, execute step 504; if not, end this process.

[0137] 504. Determine whether the status information of the fuel gauge is the third flag. If so, execute step 506; if not, end this process.

[0138] Wherein, the third flag indicates that the fuel gauge supports switching to the unlocked state.

[0139] 506. Control the fuel gauge to switch to the unlocked state.

[0140] 508. Send an algorithm shutdown command to the fuel gauge.

[0141] 510. Obtain the enable information of the algorithm function at every interval of the first duration.

[0142] 512. Determine whether the algorithm function is in the shutdown state according to the enable information. If so, execute step 518; if not, execute step 514.

[0143] 514. Determine whether the first cumulative duration reaches the first duration threshold. If so, execute step 516; if not, execute step 510.

[0144] 516. Update the status information of the fuel gauge to the first flag; then execute step 536.

[0145] 518. Send an algorithm enable command to the fuel gauge.

[0146] 520. Obtain the enable information of the algorithm function at every interval of the first duration.

[0147] 522. Determine whether the algorithm function is in the enabled state according to the enable information. If so, execute step 532; if not, execute step 524.

[0148] 524. Determine whether the second cumulative duration reaches the second duration threshold. If so, execute step 526; if not, execute step 520.

[0149] 526. Increment the cumulative transmission count by one.

[0150] 528. Determine whether the cumulative transmission count is greater than the first count threshold. If so, execute step 530; if not, execute step 518.

[0151] 530. Update the status information of the fuel gauge to the second flag, and then execute step 536.

[0152] 532. Update the status information of the fuel gauge to the third flag and clear the cumulative transmission count.

[0153] 534. Clear the first cumulative duration and the second cumulative duration, and then perform step 536.

[0154] 536. Control the fuel gauge to switch to the locked state.

[0155] Please refer to Figure 6 , Figure 6 FIG. is a schematic structural diagram of a calibration device for a fuel gauge disclosed in an embodiment of the present application. Optionally, the device may be applied to an electronic device including the battery pack introduced above, or other execution entities, which are not limited herein. Optionally, the device may include a sending unit 602 and a determining unit 604, where:

[0156] The sending unit 602 is configured to send an algorithm control instruction to the fuel gauge when the remaining state of charge (SOC) reported by the fuel gauge of the battery meets the calibration condition. The algorithm control instruction is used to trigger the fuel gauge to restart the algorithm function to clear the Coulomb integral of the fuel gauge, and the Coulomb integral is used to determine the SOC of the battery.

[0157] The determining unit 604 is configured to determine the depth of discharge value of the battery according to the battery voltage and the battery current of the battery through the algorithm function of the fuel gauge, and re-determine the initial value of the Coulomb integral according to the depth of discharge value.

[0158] Implementing the above device, when the remaining SOC reported by the fuel gauge of the battery meets the calibration condition, an algorithm control instruction can be sent to the fuel gauge. The algorithm control instruction is used to trigger the fuel gauge to restart the algorithm function to clear the Coulomb integral of the fuel gauge. Furthermore, the depth of discharge value of the battery can be determined according to the battery voltage and the battery current of the battery through the algorithm function of the fuel gauge, and the initial value of the Coulomb integral can be re-determined according to the depth of discharge value, where the Coulomb integral is used to determine the SOC of the battery. It can be seen that in the embodiment of the present application, the algorithm control instruction can be used to trigger the fuel gauge to restart the algorithm function to force the fuel gauge to calibrate the Coulomb integral of the fuel gauge through the algorithm function, so that the calibrated Coulomb integral can more accurately determine the remaining power of the battery, thereby improving the accuracy of the remaining power of the battery determined by the fuel gauge. In addition, in the embodiment of the present application, when the remaining SOC reported by the fuel gauge of the battery meets the calibration condition, the fuel gauge is calibrated, which can avoid frequent calibration of the fuel gauge and affect the normal operation of the fuel gauge.

[0159] As an optional implementation manner, the calibration condition includes: the SOC reported by the battery is the first endpoint value or the second endpoint value. The first endpoint value is the SOC corresponding to the battery in the fully discharged state, and the second endpoint value is the SOC corresponding to the battery in the fully charged state.

[0160] Implementing the above device, the electronic device can calibrate the fuel gauge when the SOC reported by the battery is at the end-point value of being emptied or fully charged. Even if additional errors are introduced during the calibration process, it will not cause deviation in the displayed battery level. Thus, the fuel gauge can be calibrated without the user's awareness, improving the user experience.

[0161] As an optional implementation manner, the calibration conditions include: the SOC reported by the battery is the first end-point value, and one or more of the following conditions: the SOC reported by the battery last time is greater than the first battery level threshold; the battery current corresponding to the battery is less than the first current threshold.

[0162] Implementing the above device, when the SOC reported by the fuel gauge undergoes a forced zero jump, the electronic device can determine that the reported SOC meets the calibration conditions, and then can calibrate the fuel gauge to avoid the subsequent occurrence of a forced zero jump of the SOC reported by the fuel gauge again; and, it can limit the battery current corresponding to the battery to be less than the first current threshold to ensure that the battery current does not have large fluctuations, thereby improving the accuracy of the determined discharge depth value, and further improving the calibration effect of the fuel gauge.

[0163] As an optional implementation manner, the calibration conditions include: the SOC reported by the battery is the second end-point value, and the battery is in a charging state and not in the target charging mode, where the target charging mode is the charging mode for communication between the electronic device corresponding to the battery and the fuel gauge.

[0164] Implementing the above device, when the battery is in a charging state and not in the target charging mode, the electronic device can determine that the calibration conditions are met, thereby avoiding the conflict between the parameter reading and writing operations between the electronic device and the fuel gauge in the target charging mode and the parameter reading and writing operations on the fuel gauge during the calibration process, and thus ensuring the calibration effect of the fuel gauge.

[0165] As an optional implementation manner, the algorithm control instructions include: an algorithm shutdown instruction and an algorithm enable instruction; the sending unit 602 is further configured to send an algorithm shutdown instruction to the fuel gauge to trigger the fuel gauge to turn off the algorithm function; and, when the fuel gauge turns off the algorithm function, send an algorithm enable instruction to the fuel gauge to trigger the fuel gauge to turn on the algorithm function.

[0166] Implementing the above device, the electronic device can send an algorithm shutdown instruction and an algorithm enable instruction to the fuel gauge in sequence to restart the algorithm function, thereby triggering the restarted algorithm function to calibrate the fuel gauge, enabling the Coulomb integration after calibration to more accurately determine the remaining battery level, and thus improving the accuracy of the remaining battery level determined by the fuel gauge.

[0167] As an optional implementation manner,Figure 6 The device shown may further include a first update unit (not shown), where:

[0168] The first update unit is configured to obtain the enable information of the algorithm function at intervals of a first duration after sending an algorithm control instruction to the fuel gauge. The enable information indicates whether the algorithm function is in an enabled state or a disabled state; and, if it is determined that the algorithm control instruction has not taken effect based on the enable information obtained within the first cumulative duration, or if it is determined that the algorithm control instruction has not taken effect based on the enable information obtained multiple times, the status information of the fuel gauge is updated to a target flag; where the target flag indicates that the fuel gauge cannot respond to the algorithm control instruction, or the fuel gauge is in an abnormal state, and the first cumulative duration is the cumulative duration from the sending moment of the algorithm control instruction to the current moment.

[0169] Implementing the above device, after the electronic device sends an algorithm control instruction to the fuel gauge, it can obtain the enable information of the algorithm function at intervals of a first duration, so as to reserve a certain enable response duration for the fuel gauge, thereby ensuring that the electronic device can obtain accurate enable information when the algorithm function is successfully enabled.

[0170] As an alternative implementation, Figure 6 The device shown may further include a second update unit (not shown), where:

[0171] The second update unit is configured to obtain the enable information of the algorithm function at intervals of a first duration after sending an algorithm control instruction to the fuel gauge. The enable information indicates whether the algorithm function is in an enabled state or a disabled state; and, if it is determined that the algorithm control instruction has not taken effect based on the enable information obtained within the second cumulative duration, the algorithm control instruction is resent to the fuel gauge; and, if the number of times of resent the algorithm control instruction to the fuel gauge is greater than or equal to a first number threshold, the status information of the fuel gauge is updated to a target flag, and the target flag indicates that the fuel gauge cannot respond to the algorithm control instruction, or the fuel gauge is in an abnormal state.

[0172] Implementing the above device, when the electronic device determines that the algorithm control instruction has not taken effect based on multiple enable information, it can repeatedly send the algorithm control instruction to the fuel gauge to ensure as much as possible that the algorithm control instruction can take effect; in addition, an upper limit value can be set for the number of times of repeatedly sending the algorithm control instruction to the fuel gauge, thereby avoiding the electronic device falling into a loop of repeatedly sending the algorithm control instruction to the fuel gauge and improving the controllability of the method.

[0173] As an alternative implementation, the algorithm control instruction includes: an algorithm shutdown instruction and an algorithm enable instruction; the target flag includes: a first flag and a second flag, the first flag indicates that the fuel gauge cannot respond to the algorithm shutdown instruction; the second flag indicates that the fuel gauge is in an abnormal state;

[0174] Wherein, when the algorithm control instruction is an algorithm shutdown instruction, the target flag is the first flag; when the algorithm control instruction is an algorithm enable instruction, the target flag is the second flag.

[0175] When implementing the above device, in the case where the algorithm shutdown instruction does not take effect, since it will not affect the normal function implementation of the fuel gauge, the status information can be updated to the first flag, indicating that the fuel gauge cannot respond to the algorithm shutdown instruction; while when the algorithm enable instruction does not take effect, at this time the fuel gauge is in the shutdown state and cannot work normally, affecting the normal use of the user. In this regard, the status information of the fuel gauge needs to be updated to the more serious second flag, so that the electronic device can know that the fuel gauge is in an abnormal state, thereby improving the intelligence level of this method.

[0176] As an alternative implementation, the algorithm control instruction is an algorithm enable instruction, and the target flag is the second flag; Figure 6 The device shown may further include an output unit not shown in the figure, wherein:

[0177] The output unit is configured to output a reminder message after updating the status information of the fuel gauge to the target flag, and the reminder message is used to remind that the fuel gauge of the battery is in an abnormal state.

[0178] When implementing the above device, when the electronic device determines that the status information of the fuel gauge is updated to the second flag, it can output a reminder message to remind the user to repair the fuel gauge, so as to ensure that the fuel gauge can resume normal function as soon as possible, thereby ensuring the normal use of the electronic device and further improving the user experience.

[0179] As an alternative implementation, Figure 6 The device shown may further include an unlocking unit not shown in the figure, wherein:

[0180] The unlocking unit is configured to control the fuel gauge to switch to an unlocked state before sending an algorithm control instruction to the fuel gauge. The unlocked state is a state that supports reading / writing of target parameters in the fuel gauge, and the target parameters are parameters related to the algorithm function.

[0181] When implementing the above device, the electronic device can send an algorithm control instruction to the fuel gauge only when it determines that the fuel gauge is unlocked, so as to ensure that the electronic device can successfully read and write the target parameters of the fuel gauge, so as to ensure that the fuel gauge can be successfully calibrated subsequently.

[0182] As an alternative implementation, Figure 6 The device shown may further include a locking unit not shown in the figure, wherein:

[0183] A locking unit is configured to control the coulomb meter to switch to a locked state after re - determining the initial value of the coulomb integral according to the depth - of - discharge value, or when the status information of the coulomb meter is the first flag or the second flag; the locked state is a state that does not support reading / writing of target parameters in the coulomb meter, the target parameters are parameters related to the algorithm function, the first flag indicates that the coulomb meter cannot respond to the algorithm shutdown instruction, and the second flag indicates that the coulomb meter is in an abnormal state.

[0184] By implementing the above - mentioned device, the electronic device can switch the coulomb meter to the locked state after calibrating the coulomb meter to avoid interference to the coulomb meter; and, when it is determined that the coulomb meter is in an abnormal state and cannot be calibrated normally, control the coulomb meter to switch to the locked state to avoid further damage caused by interference to the coulomb meter.

[0185] As an alternative implementation, the sending unit 602 is further configured to send an algorithm control instruction to the coulomb meter when the state of charge (SOC) reported by the coulomb meter of the battery meets the calibration condition and the time interval since the last calibration of the coulomb meter is greater than the time - length threshold.

[0186] By implementing the above - mentioned device, the electronic device can trigger the calibration of the coulomb meter only when it is determined that the time interval since the last calibration of the coulomb meter exceeds the calibration time - length threshold, thereby avoiding frequent calibration of the coulomb meter and saving the power consumption of the electronic device.

[0187] Please refer to Figure 7 , Figure 7 which is a schematic structural diagram of an electronic device disclosed in an embodiment of the present application. As Figure 7 shown, the electronic device may include: a memory 701 storing executable program code; a processor 702 coupled to the memory 701; wherein, the processor 702 calls the executable program code stored in the memory 701 to execute the calibration method of the coulomb meter disclosed in the above - mentioned embodiments.

[0188] An embodiment of the present application discloses a computer - readable storage medium storing a computer program, wherein the computer program causes a computer to execute the calibration method of the coulomb meter disclosed in the above - mentioned embodiments.

[0189] An embodiment of the present application further discloses an application publishing platform, wherein the application publishing platform is used to publish a computer program product, and when the computer program product runs on a computer, it causes the computer to execute some or all of the steps of the methods in the above - mentioned method embodiments.

[0190] It should be understood that the "one embodiment" or "an embodiment" mentioned throughout the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, the "in one embodiment" or "in an embodiment" that appears throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. Those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to the present application.

[0191] In various embodiments of the present application, it should be understood that the size of the serial numbers of the above processes does not necessarily mean the inevitable sequence of execution order. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.

[0192] The units described above as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0193] In addition, in each embodiment of the present application, each functional unit can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated units can be implemented in the form of hardware or in the form of software functional units.

[0194] If the above integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-accessible memory. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions for causing a computer device (which can be a personal computer, a server or a network device, etc., specifically, the processor in the computer device) to execute some or all of the steps of the above methods in each embodiment of the present application.

[0195] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing relevant hardware through a program, and this program can be stored in a computer-readable storage medium. The storage medium includes read-only memory (ROM), random access memory (RAM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), one-time programmable read-only memory (OTPROM), electrically-erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc memories, magnetic disc memories, tape memories, or any other medium that can be used to carry or store data and is computer-readable.

[0196] The above has introduced in detail the calibration method and device of the coulomb meter, electronic device, and storage medium disclosed in the embodiments of the present application. Specific examples are used in this article to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application; at the same time, for those of ordinary skill in the art, according to the idea of the present application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present application.

Claims

1. A calibration method for a coulombmeter, characterized in that, The method includes: When the state of charge (SOC) reported by the fuel gauge of the battery meets the calibration condition, sending an algorithm control instruction to the fuel gauge, where the algorithm control instruction is used to trigger the fuel gauge to restart the algorithm function to clear the Coulomb integral of the fuel gauge, and the Coulomb integral is used to determine the SOC of the battery; According to the algorithm function of the fuel gauge, determining the discharge depth value of the battery based on the battery voltage and battery current of the battery, and re-determining the initial value of the Coulomb integral according to the discharge depth value.

2. The method according to claim 1, characterized in that The calibration condition includes: The SOC reported by the battery is a first endpoint value or a second endpoint value. The first endpoint value is the SOC corresponding to the battery in the fully discharged state, and the second endpoint value is the SOC corresponding to the battery in the fully charged state.

3. The method according to claim 2, wherein The calibration condition includes: The SOC reported by the battery is the first endpoint value, and one or more of the following conditions: The SOC reported by the battery last time is greater than a first power threshold; The battery current corresponding to the battery is less than a first current threshold.

4. The method according to claim 2, wherein The calibration condition includes: The SOC reported by the battery is the second endpoint value, and the battery is in the charging state and not in the target charging mode, where the target charging mode is the charging mode for communication between the electronic device corresponding to the battery and the fuel gauge.

5. The method according to any one of claims 1 to 4, characterized in that, The algorithm control instruction includes: an algorithm shutdown instruction and an algorithm enable instruction; sending the algorithm control instruction to the fuel gauge includes: Sending an algorithm shutdown instruction to the fuel gauge to trigger the fuel gauge to shut down the algorithm function; When the fuel gauge shuts down the algorithm function, sending an algorithm enable instruction to the fuel gauge to trigger the fuel gauge to start the algorithm function.

6. The method according to claim 1, characterized in that, After sending the algorithm control instruction to the fuel gauge, the method further includes: Obtaining the enable information of the algorithm function every first time period, where the enable information indicates that the algorithm function is in the enabled state or the disabled state; If it is determined according to the enable information obtained one or more times that the algorithm control instruction is not effective, updating the status information of the fuel gauge to a target flag; Wherein, the target flag indicates that the fuel gauge cannot respond to the algorithm control instruction, or the fuel gauge is in an abnormal state.

7. The method according to claim 1, wherein After sending the algorithm control instruction to the fuel gauge, the method further includes: Obtaining the enable information of the algorithm function every first time period, where the enable information indicates that the algorithm function is in the enabled state or the disabled state; If it is determined according to the enable information obtained one or more times that the algorithm control instruction is not effective, resending the algorithm control instruction to the fuel gauge; If the number of times of resending the algorithm control instruction to the fuel gauge is greater than or equal to a first number threshold, updating the status information of the fuel gauge to a target flag, where the target flag indicates that the fuel gauge cannot respond to the algorithm control instruction, or the fuel gauge is in an abnormal state.

8. The method according to claim 6 or 7, characterized in that, The algorithm control instructions include: an algorithm shutdown instruction and an algorithm enable instruction; the target flags include: a first flag and a second flag, where the first flag indicates that the fuel gauge cannot respond to the algorithm shutdown instruction; the second flag indicates that the fuel gauge is in an abnormal state; Wherein, when the algorithm control instruction is the algorithm shutdown instruction, the target flag is the first flag; when the algorithm control instruction is the algorithm enable instruction, the target flag is the second flag.

9. The method according to claim 8, wherein The algorithm control instruction is the algorithm enable instruction, and the target flag is the second flag; After updating the status information of the fuel gauge to the target flag, the method further includes: Outputting a reminder message for reminding that the fuel gauge of the battery is in an abnormal state.

10. The method according to claim 1, characterized in that Before sending the algorithm control instruction to the fuel gauge, the method further includes: Controlling the fuel gauge to switch to an unlocked state, where the unlocked state is a state that supports reading / writing of target parameters in the fuel gauge, and the target parameters are parameters related to the algorithm function.

11. The method according to claim 1, characterized in that, The method further includes: After re-determining the initial value of the Coulomb integral according to the depth of discharge value, or when the status information of the fuel gauge is the first flag or the second flag, controlling the fuel gauge to switch to a locked state; The locked state is a state that does not support reading / writing of target parameters in the fuel gauge, where the target parameters are parameters related to the algorithm function, the first flag indicates that the fuel gauge cannot respond to the algorithm shutdown instruction, and the second flag indicates that the fuel gauge is in an abnormal state.

12. The method according to claim 1, characterized in that, Sending the algorithm control instruction to the fuel gauge when the remaining SOC reported by the fuel gauge of the battery meets the calibration condition includes: Sending the algorithm control instruction to the fuel gauge when the remaining SOC reported by the fuel gauge of the battery meets the calibration condition and the interval duration since the last calibration of the fuel gauge is greater than the duration threshold.

13. A calibration device for an electricity meter, characterized in that: The device includes: A sending unit, configured to send an algorithm control instruction to the fuel gauge when the remaining SOC reported by the fuel gauge of the battery meets the calibration condition, where the algorithm control instruction is used to trigger the fuel gauge to restart the algorithm function to clear the Coulomb integral of the fuel gauge, and the Coulomb integral is used to determine the SOC of the battery; A determining unit, configured to determine the depth of discharge value of the battery according to the battery voltage and battery current of the battery through the algorithm function of the fuel gauge, and re-determine the initial value of the Coulomb integral according to the depth of discharge value.

14. An electronic device, characterized in that, It includes a memory storing executable program code, and a processor coupled to the memory; wherein, the processor calls the executable program code stored in the memory and executes the method according to any one of claims 1 to 12.

15. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the method according to any one of claims 1 to 12.