Electric quantity detection circuit, electric quantity detection method and device

Through battery voltage and battery current detection, combined with the processing of the main control chip, the first and second power of the battery are obtained, and the problems of high battery power detection cost and low accuracy in the prior art are solved, thereby achieving lower cost and higher accuracy power detection.

CN120195567APending Publication Date: 2025-06-24FOSHAN SHUNDE MIDEA ELECTRICAL HEATING APPLIANCES MFG CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311793684.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-22
Publication Date
2025-06-24

AI Technical Summary

Technical Problem

In the prior art, the battery power detection cost is relatively high, and the power changes greatly after the device is turned on and off, which affects the user experience, and the battery detection accuracy is low.

Method used

Through battery voltage and battery current detection, combined with the processing of the main control chip, the first and second power of the battery are obtained, and the current power of the battery is determined.

Benefits of technology

It reduces the cost of power detection, improves the accuracy of power detection, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120195567A_ABST
    Figure CN120195567A_ABST
Patent Text Reader

Abstract

The invention discloses an electric quantity detection circuit, an electric quantity detection method and an electric quantity detection device, and relates to the technical field of electronics. The method is applied to an electric quantity detection circuit comprising a voltage detection circuit, a current detection circuit and a main control chip, and comprises the following steps: obtaining a battery voltage detected by the voltage detection circuit, and obtaining a first electric quantity of a battery according to the battery voltage; obtaining the battery current detected by the current detection circuit, and obtaining the second electric quantity of the battery according to the battery current; determining the current electric quantity of the battery according to the first electric quantity and the second electric quantity. The electric quantity of the battery is determined through the battery voltage and the battery current, and the electric quantity detection cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of electronic technologies, and in particular, to a power detection circuit, a power detection method, and a device. Background Art

[0002] With the development of science and technology, electronic devices are used more and more widely and have more and more functions, and have become one of the necessities in people's daily lives. With the popularization of various electronic products, batteries have become an indispensable component in people's daily work and life. In related technologies, a dedicated chip is mostly used to detect the power of the battery. Therefore, there is a problem of relatively high cost in detecting the power of the battery. Summary of the Invention

[0003] In view of the above problems, this application provides a power detection circuit, a power detection method, and a device, which can determine the power of the battery through the battery voltage and the battery current, and reduce the cost of power detection.

[0004] In a first aspect, an embodiment of this application provides a power detection circuit. The power detection circuit includes a voltage detection circuit, a current detection circuit, and a main control chip. Among them, the voltage detection circuit is used to be connected to the battery and detect the battery voltage of the battery; the current detection circuit is used to be connected to the battery and detect the battery current of the battery under a reference voltage; the main control chip is respectively connected to the voltage detection circuit and the current detection circuit, and is used to obtain the battery voltage detected by the voltage detection circuit and obtain the first power of the battery according to the battery voltage, obtain the battery current detected by the current detection circuit and obtain the second power of the battery according to the battery current, and determine the current power of the battery according to the first power and the second power.

[0005] In a second aspect, an embodiment of this application provides a power detection method. The power detection method is applied to the power detection circuit provided in the first aspect above. The method includes: obtaining the battery voltage detected by the voltage detection circuit and obtaining the first power of the battery according to the battery voltage; obtaining the battery current detected by the current detection circuit and obtaining the second power of the battery according to the battery current; determining the current power of the battery according to the first power and the second power.

[0006] In a third aspect, an embodiment of the present application provides a power detection device, which is applied to the power detection circuit provided in the first aspect as described above. The power detection device includes: a first power acquisition module, a second power acquisition module, and a current power determination module. Among them, the first power acquisition module is configured to obtain the battery voltage detected by the voltage detection circuit and obtain the first power of the battery according to the battery voltage; the second power acquisition module is configured to obtain the battery current detected by the current detection circuit and obtain the second power of the battery according to the battery current; the current power determination module is configured to determine the current power of the battery according to the first power and the second power.

[0007] In a fourth aspect, an embodiment of the present application provides an electronic device, which includes: one or more processors; a memory; the power detection circuit provided in the first aspect as described above; one or more application programs, where one or more application programs are stored in the memory and are configured to be executed by one or more processors, and one or more application programs are configured to execute the method in the second aspect as described above.

[0008] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, in which program code is stored, and the program code is called by a processor to execute the method in the second aspect as described above.

[0009] The power detection circuit, power detection method, and device provided in the embodiments of the present application obtain the battery voltage detected by the voltage detection circuit, and obtain the first power of the battery according to the battery voltage; obtain the battery current detected by the current detection circuit, and obtain the second power of the battery according to the battery current; determine the current power of the battery according to the first power and the second power, and then determine the power of the battery through the battery voltage and battery current, reducing the cost of power detection. Description of the Drawings

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

[0011] Figure 1 It shows a schematic diagram of a power detection circuit provided by an embodiment of the present application.

[0012] Figure 2 It shows a circuit schematic diagram of a voltage detection circuit provided by an embodiment of the present application.

[0013] Figure 3The circuit schematic diagram of a current detection circuit provided by an embodiment of the present application is shown.

[0014] Figure 4 The flowchart of a power detection method provided by an embodiment of the present application is shown.

[0015] Figure 5 The flowchart of a power detection method provided by an embodiment of the present application is shown.

[0016] Figure 6 The flowchart of a power detection method provided by an embodiment of the present application is shown.

[0017] Figure 7 The flowchart of a power detection method provided by an embodiment of the present application is shown.

[0018] Figure 8 The flowchart of a power detection method provided by an embodiment of the present application is shown.

[0019] Figure 9 The structural block diagram of a power detection device provided by an embodiment of the present application is shown.

[0020] Figure 10 The structural block diagram of an electronic device provided by an embodiment of the present application is shown.

[0021] Figure 11 The structural block diagram of a computer-readable storage medium provided by an embodiment of the present application is shown. Detailed implementation manners

[0022] The following details the implementation manners of the present application. Examples of the implementation manners are shown in the accompanying drawings, where the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The implementation manners described below with reference to the accompanying drawings are exemplary only for explaining the present application and should not be construed as limiting the present application.

[0023] To enable those skilled in the art to better understand the solutions of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative efforts fall within the scope of protection of the present application.

[0024] With the development of science and technology, electronic devices have been widely used. In related technologies, there are more and more electronic devices powered by batteries. Therefore, the detection of the battery power has received great attention from the majority of users.

[0025] Exemplarily, mobile intelligent products currently on the market usually use lithium-ion batteries as the power source. In related technologies, it is necessary to estimate the battery power of the mobile intelligent product and feedback it to the user. Currently, most products on the market use a dedicated battery management chip for power estimation to obtain battery data through the built-in estimation algorithm of the battery management chip; or obtain a large amount of charge and discharge data by performing multiple charge and discharges on the battery pack, and perform a power curve fitting on the large amount of charge and discharge data, and then estimate the power by reading the current battery voltage in real time and substituting it into the fitted curve.

[0026] Among them, the method of power estimation based on a dedicated chip has the problem of high cost, and there is a large change in power after the device is turned on and off, resulting in a poor user experience. In addition, since the battery voltage fluctuates greatly when the load of the mobile device changes greatly and fluctuates frequently, there are large errors and jumps in the method of estimating the power by substituting the voltage into the fitted curve, so there is a problem of low accuracy in power detection, resulting in a poor user experience effect. Therefore, in related technologies, there is a problem of high cost in detecting the power of the battery.

[0027] In view of the above problems, the inventor has discovered through long-term research and proposed a power detection circuit, a power detection method, and a device provided in an embodiment of the present application, which determine the power of the battery through the battery voltage and the battery current, reducing the cost of power detection. Among them, the specific power detection method will be described in detail in the subsequent embodiments.

