BMS low-power-consumption operation method and device, computer equipment and medium

By detecting the reset cause and storing the sleep flag in the MCU sleep state, the watchdog's on state is determined, which solves the high power consumption and frequent reset problems caused by the MCU's in low-voltage BMS because the watchdog cannot be turned off, and achieves low power consumption and stable operation.

CN119201243APending Publication Date: 2024-12-27SMARTGEN TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411209366.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-30
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

MCUs are susceptible to external electromagnetic interference in low-voltage BMS, resulting in data chaos and system instability, and the watchdog cannot be turned off, which increases system power consumption and frequent resetting problems.

Method used

After the MCU enters the sleep state, it determines whether to turn off the watchdog by detecting the reset reason and storing the sleep flag. If it is a software reset and sleep state, the watchdog will not be turned on until the wake-up source wakes up, clear the flag and turn on; otherwise, sleep will be satisfied. When conditions are set, the sleep flag is stored and stored, and software reset is performed.

Benefits of technology

The watchdog shutdown in the MCU sleep state is realized, reducing system power consumption, extending standby time and reducing frequent resets, and improving system stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119201243A_ABST
    Figure CN119201243A_ABST
Patent Text Reader

Abstract

The invention provides a BMS low-power-consumption operation method, the BMS comprises an MCU, a watchdog and a small battery, the small battery is used for supplying power to the MCU and the watchdog, the MCU is internally provided with a random access memory (RAM) which is not lost in power failure, and operation data of the watchdog are stored in the RAM which is not lost in power failure, and the method comprises the following steps: after the BMS is powered on, detecting whether the last reset reason of the MCU is software reset, if yes, executing the step of executing the step of executing the step of executing the step of executing the step of executing the step of executing the step of executing the step of executing the step of executing the step of executing the step; if yes, further searching whether a dormancy mark exists in the RAM which is not lost during power failure to judge whether the BMS is in a dormancy state before restarting, not starting the watchdog when the BMS is in the dormancy state before restarting, setting a wake-up source and then entering the dormancy mode, and clearing the dormancy mark and starting the watchdog when detecting that the wake-up source is awakened; otherwise, the BMS normally operates to start the watchdog, whether the dormancy condition is met or not is judged, when the dormancy condition is met, a dormancy mark is set and stored in the RAM which is not lost during power failure, and then software resetting is conducted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of power management, and in particular to a BMS low-power operation method, device, computer equipment and medium. Background Art

[0002] Low-voltage BMS is generally used in energy storage systems with less energy. When the energy storage system is not working, reducing unnecessary energy consumption of the entire system can extend the service life of the energy storage system and reduce losses. A complete low-voltage BMS usually consists of three ICs: an analog front end (AFE), a microcontroller (MCU), and a fuel gauge. The MCU is the core component of the low-voltage BMS, which obtains information from the AFE and fuel gauge and connects to the rest of the system. Typically, a low-voltage BMS also has a small battery (auxiliary battery or small battery) to power the MCU and other low-voltage devices.

[0003] The MCU in the BMS is easily disturbed by external electromagnetic fields, which can cause data confusion, program errors or dead loops, and thus affect the normal operation of the entire system. As an important protection mechanism, the watchdog periodically checks the internal status of the BMS. Once an abnormality or error is found, it immediately sends a restart signal to the BMS to prevent the system from falling into an unstable or unpredictable state. In conventional MCU applications, when the MCU does not need to continue running, it can enter sleep mode through the sleep instruction. However, since the watchdog cannot be turned off after it is turned on, it can only be turned off by system reset or power failure. Therefore, the MCU needs to be woken up regularly to feed the watchdog to avoid system reset, which undoubtedly increases the power consumption of the entire system. If the MCU is not woken up regularly to feed the watchdog, the entire system will be frequently reset.

[0004] Therefore, it is urgent to find a solution to turn off the watchdog when the MCU enters the sleep state, so as to reduce the power consumption of the system, extend the working time or standby time of the system, and reduce the frequent reset of the system.

