Electric quantity determination method and device, computer equipment and storage medium

By acquiring the charging and discharging state and current direction of the lithium battery, and combining it with historical reference states, an adaptive transition algorithm is used to determine the power level from the voltage-power mapping curve. This solves the problem of unstable power level display in existing technologies and achieves high-precision and low-cost power management.

CN122085154APending Publication Date: 2026-05-26MALANSHAN AUDIO & VIDEO LABORATORY
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
MALANSHAN AUDIO & VIDEO LABORATORY
Filing Date
2026-02-26
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

Existing methods for determining lithium battery power rely on expensive hardware and are prone to drastic fluctuations in power display due to voltage hysteresis. There is an urgent need for a solution that balances accuracy, cost, and user experience.

Method used

By acquiring the battery's charging and discharging state and current direction, and combining this with historical reference states, the target mapping curve is determined from the pre-stored voltage-capacity mapping curves. An adaptive transition algorithm is then used to smooth the transition, avoiding voltage hysteresis interference and reducing costs.

Benefits of technology

It achieves high-precision power determination and stable display, avoids the effects of voltage hysteresis and battery aging and degradation, and reduces the cost of power determination.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122085154A_ABST
    Figure CN122085154A_ABST
Patent Text Reader

Abstract

The invention provides an electric quantity determination method and device, computer equipment and a storage medium, and relates to the technical field of batteries, and the method comprises the steps: obtaining a charging and discharging state, a charging and discharging current direction and a historical reference state of a to-be-detected battery; determining a target mapping curve from a pre-stored charging voltage electric quantity mapping curve and a pre-stored discharging voltage electric quantity mapping curve according to the charging and discharging state, the charging and discharging current direction and a historical reference state; obtaining the current charging and discharging voltage of the to-be-detected battery, and determining the basic electric quantity value of the to-be-detected battery based on the target mapping curve; if the charging and discharging state, the charging and discharging current direction and the current charging and discharging voltage do not meet the preset triggering condition, determining the basic electric quantity value as a display electric quantity value of the to-be-detected battery; and if yes, performing smooth transition on the basic electric quantity value by adopting a self-adaptive transition algorithm, and determining the transited basic electric quantity value as the display electric quantity value of the to-be-detected battery. The power determination cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of battery technology, and more specifically, to a method, apparatus, computer device, and storage medium for determining battery capacity. Background Technology

[0002] Lithium batteries are widely used in consumer electronics, IoT devices and other fields due to their advantages such as high energy density and long cycle life. The accurate estimation of the remaining battery capacity (State of Charge, SOC) directly affects the user experience and the safety of device use.

[0003] Existing methods for determining lithium battery power mainly rely on hardware such as fuel gauge chips, which are costly, require complex calibration configurations, and are prone to drastic fluctuations in power display during charge-discharge switching due to voltage hysteresis characteristics. Therefore, there is an urgent need for a lithium battery power management solution that can balance power determination accuracy, cost control, and a good user experience. Summary of the Invention

[0004] In view of the above, the purpose of this application is to overcome the shortcomings of the prior art and provide a method, apparatus, computer device, and storage medium for determining electrical charge. This application provides the following technical solution: In a first aspect, this application provides a method for determining battery power, the method comprising: Obtain the charge / discharge state, charge / discharge current direction, and historical reference state corresponding to the charge / discharge state and charge / discharge current direction of the battery under test; Based on the charging and discharging state, the charging and discharging current direction, and the historical reference state, the target mapping curve is determined from the pre-stored charging voltage-to-energy mapping curve and discharging voltage-to-energy mapping curve. Obtain the current charge / discharge voltage of the battery under test, and determine the basic capacity value of the battery under test based on the target mapping curve; Determine whether the charging / discharging state, the direction of the charging / discharging current, and the current charging / discharging voltage meet the preset trigger conditions. If not, determine the basic power value as the displayed power value of the battery under test. If the conditions are met, an adaptive transition algorithm is used to smoothly transition the base battery value, and the transitioned base battery value is determined as the displayed battery value of the battery under test.