[0028] Please refer to Figure 1 , which shows a schematic structural diagram of a power detection circuit provided in an embodiment of the present application. In the embodiment of the present application, the power detection circuit 10 may include a voltage detection circuit 101, a current detection circuit 102, and a main control chip 103.

[0029] Among them, the voltage detection circuit 101 may be used to connect to the battery and detect the battery voltage of the battery; the current detection circuit 102 may be used to connect to the battery and detect the battery current of the battery under a reference voltage; the main control chip 103 may be respectively connected to the voltage detection circuit 101 and the current detection circuit 102, and may be used to obtain the battery voltage detected by the voltage detection circuit 101 and obtain the first power of the battery according to the battery voltage, obtain the battery current detected by the current detection circuit 102 and obtain the second power of the battery according to the battery current, and determine the current power of the battery according to the first power and the second power. Among them, the battery may include a lithium battery, a lead-acid battery, a nickel-metal hydride battery, etc., which are not limited herein.

[0030] Among them, the voltage detection circuit 101 can be composed of one or more circuit elements such as resistors and capacitors. Among them, the voltage detection circuit 101 can be connected to the battery and is used to detect the battery voltage of the battery after the electronic device to which the battery belongs is powered on. Among them, the voltage detection circuit 101 can be connected to the main control chip 103 and can send the detected battery voltage to the main control chip 103.

[0031] Exemplarily, please refer to Figure 2 , which shows a circuit schematic diagram of the voltage detection circuit provided in an embodiment of the present application. Among them, the voltage detection circuit 101 can be composed of a resistor R1, a resistor R2, a capacitor C1 and the like in the connection manner as Figure 2 shown. Among them, the voltage detection circuit 101 can be connected to the positive electrode (VBAT+) of the battery to detect the battery voltage of the battery; among them, the voltage detection circuit 101 can be connected to the main control chip 103 to transmit the detected battery voltage (VBAT_ADC) to the main control chip 103. The resistor R1 can include a resistor with a resistance value of 499K±1%Ω, the resistor R2 can include a resistor with a resistance value of 100K±1%Ω, and the capacitor C1 can include a capacitor with a capacitance value of 100nF and a withstand voltage of 25V, which is not limited herein.

[0032] Among them, the current detection circuit 102 can be composed of one or more circuit elements such as resistors, capacitors, electronic switches, and comparators. Among them, the current detection circuit 102 can be connected to the battery and is used to detect the battery current of the battery during the charging or discharging process of the battery. Among them, the current detection circuit 102 can be connected to the main control chip 103 and can send the detected battery current to the main control chip 103.

[0033] Exemplarily, please refer to Figure 3 , which shows a circuit schematic diagram of the current detection circuit provided in an embodiment of the present application. Among them, the current detection circuit 102 can be composed of a resistor R3, a resistor R4, a resistor R5, a resistor R6, a resistor R7, a resistor R8, a resistor R9, a resistor R10, a resistor R11, a resistor R12, a resistor R13, a capacitor C2, a capacitor C3, an electronic switch MOS1, and a comparator 1 in the connection manner as Figure 3 shown. Among them, the current detection circuit 102 can be connected to the negative electrode (VBAT-) of the battery to detect the battery current of the battery; among them, the current detection circuit 102 can be connected to the main control chip 103 to transmit the detected battery current (BAT_I_ADC) to the main control chip 103.

[0034] Among them, the current detection circuit 102 can receive the MCU_I_CTRL signal sent by the main control chip 103 when the electronic device to which the battery belongs is powered on to turn off the current detection circuit 102, so that the main control chip 103 can detect the reference voltage (V_REF) of the operational amplifier of the electronic device to which the battery belongs. Among them, before the battery is charged, the main control chip 103 can send the MCU_I_CTRL signal to the current detection circuit 102 to pull up the level of the left-end port of the current detection circuit 102 to turn on MOS1, so that the current detection circuit 102 can detect the output of the operational amplifier on the right and input the output to the main control chip 103 so that the main control chip 103 can obtain the reference voltage of the entire circuit.

[0035] Among them, when the battery discharges, the main control chip 103 can send the MCU_I_CTRL signal to disconnect MOS1, thereby causing the left side of the current detection circuit 102 to enter the off state and inputting the voltage corresponding to the discharge resistor to the main control chip 103, so that the main control chip 103 can obtain the battery current of the battery according to the relationship between voltage and resistance.

[0036] Among them, the resistor R3 can include a resistor with a resistance value of 10K±1%Ω, the resistor R4 can include a resistor with a resistance value of 90.9R±1%Ω, the resistor R5 can include a resistor with a resistance value of 909R±1%Ω, the resistor R6 can include a resistor with a resistance value of 10K±1%Ω, the resistor R7 can include a resistor with a resistance value of 10K±1%Ω, the resistor R8 can include a resistor with a resistance value of 0.05R±1%Ω, the resistor R9 can include a resistor with a resistance value of 90.9R±1%Ω, the resistor R10 can include a resistor with a resistance value of 909R±1%Ω, the resistor R11 can include a resistor with a resistance value of 10R±1%Ω, the resistor R12 can include a resistor with a resistance value of 10K±1%Ω, the resistor R13 can include a resistor with a resistance value of 1K±1%Ω; the capacitor C2 can include a capacitor with a capacitance value of 100nF and a withstand voltage of 25V, and the capacitor C3 can include a capacitor with a capacitance value of 100nF and a withstand voltage of 25V; the comparator 1 can include a comparator of the LM358A-SR model; MOS1 can include a field effect transistor of the 2N7002K model, which is not limited here.

[0037] Optionally, the main control chip 103 may include a Micro Controller Unit (MCU). In this embodiment, the main control chip 103 may obtain the battery voltage detected by the voltage detection circuit 101, and obtain the first power of the battery according to the battery voltage; obtain the battery current detected by the current detection circuit 102, and obtain the second power of the battery according to the battery current; determine the current power of the battery according to the first power and the second power, and further determine the power of the battery through the battery voltage and the battery current, which improves the accuracy of battery power detection while reducing the cost of power detection and improving the user experience.

[0038] Please refer to Figure 4 , Figure 4 which shows a schematic flowchart of a power detection method provided by an embodiment of the present application. The power detection method determines the power of the battery through the battery voltage and the battery current, reducing the cost of power detection. In a specific embodiment, the power detection method may be applied to a power detection device 200 as shown in Figure 9 and an electronic device 100 configured with the power detection device 200 ( Figure 10 ). The following will take the electronic device as an example to illustrate the specific process of this embodiment. Of course, it can be understood that the electronic devices to which this embodiment is applied may include, for example, a floor sweeper, a vacuum cleaner, a purifier, etc., which are not limited herein. The following will elaborate in detail on the Figure 4 flow shown, and the power detection method may specifically include the following steps:

[0039] Step S110: Obtain the battery voltage detected by the voltage detection circuit, and obtain the first power of the battery according to the battery voltage.

[0040] In some embodiments, the electronic device may include a power detection circuit provided by an embodiment of the present application. Among them, the electronic device may obtain the battery voltage detected by the voltage detection circuit included in the power detection circuit, and may obtain the first power of the battery according to the battery voltage.

[0041] In some embodiments, the electronic device may include one or more batteries, where the one or more batteries may serve as a power source for the electronic device to provide energy for the electronic device. Among them, the one or more batteries may be connected to the voltage detection circuit included in the power detection circuit, or may be connected to the current detection circuit included in the power detection circuit. Among them, the electronic device may be understood as the electronic device to which the battery belongs.

