Battery electric quantity determination method and device, equipment and medium

By calculating the equivalent internal resistance and working current of the battery, correcting the voltage, and determining the equivalent open circuit voltage of the battery, the problem of low battery power calculation accuracy in the prior art is solved, and a higher battery power calculation accuracy is achieved.

CN119986419APending Publication Date: 2025-05-13ZHU HAI SHI QING FAN KE JI YOU XIAN GONG SI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510116455.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-24
Publication Date
2025-05-13

AI Technical Summary

Technical Problem

The prior art has low accuracy when determining the battery capacity, especially in products such as electric bicycles that require accurate display of power. Both the open circuit voltage method and the Coulomb method have the problem of low calculation accuracy.

Method used

By obtaining the first voltage and the second voltage of the battery, the absolute value of the difference is calculated. If it is greater than the preset value, the operating current of the battery is obtained, the equivalent internal resistance is calculated, and the equivalent open circuit voltage is obtained, and the power is obtained through the preset corresponding relationship matching.

Benefits of technology

This method reduces the impact of battery internal resistance on battery capacity calculation by correcting the voltage, and improves the accuracy of battery capacity calculation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119986419A_ABST
    Figure CN119986419A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a method and device for determining the electric quantity of a battery, equipment and a medium, and relates to the technical field of batteries. The method comprises the following steps: acquiring a first voltage and a second voltage of a battery; if the absolute value of the difference value between the first voltage and the second voltage is greater than a preset value, obtaining the working current of the battery; determining the ratio of the difference value to the working current to obtain the equivalent internal resistance of the battery; calculating according to the equivalent internal resistance, the working current and the first voltage to obtain an equivalent open-circuit voltage of the battery; and matching the equivalent open-circuit voltage with a plurality of preset voltages in a preset corresponding relation to obtain an electric quantity corresponding to the equivalent open-circuit voltage, and taking the electric quantity corresponding to the equivalent open-circuit voltage as the electric quantity of the battery. According to the embodiment of the invention, the accuracy of battery power calculation can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of battery technology, and in particular to a method, device, equipment and medium for determining battery power. Background Art

[0002] At present, there are usually two ways to determine the battery power, one is the open circuit voltage method and the other is the coulomb method. Among them, the open circuit voltage method is widely used in various products. However, the open circuit voltage method is usually not suitable for products that need to accurately display the power. Take an electric bicycle as an example. When the electric bicycle is started, the internal resistance of the battery accounts for the voltage of the battery, which will cause the displayed power to drop instantly at the moment of starting the electric bicycle, and the displayed power will also increase instantly at the moment of charging. There is a problem of low accuracy of the battery power. When the coulomb method is used, if the battery is charged and the battery is in the constant voltage stage, the battery current is no longer a linear change, which will also lead to low accuracy in the calculation of the battery power. Summary of the invention

[0003] The main purpose of the embodiments of the present application is to provide a method, device, equipment and medium for determining battery power, aiming to improve the accuracy of battery power calculation.

[0004] To achieve the above object, a first aspect of an embodiment of the present application provides a method for determining battery power, the method comprising:

[0005] Acquire a first voltage and a second voltage of a battery, wherein the first voltage is the voltage of the battery in a preset time period, and the second voltage is the voltage of the battery in a historical time period before the preset time period;

[0006] If the absolute value of the difference between the first voltage and the second voltage is greater than a preset value, obtaining the operating current of the battery;

[0007] Determine the ratio between the difference and the operating current to obtain an equivalent internal resistance of the battery;

[0008] Calculating according to the equivalent internal resistance, the operating current and the first voltage to obtain an equivalent open circuit voltage of the battery;

[0009] The equivalent open circuit voltage is matched with multiple preset voltages in a preset corresponding relationship to obtain the electric quantity corresponding to the equivalent open circuit voltage, and the electric quantity corresponding to the equivalent open circuit voltage is used as the electric quantity of the battery, wherein the corresponding relationship includes multiple preset voltages and the electric quantity corresponding to each preset voltage.

[0010] In some embodiments, the calculating according to the equivalent internal resistance, the operating current and the first voltage to obtain the equivalent open circuit voltage of the battery includes:

[0011] Multiplying the equivalent internal resistance and the operating current to obtain a compensation voltage of the battery;

[0012] The compensation voltage is added to the first voltage to obtain an equivalent open circuit voltage of the battery.

[0013] In some embodiments, the first voltage or the second voltage is determined according to one of the following:

[0014] The data is collected by an analog-to-digital converter electrically connected to the battery;

[0015] The voltage is calculated based on the voltage sampling value collected by the analog-to-digital converter and the voltage division ratio of the voltage division circuit electrically connected to the battery.

[0016] In some embodiments, the voltage divider circuit includes a first sampling resistor and a second sampling resistor, one end of the battery is electrically connected to the first sampling resistor, and the other end of the battery is electrically connected to the second sampling resistor, and the voltage division ratio of the voltage divider circuit is obtained according to the following process:

[0017] Acquire a first resistance value of the first sampling resistor and a second resistance value of the second sampling resistor;

[0018] Adding the first resistance value and the second resistance value to obtain a sum value;

[0019] The ratio between the sum value and the second resistance value is used as the voltage division ratio.

[0020] In some embodiments, the first voltage or the second voltage is obtained according to the following process:

[0021] Collecting the voltage of the battery at every preset period to obtain N initial voltages;

[0022] Performing an average operation on N1 initial voltages to obtain a first average value;

[0023] An average operation is performed on N2 initial voltages to obtain a second average value, where the collection time of N1 initial voltages is earlier than the collection time of N2 initial voltages, and the sum of N1 and N2 is equal to N;

[0024] If the first average value is equal to the second average value, one of the first average value and the second average value is used as the first voltage or the second voltage.

[0025] In some embodiments, collecting the voltage of the battery at every preset period to obtain N initial voltages includes:

[0026] Acquire the reference voltage of the battery, the target sampling value collected by the analog-to-digital converter, and the voltage division ratio of the voltage division circuit at every preset period, wherein the target sampling value is the voltage sampling value collected by the analog-to-digital converter within the preset time period, or the voltage sampling value collected within the historical time period;

[0027] Determining a divided voltage across the battery according to the reference voltage and the target sampling value;

[0028] The voltage division ratio and the voltage division voltage are multiplied to obtain the initial voltage.

[0029] In some embodiments, when the battery is in a charging state or a discharging state, the preset period is smaller than the preset time period, and the preset period is smaller than the historical time period.

[0030] To achieve the above object, a second aspect of an embodiment of the present application provides a device for determining battery power, the device comprising:

[0031] A first acquisition module, used to acquire a first voltage and a second voltage of a battery, wherein the first voltage is the voltage of the battery in a preset time period, and the second voltage is the voltage of the battery in a historical time period before the preset time period;

[0032] A second acquisition module, configured to acquire the operating current of the battery if the absolute value of the difference between the first voltage and the second voltage is greater than a preset value;

[0033] A first operation module, used for determining a ratio between the difference and the working current to obtain an equivalent internal resistance of the battery;

[0034] a second calculation module, configured to calculate according to the equivalent internal resistance, the operating current and the first voltage to obtain an equivalent open circuit voltage of the battery;

[0035] A determination module is used to match the equivalent open circuit voltage with multiple preset voltages in a preset corresponding relationship to obtain the power corresponding to the equivalent open circuit voltage, and use the power corresponding to the equivalent open circuit voltage as the power of the battery, wherein the corresponding relationship includes multiple preset voltages and the power corresponding to each preset voltage.

[0036] To achieve the above-mentioned purpose, the third aspect of an embodiment of the present application proposes an electronic device, which includes a memory and a processor, the memory stores a computer program, and the processor implements the method for determining the battery power described in the first aspect when executing the computer program.

[0037] To achieve the above objectives, the fourth aspect of an embodiment of the present application proposes a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the method for determining the battery power described in the first aspect above.

[0038] The method, device, equipment and medium for determining the battery power proposed in the present application obtain the first voltage and the second voltage of the battery, and when the absolute value of the difference between the first voltage and the second voltage is greater than the preset value, obtain the working current of the battery, and then determine the ratio between the difference and the working current to obtain the equivalent internal resistance of the battery, and then calculate according to the equivalent internal resistance, the working current and the first voltage to obtain the equivalent open circuit voltage of the battery, and finally match the equivalent open circuit voltage with multiple preset voltages in the preset corresponding relationship to obtain the power corresponding to the equivalent open circuit voltage, and use the power corresponding to the equivalent open circuit voltage as the power of the battery. Through the above steps, the voltage can be corrected according to the equivalent internal resistance and the working current of the battery to obtain the equivalent open circuit voltage of the battery, and then the power of the battery can be determined based on the equivalent open circuit voltage. In this way, the influence of the battery internal resistance on the battery power calculation can be reduced, and the accuracy of the battery power calculation can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0040] Figure 2 is another flow chart of a method for determining battery power provided in an embodiment of the present application;

[0041] Figure 3 is a schematic diagram of the structure of a device for determining battery power provided in an embodiment of the present application;

[0042] Figure 4 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION

[0043] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0044] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0045] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0046] In order to solve the problems of the prior art, the embodiments of the present application provide a method, device, equipment and medium for determining battery power, aiming to improve the accuracy of battery power calculation.

[0047] The battery power determination method, device, equipment and medium provided in the embodiments of the present application are specifically described through the following embodiments. First, the battery power determination method in the embodiments of the present application is described.