[0005] In one embodiment, before determining the target mapping curve from pre-stored charging voltage-to-charge mapping curves and discharging voltage-to-charge mapping curves based on the charging / discharging state, the charging / discharging current direction, and the historical reference state, the method further includes: Obtain the charging and discharging test datasets of the battery under test; Multiple key charging data points are extracted from the charging experiment dataset and multiple key discharging data points are extracted from the discharging experiment dataset using the feature point extraction method. By fitting the key charging data points, the charging voltage-to-power mapping curve is obtained; by fitting the key discharging data points, the discharging voltage-to-power mapping curve is obtained.

[0006] In one embodiment, determining the target mapping curve from pre-stored charging voltage-to-charge mapping curves and discharging voltage-to-charge mapping curves based on the charging / discharging state, the charging / discharging current direction, and the historical reference state includes: Determine the charge / discharge weights based on the charge / discharge states; The current direction weight is determined based on the direction of the charging and discharging current; The weights of the historical reference states are determined based on the historical reference states. Obtain preset charging / discharging weight ratios, current direction weight ratios, and historical reference state weight ratios; and determine a weighted decision value based on the charging / discharging weight ratios, current direction weight ratios, historical reference state weight ratios, the charging / discharging weights, the current direction weights, and the historical reference state weights. Based on the weighted decision value, the target mapping curve is determined from the pre-stored charging voltage-to-power mapping curve and discharging voltage-to-power mapping curve.

[0007] In one embodiment, determining whether the charging / discharging state, the direction of the charging / discharging current, and the current charging / discharging voltage meet a preset trigger condition includes: If the charging / discharging state changes, or the direction of the charging / discharging current changes, or the change in the current charging / discharging voltage exceeds a preset amplitude threshold and the duration exceeds a preset jitter time, then the charging / discharging state, the direction of the charging / discharging current, and the current charging / discharging voltage are determined to meet the preset triggering conditions.

[0008] In one embodiment, the step of using an adaptive transition algorithm to smoothly transition the base charge value includes: The transition factors for the slow-in stage, the constant-speed stage, and the slow-out stage are calculated using a piecewise S-shaped function. Based on the transition factors for the slow-in stage, the constant-speed stage, and the slow-out stage, and the basic energy value, the basic energy value after the transition is determined. The formula for calculating the transition factor in the gradual entry phase is as follows:

[0009] The formula for calculating the transition factor during the uniform velocity phase is as follows:

[0010] The formula for calculating the transition factor in the gradual exit phase is as follows:

[0011] In the formula, This represents the transition factor for the gradual entry phase. This represents the transition factor during the uniform velocity phase. This represents the transition factor for the gradual exit phase. Indicates the current transition progress. This indicates the preset steepness factor. This indicates the preset steepness factor.

[0012] In one embodiment, the method further includes: When the charging / discharging state changes from a discharging state to a charging state, and the current charging / discharging voltage is detected to be rising, and the base charge value is lower than the current charge display value, the battery under test is controlled to enter the hysteresis avoidance mode. In the hysteresis avoidance mode, the current power display value is locked as the transition starting point and temporary target, and the current value in the charging state is integrated by coulomb at a preset ratio to slowly increase the current power display value until the base power value coincides with the current power display value, and then the hysteresis avoidance mode is exited.

[0013] In one embodiment, the method further includes: Based on the cumulative discharge capacity and ambient temperature data of the battery under test, the capacity decay index is calculated, and the capacity decay index is used to compensate for the base capacity value or the base capacity value after transition, and the displayed capacity value of the battery under test is output.