[0042] Among them, the electronic device can receive a first battery power detection instruction input by the user. Among them, the target detection battery identifier can be carried in the first battery power detection instruction. Correspondingly, after receiving the first battery power detection instruction, the electronic device can determine that battery power detection needs to be performed, can parse the first battery power detection instruction to obtain the target detection battery identifier carried by the first battery power detection instruction, and can determine the target battery corresponding to the target detection battery identifier from the batteries included in the electronic device. Further, the electronic device can obtain the battery voltage of the target battery detected by the voltage detection circuit, and can obtain the first battery power of the target battery based on the battery voltage.

[0043] In some embodiments, the battery for which the electronic device performs power detection is fixed. Among them, the electronic device can receive a second battery power detection instruction input by the user, and the target detection battery identifier is not carried in the second battery power detection instruction. Correspondingly, after receiving the second battery power detection instruction, the electronic device can determine that power detection needs to be performed on the battery. The electronic device can obtain the battery voltage obtained by the voltage detection circuit for voltage detection of the fixed battery, and can obtain the first battery power of the fixed battery based on the battery voltage.

[0044] As an implementable manner, the electronic device can receive a third battery power detection instruction input by the user. Among them, the detection duration can be carried in the third battery power detection instruction. Correspondingly, after receiving the third battery power detection instruction, the electronic device determines that battery power detection needs to be performed, and can parse the third battery power detection instruction to obtain the detection duration carried by the third battery power detection instruction. Correspondingly, the electronic device can obtain the battery voltage detected by the voltage detection circuit within the detection duration, and can obtain the first battery power of the battery based on the battery voltage.

[0045] As another implementable manner, the detection duration for the electronic device to perform power detection on the battery is fixed. The electronic device can receive a fourth battery power detection instruction input by the user, and the detection duration is not carried in the fourth battery power detection instruction. Correspondingly, after receiving the fourth battery power detection instruction, the electronic device can determine that battery power detection needs to be performed. The electronic device can obtain the battery voltage detected by the voltage detection circuit within the fixed detection duration, and can obtain the first battery power of the battery based on the battery voltage.

[0046] Among them, the detection duration can include the duration indicating the operation of the electronic device to which the battery belongs, and can also include the battery life duration of the battery, etc., which is not limited here. Exemplarily, the detection duration is the battery life duration of the battery is 2 to 3 hours.

[0047] In some embodiments, the electronic device can control the voltage detection circuit to detect the battery voltage of the battery connected to the voltage detection circuit after power-on, and can obtain the first power level of the battery according to the battery voltage.

[0048] Optionally, the correspondence between voltage and power level can be preset in the electronic device, and the electronic device can also obtain the correspondence between voltage and power level from an associated cloud or electronic device. Among them, the correspondence between voltage and power level can be provided by the cell manufacturer corresponding to the battery, can also be obtained from third-party experimental data, or can also be set by the user independently, which is not limited herein. Among them, the correspondence between voltage and power level can include a curve corresponding voltage and power level, or can also include a mapping relation table of voltage and power level; among them, in the correspondence between voltage and power level, voltage and power level can be in a one-to-one relationship, a one-to-many relationship, or a many-to-one relationship, which is not limited herein.

[0049] In some embodiments, after the electronic device obtains the battery voltage detected by the voltage detection circuit, it can obtain the power level corresponding to the voltage equal to the battery voltage as the first power level of the battery based on the correspondence between voltage and power level.

[0050] In some embodiments, the electronic device can preset a corrected power level. Among them, the corrected power level can include the current power level of the battery saved by the electronic device before this power-on, can also include a fixed and unchanging power level preset in the electronic device, or can also include a power level set by the user independently. Among them, the electronic device can also obtain the corrected power level from an associated cloud or electronic device through wireless communication technologies (such as WiFi, Bluetooth, zigbee, etc.), or can also obtain the corrected power level from an associated electronic device through a serial communication interface (such as a serial peripheral interface, etc.).

[0051] Among them, after the electronic device obtains the battery voltage detected by the voltage detection circuit, it can obtain the power level corresponding to the voltage equal to the battery voltage as the initial power level based on the correspondence between voltage and power level. Correspondingly, the electronic device can obtain the first power level of the battery based on the initial power level and the corrected power level. Among them, the electronic device can obtain the average value of the initial power level and the corrected power level as the first power level, or can also obtain the difference between the initial power level and the corrected power level, and when the difference is less than the first deviation threshold, determine the initial power level as the first power level; or when the difference is greater than or equal to the first deviation threshold, determine the corrected power level as the first power level.

[0052] Step S120: Obtain the battery current detected by the current detection circuit, and obtain the second power level of the battery according to the battery current.

[0053] In some embodiments, when the electronic device is powered on, it can control the current detection circuit to turn off, and read the reference voltage corresponding to the current detection circuit through the main control chip included in the electronic device, so that the electronic device can obtain the battery current detected by the current detection circuit under the reference voltage.

[0054] Wherein, after obtaining the reference voltage, the electronic device can control the current detection circuit to detect the battery current of the electronic device to which the battery connected to the current detection circuit belongs, and obtain the second battery power according to the battery current.

[0055] Optionally, the electronic device can integrate the battery current detected by the current detection circuit to obtain the periodic capacity change value of the battery during charging or discharging; after obtaining the periodic capacity change value, the electronic device can combine it with the first battery power to obtain the second battery power.

[0056] Optionally, the process of the electronic device integrating the battery current detected by the current detection circuit to obtain the periodic capacity change value may include obtaining the product of the battery current and the duration of the current detection circuit detecting the battery current as the periodic capacity change value. Optionally, the process of the electronic device combining the periodic capacity change value and the first battery power to obtain the second battery power may include determining the difference between the first battery power and the periodic capacity change value as the second battery power; or determining the sum of the first battery power and the first periodic capacity change value as the second battery power.

[0057] Exemplarily, when the electronic device is powered on, it can control the current detection circuit to turn off through the main control chip, and obtain the reference voltage for calculating the battery current during the charging or discharging process of the battery by the current detection circuit. Wherein, the electronic device can obtain the initial battery power corresponding to the battery voltage according to the battery voltage detected by the voltage detection circuit and the voltage-power curve provided by the battery cell manufacturer. Wherein, the electronic device can also obtain the shutdown battery power of the battery saved by the electronic device before the last shutdown and stored in the flash memory of the main control chip MCU of the electronic device. Correspondingly, the electronic device can determine the first battery power according to the magnitude relationship between the deviation between the initial battery power and the shutdown battery power and the first deviation threshold. Optionally, if the deviation between the initial battery power and the shutdown battery power is less than the first deviation threshold, the electronic device can determine the initial battery power as the first battery power of the battery; if the deviation between the initial battery power and the shutdown battery power is greater than or equal to the first deviation threshold, the electronic device can determine the shutdown battery power as the first battery power of the battery.

[0058] After the electronic device obtains the reference voltage, it can control the current detection circuit to work through the main control chip to detect the battery current under the reference voltage. The electronic device can obtain the periodic capacity change value based on the obtained battery current and the detection duration of the current detection circuit for detecting the battery current. After the electronic device obtains the periodic capacity change value, it can determine the second battery power as the sum of the first power and the periodic capacity change value, or determine the second battery power as the difference between the first power and the periodic capacity change value.

[0059] Step S130: Determine the current power of the battery according to the first power and the second power.

[0060] In some embodiments, after the electronic device obtains the first power or the second power, it can determine the current power of the battery. The electronic device can use the first power obtained after power-on as the current power of the battery. The electronic device can also use the second power obtained during the charging or discharging process of the battery as the current power of the battery.

[0061] It can be understood that the electronic device detects the battery power through a power detection circuit including a voltage detection circuit and a current detection circuit, which reduces the hardware cost of battery power detection. In addition, the electronic device detects the battery power by integrating voltage and current, reducing the fluctuation of power estimation under the condition of a large load of the electronic device to which the battery belongs, and improving the accuracy of power detection.