[0005] In order to solve the above problems, people have been seeking an ideal technical solution. Summary of the invention

[0006] The purpose of the present invention is to address the deficiencies of the prior art and thereby provide a BMS low-power operation method, device, computer equipment and medium. After the MCU enters the sleep state, the watchdog is also turned off at the same time to reduce the power consumption of the system.

[0007] In order to achieve the above object, the technical solution adopted by the present invention is: A first aspect provides a low-power operation method for a BMS, wherein the BMS includes an MCU, a watchdog, and a small battery, wherein the small battery is used to power the MCU and the watchdog, wherein a RAM that is not lost upon power failure is provided in the MCU, and operation data of the watchdog is stored in the RAM that is not lost upon power failure, and the method includes the following steps: After the BMS is powered on, it detects whether the last reset of the MCU is a software reset. If so, it further checks whether there is a sleep flag in the RAM that is not lost when the power is off to determine whether the BMS is in sleep mode before restarting. If the BMS is in sleep mode before restarting, the watchdog is not turned on. After the wake-up source is set, it enters sleep mode until a wake-up source is detected. The sleep flag is cleared and the BMS is running normally with the watchdog turned on. Otherwise, the BMS operates normally and starts the watchdog to determine whether the sleep conditions are met. When the sleep conditions are met, the sleep flag is set and stored in the RAM that is not lost when power is off, and then a software reset is performed.

[0008] Preferably, detecting whether the last reset reason of the MCU is a software reset includes: obtaining an MCU reset flag, determining whether the reset type of the MCU reset flag is a software reset, and if so, determining that it is a software reset.

[0009] A second aspect provides a BMS low power consumption operation device, comprising: The reset reason determination module is used to detect whether the last reset reason of the MCU is a software reset after the BMS is powered on; A sleep judgment module is used to check whether there is a sleep flag in the RAM that is not lost when power is off to judge whether the BMS is in sleep state before restarting when the reset reason is software reset; The re-sleep module is used to disable the watchdog when the BMS is in sleep mode before restarting. After setting the wake-up source, the BMS enters sleep mode until a wake-up source is detected. The sleep flag is cleared and the BMS starts to operate normally and the watchdog is turned on. The normal operation module is used to turn on the watchdog when the BMS is operating normally, determine whether the sleep conditions are met, set the sleep flag and store it in the RAM that will not be lost when the power is off, and then perform a software reset.

[0010] A third aspect provides a low-power BMS, including an MCU, a watchdog and a small battery, wherein the small battery is used to power the MCU and the watchdog, the MCU is provided with a RAM that is not lost when power is off, and the operation data of the watchdog is stored in the RAM that is not lost when power is off; It also includes the aforementioned BMS low power consumption operation device.

[0011] A fourth aspect provides a computer device, comprising: one or more processors; a memory for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the BMS low-power operation method as described above.

[0012] A fifth aspect provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the BMS low-power operation method as described above is implemented.

[0013] The present invention has outstanding substantive features and significant progress compared to the prior art. Specifically, after power-on, the present invention first detects the reason for the last reset of the MCU. If it is a software reset, it means that the BMS is restarted, otherwise it is considered that the BMS is powered off and then powered on again. When the BMS is restarted, it is further determined whether the BMS was in a dormant state before the restart by whether there is a dormant flag. If the BMS was in a dormant state before the restart, it means that the BMS needs to be dormant this time. At this time, the watchdog is not turned on, and the wake-up source is set to go into sleep directly. When the BMS is dormant, if there is a wake-up source to wake it up, the dormant flag is cleared, the watchdog is turned on, and the BMS operates normally. In other states, such as the BMS is powered off and then powered on again or the BMS is restarted and was not in a dormant state before the restart, the BMS operates normally and turns on the watchdog to determine whether the dormant conditions are met. When the dormant conditions are met, the dormant flag is set and stored in a RAM that is not lost when the power is off, and then a software reset is performed. This special method is used to implement a method in which the watchdog is turned off and the system enters dormancy. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1 It is a schematic diagram of the process of Example 1 of the present invention. DETAILED DESCRIPTION