[0048] The method for determining the battery power provided in the embodiment of the present application relates to the field of battery technology. The method for determining the battery power provided in the embodiment of the present application can be applied to a terminal, can be applied to a server side, or can be software running in a terminal or a server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or can be configured as a server cluster or a distributed system composed of multiple physical servers, or can be configured as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution networks, and big data and artificial intelligence platforms; the software can be an application that implements the method for determining the battery power, etc., but is not limited to the above forms.

[0049] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0050] Figure 1 The method for determining the battery power provided by the embodiment of the present application is a flow chart. The method for determining the battery power provided by the embodiment of the present application can be applied to electronic devices. Figure 1 The method may include but is not limited to steps 101 to 105.

[0051] Step 101 : acquiring a first voltage and a second voltage of a battery, wherein the first voltage is the voltage of the battery in a preset time period, and the second voltage is the voltage of the battery in a historical time period before the preset time period.

[0052] The battery may be a lithium battery, an aluminum battery, a lead-acid battery or other batteries. The electronic device may obtain a first voltage and a second voltage of the battery. The first voltage is the voltage of the battery in a preset time period, and the second voltage is the voltage of the battery in a historical time period before the preset time period. When the load of the battery is in a standby state, the current in the circuit is small, and the first voltage and the second voltage may be regarded as constant voltages. When the battery is in a charging state or a discharging state, the first voltage is a non-constant voltage, and the second voltage may be a non-constant voltage or a constant voltage. The preset time period may be determined based on a preset cycle. For example, if the preset cycle is 10 milliseconds, in order to improve the reliability of the first voltage, the first voltage may be determined based on data collected in 10 preset cycles, that is, the preset time period may be a time period from the current moment to 100 milliseconds before the current moment. The current moment is the moment when the battery power starts to be calculated. The historical time period is a time period before the preset time period. The duration of the historical time period may be the same as or different from the duration of the preset time period, which is not limited here.

[0053] Step 102: If the absolute value of the difference between the first voltage and the second voltage is greater than a preset value, the operating current of the battery is obtained.

[0054] The electronic device can determine the difference ΔU between the first voltage and the second voltage, and then determine the absolute value |ΔU| of the difference ΔU. If the absolute value |ΔU| of the difference ΔU is greater than the preset value, it can be determined that the voltage of the battery has changed and the battery power needs to be re-determined. At this time, the electronic device can obtain the working current of the battery. Among them, the preset value can be determined according to the actual situation. For example, the preset value can be 0.01. The working current of the battery can be collected by an operational amplifier module electrically connected to the battery. Specifically, the working current of the battery flows through a smaller sampling resistor (for example, a sampling resistor of milliohm level), and the operational amplifier module can amplify the voltage on the sampling resistor by a certain multiple to obtain the amplified voltage. After adding the amplified voltage to the pre-calibrated bias voltage (for example, 2.5 volts), the output voltage of the operational amplifier module can be obtained. Subsequently, the output voltage is connected to the single-chip microcomputer, and the 12-bit digital-to-analog conversion module of the single-chip microcomputer reads the sampled value corresponding to the output voltage of the operational amplifier module. Finally, based on the following formula (1), the working current of the battery can be determined.

[0055]

[0056] Among them, I is the working current of the battery, ADC is the sampling value corresponding to the output voltage of the operational amplifier module, and V ref is the battery reference voltage, which can be 5 volts, V bias is the bias voltage of the battery, A op is the magnification of the operational amplifier module, for example, it can be 20 times, R sample is the resistance value of the sampling resistor, which may be 0.01 ohm, for example.

[0057] Step 103, determining the ratio between the difference and the operating current to obtain the equivalent internal resistance of the battery.

[0058] After obtaining the difference ΔU between the first voltage and the second voltage and acquiring the working current, the ratio between the difference ΔU and the working current I can be determined to obtain the equivalent internal resistance R of the battery, that is, R=ΔU / I.

[0059] Step 104 , calculating according to the equivalent internal resistance, the operating current and the first voltage to obtain an equivalent open circuit voltage of the battery.

[0060] According to the equivalent internal resistance, the working current and the first voltage, the equivalent open circuit voltage of the battery can be calculated. It is understandable that during the operation of the circuit, due to the internal resistance of the battery, there is a certain difference between the voltage across the battery collected and the actual circuit open circuit voltage. Therefore, it is necessary to compensate the collected first voltage to obtain the actual circuit open circuit voltage, that is, the equivalent open circuit voltage. Exemplarily, the equivalent internal resistance and the working current can be multiplied to obtain the compensation voltage of the battery, and the compensation voltage can be added to the first voltage to obtain the equivalent open circuit voltage of the battery.

[0061] Step 105, matching the equivalent open circuit voltage with a plurality of preset voltages in a preset corresponding relationship to obtain the electric quantity corresponding to the equivalent open circuit voltage, and using the electric quantity corresponding to the equivalent open circuit voltage as the electric quantity of the battery, wherein the corresponding relationship includes a plurality of preset voltages and the electric quantity corresponding to each preset voltage.