[0062] The power detection method provided by an embodiment of the present application obtains the battery voltage detected by the voltage detection circuit, and obtains the first power of the battery according to the battery voltage; obtains the battery current detected by the current detection circuit, and obtains the second power of the battery according to the battery current; determines the current power of the battery according to the first power and the second power, and further determines the power of the battery through the battery voltage and the battery current, reducing the cost of power detection.

[0063] Please refer to Figure 5 , Figure 5 which shows a schematic flow chart of the power detection method provided by an embodiment of the present application. This method is applied to the above-mentioned electronic device. The following will elaborate on the Figure 5 shown process in detail. The power detection method may specifically include the following steps:

[0064] Step S210: If it is detected that the electronic device to which the battery belongs is powered on, obtain the battery voltage detected by the voltage detection circuit.

[0065] In some embodiments, if the electronic device detects that the electronic device to which the battery belongs is powered on, it can obtain the battery voltage detected by the voltage detection circuit connected to the battery. Among them, the electronic device may include the electronic device to which the battery belongs. Optionally, the electronic device may receive a power-on instruction input by the user and power on in response to the power-on instruction; further, if the electronic device detects that the electronic device to which the battery belongs is powered on, it can obtain the battery voltage detected by the voltage detection circuit.

[0066] Step S220: Obtain the initial battery level according to the first preset relationship and the battery voltage, where the first preset relationship includes the corresponding relationships between multiple voltages and multiple battery levels.

[0067] In some embodiments, the first preset relationship may be pre-set in the electronic device, where the first preset relationship may include the corresponding relationships between multiple voltages and multiple battery levels. Optionally, the first preset relationship may include a mapping table of multiple voltages and multiple battery levels, may also include a mapping curve of multiple voltages and multiple battery levels, or may also include a mapping formula of multiple voltages and multiple battery levels. Among them, the relationship between the multiple voltages and the multiple battery levels may be a one-to-one relationship, a one-to-many relationship, or a many-to-one relationship, which is not limited herein.

[0068] Among them, after the electronic device obtains the battery voltage, it can obtain the initial battery level according to the first preset relationship and the battery voltage. Exemplarily, the electronic device can obtain the initial battery level corresponding to the battery voltage through the voltage-battery level curve provided by the battery cell manufacturer.

[0069] Step S230: Obtain the shutdown battery level of the electronic device to which the battery belongs before power-on.

[0070] In some embodiments, the shutdown battery level of the electronic device to which the battery belongs before power-on may be pre-set in the electronic device. Exemplarily, the shutdown battery level of the electronic device to which the battery belongs is stored in the flash of the MCU included in the electronic device to which the battery belongs. It can also be understood that the current battery level of the battery before the electronic device to which the battery belongs shuts down is stored in the flash of the MCU included in the electronic device to which the battery belongs.

[0071] Optionally, the electronic device may obtain the shutdown battery level of the electronic device to which the battery belongs before power-on. Among them, when the electronic device includes the electronic device to which the battery belongs, the electronic device can directly obtain the shutdown battery level; the electronic device can also obtain the shutdown battery level of the electronic device to which the battery belongs from the associated cloud or electronic device.

[0072] As an implementable manner, the process by which the electronic device obtains the shutdown power can include that if the electronic device detects that the battery charging is completed, the current power of the battery can be determined as the first total capacity of the battery. Among them, the electronic device can determine the first target power based on the current power and the first total capacity; if the deviation between the first target power and the first total capacity is greater than the second threshold, the electronic device can determine the current power as the shutdown power of the electronic device to which the battery belongs before power-on.

[0073] In some embodiments, the electronic device may include a circuit of an external adapter. Among them, the process by which the electronic device detects whether the battery charging is completed can include that the electronic device can obtain the current of the adapter, determine whether the current is less than or equal to the current threshold, and determine whether the battery charging is completed according to the determination result. Exemplarily, if the current is less than or equal to the current threshold, it can be determined that the battery charging is completed; if the current is greater than the current threshold, it can be determined that the battery charging is not completed.

[0074] Among them, the current threshold can be preset in the electronic device, and the electronic device can also obtain the current threshold from an associated cloud or electronic device; among them, the current threshold can be obtained through third-party experimental data or can be set by the user independently, which is not limited herein.

[0075] Among them, the process by which the electronic device determines the first target power based on the current power and the first total capacity can include that the electronic device can determine the product of the quotient of dividing the current power by the first total capacity multiplied by 100 as the first target power.

[0076] Optionally, after the electronic device obtains the first target power, it can calculate the deviation between the first target power and the first total capacity, and determine the shutdown power of the electronic device to which the battery belongs before power-on according to the deviation. Exemplarily, if the electronic device determines that the deviation between the first target power and the first total capacity is greater than the second threshold, it can determine the current power as the shutdown power of the electronic device to which the battery belongs before power-on; if the electronic device determines that the deviation between the first target power and the first total capacity is less than or equal to the second threshold, it can determine the most recently determined shutdown power as the shutdown power of the electronic device to which the battery belongs before power-on.

[0077] Among them, the deviation between the first target power and the first total capacity can include the difference between the first target power minus the first total capacity, or can also include the difference between the first target power minus the first total capacity divided by the first total capacity, which is not limited herein.

[0078] Among them, the electronic device can store the determined shutdown power in the memory of the electronic device, for example, stored in the flash memory included in the MCU of the electronic device.

[0079] Among them, the second threshold can be preset in the electronic device, or the electronic device can obtain it from the cloud or the electronic device of the relevant quantity; among them, the second threshold can be obtained through third-party experimental data or can be set independently by the user, which is not limited here. Exemplarily, the second threshold is 1%.

[0080] As another implementable method, the process for the electronic device to obtain the shutdown power can include: if the electronic device detects that the battery is not fully charged, it can obtain the second total capacity of the battery determined most recently, and determine the second target power based on the second total capacity and the current power; if the deviation between the second target power and the second total capacity is less than or equal to the second threshold, the shutdown power determined most recently can be determined as the shutdown power of the electronic device to which the battery belongs before power-on.

[0081] Among them, the shutdown power can be used as a calibration power to calibrate the initial power to obtain the first power, so as to reduce the fluctuation of power detection, avoid the jump of power detection of the battery after the electronic device to which the battery belongs is shut down or restarted, and improve the accuracy of power detection.

[0082] Among them, if the electronic device detects that the battery is not fully charged, after obtaining the second total capacity of the battery determined most recently, the process of determining the second target power based on the second total capacity and the current power can include: the electronic device can determine the product of the quotient of dividing the current power by the second total capacity multiplied by 100 as the second target power.

[0083] Optionally, after the electronic device obtains the second target power, it can calculate the deviation between the second target power and the second total capacity, and determine the shutdown power of the electronic device to which the battery belongs before power-on according to the deviation. Exemplarily, if the electronic device determines that the deviation between the second target power and the second total capacity is greater than the second threshold, the current power can be determined as the shutdown power of the electronic device to which the battery belongs before power-on; if the electronic device determines that the deviation between the second target power and the second total capacity is less than or equal to the second threshold, the shutdown power determined most recently can be determined as the shutdown power of the electronic device to which the battery belongs before power-on.

[0084] Among them, the deviation between the second target power and the second total capacity can include the difference between the second target power minus the second total capacity, or can also include the difference between the second target power minus the second total capacity divided by the second total capacity, which is not limited here.

[0085] Step S240: Obtain the first power based on the magnitude relationship between the initial power and the shutdown power.