[0014] Secondly, this application provides a power determination device, the device comprising: The data acquisition module is used to acquire the charging and discharging state, the direction of charging and discharging current, and the historical reference state corresponding to the charging and discharging state and the direction of charging and discharging current of the battery under test. The curve determination module is used to determine the target mapping curve from the pre-stored charging voltage-to-power mapping curve and discharging voltage-to-power mapping curve based on the charging and discharging state, the charging and discharging current direction, and the historical reference state. The power determination module is used to obtain the current charge and discharge voltage of the battery under test and determine the basic power value of the battery under test based on the target mapping curve. The judgment module is used to determine whether the charging and discharging state, the direction of the charging and discharging current, and the current charging and discharging voltage meet the preset trigger conditions. If they do not meet the conditions, the basic power value is determined as the displayed power value of the battery under test. If they meet the conditions, an adaptive transition algorithm is used to smoothly transition the basic power value, and the transitioned basic power value is determined as the displayed power value of the battery under test.

[0015] Thirdly, this application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the computer program executes the power determination method described in the first aspect when it is run on the processor.

[0016] Fourthly, this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the power determination method described in the first aspect.

[0017] This application achieves high-precision determination and stable display of battery power without the need for dedicated hardware, avoiding interference from voltage hysteresis and battery aging and degradation, and reducing the cost of power determination.

[0018] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0019] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 A flowchart of a power determination method provided in an embodiment of this application is shown; Figure 2 A schematic diagram of the power determination device provided in an embodiment of this application is shown; Figure 3 A schematic diagram of the structure of a computer device provided in an embodiment of this application is shown.

[0021] Explanation of key component symbols: 200 - Power consumption determination device; 210 - Data acquisition module; 220 - Curve determination module; 230 - Power consumption determination module; 240 - Judgment module; 300 - Computer equipment; 301 - Transceiver; 302 - Processor; 303 - Memory. Detailed Implementation

[0022] Embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.

[0023] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.

[0024] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein in the template description is for the purpose of describing particular embodiments only and is not intended to limit the invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.

[0025] Example 1 Existing methods for determining battery level primarily rely on dedicated fuel gauge chips, which are costly in terms of hardware. Furthermore, due to the battery's voltage hysteresis effect, the displayed battery level will fluctuate drastically when the battery's state of charge / discharge changes. For more information, please refer to [link to relevant documentation]. Figure 1 This application provides a method for determining battery power, the method including steps S110 to S150.

[0026] Step S110: Obtain the charge / discharge state, charge / discharge current direction, and historical reference state corresponding to the charge / discharge state and charge / discharge current direction of the battery under test.

[0027] In this embodiment, the charging and discharging current data of the battery under test is acquired through the standard analog-to-digital converter (ADC) interface of the microcontroller unit (MCU). The charging and discharging current direction is identified by a current direction sensing algorithm (positive current for charging, negative current for discharging). The current charging and discharging state of the battery under test is determined by a state recognition engine. At the same time, the relevant records of the recent charging and discharging state and charging and discharging current direction of the battery under test are retrieved as historical reference states. The acquisition of charging and discharging current data and charging and discharging state is combined with sliding window mean filtering to suppress noise and ensure the accuracy of the acquired data.

[0028] Step S120: Determine the target mapping curve from the pre-stored charging voltage-to-power mapping curve and discharging voltage-to-power mapping curve based on the charging / discharging state, the charging / discharging current direction, and the historical reference state.

[0029] Based on the charging voltage-to-capacity mapping curve, the capacity of the battery under test at different charging voltages can be determined; based on the discharging voltage-to-capacity mapping curve, the capacity of the battery under test at different discharging voltages can be determined.

[0030] To determine the charging voltage-to-capacity mapping curve and the discharging voltage-to-capacity mapping curve, before determining the target mapping curve from pre-stored charging voltage-to-capacity mapping curves based on the charging / discharging state, the charging / discharging current direction, and the historical reference state, the method further includes: acquiring the charging experiment dataset and the discharging experiment dataset of the battery under test; extracting multiple key charging data points from the charging experiment dataset and multiple key discharging data points from the discharging experiment dataset using a feature point extraction method; fitting each of the key charging data points to obtain the charging voltage-to-capacity mapping curve, and fitting each of the key discharging data points to obtain the discharging voltage-to-capacity mapping curve.