[0062] After obtaining the equivalent open circuit voltage, the equivalent open circuit voltage can be matched with multiple preset voltages in the preset corresponding relationship to obtain the electric quantity corresponding to the equivalent open circuit voltage. The electric quantity is in the form of a percentage, and its value range is 0 to 100%. Among them, the corresponding relationship can be calibrated in advance through experiments. In other words, the voltage corresponding to each electric quantity can be measured, and the voltage corresponding to each electric quantity can be used as the preset voltage. In this way, a corresponding relationship including multiple preset voltages and the electric quantity corresponding to each preset voltage can be obtained. In this way, the electric quantity corresponding to the equivalent open circuit voltage can be used as the electric quantity of the battery, thereby obtaining the electric quantity of the battery. It should be noted that the electric quantity of the battery in the embodiment of the present application refers to the remaining electric quantity of the battery.

[0063] Steps 101 to 105 shown in the embodiment of the present application are obtained by obtaining the first voltage and the second voltage of the battery, and when the absolute value of the difference between the first voltage and the second voltage is greater than a preset value, obtaining the working current of the battery, and then determining the ratio between the difference and the working current to obtain the equivalent internal resistance of the battery, and then calculating according to the equivalent internal resistance, the working current and the first voltage to obtain the equivalent open circuit voltage of the battery, and finally matching the equivalent open circuit voltage with a plurality of preset voltages in a preset corresponding relationship to obtain the electric quantity corresponding to the equivalent open circuit voltage, and taking the electric quantity corresponding to the equivalent open circuit voltage as the electric quantity of the battery. Through the above steps, the voltage can be corrected according to the equivalent internal resistance and the working current of the battery to obtain the equivalent open circuit voltage of the battery, and then the electric quantity of the battery can be determined based on the equivalent open circuit voltage. In this way, the influence of the internal resistance of the battery on the calculation of the battery electric quantity can be reduced, and the accuracy of the calculation of the battery electric quantity can be improved.

[0064] In some embodiments, the first voltage or the second voltage is determined according to one of the following:

[0065] The data is collected by an analog-to-digital converter electrically connected to the battery;

[0066] The voltage is calculated based on the voltage sampling value collected by the analog-to-digital converter and the voltage division ratio of the voltage division circuit electrically connected to the battery.

[0067] The first voltage or the second voltage can be obtained in a variety of ways. When the analog-to-digital converter has an internal reference voltage source or a pin that supports measuring voltage, the first voltage or the second voltage can be directly collected through the analog-to-digital converter electrically connected to the battery. When the analog-to-digital converter does not have the function of directly collecting voltage, in order to protect the analog-to-digital converter, a voltage divider circuit can be set between the analog-to-digital converter and the battery. At this time, the first voltage or the second voltage can be calculated based on the voltage sampling value collected by the analog-to-digital converter and the voltage divider ratio of the voltage divider circuit electrically connected to the battery. The first voltage or the second voltage can be obtained by any of the above two methods, so that the battery power can be determined based on the first voltage and the second voltage.

[0068] In some embodiments, the voltage divider circuit includes a first sampling resistor and a second sampling resistor, one end of the battery is electrically connected to the first sampling resistor, and the other end of the battery is electrically connected to the second sampling resistor, and the voltage division ratio of the voltage divider circuit is obtained according to the following process:

[0069] Acquire a first resistance value of the first sampling resistor and a second resistance value of the second sampling resistor;

[0070] Adding the first resistance value and the second resistance value to obtain a sum value;

[0071] The ratio between the sum value and the second resistance value is used as the voltage division ratio.

[0072] Before adopting the method of calculating the first voltage or the second voltage according to the voltage sampling value and the voltage division ratio of the voltage division circuit, the voltage division ratio of the voltage division circuit can be determined. The voltage division circuit includes a first sampling resistor and a second sampling resistor, one end of the battery is electrically connected to the first sampling resistor, and the other end of the battery is electrically connected to the second sampling resistor. The electronic device can obtain the first resistance value R1 of the first sampling resistor and the second resistance value R2 of the second sampling resistor, and add the first resistance value R1 to the second resistance value R2 to obtain the sum of the first resistance value R1 and the second resistance value R2, and then use the ratio between the sum and the second resistance value R2 as the voltage division ratio, thereby determining the voltage division ratio of the voltage division circuit, so that the electronic device can subsequently calculate the first voltage or the second voltage according to the voltage sampling value and the voltage division ratio of the voltage division circuit.

[0073] In some embodiments, the first voltage or the second voltage is obtained according to the following process:

[0074] Collecting the voltage of the battery at every preset period to obtain N initial voltages;

[0075] Performing an average operation on N1 initial voltages to obtain a first average value;