[0086] In some embodiments, after the electronic device obtains the initial power and the shutdown power, it can obtain the first power of the battery according to the magnitude relationship between the initial power and the shutdown power. Optionally, the electronic device can subtract the shutdown power from the initial power to obtain the magnitude relationship; the electronic device can also divide the result of subtracting the shutdown power from the initial power by the shutdown power to obtain the magnitude relationship, which is not limited herein.

[0087] Among them, the process by which the electronic device obtains the first power according to the magnitude relationship between the initial power and the shutdown power may include: if it is determined based on the magnitude relationship that the ratio of the difference between the initial power and the shutdown power to the shutdown power is greater than the first threshold, the initial power can be determined as the first power; or if it is determined based on the magnitude relationship that the ratio of the difference between the initial power and the shutdown power to the shutdown power is less than or equal to the first threshold, the shutdown power is determined as the first power.

[0088] Among them, the first threshold can be pre-set in the electronic device, or the electronic device can obtain it from the cloud or the electronic device of relevant quantities; among them, the first threshold can be obtained through third-party experimental data or can be set by the user independently, which is not limited herein. Exemplarily, the first threshold includes 20%.

[0089] It can be understood that the electronic device can judge the capacity error between the initial power and the shutdown power according to the magnitude relationship between the initial power and the shutdown power, and determine the first power of the battery according to the magnitude relationship, and then determine the current power of the battery according to the first power, effectively avoiding the influence of voltage fluctuation on the power estimation based on voltage, and improving the accuracy of power detection.

[0090] Step S250: Obtain the battery current detected by the current detection circuit, and obtain the second power of the battery according to the battery current.

[0091] Step S260: Determine the current power of the battery according to the first power and the second power.

[0092] Among them, for the specific descriptions of steps S250 - S260, please refer to the specific descriptions of steps S120 - S130 above, and will not be elaborated here one by one.

[0093] The power detection method provided by an embodiment of this application, compared with Figure 4The power detection method shown. In this embodiment, if it is detected that the electronic device to which the battery belongs is powered on, the battery voltage detected by the voltage detection circuit is obtained, and the initial power is obtained according to the first preset relationship and the battery voltage, where the first preset relationship includes the corresponding relationships between multiple voltages and multiple powers; the power-off power of the electronic device to which the battery belongs before power-on is obtained; the first power is obtained according to the magnitude relationship between the initial power and the power-off power. Furthermore, when determining the power of the battery through the battery voltage and the battery current, while reducing the cost of power detection, it effectively avoids the influence of voltage fluctuations on estimating the power of the battery based on voltage, and improves the accuracy of power detection.

[0094] Please refer to Figure 6 , Figure 6 shows a schematic flowchart of the power detection method provided by an embodiment of the present application. This method is applied to the above-mentioned electronic device. The following will elaborate in detail on Figure 6 the process shown. The power detection method may specifically include the following steps:

[0095] Step S310: Obtain the battery voltage detected by the voltage detection circuit, and obtain the first power of the battery according to the battery voltage.

[0096] Among them, for the specific description of step S310, please refer to the specific description of step S110 above, and details will not be elaborated here.

[0097] Step S320: If it is detected that the electronic device to which the battery belongs is powered on, turn off the current detection circuit to obtain the reference voltage.

[0098] In some embodiments, when the electronic device detects that the electronic device to which the battery connected to the power detection circuit belongs is powered on, the current detection circuit included in the power detection circuit can be controlled to be turned off by the main control chip included in the power detection circuit, so that the main control chip obtains the reference voltage for calculating the battery current of the battery for charging or discharging by the current detection circuit.

[0099] Exemplarily, the electronic device includes the electronic device to which the battery belongs. If the electronic device is powered on, the main control MCU included in the electronic device can turn off the power detection circuit and read the reference voltage Vref, so that the current detection circuit calculates the battery current for charging or discharging the battery under the reference voltage.

[0100] Step S330: Turn on the current detection circuit, and obtain the battery current detected by the current detection circuit based on the reference voltage.

[0101] In some embodiments, after the electronic device obtains the reference voltage, it can turn on the current detection circuit and obtain the battery current detected by the current detection circuit based on the reference voltage.

[0102] Among them, the electronic device can obtain the battery current of the battery discharge detected by the current detection circuit under the reference voltage; the electronic device can also obtain the battery current of the battery charging detected by the current detection circuit under the reference voltage.

[0103] Step S340: Obtain the current detection duration.

[0104] In some embodiments, when the electronic device turns on the current detection circuit and detects the battery current based on the current detection circuit, it can obtain the current detection duration for detecting the battery current based on the current detection circuit; correspondingly, the electronic device can integrate the battery current based on the current detection duration and the battery current to obtain a battery capacity change value.

[0105] Among them, the electronic device can start timing after turning on the current detection circuit to obtain the current detection duration for detecting the battery current based on the current detection circuit.

[0106] Step S350: Obtain a periodic capacity change value according to the current detection duration and the battery current.

[0107] In some embodiments, after the electronic device obtains the current detection duration and the battery current, it can obtain a periodic capacity change value according to the current detection duration and the battery current. Among them, the electronic device can determine the product of the current detection duration and the battery current as the periodic capacity change value.

[0108] Exemplarily, if the total current value of the electronic device to which the battery belongs detected by the current detection circuit obtained by the electronic device is A1, it can be understood that the battery current is A1; among them, the electronic device can obtain the current detection duration T for detecting the current by the current detection circuit, which can be understood as the sampling time of the operating system of the electronic device for the current detection circuit. Among them, the electronic device can use the product of A1×T as the periodic capacity change value C2.

[0109] Step S360: Obtain a target temperature coefficient according to a second preset relationship and the periodic capacity change value, where the second preset relationship includes corresponding relationships between multiple capacities and multiple temperature coefficients.

[0110] In some embodiments, after obtaining the periodic capacity change value, the electronic device may obtain the target temperature coefficient according to the second preset relationship and the periodic capacity change value. Among them, the second preset relationship may be preset in the electronic device, or the electronic device may obtain the second preset relationship from an associated cloud or electronic device; among them, the second preset relationship may be provided by the battery cell manufacturer, obtained through third-party experimental data, or set by the user independently, which is not limited herein.

[0111] Among them, the second preset relationship may include the corresponding relationships between multiple capacities and multiple temperature coefficients. Among them, the corresponding relationships between multiple capacities and multiple temperature coefficients may include a mapping relationship table between multiple capacities and multiple temperature coefficients, a mapping curve between multiple capacities and multiple temperature coefficients, and a mapping formula between multiple capacities and multiple temperature coefficients, which is not limited herein. Among them, the multiple capacities and multiple temperature coefficients may be in a one-to-one correspondence, a one-to-many relationship, or a many-to-one relationship, which is not limited herein.

[0112] Exemplarily, the second preset relationship includes a mapping curve between multiple capacities and multiple temperature coefficients. Among them, after the electronic device obtains the periodic capacity change value, it may determine the target temperature coefficient corresponding to the periodic capacity change value from the mapping curve between multiple capacities and multiple temperature coefficients based on the periodic capacity change value.

[0113] Step S370: Obtain the current integrated power according to the periodic capacity change value and the target temperature coefficient.

[0114] In some embodiments, after the electronic device obtains the periodic capacity change value and the target temperature coefficient, it may obtain the current integrated power according to the periodic capacity change value and the target temperature coefficient. Among them, the electronic device may determine the product of the periodic capacity change value and the target temperature coefficient as the current integrated power.

[0115] Step S380: Obtain the second power according to the current integrated power and the first power.

[0116] In some embodiments, after the electronic device obtains the current integrated power and the first power, it may obtain the second power of the battery according to the current integrated power and the first power. Among them, the electronic device may determine the sum of the current integrated power and the first power as the second power, or the electronic device may determine the difference between the current integrated power and the first power as the second power.