[0031] Multiple key charging data points were determined from the charging experiment dataset and multiple key discharging data points were determined from the discharging experiment dataset using feature extraction. After removing invalid and redundant data, curve fitting was performed on each key charging data point to obtain a charging voltage-to-capacity mapping curve that conforms to the charging characteristics of the battery under test. Similarly, curve fitting was performed on each key discharging data point to obtain a discharging voltage-to-capacity mapping curve that conforms to the discharging characteristics of the battery under test.

[0032] It should be noted that during the fitting process, for the charging voltage-to-charge mapping curve, the characteristics of the constant voltage stage are optimized to accurately reflect the changes in charge at the end of charging; for the discharging voltage-to-charge mapping curve, the identification of the plateau region is strengthened to ensure the accuracy of charge determination during the smooth discharge voltage stage.

[0033] It is understandable that separate charging voltage-capacity mapping curves and discharging voltage-capacity mapping curves are constructed for different stages of the charging and discharging of the battery under test, avoiding the problem that a single voltage curve cannot adapt to the battery voltage hysteresis characteristics. Moreover, the mapping curve construction and capacity determination process based on pure software algorithms do not rely on hardware chips, reducing costs and providing greater versatility and portability for different battery specifications.

[0034] The step of determining the target mapping curve from pre-stored charging voltage-to-power mapping curves and discharging voltage-to-power mapping curves based on the charging / discharging state, the charging / discharging current direction, and the historical reference state includes: determining charging / discharging weights based on the charging / discharging state; determining current direction weights based on the charging / discharging current direction; and determining historical reference state weights based on the historical reference state. Obtain preset charging / discharging weight ratios, current direction weight ratios, and historical reference state weight ratios. Determine a weighted decision value based on the charging / discharging weight ratios, current direction weight ratios, historical reference state weight ratios, charging / discharging weights, current direction weights, and historical reference state weights. Determine a target mapping curve from pre-stored charging voltage-to-energy mapping curves and discharging voltage-to-energy mapping curves based on the weighted decision value.

[0035] Different weighting ratios are preset for charge / discharge state, charge / discharge current direction, and historical reference state, such as 50% for charge / discharge current direction, 30% for charge / discharge state, and 20% for historical reference state. Based on these ratios, the weight values ​​corresponding to different dimensions can be calculated to obtain a comprehensive weighted decision value. Finally, based on this weighted decision value, a target mapping curve suitable for the current operating state of the battery under test is determined from the charging voltage-capacity mapping curve and the discharging voltage-capacity mapping curve.

[0036] In addition, it should be noted that, in order to avoid frequent curve switching, a state-holding strategy will be adopted for low current states, such as charging and discharging currents from -20mA to +20mA, to keep the current mapping curve unchanged.

[0037] It is understandable that by using weighted decision-making based on multi-dimensional parameters to replace a single state determination, the curve selection deviation caused by brief anomalies during the charging and discharging process can be effectively avoided, thereby improving the accuracy of curve matching.

[0038] Step S130: Obtain the current charge / discharge voltage of the battery under test, and determine the basic capacity value of the battery under test based on the target mapping curve.

[0039] The target mapping curve is either a charging voltage-to-capacity mapping curve or a discharging voltage-to-capacity mapping curve. The current charging / discharging voltage of the battery under test includes either the current charging voltage or the current discharging voltage. If the target mapping curve is a charging voltage-to-capacity mapping curve, the basic capacity of the battery under test can be determined based on the current charging voltage; if the target mapping curve is a discharging voltage-to-capacity mapping curve, the basic capacity of the battery under test can be determined based on the current discharging voltage.

[0040] It is understandable that determining the basic charge level based on the target mapping curve adapted to the current working state of the battery under test, which conforms to the voltage and charge characteristics of the actual charging and discharging of the battery under test, solves the problem of poor adaptability of a single curve and effectively reduces the error in determining the basic charge level.

[0041] Step S140: Determine whether the charging / discharging state, the charging / discharging current direction, and the current charging / discharging voltage meet the preset trigger conditions. If not, determine the basic power value as the displayed power value of the battery under test.