[0076] An average operation is performed on N2 initial voltages to obtain a second average value, where the collection time of N1 initial voltages is earlier than the collection time of N2 initial voltages, and the sum of N1 and N2 is equal to N;

[0077] If the first average value is equal to the second average value, one of the first average value and the second average value is used as the first voltage or the second voltage.

[0078] The first voltage and the second voltage both refer to voltages that maintain a fixed value for a period of time. Therefore, when determining the first voltage or the second voltage, the voltage of the battery can be collected every preset period, and after N preset periods, N initial voltages can be obtained. The preset period can be 10 milliseconds. Subsequently, the N1 initial voltages can be averaged to obtain a first average value, and the N2 initial voltages can be averaged to obtain a second average value. The collection time of the N1 initial voltages is earlier than the collection time of the N2 initial voltages, and the sum of N1 and N2 is equal to N. N1 and N2 can be the same, for example, both are 5, or, according to actual conditions, N1 and N2 can also take different values. After obtaining the first average value and the second average value, if the first average value and the second average value are equal, it can be determined that the voltage is constant, so one of the first average value and the second average value can be used as the first voltage or the second voltage. In this way, the first voltage or the second voltage can be obtained, which is convenient for determining the battery power based on the first voltage and the second voltage.

[0079] In some embodiments, collecting the voltage of the battery at every preset period to obtain N initial voltages includes:

[0080] Acquire the reference voltage of the battery, the target sampling value collected by the analog-to-digital converter, and the voltage division ratio of the voltage division circuit at every preset period, wherein the target sampling value is the voltage sampling value collected by the analog-to-digital converter within the preset time period, or the voltage sampling value collected within the historical time period;

[0081] Determining a divided voltage across the battery according to the reference voltage and the target sampling value;

[0082] The voltage division ratio and the voltage division voltage are multiplied to obtain the initial voltage.

[0083] Since the target sampling value collected by the analog-to-digital converter is a digital value, it is necessary to convert the target sampling value collected by the analog-to-digital converter, and then determine the initial voltage according to the converted voltage value. Specifically, every preset period (for example, 10 milliseconds), the reference voltage of the battery, the target sampling value collected by the analog-to-digital converter, and the voltage division ratio of the voltage divider circuit can be obtained. Among them, the reference voltage can be predetermined, for example, the reference voltage can be 5 volts. The voltage division ratio is determined according to the first resistance value R1 of the first sampling resistor and the second resistance value R2 of the second sampling resistor in the voltage divider circuit. It can be understood that when calculating the first voltage, the target sampling value is the voltage sampling value collected by the analog-to-digital converter within a preset time period, and when calculating the second voltage, the target sampling value is the voltage sampling value collected by the analog-to-digital converter within a historical time period.

[0084] According to the reference voltage and the target sampling value, the divided voltage at both ends of the battery can be determined. The divided voltage satisfies the following formula (2):

[0085] V b =ADC voltage *V ref / 4095; (2)

[0086] Among them, V b is the divided voltage, ADC voltage is the target sampling value, V ref is the reference voltage.

[0087] Then, by multiplying the voltage division ratio and the voltage division voltage, the initial voltage can be obtained. The initial voltage satisfies the following formula (3):

[0088] U=V b *(R1+R2) / R2=ADC voltage *V ref *(R1+R2) / (R2*4095); (3)

[0089] It should be noted that when the target sampling value is the voltage sampling value collected by the analog-to-digital converter within a preset time period, the calculated initial voltage is used to determine the first voltage, and when the target sampling value is the voltage sampling value collected by the analog-to-digital converter within a historical time period, the calculated initial voltage is used to determine the second voltage. In this way, the initial voltage can be obtained to obtain the first voltage or the second voltage based on the initial voltage.

[0090] In some embodiments, when the battery is in a charging state or a discharging state, the preset period is smaller than the preset time period, and the preset period is smaller than the historical time period.

[0091] When the battery is in a charging state or a discharging state, in order to improve the reliability of the first voltage and the second voltage, the preset period is less than the preset time period, and the preset period is less than the historical time period. In addition, when the battery is powered on for the first time, in order to quickly determine the battery power when the battery is powered on, the voltage sampling value collected by the analog-to-digital converter can be directly converted to obtain the equivalent open-circuit voltage of the battery, and then the battery power is determined, without having to obtain the first voltage and the second voltage over a long period of time, and determine the power based on the first voltage and the second voltage. At a certain moment after the battery is powered on for the first time, if the power needs to be determined again, the equivalent open-circuit voltage obtained when the battery is powered on for the first time will be used as the second voltage to determine the updated power of the battery. In this case, the historical time period can be less than or equal to the preset period, or greater than the preset period.

[0092] In some embodiments, the calculating according to the equivalent internal resistance, the operating current and the first voltage to obtain the equivalent open circuit voltage of the battery includes:

[0093] Multiplying the equivalent internal resistance and the operating current to obtain a compensation voltage of the battery;