[0015] The technical solution of the present invention is further described in detail below through specific implementation methods.

[0016] Example 1 This embodiment provides a BMS low-power operation method, the BMS includes an MCU, a watchdog and a small battery, the small battery is used to power the MCU and the watchdog, the MCU is provided with a RAM that is not lost when power is off, and the operation data of the watchdog is stored in the RAM that is not lost when power is off, such as Figure 1 As shown, the method comprises the following steps: After the BMS is powered on, it detects whether the last reset reason of the MCU is a software reset. If it is not a software reset but a power-off and power-on, the BMS will run normally and start the watchdog to determine whether the sleep conditions are met. If the sleep conditions are met, the sleep flag is set and stored in the RAM that is not lost when the power is off, and then the software reset is performed.

[0017] If it is a software reset, further check whether there is a sleep flag in the RAM that is not lost when power is off to determine whether the BMS is in sleep state before restarting. If it is in sleep state before restarting the BMS, the watchdog is not turned on, and the sleep mode is entered after the wake-up source is set to continue sleeping; until the wake-up source is detected to wake up, the sleep flag is cleared, and the BMS operates normally and the watchdog is turned on; Determine whether the sleep condition is met. If the sleep condition is met, set the sleep flag and store it in RAM that is not lost when power is off, and then perform a software reset.

[0018] In specific implementation, the wake-up source can be charging wake-up, discharging wake-up, physical switch, communication signal and external analog signal. It can be understood that as long as the set wake-up source wakes up, the sleep mode will be exited until the sleep condition is met again, and then the sleep mode will be entered again.

[0019] In one embodiment, detecting whether the last reset reason of the MCU is a software reset includes: obtaining an MCU reset flag, determining whether the reset type of the MCU reset flag is a software reset, and if so, determining that it is a software reset.

[0020] Specifically, reset types include power-on reset and system reset, among which system reset includes external pin reset, low voltage reset, watchdog reset, low leakage wake-up reset, clock loss reset, clock lock reset, software reset, etc. Different reset types have different reset flags, for example, the power-on reset flag is POR, and the software reset flag is SW. After obtaining the MCU reset flag, determine whether the cause of the last reset is a software reset by judging whether the MCU reset flag is SW.

[0021] After the BMS is powered on, the embodiment of the present invention first detects the reason for the last reset of the MCU. If it is a software reset, it means that the BMS is restarted, otherwise it is considered that the BMS is powered off and then powered on again.

[0022] When the BMS restarts, it is further judged whether the BMS was in sleep state before restarting by whether there is a sleep flag. If the BMS was in sleep state before restarting, it means that the BMS needs to sleep this time. At this time, the watchdog is not turned on, and the wake-up source is set to sleep directly. When the BMS is in sleep state, if there is a wake-up source to wake it up, the sleep flag is cleared, the watchdog is turned on, and the BMS runs normally.

[0023] In other states, such as when the BMS is powered off and then powered on again or when the BMS is restarted and is not in sleep state before the restart, the BMS will run normally and start the watchdog to determine whether the sleep conditions are met. If the sleep conditions are met, the sleep flag is set and stored in the RAM that is not lost when the power is off, and then the software is reset. This special method realizes the method of turning off the watchdog and putting the system into sleep, and at the same time prevents the MCU from being powered off when the small battery is dead, and then can enter the normal rest process again when it is powered on again.

[0024] Example 2 This embodiment provides a BMS low power consumption operation device, including: The reset reason determination module is used to detect whether the last reset reason of the MCU is a software reset after the BMS is powered on; A sleep judgment module is used to check whether there is a sleep flag in the RAM that is not lost when power is off to judge whether the BMS is in sleep state before restarting when the reset reason is software reset; The re-sleep module is used to disable the watchdog when the BMS is in sleep mode before restarting. After setting the wake-up source, the BMS enters sleep mode until a wake-up source is detected. The sleep flag is cleared and the BMS starts to operate normally and the watchdog is turned on. The normal operation module is used to turn on the watchdog when the BMS is operating normally, determine whether the sleep conditions are met, set the sleep flag and store it in the RAM that will not be lost when the power is off, and then perform a software reset.