[0117] In some embodiments, the process by which the electronic device obtains the second power based on the current integrated power and the first power may include: if the electronic device detects that the battery is in a charging state, the sum of the current integrated power and the first power may be determined as the second power; or if the electronic device detects that the battery is not in a charging state, the difference between the current integrated power and the first power may be determined as the second power.

[0118] Among them, the electronic device may include a circuit of an external adapter. Correspondingly, the main control chip of the electronic device may determine whether the battery is charging by detecting whether there is voltage in the adapter. If there is voltage, it may be determined that the battery is in a charging state; if there is no voltage, it may be determined that the battery is not in a charging state.

[0119] It can be understood that the electronic device detects the battery power through voltage and current integration, improving the accuracy of power detection; in addition, in the working conditions where the load of the electronic device to which the battery belongs changes greatly, detecting the power through voltage and current integration effectively suppresses the jump of the power estimation of the battery after the electronic device to which the battery belongs is shut down or restarted, reducing the volatility of power detection.

[0120] Step S390: Determine the current power of the battery according to the first power and the second power.

[0121] Among them, for the specific description of step S390, please refer to the specific description of step S130 above, and details will not be repeated here.

[0122] The power detection method provided by an embodiment of the present application, compared with Figure 4 the power detection method shown, in this embodiment, if it is detected that the electronic device to which the battery belongs is powered on, the current detection circuit may be turned off to obtain the reference voltage; the current detection circuit may be turned on, and the battery current detected by the current detection circuit may be obtained based on the reference voltage; the current detection duration may be obtained; the periodic capacity change value may be obtained according to the current detection duration and the battery current; the target temperature coefficient may be obtained according to the second preset relationship and the periodic capacity change value, where the second preset relationship includes the corresponding relationship between multiple capacities and multiple temperature coefficients; the current integrated power may be obtained according to the periodic capacity change value and the target temperature coefficient; the second power may be obtained according to the current integrated power and the first power, and then the power of the battery may be detected by voltage and current integration, while reducing the cost of power detection and improving the accuracy of power detection.

[0123] Please refer to Figure 7 , Figure 7 shows a schematic flowchart of the power detection method provided by an embodiment of the present application. This method is applied to the above-mentioned electronic device. Next, it will be directed to Figure 7The following describes the process shown in detail. The power detection method may specifically include the following steps:

[0124] Step S410: Obtain the battery voltage detected by the voltage detection circuit, and obtain the first power of the battery based on the battery voltage.

[0125] Step S420: Obtain the battery current detected by the current detection circuit, and obtain the second power of the battery based on the battery current.

[0126] For the specific descriptions of steps S410 - S420, please refer to the specific descriptions of steps S110 - S120 in the previous text, and details will not be repeated here.

[0127] Step S430: If it is detected that the electronic device to which the battery belongs is powered on, determine the first power as the current power of the battery.

[0128] In some embodiments, if the electronic device detects that the electronic device to which the battery belongs is powered on, it may determine the first power as the current power of the battery.

[0129] Exemplarily, please refer to Figure 8 , which shows a schematic flowchart of the power detection method provided by an embodiment of the present application. Among them, the electronic device may include household electronic devices such as a floor sweeper, a mobile air purifier, a handheld wireless vacuum cleaner, etc. Among them, the battery life of the electronic device may be 2 - 3 hours. Among them, after the electronic device is powered on, it may control the current detection circuit to be turned off and obtain the reference voltage of the current detection circuit. Among them, after the electronic device is powered on, it may obtain the battery voltage detected by the voltage detection circuit, and may substitute the battery voltage into a preset voltage - power curve to obtain the initial power C0 corresponding to the battery voltage. Among them, the electronic device may also obtain the shutdown power C1 saved in the main control chip before the electronic device's most recent shutdown.

[0130] Among them, if it is determined that there is no pre - saved shutdown power C1 in the electronic device, the electronic device may use the initial power C0 as the first power of the battery, and may also determine the first power as the current power C of the battery. Among them, if it is determined that there is a pre - saved shutdown power C1 in the electronic device, the electronic device may calculate whether the error between the current power C0 and the shutdown power C1 is greater than the first threshold of 20%, which can be understood as determining whether the value of (C0 - C1) / C1 is greater than 20%; if it is greater, the electronic device may use the initial power C0 as the first power of the battery, and may also determine the first power as the current power C of the battery; if it is less than or equal to, the electronic device may use the shutdown power C1 as the first power of the battery, and may also determine the first power as the current power C of the battery.

[0131] Step S440: If it is detected that the battery is in a charging state or a discharging state after the electronic device to which the battery belongs is powered on, then determine the second power as the current power of the battery.

[0132] In some embodiments, if it is detected that the battery is in a charging state or a discharging state after the electronic device to which the battery belongs is powered on, the electronic device may determine the second power as the current power of the battery.

[0133] Exemplarily, please refer to again Figure 8 , after the electronic device determines the first power as the current power C of the battery if it detects that the electronic device to which the battery belongs is powered on, if it is detected that the battery is in a charging state or a discharging state after the electronic device to which the battery belongs is powered on, the second power may be determined as the current power of the battery.

[0134] Among them, if the electronic device detects that the battery is in a charging state, the second power may be determined as the current power of the battery. Among them, the second power may be equal to the sum of the first power and the current integral power (battery current A2 × current detection duration T × target temperature coefficient); among them, the first power can be understood as the current power C determined when the electronic device detects that the electronic device to which the battery belongs is powered on. That is, the current power C = current power C + battery current A1 × current detection duration T × target temperature coefficient.

[0135] Among them, if the electronic device detects that the battery is in a discharging state, the second power may be determined as the current power of the battery. Among them, the second power may be equal to the difference between the first power and the current integral power (battery current A1 × current detection duration T × target temperature coefficient). Among them, the first power can be understood as the current power C determined when the electronic device detects that the electronic device to which the battery belongs is powered on. That is, the current power C = current power C - battery current A1 × current detection duration T × target temperature coefficient.

[0136] Among them, if the electronic device detects that the battery charging is completed, the current power of the battery can be determined as the first total capacity of the battery, that is, the current power C = the first total capacity. Accordingly, the electronic device can determine the first target power based on the current power and the first total capacity. For example, the current power SOC = the current power C / the first total capacity × 100. Among them, if the electronic device determines that the deviation between the first target power and the first total capacity is greater than the second threshold of 1%, the current power C can be determined as the shutdown power of the electronic device to which the battery belongs before power-on; if the electronic device determines that the deviation between the first target power and the first total capacity is less than or equal to the second threshold of 1%, the most recently determined shutdown power can be determined as the shutdown power of the electronic device to which the battery belongs before power-on. Among them, the electronic device can save the determined shutdown power, such as the current power C, in the flash.

[0137] Among them, if the electronic device detects that the battery charging is not completed, the second total capacity of the battery determined most recently can be obtained. Accordingly, the electronic device can determine the second target power based on the current power and the second total capacity. For example, the current power SOC = the current power C / the second total capacity × 100. Among them, if the electronic device determines that the deviation between the second target power and the second total capacity is greater than the second threshold of 1%, the current power C can be determined as the shutdown power of the electronic device to which the battery belongs before power-on; if the electronic device determines that the deviation between the second target power and the second total capacity is less than or equal to the second threshold of 1%, the most recently determined shutdown power can be determined as the shutdown power of the electronic device to which the battery belongs before power-on. Among them, the electronic device can save the determined shutdown power, such as the current power C, in the flash.

[0138] Among them, determining whether the deviation between the first target power and the first total capacity is greater than the second threshold of 1%, or determining whether the deviation between the second target power and the second total capacity is greater than the second threshold of 1% can be understood as determining whether the power SOC changes by 1%.