[0094] The compensation voltage is added to the first voltage to obtain an equivalent open circuit voltage of the battery.

[0095] The equivalent open circuit voltage of the battery can be calculated based on the equivalent internal resistance, the working current and the first voltage. Specifically, the equivalent internal resistance and the working current can be multiplied to obtain the compensation voltage of the battery, and then the compensation voltage is added to the first voltage to obtain the equivalent open circuit voltage of the battery, that is, the equivalent open circuit voltage U open =U+RI, where U open is the equivalent open circuit voltage, U is the first voltage, R is the equivalent internal resistance, and I is the operating current. In this way, the electronic device can determine the battery power according to the equivalent open circuit voltage and the preset corresponding relationship, thereby improving the accuracy of battery power calculation.

[0096] Figure 2 is another flow chart of the method for determining the battery power provided in the embodiment of the present application, please refer to Figure 2 The following is an example of a method for determining the battery power provided in an embodiment of the present application. The method for determining the battery power includes the following steps:

[0097] Step 1: After the battery is powered on for the first time, obtain the current equivalent open circuit voltage of the battery;

[0098] Step 2, determining the battery capacity when it is powered on for the first time based on the current equivalent open circuit voltage of the battery;

[0099] Step 3, obtaining a first voltage and a second voltage, and determining a difference between the first voltage and the second voltage;

[0100] Step 4, determine whether the difference is positive, if so, proceed to step 6, if not, proceed to step 5;

[0101] Step 5, determining that the battery is in a discharging state;

[0102] Step 6, confirm that the battery is in a charging state;

[0103] Step 7, obtaining the operating current of the battery;

[0104] Step 8, calculating the equivalent internal resistance of the battery according to the difference and the operating current;

[0105] Step 9, calculating the equivalent open circuit voltage in real time;

[0106] Step 10: Determine the battery capacity according to the equivalent open circuit voltage and the preset corresponding relationship.

[0107] Specifically, after the battery is powered on for the first time, it is determined that the load of the battery is in a standby state. At this time, the electronic device can obtain the voltage sampling value collected by the analog-to-digital converter, and calculate the current equivalent open-circuit voltage of the battery according to the voltage sampling value and the voltage division ratio of the voltage divider circuit, and then determine the battery power after the first power-on according to the current equivalent open-circuit voltage of the battery. Subsequently, during the operation of the battery, the first voltage can be obtained through the analog-to-digital converter, that is, the initial voltage of 10 consecutive preset cycles is obtained, and the average value of the initial voltage of the first 5 preset cycles in the 10 consecutive preset cycles is determined to obtain the first average value. At the same time, the average value of the initial voltage of the last 5 preset cycles in the 10 consecutive preset cycles can be determined to obtain the second average value. If the first average value is equal to the second average value, the first average value or the second average value is used as the first voltage. The determination method of the second voltage can refer to the determination method of the first voltage mentioned above. In this way, the difference between the first voltage and the second voltage can be obtained, and it can be determined whether the difference is a positive value. If the difference is a positive value, it can be determined that the battery is in a charging state, and if the difference is a negative value, it can be determined that the battery is in a discharging state. When the difference is greater than 0.01, it can be considered that the battery voltage has changed and the battery power needs to be updated. At this time, the battery operating current I can be obtained and the equivalent internal resistance of the battery can be determined based on R=ΔU / I, where R is the equivalent internal resistance, ΔU is the difference, and I is the operating current. open =U+RI, the equivalent open circuit voltage can be calculated in real time, where U open is the equivalent open circuit voltage, U is the first voltage, R is the equivalent internal resistance, and I is the working current. Finally, according to the equivalent open circuit voltage and the preset corresponding relationship, the amount of electricity corresponding to the equivalent open circuit voltage can be obtained, and the amount of electricity corresponding to the equivalent open circuit voltage is used as the amount of electricity of the battery.

[0108] The method for determining the battery power provided in the embodiment of the present application can solve the problem that the open circuit voltage method in the prior art cannot accurately calculate the real-time voltage, and the current integration method often needs to be implemented by a dedicated power meter chip, which is relatively expensive. While simplifying the process of battery power calculation, the accuracy of battery power calculation is improved.

[0109] Figure 3 This is a schematic diagram of the structure of the device for determining the battery power provided in the embodiment of the present application. Figure 3 The battery power determination device 300 provided in the embodiment of the present application can implement the above-mentioned battery power determination method, and the device 300 includes:

[0110] A first acquisition module 301 is used to acquire a first voltage and a second voltage of a battery, wherein the first voltage is the voltage of the battery in a preset time period, and the second voltage is the voltage of the battery in a historical time period before the preset time period;

[0111] A second acquisition module 302, configured to acquire the operating current of the battery if the absolute value of the difference between the first voltage and the second voltage is greater than a preset value;