[0042] Determining whether the charging / discharging state, the charging / discharging current direction, and the current charging / discharging voltage meet preset trigger conditions includes: if the charging / discharging state changes, or the charging / discharging current direction changes, or the change in the current charging / discharging voltage exceeds a preset amplitude threshold and the duration exceeds a preset jitter time, then determining that the charging / discharging state, the charging / discharging current direction, and the current charging / discharging voltage meet the preset trigger conditions.

[0043] In this embodiment, it is determined whether the duration of any of the following conditions exceeds a preset jitter time, such as 500ms: the charging / discharging state changes, or the charging / discharging current direction changes, or the change amplitude of the current charging / discharging voltage exceeds a preset amplitude threshold. If any change exceeds the preset jitter time, it is determined that the battery under test has a sudden change in charge level. At this time, an adaptive transition algorithm is needed to smoothly transition the basic charge level.

[0044] If the preset trigger condition is not met, it means that the battery under test is in a stable charging, discharging or resting state, without state switching, voltage change, etc. In this case, there is no need to do any additional processing on the basic charge value. The basic charge value calculated by the target mapping curve is directly determined as the final displayed charge value of the battery under test.

[0045] Understandably, making judgments based on preset trigger conditions and a de-jitter mechanism avoids meaningless processing caused by instantaneous anomalies or minor voltage fluctuations, thus improving the anti-interference capability of the power display. For stable battery operating states, the baseline power value is directly used as the displayed power value, and smoothing processing is only initiated when the state of the battery under test actually changes. This ensures display efficiency when the state is stable, while also allowing for precise transition triggering when needed, balancing the computational efficiency of power calculation with display requirements.

[0046] Step S150: If satisfied, an adaptive transition algorithm is used to smoothly transition the base power value, and the transitioned base power value is determined as the displayed power value of the battery under test.

[0047] The transition factors for the slow-in stage, the constant-speed stage, and the slow-out stage are calculated using a piecewise S-shaped function. Based on the transition factors for the slow-in stage, the constant-speed stage, and the slow-out stage, and the basic energy value, the basic energy value after the transition is determined. The formula for calculating the transition factor in the gradual entry phase is as follows:

[0048] The formula for calculating the transition factor during the uniform velocity phase is as follows:

[0049] The formula for calculating the transition factor in the gradual exit phase is as follows:

[0050] In the formula, This represents the transition factor for the gradual entry phase. This represents the transition factor during the uniform velocity phase. This represents the transition factor for the gradual exit phase. Indicates the current transition progress. This indicates the preset steepness factor. This indicates the preset steepness factor.

[0051] The transition process of the base charge value is divided into three stages: gradual entry, constant speed, and gradual exit. The transition factor is calculated for each stage using corresponding formulas: the gradual entry stage uses an S-shaped formula that includes a cosine function. The base charge value is gradually increased from its initial value; during the constant speed phase, a linear formula is used. This achieves a smooth and linear change in the base energy value; another S-shaped formula is used during the gradual exit phase. This allows the base charge to converge slowly, ultimately combining the current transition progress P and the preset slow-in steepness factor. and preset steepness factor The transition factors of the three stages are combined with the base electricity value to obtain the base electricity value after the transition.

[0052] Based on the piecewise S-shaped function, the smooth transition process avoids the power jump problem that is easy to occur in traditional linear transition, making the power display more smooth and natural when switching between charging and discharging states.

[0053] The preset slow-in steepness factor and preset slow-out steepness factor can be flexibly adjusted according to the voltage hysteresis characteristics of different batteries to adapt to the differences in characteristics of various batteries. It has strong versatility, requires no additional hardware support, and ensures the transition effect while reducing costs.