[0025] Specifically, the operation process of the BMS low-power operation device refers to the low-power operation method described in Example 1, which will not be repeated here.

[0026] Example 3 This embodiment provides a low-power BMS, including an MCU, a watchdog and a small battery, wherein the small battery is used to supply power to the MCU and the watchdog, and a RAM that is not lost when power is off is provided in the MCU, and the operation data of the watchdog is stored in the RAM that is not lost when power is off; It also includes the BMS low power consumption operation device described in Example 2.

[0027] Example 4 This embodiment provides a computer device, which includes: one or more processors; a memory for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the BMS low-power operation method as described in Example 1.

[0028] Example 5 This embodiment provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the BMS low-power operation method as described in Embodiment 1 is implemented.

[0029] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, ordinary technicians in the field should understand that the specific implementation methods of the present invention can still be modified or some technical features can be replaced by equivalents without departing from the spirit of the technical solution of the present invention, which should be included in the scope of the technical solution for protection of the present invention.

Claims

1. A BMS low-power operation method, the BMS includes an MCU, a watchdog and a small battery, the small battery is used to power the MCU and the watchdog, the MCU is provided with a RAM that is not lost when power is off, and the operation data of the watchdog is stored in the RAM that is not lost when power is off, characterized in that: The following steps are involved: After the BMS is powered on, it detects whether the last reset of the MCU is a software reset. If so, it further checks whether there is a sleep flag in the RAM that is not lost when the power is off to determine whether the BMS is in sleep mode before restarting. If the BMS is in sleep mode before restarting, the watchdog is not turned on. After the wake-up source is set, it enters sleep mode until a wake-up source is detected. The sleep flag is cleared and the BMS is running normally with the watchdog turned on. Otherwise, the BMS operates normally and starts the watchdog to determine whether the sleep conditions are met. When the sleep conditions are met, the sleep flag is set and stored in the RAM that is not lost when power is off, and then a software reset is performed.

2. A low power consumption operation method in a BMS sleep state according to claim 1, characterized in that: Detecting whether the last reset reason of the MCU is a software reset includes: obtaining an MCU reset flag, determining whether the reset type of the MCU reset flag is a software reset, and if so, determining that it is a software reset.

3. A BMS low power consumption operation device, characterized in that: include The reset reason determination module is used to detect whether the last reset reason of the MCU is a software reset after the BMS is powered on; A sleep judgment module is used to check whether there is a sleep flag in the RAM that is not lost when power is off to judge whether the BMS is in sleep state before restarting when the reset reason is software reset; The re-sleep module is used to disable the watchdog when the BMS is in sleep mode before restarting. After setting the wake-up source, the BMS enters sleep mode until a wake-up source is detected. The sleep flag is cleared and the BMS starts to operate normally and the watchdog is turned on. The normal operation module is used to turn on the watchdog when the BMS is operating normally, determine whether the sleep conditions are met, set the sleep flag and store it in the RAM that will not be lost when the power is off, and then perform a software reset.

4. A BMS low power consumption operation device according to claim 3, characterized in that: The reset reason determination module detects the last restart reason of the MCU, including: obtaining an MCU reset flag, determining whether the reset type of the MCU reset flag is a software reset, and if so, determining that it is a software reset.

5. A low power consumption BMS, characterized in that: It includes an MCU, a watchdog and a small battery, wherein the small battery is used to supply power to the MCU and the watchdog, the MCU is provided with a RAM which is not lost in case of power failure, and the operation data of the watchdog is stored in the RAM which is not lost in case of power failure; It also includes the BMS low power consumption operation device as described in claim 3 or 4.

6. A computer device, characterized in that: The computer device includes: one or more processors; a memory for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the BMS low-power operation method as described in any one of claims 1-2.

7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the BMS low-power operation method according to any one of claims 1 to 2 is implemented.