[0139] Among them, the shutdown power can be used as the calibration power for obtaining the first power from the initial power corresponding to the battery voltage after the electronic device to which the battery belongs is powered on.

[0140] It can be understood that the electronic device estimates the battery power based on the integration of voltage and current, avoiding the jump of power detection after the electronic device to which the battery belongs shuts down or restarts, effectively avoiding the influence of voltage fluctuation on the battery power estimated based on voltage, and improving the accuracy of power detection.

[0141] The power detection method provided by an embodiment of the present application, compared with Figure 4The power detection method shown. In this embodiment, if it is detected that the electronic device to which the battery belongs is powered on, the first power is determined as the current power of the battery; if it is detected that the battery is in a charging state or a discharging state after the electronic device to which the battery belongs is powered on, the second power is determined as the current power of the battery. Furthermore, when determining the power of the battery based on the battery voltage and the battery current, while reducing the cost of power detection, it effectively avoids the influence of voltage fluctuations on estimating the power of the battery based on voltage, and improves the accuracy of power detection.

[0142] Please refer to Figure 9 , Figure 9 which shows a block diagram of a power detection device provided in an embodiment of the present application. The power detection device 200 can be applied to the power detection circuit 10 provided in an embodiment of the present application (as Figure 1 shown). The following will elaborate in detail on the Figure 9 process shown. The power detection device 200 includes: a first power acquisition module 210, a second power acquisition module 220, and a current power determination module 230, where:

[0143] The first power acquisition module 210 is configured to acquire the battery voltage detected by the voltage detection circuit, and obtain the first power of the battery according to the battery voltage.

[0144] The second power acquisition module 220 is configured to acquire the battery current detected by the current detection circuit, and obtain the second power of the battery according to the battery current.

[0145] The current power determination module 230 is configured to determine the current power of the battery according to the first power and the second power.

[0146] Furthermore, the first power acquisition module 210 may include: a battery voltage acquisition unit, where:

[0147] The battery voltage acquisition unit is configured to acquire the battery voltage detected by the voltage detection circuit if it is detected that the electronic device to which the battery belongs is powered on.

[0148] Furthermore, the first power acquisition module 210 may include: an initial power acquisition unit, a shutdown power acquisition unit, and a first power acquisition subunit, where:

[0149] The initial power acquisition unit is configured to obtain an initial power according to a first preset relationship and the battery voltage, where the first preset relationship includes corresponding relationships between multiple voltages and multiple powers.

[0150] The shutdown power acquisition unit is configured to acquire the shutdown power of the electronic device to which the battery belongs before it is powered on.

[0151] A first power quantity obtaining subunit, configured to obtain the first power quantity according to a magnitude relationship between the initial power quantity and the shutdown power quantity.

[0152] Further, the first power quantity obtaining subunit may include: an initial power quantity determining first power quantity unit or a shutdown power quantity determining first power quantity unit, where:

[0153] The initial power quantity determining first power quantity unit is configured to determine the initial power quantity as the first power quantity if it is determined based on the magnitude relationship that a ratio of a difference between the initial power quantity and the shutdown power quantity to the shutdown power quantity is greater than a first threshold.

[0154] The shutdown power quantity determining first power quantity unit is configured to determine the shutdown power quantity as the first power quantity if it is determined based on the magnitude relationship that a ratio of a difference between the initial power quantity and the shutdown power quantity to the shutdown power quantity is less than or equal to the first threshold.

[0155] Further, the power quantity detection device 200 may further include: a first total capacity determining unit, a first target power quantity determining unit, and a shutdown power quantity determining first unit, where:

[0156] The first total capacitance determining unit is configured to, if it is detected that the battery charging is completed, determine the current power quantity of the battery as the first total capacity of the battery.

[0157] The first target power quantity determining unit is configured to determine a first target power quantity based on the current power quantity and the first total capacity.

[0158] The shutdown power quantity determining first unit is configured to, if a deviation between the first target power quantity and the first total capacity is greater than a second threshold, determine the current power quantity as the shutdown power quantity of the electronic device to which the battery belongs before power-on.

[0159] Further, the power quantity detection device 200 may further include: a second total capacitance determining unit, a second target power quantity determining unit, and a shutdown power quantity determining second unit, where:

[0160] The second total capacitance determining unit is configured to, if it is detected that the battery charging is not completed, obtain the second total capacity of the battery determined most recently.

[0161] The second target power quantity determining unit is configured to determine a second target power quantity based on the second total capacity and the current power quantity.

[0162] The shutdown power quantity determining second unit is configured to, if a deviation between the second target power quantity and the second total capacity is less than or equal to the second threshold, determine the shutdown power quantity determined most recently as the shutdown power quantity of the electronic device to which the battery belongs before power-on.

[0163] Further, the second power acquisition module 220 may include: a reference voltage acquisition unit and a battery current acquisition unit, where:

[0164] The reference voltage acquisition unit is configured to, if it is detected that the electronic device to which the battery belongs is powered on, turn off the current detection circuit to acquire the reference voltage.

[0165] The battery current acquisition unit is configured to turn on the current detection circuit and acquire the battery current detected by the current detection circuit based on the reference voltage.

[0166] Further, the second power acquisition module 220 may include: a current detection duration acquisition unit, a cycle capacity change value acquisition unit, a target temperature coefficient acquisition unit, and a second power acquisition subunit, where:

[0167] The current detection duration acquisition unit is configured to acquire the current detection duration.

[0168] The cycle capacity change value acquisition unit is configured to acquire a cycle capacity change value according to the current detection duration and the battery current.

[0169] The target temperature coefficient acquisition unit is configured to acquire a target temperature coefficient according to a second preset relationship and the cycle capacity change value, where the second preset relationship includes corresponding relationships between multiple capacities and multiple temperature coefficients.

[0170] The second power acquisition subunit is configured to acquire the second power according to the current integrated power and the first power.

[0171] Further, the second power acquisition subunit may include: a first second power acquisition unit or a second second power acquisition unit, where:

[0172] The first second power acquisition unit is configured to, if it is detected that the battery is in a charging state, determine the sum of the current integrated power and the first power as the second power.

[0173] The second second power acquisition unit is configured to, if it is detected that the battery is not in a charging state, determine the difference between the current integrated power and the first power as the second power.

[0174] Further, the current power determination module 230 may include: a first current power determination unit and a second current power determination unit, where:

[0175] The first current power determination unit is configured to, if it is detected that the electronic device to which the battery belongs is powered on, determine the first power as the current power of the battery.

[0176] A second unit for determining the current power, which is configured to determine the second power as the current power of the battery if it is detected that the battery is in a charging state or a discharging state after the electronic device to which the battery belongs is powered on.

[0177] Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the foregoing method embodiments, and will not be described herein again.

[0178] In several embodiments provided in the present application, the coupling between modules can be electrical, mechanical, or other forms of coupling.

[0179] In addition, in each embodiment of the present application, the various functional modules can be integrated in one processing module, or each module can exist physically alone, or two or more modules can be integrated in one module. The above-mentioned integrated modules can be implemented in the form of hardware or in the form of software functional modules.

[0180] Please refer to Figure 10 , which shows a structural block diagram of an electronic device provided by an embodiment of the present application. The electronic device 100 can be an electronic device capable of running application programs, such as a vacuum cleaner, a floor sweeper, a purifier, etc. The electronic device 100 in the present application may include: a processor 110, a memory 120, a power detection circuit 10 provided by an embodiment of the present application ( Figure 10 not shown in the figure), and one or more application programs. Among them, one or more application programs can be stored in the memory 120 and configured to be executed by one or more processors 110, and one or more programs are configured to execute the methods described in the foregoing method embodiments.