[0054] In one embodiment, the method further includes: when the charge / discharge state changes from a discharge state to a charging state, and the current charge / discharge voltage is detected to be rising, and the baseline charge value is lower than the current charge display value, controlling the battery under test to enter a hysteresis avoidance mode; in the hysteresis avoidance mode, locking the current charge display value as a transition starting point and temporary target, and performing coulomb integration on the current value in the charging state at a preset ratio to slowly increase the current charge display value until the baseline charge value coincides with the current charge display value, and then exiting the hysteresis avoidance mode.

[0055] When the battery under test switches from discharging to charging and the voltage rises, and the base charge value is lower than the currently displayed charge value, it enters the hysteresis avoidance mode. At this time, the currently displayed charge value is locked as the transition starting point and temporary target. At the same time, the charging current is integrated by coulomb according to a preset ratio (such as 5%) to make the displayed charge value increase slowly until the base charge value and the displayed charge value coincide, and then the hysteresis avoidance mode is exited.

[0056] Understandably, this method effectively solves the problem of inflated battery level display caused by a sudden voltage surge during the initial charging phase after battery discharge, but the actual battery level does not increase synchronously. It avoids the battery level determination deviation caused by voltage hysteresis and ensures the accuracy of the battery level display.

[0057] In one embodiment, the method further includes: calculating a capacity decay index based on the cumulative discharge capacity and ambient temperature data of the battery under test, and using the capacity decay index to compensate for the base charge value or the base charge value after transition, and outputting the displayed charge value of the battery under test.

[0058] In this embodiment, by acquiring the cumulative discharge capacity of the battery under test (total discharge within the statistical usage period) and ambient temperature data, the capacity decay index is calculated by substituting it into a preset capacity decay model. Then, the index is used to proportionally compensate the base power value (or the power value after transition) (e.g., if the decay is 10%, the base power value is multiplied by 0.9). This avoids the impact of battery aging and temperature fluctuations on the actual capacity reduction on the accuracy of power determination, and improves the long-term accuracy of power display.

[0059] The battery power determination method provided in this application acquires the charging / discharging state, charging / discharging current direction, and historical reference states corresponding to the charging / discharging state and charging / discharging current direction of the battery under test. Based on the charging / discharging state, charging / discharging current direction, and historical reference states, a target mapping curve is determined from pre-stored charging voltage-to-power mapping curves and discharging voltage-to-power mapping curves. The current charging / discharging voltage of the battery under test is acquired, and a basic battery power value is determined based on the target mapping curve. It is then determined whether the charging / discharging state, charging / discharging current direction, and current charging / discharging voltage meet preset trigger conditions. If not, the basic battery power value is determined as the displayed battery power value. If it does, an adaptive transition algorithm is used to smoothly transition the basic battery power value, and the transitioned basic battery power value is determined as the displayed battery power value. This method achieves high-precision battery power determination and stable display without the need for dedicated hardware, avoiding interference from voltage hysteresis and battery aging degradation, and reducing the cost of battery power determination.

[0060] Example 2 In addition, please see Figure 2 This application embodiment also provides a power determination device 200, including: The data acquisition module 210 is used to acquire the charging and discharging state, the charging and discharging current direction, and the historical reference state corresponding to the charging and discharging state and the charging and discharging current direction of the battery under test. The curve determination module 220 is used to determine the target mapping curve from the pre-stored charging voltage-to-power mapping curve and discharging voltage-to-power mapping curve based on the charging and discharging state, the charging and discharging current direction, and the historical reference state. The power determination module 230 is used to obtain the current charge and discharge voltage of the battery under test and determine the basic power value of the battery under test based on the target mapping curve. The judgment module 240 is used to determine whether the charging and discharging state, the charging and discharging current direction, and the current charging and discharging voltage meet the preset trigger conditions. If they do not meet the conditions, the basic power value is determined as the displayed power value of the battery under test. If they meet the conditions, an adaptive transition algorithm is used to smoothly transition the basic power value, and the transitioned basic power value is determined as the displayed power value of the battery under test.

[0061] The power determination device 200 provided in this application embodiment can execute the power determination method provided in the above-described method embodiment 1. To avoid repetition, it will not be described again here.