[0112] A first operation module 303 is used to determine the ratio between the difference and the working current to obtain an equivalent internal resistance of the battery;

[0113] A second calculation module 304, configured to calculate according to the equivalent internal resistance, the operating current and the first voltage to obtain an equivalent open circuit voltage of the battery;

[0114] The determination module 305 is used to match the equivalent open circuit voltage with multiple preset voltages in a preset corresponding relationship to obtain the power corresponding to the equivalent open circuit voltage, and use the power corresponding to the equivalent open circuit voltage as the power of the battery, wherein the corresponding relationship includes multiple preset voltages and the power corresponding to each preset voltage.

[0115] In some embodiments, the second operation module 304 includes:

[0116] A first operation submodule, used for multiplying the equivalent internal resistance and the working current to obtain a compensation voltage of the battery;

[0117] The second operation submodule is used to add the compensation voltage to the first voltage to obtain an equivalent open circuit voltage of the battery.

[0118] In some embodiments, the first acquisition module 301 includes one of the following:

[0119] A first acquisition submodule, used for acquiring data through an analog-to-digital converter electrically connected to the battery;

[0120] The voltage calculation submodule is used to calculate the voltage according to the voltage sampling value collected by the analog-to-digital converter and the voltage division ratio of the voltage division circuit electrically connected to the battery.

[0121] In some embodiments, the voltage calculation submodule includes:

[0122] A first acquiring unit, configured to acquire a first resistance value of the first sampling resistor and a second resistance value of the second sampling resistor;

[0123] a calculation unit, configured to add the first resistance value and the second resistance value to obtain a sum value;

[0124] The voltage division ratio calculation unit is used to use the ratio between the sum value and the second resistance value as the voltage division ratio.

[0125] In some embodiments, the first acquisition module 301 includes:

[0126] A second acquisition submodule is used to collect voltage of the battery at every preset period to obtain N initial voltages;

[0127] A first average operation submodule, used for performing an average operation on N1 initial voltages to obtain a first average value;

[0128] A second average operation submodule is used to perform an average operation on N2 initial voltages to obtain a second average value, where the collection time of N1 initial voltages is earlier than the collection time of N2 initial voltages, and the sum of N1 and N2 is equal to N;

[0129] A determination submodule is configured to use one of the first average value and the second average value as the first voltage or the second voltage if the first average value and the second average value are equal.

[0130] In some embodiments, the second acquisition submodule includes:

[0131] a second acquisition unit, configured to acquire the reference voltage of the battery, the target sampling value collected by the analog-to-digital converter, and the voltage division ratio of the voltage division circuit at every preset period, wherein the target sampling value is the voltage sampling value collected by the analog-to-digital converter within the preset time period, or the voltage sampling value collected within the historical time period;

[0132] a determination unit, configured to determine a divided voltage across the battery according to the reference voltage and the target sampling value;

[0133] The operation unit is used to multiply the voltage division ratio and the voltage division voltage to obtain the initial voltage.

[0134] In some embodiments, when the battery is in a charging state or a discharging state, the preset cycle is smaller than the preset time period, and the preset cycle is smaller than the historical time period.

[0135] The specific implementation of the device for determining the battery power is substantially the same as the specific implementation of the method for determining the battery power described above, and will not be described in detail herein.

[0136] The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above-mentioned method for determining the battery power when executing the computer program. The electronic device can be any intelligent terminal including a tablet computer, a car computer, etc.

[0137] Figure 4 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. Figure 4 , electronic equipment includes:

[0138] The processor 401 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;

[0139] The memory 402 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 402 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 402, and the processor 401 calls and executes the method for determining the battery power of the embodiment of this application;

[0140] Input / output interface 403, used to implement information input and output;

[0141] Communication interface 404, used to realize communication interaction between the device and other devices, which can be realized through wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WI FI, Bluetooth, etc.);

[0142] Bus 405 , which transmits information between various components of the device (e.g., processor 401 , memory 402 , input / output interface 403 , and communication interface 404 );

[0143] The processor 401 , the memory 402 , the input / output interface 403 and the communication interface 404 are connected to each other in communication within the device via the bus 405 .

[0144] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned method for determining the battery power is implemented.

[0145] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0146] The method, device, equipment and medium for determining the battery power proposed in the present application obtain the first voltage and the second voltage of the battery, and when the absolute value of the difference between the first voltage and the second voltage is greater than the preset value, obtain the working current of the battery, and then determine the ratio between the difference and the working current to obtain the equivalent internal resistance of the battery, and then calculate according to the equivalent internal resistance, the working current and the first voltage to obtain the equivalent open circuit voltage of the battery, and finally match the equivalent open circuit voltage with multiple preset voltages in the preset corresponding relationship to obtain the power corresponding to the equivalent open circuit voltage, and use the power corresponding to the equivalent open circuit voltage as the power of the battery. Through the above steps, the voltage can be corrected according to the equivalent internal resistance and the working current of the battery to obtain the equivalent open circuit voltage of the battery, and then the power of the battery can be determined based on the equivalent open circuit voltage. In this way, the influence of the battery internal resistance on the battery power calculation can be reduced, and the accuracy of the battery power calculation can be improved.

