A method and device for calculating electric quantity, an electronic device, and a storage medium
By collecting power parameter information in real time and determining the battery open circuit voltage when the battery meter is initialized, the problem of inaccurate battery open circuit voltage acquisition is solved, and the accuracy of power calculation is improved.
Patent Information
- Application Number
- CN202310213113.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-28
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2043-02-28
AI Technical Summary
In the existing electronic equipment power detection methods, inaccurate acquisition of open circuit voltage of the battery leads to inaccurate initial power calculation, affecting the accuracy of power display.
By collecting the power parameter information of the electronic device in real time, when the power meter is reset, it is determined whether the power meter is initialized, and the power parameter information before the power meter is initialized is used to determine the battery open circuit voltage, and the initial power is corrected based on the power parameter information of the set period.
Improve the accuracy of the initial battery power calculation and ensure the accuracy of the battery power display.
Smart Images

Figure CN116298970B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method, device, electronic device and storage medium for calculating power. Background Art
[0002] With the advancement of technology and improvements in living standards, electronic devices are becoming increasingly common in our daily lives, and people's expectations for their use are also increasing. For example, users are becoming increasingly sensitive to the accuracy of battery display on electronic devices. Electronic devices are widely powered by lithium batteries, and battery level monitoring allows users to obtain accurate and timely information on the remaining battery power, avoiding losses caused by sudden shutdowns.
[0003] Currently, electronic devices commonly use methods such as voltage detection or coulomb counter detection to detect battery charge. These detection methods generally require battery parameter modeling. When the battery is powered on, the battery model parameters are loaded. After initializing the fuel gauge, the initial battery charge is estimated based on the current battery open-circuit voltage and battery model parameters. Subsequently, the real-time battery charge is calculated using an algorithm. However, due to inaccurate battery open-circuit voltage acquisition, the fuel gauge's initial charge estimate is often inaccurate, resulting in inaccurate subsequent battery charge display. Summary of the Invention
[0004] The embodiments of the present application provide a method, device, electronic device, and storage medium for calculating power.
[0005] According to a first aspect of the present application, a method for calculating power is provided, the method comprising: collecting power parameter information of an electronic device, the power parameter information including battery voltage and charge and discharge current; detecting power meter reset information of the electronic device; when the power meter reset information indicates that the power meter is reset, judging whether the power meter has written a preset parameter group to complete initialization; determining the battery open circuit voltage of the electronic device based on the power parameter information collected before the power meter completes initialization; determining a first initial power based on the battery open circuit voltage and the battery information of the electronic device; and correcting the first initial power based on the power parameter information of a set time period to determine the initial power of the battery.
[0006] According to an embodiment of the present application, detecting the reset information of the electric meter of the electronic device includes: detecting current electric meter parameters; and determining whether the electric meter is reset based on the current electric meter parameters and preset electric meter parameters.
[0007] According to an embodiment of the present application, determining the open-circuit voltage of the battery of the electronic device according to the power parameter information includes: obtaining the initial battery voltage initially collected by the electronic device from the power parameter information; when the initial battery voltage is greater than the battery protection voltage of the electronic device, using the initial battery voltage as the open-circuit voltage of the battery; when the initial battery voltage is less than or equal to the battery protection voltage, determining the battery protection voltage as the open-circuit voltage of the battery.
[0008] According to an embodiment of the present application, the set time period is from the time when the open-circuit voltage of the battery is first collected to the time when the fuel gauge completes initialization.
[0009] According to an embodiment of the present application, the battery information includes the correspondence information between the battery voltage and the power; correspondingly, determining the first initial power according to the open-circuit voltage of the battery and the battery information includes: matching the open-circuit voltage of the battery with the correspondence information between the battery voltage and the power to obtain the power value corresponding to the open-circuit voltage of the battery, and using the power value as the first initial power.
[0010] According to an embodiment of the present application, the battery information includes the battery parameters and battery characteristics of the battery, and the battery information is obtained by the fuel gauge testing the battery of the electronic device for which the power is calculated this time or a battery of the same model as the battery.
[0011] According to a second aspect of the present application, there is provided a power calculation device, the device includes: a collection module for collecting power parameter information of an electronic device, the power parameter information including battery voltage and current; a detection module for detecting the fuel gauge reset information of the electronic device; a judgment module for judging whether the fuel gauge has completed initialization by writing a preset parameter group when the fuel gauge reset information indicates that the fuel gauge has been reset; a battery open-circuit voltage determination module for determining the open-circuit voltage of the battery of the electronic device according to the power parameter information collected before the fuel gauge completes initialization; a first initial power determination module for determining a first initial power according to the open-circuit voltage of the battery and the battery information of the electronic device; a correction module for correcting the first initial power according to the power parameter information of the set time period to determine the initial battery power.
[0012] According to an embodiment of the present application, the detection module includes: a fuel gauge parameter acquisition sub-module for acquiring the current fuel gauge parameters; a reset judgment sub-module for judging whether the fuel gauge has been reset according to the current fuel gauge parameters and the preset fuel gauge parameters.
[0013] According to a third aspect of the present application, there is provided an electronic device, including:
[0014] at least one processor; and
[0015] a memory communicatively connected to the at least one processor; wherein
[0016] the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method described in this application.
[0017] According to the fourth aspect of this application, a non-transitory computer-readable storage medium storing computer instructions is provided, and the computer instructions are used to cause the computer to execute the method described in this application.
[0018] In the method of the embodiment of this application, by collecting the power parameter information of the electronic device in real time, when it is detected that the fuel gauge resets, it is determined whether the fuel gauge is initialized by judging whether the preset parameter group of the fuel gauge is written completely. When the fuel gauge is initialized, a more accurate open-circuit voltage of the battery is determined according to the power parameter information collected before the fuel gauge is initialized, and the first initial power obtained according to the open-circuit voltage of the battery is corrected according to the power parameter information of the set period, which can effectively improve the accuracy of calculating the initial power of the battery.
[0019] It should be understood that the teachings of this application do not require achieving all the beneficial effects described above. Instead, specific technical solutions can achieve specific technical effects, and other embodiments of this application can also achieve the beneficial effects not mentioned above. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] By referring to the drawings and reading the detailed description below, the above and other objects, features, and advantages of the exemplary embodiments of this application will become easy to understand. In the drawings, several embodiments of this application are shown in an exemplary and non-limiting manner, wherein:
[0021] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts.
[0022] Figure 1 shows a schematic diagram of the voltage detection principle in the prior art;
[0023] Figure 2 shows a schematic diagram of the implementation process of the power calculation method in the embodiment of this application;
[0024] Figure 3 shows a schematic diagram of the implementation process of the fuel gauge reset detection method of the power calculation method in the embodiment of this application;
[0025] Figure 4Shows the schematic implementation process of the battery open-circuit voltage determination method for the battery power calculation method in the embodiments of the present application;
[0026] Figure 5 Shows the schematic diagram of the battery power calculation device in the embodiments of the present application;
[0027] Figure 6 Shows the schematic composition structure diagram of the electronic device in the embodiments of the present application. Detailed implementation manners
[0028] To make the objectives, features, and advantages of the present application more obvious and understandable, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative efforts belong to the scope of protection of the present application.
[0029] In the following description, reference is made to "some embodiments", which describe a subset of all possible embodiments. However, it can be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments, and can be combined with each other without conflict.
[0030] In the following description, the terms "first / second" involved are only used to distinguish similar objects, and do not represent a specific order for the objects. It can be understood that "first / second" can be interchanged with a specific order or sequence when allowed, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.
[0031] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the technical field to which the present application belongs. The terms used herein are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.
[0032] Before further elaborating on the embodiments of the present application, the nouns and terms involved in the embodiments of the present application are described. The nouns and terms involved in the embodiments of the present application are applicable to the following explanations.
[0033] SOC represents the State of Charge, also known as the remaining battery capacity. It represents the ratio of the remaining capacity of the battery after being used for a period of time or left unused for a long time to its fully charged capacity. In this application, it is also used as the initial battery capacity and is usually expressed as a percentage; it is usually represented by one byte, that is, two-digit hexadecimal, with a value range of 0 to 100, meaning the remaining battery capacity is 0% to 100%; when SOC = 0, it means the battery is fully discharged, and when SOC = 1, it means the battery is fully charged.
[0034] OCV represents the Open Circuit Voltage of the battery, which refers to the potential difference between the two poles of the battery when the battery is in an open circuit state and not discharging. Generally, it is the battery voltage measured after the battery is left idle for a period of time. In a real usage scenario, the battery voltage fluctuates during the charging and discharging process of the battery. Therefore, the smaller the charging and discharging current of the battery, the closer the battery voltage is to OCV.
[0035] Figure 1 shows a schematic diagram of the voltage detection principle in the prior art. As Figure 1 shown, the upper curve is the battery voltage (VCELL) curve, and the lower curve is the curve of the current remaining battery capacity (SOC) of the battery. During the entire detection process, a battery voltage of 3.81V can correspond to four situations of the current actual remaining battery capacity of the battery being 2%, 72%, and 50%. Among them, the difference between the maximum value of 72% and the minimum value of 2% in the four situations is as high as 70%. Therefore, the real-time battery voltage cannot accurately reflect the real battery capacity, and only the battery OCV can reflect the battery capacity. However, in the prior art, the real-time battery voltage collected when the fuel gauge initialization is completed is used as the OCV, and the OCV collected in this way has a large gap with the real OCV.
[0036] Therefore, based on the above problems, this application provides a battery capacity calculation method, device, electronic device, and storage medium.
[0037] The following uses specific embodiments to elaborate in detail on the technical solution of this application and how the technical solution of this application solves the above technical problems. These specific embodiments below can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The following will describe the embodiments of this application with reference to the accompanying drawings.
[0038] Figure 2 shows a schematic diagram of the implementation process of the battery capacity calculation method in the embodiments of this application.
[0039] Refer to Figure 2, embodiments of the present application provide a method for calculating power, and the method includes: operation 201, collecting power parameter information of an electronic device, where the power parameter information includes battery voltage and charge and discharge current; operation 202, detecting power meter reset information of the electronic device; operation 203, when the power meter reset information indicates that the power meter is reset, determining whether the power meter has completed initialization by writing a preset parameter group; operation 204, determining the open-circuit voltage of the battery of the electronic device according to the power parameter information collected before the power meter completes initialization; operation 205, determining a first initial power according to the open-circuit voltage of the battery and the battery information of the electronic device; operation 206, correcting the first initial power according to the power parameter information of a set period to determine the initial battery power.
[0040] In operation 201, when the electronic device is started, power parameter information of the electronic device is synchronously and real-time collected for subsequent use, where the power parameter information includes battery voltage and charge and discharge current.
[0041] Specifically, the application scenario of the embodiments of the present application can be when the electronic device is used for the first time or when the battery power of the electronic device is exhausted, resulting in system power-off and recharge restart. It should be noted that the present application does not specifically limit the application scenario, but only provides an exemplary illustration.
[0042] Further, when the application scenario is that the electronic device is used for the first time, in the embodiments of the present application, when the power-on key of the electronic device is pressed and the program is loading the system, real-time sampling of power parameter information such as the battery voltage and charge and discharge current of the electronic device starts.
[0043] When the application scenario is that the battery power of the electronic device is exhausted, resulting in system power-off and recharge restart, in the embodiments of the present application, when the charger is connected and before charging starts, real-time sampling of power parameter information such as the battery voltage and charge and discharge current starts.
[0044] In operation 202, power meter reset information of the electronic device is detected.
[0045] Specifically, the reset of the power meter of the electronic device indicates that the electronic device is used for the first time or the situation where the electronic device is restarted after the battery power is exhausted and the system is powered off. Usually, when the electronic device is used for the first time or when the battery power is exhausted and the system is powered off and then charged and powered on, the battery voltage will jump, resulting in inaccurate OCV collected, and thus inaccurate battery power calculated through OCV. Therefore, during the startup process of the electronic device, power meter reset information of the electronic device is detected, so that it can be determined whether the power meter is reset according to the power meter reset information.
[0046] In operation 203, when the power meter reset information indicates that the power meter is reset, it is determined whether the power meter has completed initialization by writing a preset parameter group.
[0047] Specifically, after the electronic device is started, the fuel gauge enters the initialization phase. The initialization of the fuel gauge may include: determining whether the fuel gauge is reset. In the case of reset, writing a preset parameter group to the fuel gauge. When the writing of the preset parameter group of the fuel gauge is completed, the initialization of the fuel gauge is completed. Among them, if the fuel gauge is not reset during the initialization process of the fuel gauge, the initialization process of the fuel gauge only includes determining whether the fuel gauge is reset. If it is determined that the fuel gauge is not reset, it is directly determined that the initialization of the fuel gauge is completed.
[0048] Furthermore, the preset parameter group of the fuel gauge is the battery information obtained during the process of the fuel gauge testing the battery.
[0049] Specifically, when the battery of the electronic device leaves the factory, the battery or batteries of the same model need to be sent to the manufacturer of the fuel gauge used in the electronic device, and the fuel gauge is used to test the battery to obtain the battery information.
[0050] Specifically, the battery information can be regarded as battery model parameters. The generation process of the battery information can refer to the process of the existing technology fuel gauge establishing a battery model for the battery, which will not be elaborated here. After the fuel gauge completes the initialization, it performs operations such as calculating the battery power. Therefore, in the case of determining that the fuel gauge is reset, the process of writing the preset parameter group is also detected, and it is determined in real time whether the preset parameter group of the fuel gauge is written completely, so as to determine whether the initialization of the fuel gauge is completed.
[0051] In operation 204, according to the power parameter information collected before the fuel gauge completes the initialization, determine the open-circuit voltage of the battery of the electronic device.
[0052] Specifically, by using the power parameter information collected before the fuel gauge completes the initialization to further determine the OCV, the obtained OCV is more accurate. It effectively avoids the problem that the SOC determined by using the battery voltage when the fuel gauge completes the initialization as the OCV is inaccurate.
[0053] In operation 205, according to the open-circuit voltage of the battery and the battery information of the electronic device, determine the first initial battery power.
[0054] Specifically, the battery information is carried when the battery leaves the factory, and the battery information of the same model of battery is the same. By matching the OCV with the battery information, the battery power corresponding to the OCV can be matched from the battery information to obtain the first initial battery power.
[0055] In operation 206, correct the first initial battery power according to the power parameter information of the set time period to determine the initial battery power.
[0056] In the embodiments of the present application, the open-circuit voltage of the battery used is the open-circuit voltage of the battery collected before the fuel gauge completes initialization. However, from the moment when the OCV is collected to the moment when the fuel gauge completes initialization and uses an algorithm to calculate the battery power based on the OCV, the electronic device will consume power during this period. Therefore, after calculating the battery power according to the OCV in the embodiments of the present application, the power consumption during this period is fully considered, that is, the power consumption from when the OCV is collected to when the fuel gauge starts to use the algorithm to calculate the battery power through the OCV, so as to calculate a more accurate initial battery power.
[0057] In the embodiments of the present application, by collecting the power parameter information of the electronic device in real time, when it is detected that the fuel gauge resets, a more accurate open-circuit voltage of the battery can be obtained according to the collected power parameter information, and the first initial power obtained according to the open-circuit voltage of the battery is corrected according to the power parameter information of the set time period, which can effectively improve the accuracy of calculating the initial battery power.
[0058] Figure 3 The figure shows a schematic flowchart of the implementation of the fuel gauge reset detection method for the battery power calculation method in the embodiments of the present application.
[0059] Reference Figure 3 , in an embodiment of the present application, the fuel gauge reset information of the electronic device is detected through the following operations: Operation 301, detecting the current fuel gauge parameters; Operation 302, judging whether the fuel gauge resets according to the current fuel gauge parameters and the preset fuel gauge parameters.
[0060] In Operation 301, the current fuel gauge parameters are detected.
[0061] Specifically, when the fuel gauge in the electronic device resets, the fuel gauge parameters configured in the fuel gauge will all be restored to the preset fuel gauge parameters of the fuel gauge when the device leaves the factory. Therefore, it can be judged whether the fuel gauge resets by the fuel gauge parameters obtained by detecting the fuel gauge parameters of the fuel gauge.
[0062] In Operation 302, it is judged whether the fuel gauge resets by comparing the current fuel gauge parameters with the preset fuel gauge parameters.
[0063] Specifically, by comparing the current actual current fuel gauge parameters of the electronic device with the preset fuel gauge parameters, it can be judged whether the fuel gauge resets by detecting whether the current fuel gauge parameters at the start of the device are the preset fuel gauge parameters of the fuel gauge when the device leaves the factory.
[0064] It should be noted that the present application does not specifically limit the solution for judging whether the fuel gauge resets. As long as it can determine whether the fuel gauge resets, the solution belongs to the protection scope of the present application. For example, judging whether the fuel gauge resets according to the state of the flag bit of the fuel gauge.
[0065] Figure 4 The figure shows a schematic flowchart of the implementation of the battery open-circuit voltage determination method for the battery power calculation method according to an embodiment of the present application.
[0066] Reference Figure 4 , in an embodiment of the present application, the battery open-circuit voltage of the electronic device can be determined through the following operations: Operation 401, obtain the initial battery voltage collected by the electronic device for the first time from the power parameter information; Operation 402, when the initial battery voltage is greater than the battery protection voltage of the electronic device, use the initial battery voltage as the battery open-circuit voltage; Operation 403, when the initial battery voltage is less than or equal to the battery protection voltage, determine the battery protection voltage as the battery open-circuit voltage.
[0067] In Operation 401, obtain the initial battery voltage collected by the electronic device for the first time from the power parameter information.
[0068] Specifically, when the electronic device is started, the system or the fuel gauge of the electronic device collects the battery voltage and charging current of the electronic device in real time. In order to collect a more accurate OCV, the initial battery voltage collected by the electronic device for the first time can be used as the OCV. Therefore, it is first necessary to obtain the initial battery voltage recorded by the electronic device for the first time from the power parameter information.
[0069] In Operation 402, when the initial battery voltage is greater than the battery protection voltage of the electronic device, use the initial battery voltage as the battery open-circuit voltage.
[0070] Specifically, when the initial battery voltage is greater than the battery protection voltage of the electronic device, it can be determined that the electronic device is in the initial use state at this time, that is, the battery is powered and the battery is first installed in the electronic device.
[0071] For the case of the initial use of the electronic device, the existing SOC calculation scheme is that when the electronic device is powered on, when it is powered on to initialize the fuel gauge, the battery voltage is sampled, and the SOC is estimated through the sampled battery voltage.
[0072] However, for the scenario of the initial use of the electronic device, some electronic devices take a long time to power on, and the fuel gauge cannot be initialized at the beginning of the power-on of the electronic device. And the current consumption during the power-on process is large, and the battery voltage of the battery will also have a large fluctuation, resulting in a gap between the collected battery voltage and the true OCV, and the calculated SOC is inaccurate by calculating the SOC through the inaccurate OCV. And the power consumption between the start of the power-on of the electronic device and the start of the operation of the power calculation method is not considered.
[0073] Therefore, for the above scenario, the embodiments of the present application directly use the battery voltage first sampled by the electronic device as the OCV, making the OCV more accurate. Among them, the initial battery voltage first recorded by the electronic device can be regarded as the battery voltage sampled before the power-on key of the electronic device is pressed and the program loads the system.
[0074] In operation 403, when the initial battery voltage is less than or equal to the battery protection voltage, the battery protection voltage is determined as the battery open-circuit voltage.
[0075] Specifically, when the initial battery voltage is less than the battery protection voltage of the electronic device, it can be determined that the current situation of the electronic device is that the system has powered off due to the exhaustion of the battery power of the electronic device and then restarted after charging, that is, the battery is completely out of power, and the electronic device is in the state of charging and powering on when it is powered off.
[0076] For the situation of the electronic device system powering off and restarting, the existing SOC calculation scheme still waits for the electronic device to power on. When the power-on initializes the power measurement, it samples the battery voltage and estimates the SOC through the sampled battery voltage.
[0077] However, for the situation of the electronic device system powering off and restarting due to the exhaustion of the battery power of the electronic device and then charging, the electronic device needs to charge and power on. Generally, an electronic device has a power-on voltage, also known as the battery protection voltage. When the battery voltage reaches the power-on voltage, the power-on behavior starts to be executed. But in the charging scenario, the battery voltage will be pushed relatively high, that is, Figure 1 For example, in the scenario where the battery voltage is 3.81V but the actual battery power is only 2%, if the battery voltage at the time of initializing the power measurement is used to estimate the SOC after the electronic device powers on, the estimated SOC is not accurate.
[0078] Therefore, for the above situation of the electronic device system powering off and restarting, the initial battery voltage obtained by the present application according to the sampled power parameter information can be regarded as the battery voltage sampled without charging after the electronic device is connected to the charger. When the initial battery voltage is less than the battery protection voltage, the embodiments of the present application directly use the battery protection voltage of the battery as the OCV. Generally, the estimated SOC is 0% in this way.
[0079] In an embodiment of the present application, the set time period is from the time when the battery open-circuit voltage is first collected to the time when the power measurement initialization is completed.
[0080] Specifically, for the two scenarios targeted by the above operation 402 and operation 403, the power measurement calculates the SOC when the power measurement initialization is completed. The OCV is obtained when the power measurement initialization is completed. However, before the OCV is obtained, the power is also continuously consumed. Therefore, it is also necessary to consider the power consumption between the time when the battery open-circuit voltage is collected and the completion of the power measurement initialization.
[0081] In an embodiment of the present application, the battery information includes the correspondence information between the battery voltage and the battery power. The battery open-circuit voltage can be matched with the correspondence information between the voltage and the power to obtain the power value corresponding to the battery open-circuit voltage, and the power value is used as the first initial power.
[0082] Specifically, the battery information includes the correspondence information between the battery voltage and the power. Therefore, when the battery open-circuit voltage is determined, the battery open-circuit voltage can be matched with the battery information to find out the power corresponding to the battery open-circuit voltage as the first initial power.
[0083] Furthermore, the correspondence information between the battery voltage and the power can be shown in the form of a data table.
[0084] In an embodiment of the present application, the battery information includes the battery parameters and battery characteristics of the battery. The battery information is obtained by the fuel gauge testing the battery of the electronic device for which the power is calculated this time or a battery of the same model as the battery.
[0085] Specifically, when the battery leaves the factory, the fuel gauge continuously tests the battery according to the battery-related parameters of the electronic device, such as the battery internal resistance, the full charge capacity of the battery, etc., and can test the battery information for adapting to the current battery, and the battery information includes battery parameters, battery characteristics, etc.
[0086] In this embodiment of the present application, the battery information can be shown in the form of battery model parameters. Specifically, the process of the fuel gauge generating the battery model parameters can refer to the process of the fuel gauge performing battery modeling on the battery in the prior art, which will not be elaborated here.
[0087] Figure 5 The schematic diagram of the power calculation device in the embodiment of the present application is shown.
[0088] Based on the above power calculation method, the embodiment of the present application further provides a power calculation device. The device 50 includes: an acquisition module 501 for acquiring the power parameter information of the electronic device, and the power parameter information includes the battery voltage and the charge and discharge current; a detection module 502 for detecting the fuel gauge reset information of the electronic device; a judgment module 503 for judging whether the fuel gauge writes the preset parameter group to complete the initialization when the fuel gauge reset information shows that the fuel gauge is reset; a battery open-circuit voltage determination module 504 for determining the battery open-circuit voltage of the electronic device according to the power parameter information acquired before the fuel gauge completes the initialization; a first initial power determination module 505 for the determination module to determine the first initial power according to the battery open-circuit voltage and the battery information of the electronic device; a correction module 506 for correcting the first initial power according to the power parameter information in the set time period to determine the initial battery power.
[0089] In an embodiment of the present application, the detection module includes: a coulomb counter parameter acquisition sub-module for acquiring current coulomb counter parameters; and a reset determination sub-module for determining whether the coulomb counter has been reset according to the current coulomb counter parameters and preset coulomb counter parameters.
[0090] In an embodiment of the present application, the battery open-circuit voltage determination sub-module includes: an initial battery voltage determination sub-module for acquiring the initial battery voltage first collected by the electronic device from the power parameter information; a first determination sub-module for using the initial battery voltage as the battery open-circuit voltage when the initial battery voltage is greater than the battery protection voltage of the electronic device; and a second determination sub-module for determining the battery protection voltage as the battery open-circuit voltage when the initial battery voltage is less than or equal to the battery protection voltage.
[0091] In an embodiment of the present application, the battery information includes the correspondence information between the battery voltage and the power; correspondingly, the first initial power determination module is used to match the battery open-circuit voltage with the correspondence information between the battery voltage and the power to obtain the power value corresponding to the battery open-circuit voltage, and use the power value as the initial power.
[0092] It should be noted that the description of the device in the embodiments of the present application is similar to the description of the above method embodiments, and has similar beneficial effects to the method embodiments, so it will not be elaborated here. For the technical details not described in the auxiliary driving device provided in the embodiments of the present application, they can be understood according to Figures 1 to 4 the description in
[0093] According to the embodiments of the present application, the present application also provides an electronic device and a non-transitory computer-readable storage medium.
[0094] Figure 6 FIG shows a schematic block diagram of an exemplary electronic device 600 that can be used to implement the embodiments of the present application. The electronic device is intended to represent various forms of digital computers, such as, laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as, personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described herein and / or claimed.
[0095] As Figure 6As shown, the electronic device 600 includes a computing unit 601, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 can also be stored. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 606 is also connected to the bus 604.
[0096] Multiple components in the electronic device 600 are connected to the I / O interface 605, including: an input unit 606, such as a keyboard, a mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a magnetic disk, an optical disc, etc.; and a communication unit 609, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 609 allows the electronic device 600 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0097] The computing unit 601 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 601 include but are not limited to a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 601 executes the various methods and processes described above, such as the power calculation method. For example, in some embodiments, the power calculation method can be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as the storage unit 608. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 600 via the ROM 602 and / or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the computing unit 601, one or more steps of the power calculation method described above can be executed. Alternatively, in other embodiments, the computing unit 601 can be configured to execute the power calculation method in any other appropriate manner (e.g., by means of firmware).
[0098] The various embodiments of the systems and techniques described above in this specification can be implemented in digital electronic circuitry, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on a chip (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which may be a special-purpose or general-purpose programmable processor that receives data and instructions from, and transmits data and instructions to, a storage system, at least one input device, and at least one output device.
[0099] The program code for implementing the methods of the present application can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing device, such that the program codes, when executed by the processor or controller, cause the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code can be executed entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine, or entirely on the remote machine or server.
[0100] In the context of the present application, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0101] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, speech input, or tactile input).
[0102] The systems and techniques described herein can be implemented in a computing system including backend components (e.g., as a data server), or a computing system including middleware components (e.g., an application server), or a computing system including frontend components (e.g., a user computer having a graphical user interface or a web browser through which the user can interact with an implementation of the systems and techniques described herein), or a computing system including any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local area network (LAN), wide area network (WAN), and the Internet.
[0103] A computer system can include a client and a server. The client and the server are generally far from each other and typically interact through a communication network. The client - server relationship is created by computer programs running on respective computers and having a client - server relationship with each other. The server can be a cloud server, or a server of a distributed system, or a server incorporating blockchain.
[0104] It should be understood that various forms of the processes shown above can be used, with steps reordered, added, or deleted. For example, the steps recited in this application can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this application can be achieved, and no limitation is imposed herein.
[0105] The above are only specific implementation manners of this application, but the protection scope of this application is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in this application, and all such changes or substitutions should be covered by the protection scope of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.
Claims
1. A method for calculating electric quantity, characterized in that, The method includes: Collecting power parameter information of an electronic device, where the power parameter information includes battery voltage and charge / discharge current; Detecting the fuel gauge reset information of the electronic device; When the fuel gauge reset information indicates that the fuel gauge has been reset, determining whether the fuel gauge has completed initialization by writing a preset parameter group; Determining the open-circuit voltage of the battery of the electronic device according to the power parameter information collected before the fuel gauge completes initialization; Determining a first initial battery level according to the open-circuit voltage of the battery and the battery information of the electronic device; Correcting the first initial battery level according to the power parameter information within a set time period to determine the initial battery level; Determining the open-circuit voltage of the battery of the electronic device according to the power parameter information collected before the fuel gauge completes initialization, including: Obtaining the initial battery voltage collected for the first time by the electronic device from the power parameter information; When the initial battery voltage is greater than the battery protection voltage of the electronic device, using the initial battery voltage as the open-circuit voltage of the battery; When the initial battery voltage is less than or equal to the battery protection voltage, determining the battery protection voltage as the open-circuit voltage of the battery.
2. The method according to claim 1, characterized in that, The detecting the fuel gauge reset information of the electronic device includes: Detecting the current fuel gauge parameters; Judging whether the fuel gauge has been reset according to the current fuel gauge parameters and the preset fuel gauge parameters.
3. The method according to claim 1, wherein The set time period is the time from when the open-circuit voltage of the battery is first collected to the time when the fuel gauge completes initialization.
4. The method according to claim 1, characterized in that, The battery information includes the correspondence information between battery voltage and battery level; correspondingly, The determining a first initial battery level according to the open-circuit voltage of the battery and the battery information of the electronic device includes: Matching the open-circuit voltage of the battery with the correspondence information between battery voltage and battery level to obtain the battery level value corresponding to the open-circuit voltage of the battery, and using the battery level value as the first initial battery level.
5. The method according to claim 1, wherein The battery information includes the battery parameters and battery characteristics of the battery, and the battery information is obtained by testing the battery of the electronic device for which the battery level is calculated this time or a battery of the same model as the battery.
6. An electric quantity calculation device, characterized in that The device includes: A collecting module, configured to collect power parameter information of an electronic device, where the power parameter information includes battery voltage and charge / discharge current; A detecting module, configured to detect the fuel gauge reset information of the electronic device; A judging module, configured to judge whether the fuel gauge has completed initialization by writing a preset parameter group when the fuel gauge reset information indicates that the fuel gauge has been reset; An open-circuit voltage determining module for the battery, configured to determine the open-circuit voltage of the battery of the electronic device according to the power parameter information collected before the fuel gauge completes initialization; A first initial battery level determining module, configured to determine a first initial battery level according to the open-circuit voltage of the battery and the battery information of the electronic device; A correcting module, configured to correct the first initial battery level according to the power parameter information within a set time period to determine the initial battery level; Wherein, the open-circuit voltage determining module for the battery includes: An initial battery voltage determination sub-module, configured to obtain an initial battery voltage initially collected by the electronic device from the power parameter information; A first determination sub-module, configured to use the initial battery voltage as the battery open-circuit voltage when the initial battery voltage is greater than the battery protection voltage of the electronic device; A second determination sub-module, configured to determine the battery protection voltage as the battery open-circuit voltage when the initial battery voltage is less than or equal to the battery protection voltage.
7. The device according to claim 6, characterized in that The detection module includes: A fuel gauge parameter acquisition sub-module, configured to acquire current fuel gauge parameters; A reset judgment sub-module, configured to judge whether the fuel gauge has been reset according to the current fuel gauge parameters and the preset fuel gauge parameters.
8. An electronic device, characterized in that, Including: At least one processor; And A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method according to any one of claims 1-5.
9. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause a computer to execute the method according to any one of claims 1-5.
Citation Information
Patent Citations
Computing method for battery electric quantity state
CN101320079A
Residual battery capacity estimation management system and method
CN105242215A