[0062] Example 3 Furthermore, this application provides a computer device including a memory and a processor. The memory stores a computer program, which executes the power determination method provided in Embodiment 1 when running on the processor.

[0063] For details, please see Figure 3 The computer device 300 includes a transceiver 301, a bus interface, and a processor 302. The processor 302 is used to acquire the charging / discharging state, charging / discharging current direction, and historical reference states corresponding to the charging / discharging state and charging / discharging current direction of the battery under test; determine a target mapping curve from pre-stored charging voltage-to-power mapping curves and discharging voltage-to-power mapping curves based on the charging / discharging state, charging / discharging current direction, and historical reference states; acquire the current charging / discharging voltage of the battery under test, and determine the basic power value of the battery under test based on the target mapping curve; determine whether the charging / discharging state, charging / discharging current direction, and current charging / discharging voltage meet preset trigger conditions; if not, determine the basic power value as the displayed power value of the battery under test; if so, use an adaptive transition algorithm to smoothly transition the basic power value, and determine the transitioned basic power value as the displayed power value of the battery under test.

[0064] In this embodiment of the application, the computer device 300 further includes a memory 303. Figure 3 In this context, the bus architecture can include any number of interconnected buses and bridges, specifically linking various circuits together, represented by one or more processors (processor 302) and memory (memory 303). The bus architecture can also link various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. The bus interface provides an interface. The transceiver 301 can be multiple elements, including transmitters and receivers, providing a unit for communicating with various other devices over a transmission medium. The processor 302 is responsible for managing the bus architecture and general processing, and the memory 303 can store data used by the processor 302 during operation.

[0065] The computer device 300 provided in this embodiment of the invention can execute the power determination method provided in the above-described method embodiment 1. To avoid repetition, it will not be described again here.

[0066] Example 4 Furthermore, embodiments of the present invention provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the power determination method provided in Embodiment 1.

[0067] In this embodiment, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc.

[0068] The computer-readable storage medium provided in this embodiment can implement the power determination method provided in Embodiment 1. To avoid repetition, it will not be described again here.

[0069] In all examples shown and described herein, any specific values ​​should be interpreted as merely exemplary and not as limitations; therefore, other examples of exemplary embodiments may have different values.

[0070] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.

[0071] The above-described embodiments are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention.

Claims

1. A method for determining electrical charge, characterized in that, The method includes: Obtain the charge / discharge state, charge / discharge current direction, and historical reference state corresponding to the charge / discharge state and charge / discharge current direction of the battery under test; Based on the charging and discharging state, the charging and discharging current direction, and the historical reference state, the target mapping curve is determined from the pre-stored charging voltage-to-energy mapping curve and discharging voltage-to-energy mapping curve. Obtain the current charge / discharge voltage of the battery under test, and determine the basic capacity value of the battery under test based on the target mapping curve; Determine whether the charging / discharging state, the direction of the charging / discharging current, and the current charging / discharging voltage meet the preset trigger conditions. If not, determine the basic power value as the displayed power value of the battery under test. If the conditions are met, an adaptive transition algorithm is used to smoothly transition the base battery value, and the transitioned base battery value is determined as the displayed battery value of the battery under test.

2. The method for determining the amount of electricity according to claim 1, characterized in that, Before determining the target mapping curve from the pre-stored charging voltage-to-charge mapping curve and discharging voltage-to-charge mapping curve based on the charging / discharging state, the charging / discharging current direction, and the historical reference state, the method further includes: Obtain the charging and discharging test datasets of the battery under test; Multiple key charging data points are extracted from the charging experiment dataset and multiple key discharging data points are extracted from the discharging experiment dataset using the feature point extraction method. By fitting the key charging data points, the charging voltage-to-power mapping curve is obtained; by fitting the key discharging data points, the discharging voltage-to-power mapping curve is obtained.