[0181] The processor 110 may include one or more processing cores. The processor 110 connects various parts within the entire electronic device 100 using various interfaces and circuits. By running or executing instructions, programs, code sets, or instruction sets stored in the memory 120, and by invoking data stored in the memory 120, it performs various functions of the electronic device 100 and processes data. Optionally, the processor 110 may be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), or programmable logic array (PLA). The processor 110 may integrate a combination of one or several of a central processing unit (CPU), a graphics processing unit (GPU), and a modem, etc. Among them, the CPU mainly processes the operating system, user interface, application programs, etc.; the GPU is responsible for rendering and drawing the content to be displayed; the modem is used to process wireless communication. It can be understood that the above-mentioned modem may not be integrated into the processor 110 and may be implemented separately through a communication chip.

[0182] The memory 120 may include random access memory (RAM) and may also include read-only memory. The memory 120 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 120 may include a program storage area and a data storage area. Among them, the program storage area may store instructions for implementing the operating system, instructions for implementing at least one function (such as touch function, sound playback function, image playback function, etc.), instructions for implementing the following various method embodiments, etc. The data storage area may also store data created during the use of the electronic device 100 (such as audio data, temperature data, time data, etc.).

[0183] In some embodiments, the processor 110 may include the main control chip of the power detection circuit 10, which can be respectively connected to the voltage detection circuit and the current detection circuit, and can be used to obtain the battery voltage detected by the voltage detection circuit and obtain the first battery power according to the battery voltage, obtain the battery current detected by the current detection circuit and obtain the second battery power according to the battery current, and determine the current battery power according to the first battery power and the second battery power.

[0184] Please refer to Figure 11, which shows a structural block diagram of a computer-readable storage medium provided by an embodiment of the present application. Program code is stored in the computer-readable medium 300, and the program code can be called by a processor to execute the method described in the above method embodiment.

[0185] The computer-readable storage medium 300 can be an electronic memory such as a flash memory, EEPROM (electrically erasable programmable read-only memory), EPROM, hard disk, or ROM. Optionally, the computer-readable storage medium 300 includes a non-transitory computer-readable storage medium. The computer-readable storage medium 300 has a storage space for the program code 310 that executes any method step in the above method. These program codes can be read out from or written into one or more computer program products. The program code 310 can be compressed in an appropriate form, for example.

[0186] In summary, the power detection circuit, power detection method, and device provided by the embodiments of the present application obtain the battery voltage detected by the voltage detection circuit and obtain the first power of the battery according to the battery voltage; obtain the battery current detected by the current detection circuit and obtain the second power of the battery according to the battery current; determine the current power of the battery according to the first power and the second power, and further determine the power of the battery through the battery voltage and the battery current, reducing the cost of power detection.

[0187] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, and are not intended to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A power detection circuit, characterized in that, The power detection circuit includes: A voltage detection circuit for connecting to the battery and detecting the battery voltage of the battery; A current detection circuit for connecting to the battery and detecting the battery current of the battery under a reference voltage; A main control chip, respectively connected to the voltage detection circuit and the current detection circuit, for obtaining the battery voltage detected by the voltage detection circuit and obtaining the first power of the battery according to the battery voltage, obtaining the battery current detected by the current detection circuit and obtaining the second power of the battery according to the battery current, and determining the current power of the battery according to the first power and the second power.

2. A method for detecting electric quantity, characterized in that, Applied to the power detection circuit as described in claim 1, the method includes: Obtaining the battery voltage detected by the voltage detection circuit and obtaining the first power of the battery according to the battery voltage; Obtaining the battery current detected by the current detection circuit and obtaining the second power of the battery according to the battery current; Determining the current power of the battery according to the first power and the second power.

3. The method according to claim 2, wherein The obtaining of the battery voltage detected by the voltage detection circuit includes: If it is detected that the electronic device to which the battery belongs is powered on, obtaining the battery voltage detected by the voltage detection circuit.

4. The method according to claim 2, wherein The obtaining of the first power of the battery according to the battery voltage includes: Obtaining an initial power according to a first preset relationship and the battery voltage, wherein the first preset relationship includes corresponding relationships between multiple voltages and multiple powers; Obtaining the shutdown power of the electronic device to which the battery belongs before it is powered on; Obtaining the first power according to the magnitude relationship between the initial power and the shutdown power.

5. The method according to claim 4, wherein The obtaining of the first power according to the magnitude relationship between the initial power and the shutdown power includes: If it is determined based on the magnitude relationship that the ratio of the difference between the initial power and the shutdown power to the shutdown power is greater than a first threshold, determining the initial power as the first power; or If it is determined based on the magnitude relationship that the ratio of the difference between the initial power and the shutdown power to the shutdown power is less than or equal to the first threshold, determining the shutdown power as the first power.

6. The method according to claim 4, characterized in that, The method further includes: If it is detected that the battery charging is completed, determining the current power of the battery as the first total capacity of the battery; Determining a first target power based on the current power and the first total capacity; If the deviation between the first target power and the first total capacity is greater than a second threshold, determining the current power as the shutdown power of the electronic device to which the battery belongs before it is powered on.

7. The method according to claim 6, wherein The method further includes: If it is detected that the battery is not fully charged, obtaining the second total capacity of the battery determined most recently; Determining a second target power based on the second total capacity and the current power; If the deviation between the second target power and the second total capacity is less than or equal to the second threshold, determining the shutdown power determined most recently as the shutdown power of the electronic device to which the battery belongs before it is powered on.

8. The method according to claim 2, characterized in that The obtaining of the battery current detected by the current detection circuit includes: If it is detected that the electronic device to which the battery belongs is powered on, the current detection circuit is turned off to obtain the reference voltage; The current detection circuit is turned on, and the battery current detected by the current detection circuit is obtained based on the reference voltage.

9. The method according to claim 2, wherein The obtaining of the second power of the battery according to the battery current includes: Obtaining the current detection duration; Obtaining the periodic capacity change value according to the current detection duration and the battery current; Obtaining the target temperature coefficient according to the second preset relationship and the periodic capacity change value, wherein the second preset relationship includes the corresponding relationships between multiple capacities and multiple temperature coefficients; Obtaining the current integrated power according to the periodic capacity change value and the target temperature coefficient; Obtaining the second power according to the current integrated power and the first power.

10. The method according to claim 9, characterized in that, The obtaining of the second power according to the current integrated power and the first power includes: If it is detected that the battery is in a charging state, the sum of the current integrated power and the first power is determined as the second power; or If it is detected that the battery is not in a charging state, the difference between the current integrated power and the first power is determined as the second power.

11. The method according to claim 2, characterized in that, The determining of the current power of the battery according to the first power and the second power includes: If it is detected that the electronic device to which the battery belongs is powered on, the first power is determined as the current power of the battery; If it is detected that the battery is in a charging state or a discharging state after the electronic device to which the battery belongs is powered on, the second power is determined as the current power of the battery.

12. An electric quantity detection device, characterized in that, Applied to the power detection circuit as described in claim 1, the device includes: A first power obtaining module, configured to obtain the battery voltage detected by the voltage detection circuit and obtain the first power of the battery according to the battery voltage; A second power obtaining module, configured to obtain the battery current detected by the current detection circuit and obtain the second power of the battery according to the battery current; A current power determining module, configured to determine the current power of the battery according to the first power and the second power.

13. An electronic device, characterized in that, Including: One or more processors; A memory; The power detection circuit as described in claim 1; One or more application programs, wherein the one or more application programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs are configured to execute the method as described in any one of claims 2-11.

14. A computer-readable storage medium, characterized in that, Program code is stored in the computer-readable storage medium, and the program code can be called by the processor to execute the method as described in any one of claims 2-11.