[0147] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0148] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.

[0149] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0150] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.

[0151] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0152] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0153] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

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

[0155] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0156] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, 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, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.

[0157] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.

Claims

1. A method for determining battery power, characterized in that: The method comprises: Acquire a first voltage and a second voltage of a battery, wherein the first voltage is the voltage of the battery in a preset time period, and the second voltage is the voltage of the battery in a historical time period before the preset time period; If the absolute value of the difference between the first voltage and the second voltage is greater than a preset value, obtaining the operating current of the battery; Determine the ratio between the difference and the operating current to obtain an equivalent internal resistance of the battery; Calculating according to the equivalent internal resistance, the operating current and the first voltage to obtain an equivalent open circuit voltage of the battery; The equivalent open circuit voltage is matched with multiple preset voltages in a preset corresponding relationship to obtain the electric quantity corresponding to the equivalent open circuit voltage, and the electric quantity corresponding to the equivalent open circuit voltage is used as the electric quantity of the battery, wherein the corresponding relationship includes multiple preset voltages and the electric quantity corresponding to each preset voltage.

2. The method according to claim 1, characterized in that The calculating according to the equivalent internal resistance, the operating current and the first voltage to obtain the equivalent open circuit voltage of the battery includes: Multiplying the equivalent internal resistance and the operating current to obtain a compensation voltage of the battery; The compensation voltage is added to the first voltage to obtain an equivalent open circuit voltage of the battery.

3. The method according to claim 1, characterized in that The first voltage or the second voltage is determined according to one of the following: The data is collected by an analog-to-digital converter electrically connected to the battery; The voltage is calculated based on the voltage sampling value collected by the analog-to-digital converter and the voltage division ratio of the voltage division circuit electrically connected to the battery.

4. The method according to claim 3, characterized in that The voltage divider circuit includes a first sampling resistor and a second sampling resistor, one end of the battery is electrically connected to the first sampling resistor, and the other end of the battery is electrically connected to the second sampling resistor. The voltage divider ratio of the voltage divider circuit is obtained according to the following process: Acquire a first resistance value of the first sampling resistor and a second resistance value of the second sampling resistor; Adding the first resistance value and the second resistance value to obtain a sum value; The ratio between the sum value and the second resistance value is used as the voltage division ratio.

5. The method according to claim 3, characterized in that: The first voltage or the second voltage is obtained according to the following process: Collecting the voltage of the battery at every preset period to obtain N initial voltages; Performing an average operation on N1 initial voltages to obtain a first average value; An average operation is performed on N2 initial voltages to obtain a second average value, where the collection time of N1 initial voltages is earlier than the collection time of N2 initial voltages, and the sum of N1 and N2 is equal to N; If the first average value is equal to the second average value, one of the first average value and the second average value is used as the first voltage or the second voltage.

6. The method according to claim 5, characterized in that The voltage of the battery is collected at every preset period to obtain N initial voltages, including: Acquire the reference voltage of the battery, the target sampling value collected by the analog-to-digital converter, and the voltage division ratio of the voltage division circuit at every preset period, wherein the target sampling value is the voltage sampling value collected by the analog-to-digital converter within the preset time period, or the voltage sampling value collected within the historical time period; Determining a divided voltage across the battery according to the reference voltage and the target sampling value; The voltage division ratio and the voltage division voltage are multiplied to obtain the initial voltage.

7. The method according to claim 5, characterized in that When the battery is in a charging state or a discharging state, the preset period is shorter than the preset time period, and the preset period is shorter than the historical time period.

8. A device for determining battery power, characterized in that: The device comprises: A first acquisition module, used to acquire a first voltage and a second voltage of a battery, wherein the first voltage is the voltage of the battery in a preset time period, and the second voltage is the voltage of the battery in a historical time period before the preset time period; A second acquisition module, configured to acquire the operating current of the battery if the absolute value of the difference between the first voltage and the second voltage is greater than a preset value; A first operation module, used for determining a ratio between the difference and the working current to obtain an equivalent internal resistance of the battery; a second calculation module, configured to calculate according to the equivalent internal resistance, the operating current and the first voltage to obtain an equivalent open circuit voltage of the battery; A determination module is used to match the equivalent open circuit voltage with multiple preset voltages in a preset corresponding relationship to obtain the power corresponding to the equivalent open circuit voltage, and use the power corresponding to the equivalent open circuit voltage as the power of the battery, wherein the corresponding relationship includes multiple preset voltages and the power corresponding to each preset voltage.

9. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the method for determining the battery power according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for determining the battery power according to any one of claims 1 to 7 is implemented.