3. The method for determining the amount of electricity according to claim 1, characterized in that, The step of determining the target mapping curve from pre-stored charging voltage-to-charge mapping curves and discharging voltage-to-charge mapping curves based on the charging / discharging state, the charging / discharging current direction, and the historical reference state includes: Determine the charge / discharge weights based on the charge / discharge states; The current direction weight is determined based on the direction of the charging and discharging current; The weights of the historical reference states are determined based on the historical reference states. Obtain preset charging / discharging weight ratios, current direction weight ratios, and historical reference state weight ratios; and determine a weighted decision value based on the charging / discharging weight ratios, current direction weight ratios, historical reference state weight ratios, the charging / discharging weights, the current direction weights, and the historical reference state weights. Based on the weighted decision value, the target mapping curve is determined from the pre-stored charging voltage-to-power mapping curve and discharging voltage-to-power mapping curve.

4. The method for determining the amount of electricity according to claim 3, characterized in that, The step of determining whether the charging / discharging state, the direction of the charging / discharging current, and the current charging / discharging voltage meet the preset triggering conditions includes: If the charging / discharging state changes, or the direction of the charging / discharging current changes, or the change in the current charging / discharging voltage exceeds a preset amplitude threshold and the duration exceeds a preset jitter time, then the charging / discharging state, the direction of the charging / discharging current, and the current charging / discharging voltage are determined to meet the preset triggering conditions.

5. The method for determining the amount of electricity according to claim 4, characterized in that, The step of using an adaptive transition algorithm to smoothly transition the base battery value includes: The transition factors for the slow-in stage, the constant-speed stage, and the slow-out stage are calculated using a piecewise S-shaped function. Based on the transition factors for the slow-in stage, the constant-speed stage, and the slow-out stage, and the basic energy value, the basic energy value after the transition is determined. The formula for calculating the transition factor in the gradual entry phase is as follows: The formula for calculating the transition factor during the uniform velocity phase is as follows: The formula for calculating the transition factor in the gradual exit phase is as follows: In the formula, This represents the transition factor for the gradual entry phase. This represents the transition factor during the uniform velocity phase. This represents the transition factor for the gradual exit phase. Indicates the current transition progress. This indicates the preset steepness factor. This indicates the preset steepness factor.

6. The method for determining the amount of electricity according to claim 4, characterized in that, The method further includes: When the charging / discharging state changes from a discharging state to a charging state, and the current charging / discharging voltage is detected to be rising, and the base charge value is lower than the current charge display value, the battery under test is controlled to enter the hysteresis avoidance mode. In the hysteresis avoidance mode, the current power display value is locked as the transition starting point and temporary target, and the current value in the charging state is integrated by coulomb at a preset ratio to slowly increase the current power display value until the base power value coincides with the current power display value, and then the hysteresis avoidance mode is exited.

7. The method for determining the amount of electricity according to claim 1, characterized in that, The method further includes: Based on the cumulative discharge capacity and ambient temperature data of the battery under test, the capacity decay index is calculated, and the capacity decay index is used to compensate for the base capacity value or the base capacity value after transition, and the displayed capacity value of the battery under test is output.

8. A power determination device, characterized in that, The device includes: The data acquisition module is used to acquire the charging and discharging state, the direction of charging and discharging current, and the historical reference state corresponding to the charging and discharging state and the direction of charging and discharging current of the battery under test. The curve determination module is used to determine the target mapping curve from the pre-stored charging voltage-to-power mapping curve and discharging voltage-to-power mapping curve based on the charging and discharging state, the charging and discharging current direction, and the historical reference state. The power determination module is used to obtain the current charge and discharge voltage of the battery under test and determine the basic power value of the battery under test based on the target mapping curve. The judgment module is used to determine whether the charging and discharging state, the direction of the charging and discharging current, and the current charging and discharging voltage meet the preset trigger conditions. If they do not meet the conditions, the basic power value is determined as the displayed power value of the battery under test. If they meet the conditions, an adaptive transition algorithm is used to smoothly transition the basic power value, and the transitioned basic power value is determined as the displayed power value of the battery under test.

9. A computer device, characterized in that, It includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the power determination method according to any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the power determination method according to any one of claims 1-7.