A battery control method, apparatus, device, and medium
By acquiring and processing battery information through the state machine in the battery management system, the numerical sequence of charge and discharge states is automatically determined, which solves the problem of increased hardware costs in battery control schemes and achieves the effect of battery autonomously switching states.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-28
- Publication Date
- 2026-03-27
AI Technical Summary
Existing battery control solutions require an additional host to control all batteries in the electric device, increasing hardware costs, and individual batteries cannot autonomously switch between discharge and charging states.
The battery management system obtains battery information periodically through the state machine, determines the current and next charge/discharge state sequence, and instructs the discharge and charge switches to turn on or off based on these sequence, thus enabling the battery to autonomously switch states.
The battery can automatically switch between discharge and charging states without the need for additional host settings, reducing hardware costs.
Smart Images

Figure CN116749831B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a battery control method, apparatus, device, and medium. Background Technology
[0002] Electric bicycles, electric motorcycles, and other electric devices typically incorporate multiple batteries. These batteries constitute the device's battery system. The positive terminals of each battery are connected in parallel to the positive terminal of the electric device, and the negative terminals are connected in parallel to the negative terminal, thus achieving parallel connection of the batteries within the device. Each battery can be equipped with a unique corresponding Battery Management System (BMS), a discharge switch, and a charging switch. The BMS controls the on / off state of the battery's discharge and charging switches.
[0003] In related technologies, a common battery control scheme involves setting up a host computer within the electric device to control all the batteries in the device. Based on preset discharge and charging conditions, the host computer instructs each battery management system to turn its discharge and charging switches on or off, thereby switching the discharge and charging states of each battery. This battery control scheme requires an additional host computer to control all the batteries in the electric device, increasing hardware costs, and individual batteries cannot autonomously switch between discharge and charging states. Summary of the Invention
[0004] This invention provides a battery control method, apparatus, device, and medium to solve the problems in related technologies where battery control schemes require an additional host to control all batteries in an electric device, increasing hardware costs and preventing individual batteries from autonomously switching between discharge and charging states.
[0005] According to one aspect of the present invention, a battery control method is provided, applied in a battery management system of a battery, comprising:
[0006] The current battery information of the battery and other batteries is acquired periodically through a state machine. Based on the current battery information of the battery and other batteries, the current charge and discharge state numerical sequence of the battery system is determined.
[0007] The current battery information includes: the current battery enable variable, the current discharge switch state value, and the current charging switch state value.
[0008] The state machine determines the next charge / discharge state value sequence corresponding to the current charge / discharge state value sequence. Based on the state value corresponding to the battery in the next charge / discharge state value sequence, it instructs the battery's discharge switch and charging switch to be turned on or off.
[0009] According to another aspect of the present invention, a battery control device is provided, configured in a battery management system of a battery, comprising:
[0010] The numerical sequence determination module is used to periodically acquire the current battery information of the battery and other batteries through a state machine, and determine the current charge and discharge state numerical sequence of the battery system based on the current battery information of the battery and other batteries.
[0011] The current battery information includes: the current battery enable variable, the current discharge switch state value, and the current charging switch state value.
[0012] The switch indicator module is used to determine the next charge / discharge state value sequence corresponding to the current charge / discharge state value sequence through the state machine, and to indicate whether the discharge switch and the charging switch of the battery are turned on or off according to the state value corresponding to the battery in the next charge / discharge state value sequence.
[0013] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0014] At least one processor;
[0015] and a memory that is in communication with the at least one processor network;
[0016] The memory stores a computer program that can be executed by the at least one processor, which is then executed by the at least one processor to enable the at least one processor to perform the battery control method according to any embodiment of the present invention.
[0017] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the battery control method according to any embodiment of the present invention.
[0018] The technical solution of this invention uses a state machine in the battery management system to periodically acquire the current battery enable variables, current discharge switch state values, and current charging switch state values of the battery and other batteries. Based on these values, the current charge / discharge state value sequence of the battery system is determined. Then, the state machine determines the next charge / discharge state value sequence corresponding to the current sequence. Based on the state value corresponding to the battery in the next sequence, the discharge and charging switches of the battery are instructed to be turned on or off. This solves the problem that related battery control schemes require an additional control unit for all batteries in the electric device. The use of a host computer to control the battery increases hardware costs and addresses the issue that individual batteries cannot autonomously switch between discharge and charge states. This paper addresses this problem by employing a state machine from a battery management system. This machine automatically determines the sequence of values representing the discharge and charge states of each battery in the system at the next moment, based on the battery enable variables, discharge switch state values, and charge switch state values at the current moment. It then automatically instructs the battery's discharge and charge switches to turn on or off according to the corresponding state values in the sequence. This allows the batteries to autonomously switch between discharge and charge states based on the system's overall charging and discharging status, eliminating the need for a separate host computer to control all batteries in the electric device.
[0019] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 This is a flowchart of a battery control method provided in Embodiment 1 of the present invention.
[0022] Figure 2 This is a flowchart of a battery control method provided in Embodiment 2 of the present invention.
[0023] Figure 3 This is a schematic diagram of a battery control device provided in Embodiment 3 of the present invention.
[0024] Figure 4 A schematic diagram of the structure of an electronic device for implementing the battery control method of this invention. Detailed Implementation
[0025] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0026] It should be noted that the terms "target," "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising," "including," and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0027] Example 1
[0028] Figure 1 This is a flowchart illustrating a battery control method according to Embodiment 1 of the present invention. This embodiment is applicable to situations where the battery autonomously switches between discharge and charging states during the use of electric equipment. The method can be executed by a battery control device, which can be implemented in hardware and / or software and can be configured within the battery's battery management system. Figure 1 As shown, the method includes:
[0029] Step 101: Using a state machine, periodically acquire the current battery information of the battery and other batteries, and determine the current charge / discharge state sequence of the battery system based on the current battery information of the battery and other batteries.
[0030] The current battery information includes: the current battery enable variable, the current discharge switch state value, and the current charging switch state value.
[0031] Optionally, the battery can be any one of the batteries in the electric device. The other batteries are all the batteries in the electric device other than the battery mentioned above. Electric devices typically have multiple batteries. These multiple batteries constitute the battery system of the electric device. The positive terminals of each battery are connected in parallel to the positive terminal of the electric device, and the negative terminals of each battery are connected in parallel to the negative terminal of the electric device, thus achieving parallel connection of the batteries in the electric device. Each battery has a uniquely corresponding battery management system, discharge switch, and charging switch.
[0032] Optionally, the battery management system is an electronic control system used to monitor the battery's operating status. The state machine is a program written and configured by engineers within the battery management system to periodically determine the current charge / discharge state value sequence of the battery system, the next charge / discharge state value sequence corresponding to the current sequence, and, based on the state value corresponding to the battery in the next charge / discharge state value sequence, instruct the battery's discharge and charge switches to be turned on or off, thereby enabling the battery to autonomously switch between discharge and charge states according to the battery system's charge / discharge state.
[0033] Optionally, the battery discharge switch is a switch connected to the battery used to start or stop the battery's discharge function. When the battery discharge switch is turned on, the battery starts its discharge function and can discharge to power electric devices. When the battery discharge switch is turned off, the battery stops its discharge function, stops discharging to external devices, and does not supply power to electric devices. For example, the battery discharge switch is a field-effect transistor connected to the battery used to start or stop the battery's discharge function.
[0034] Optionally, the battery charging switch is a switch connected to the battery used to start or stop the battery charging function. When the battery charging switch is turned on, the battery starts the charging function and can receive charging from an external power source. When the battery charging switch is turned off, the battery stops the charging function and does not receive charging from an external power source. For example, the battery charging switch is a field-effect transistor connected to the battery used to start or stop the battery charging function.
[0035] Optionally, the current battery information includes: the current battery enable variable, the current discharge switch state value, and the current charging switch state value.
[0036] Optionally, the current battery enabling variable is the battery enabling variable at the current moment. The battery enabling variable is a value set in the battery management system to indicate whether the battery can be charged and discharged. The battery enabling variable is 1 or 0. If the battery enabling variable is 1, it indicates that the battery can be charged and discharged. If the battery enabling variable is 0, it indicates that the battery cannot be charged and discharged.
[0037] Optionally, the battery management system can update the battery's current battery enabling variables in real time based on the battery's operating status. For example, the battery management system updates the battery enabling variables to 0 after detecting that the battery has been removed. The battery management system also updates the battery enabling variables to 0 after detecting a battery malfunction.
[0038] Optionally, the current discharge switch state value of the battery is the discharge switch state value of the battery at the current moment. The battery discharge switch state value is a value set in the battery management system to indicate whether the battery discharge switch is on or off. The discharge switch state value is 1 or 0. If the battery discharge switch state value is 1, it indicates that the battery discharge switch is on. If the battery discharge switch state value is 0, it indicates that the battery discharge switch is off.
[0039] Optionally, the current charging switch state value of the battery is the charging switch state value of the battery at the current moment. The charging switch state value of the battery is a value set in the battery management system to indicate whether the charging switch is on or off. The charging switch state value is 1 or 0. If the charging switch state value of the battery is 1, it indicates that the charging switch is on. If the charging switch state value of the battery is 0, it indicates that the charging switch is off.
[0040] Optionally, the state machine can obtain the current battery information of the battery from the battery management system to which it belongs. The state machine can also obtain the current battery information of other batteries based on the communication connection between its battery management system and the battery management systems of other batteries.
[0041] Optionally, the step of periodically acquiring the current battery information of the battery and other batteries includes: periodically acquiring the current battery information of the battery and other batteries at preset time intervals.
[0042] Optionally, the state machine acquires the current battery information of the battery and other batteries every preset time interval. The preset time interval can be set according to business requirements. For example, the preset time interval is 5 minutes, and the state machine acquires the current battery information of the battery and other batteries every 5 minutes.
[0043] Optionally, the current state-of-charge (SOC) sequence of the battery system is the sequence of SOC values of the electric device's battery system at the current moment. The SOC sequence is a sequence of values composed of the discharge switch states of the disabled batteries, the charging switch states of the disabled batteries, the discharge switch states of the enabled batteries, and the charging switch states of the enabled batteries. The current SOC sequence is a sequence of values composed of the discharge switch states of the currently disabled batteries, the charging switch states of the currently disabled batteries, the discharge switch states of the currently enabled batteries, and the charging switch states of the currently enabled batteries.
[0044] Optionally, the disabled batteries in the battery system include all batteries in the battery system whose battery enable variable is 0, that is, all batteries in the battery system that cannot be charged or discharged. The currently disabled batteries in the battery system are the disabled batteries in the battery system at the current moment.
[0045] Optionally, the discharge switch status value for disabled batteries is used to indicate whether the discharge switches of all batteries that cannot be charged or discharged are on or off. The discharge switch status value for disabled batteries is 01, 10, or 00. If the discharge switch status value is 01, it indicates that all discharge switches of all batteries that cannot be charged or discharged are on. If the discharge switch status value is 10, it indicates that all discharge switches of all batteries that cannot be charged or discharged are off. If the discharge switch status value is 00, it indicates that not all discharge switches of all batteries that cannot be charged or discharged are off.
[0046] Optionally, the charging switch status value for disabled batteries is used to indicate whether the charging switches for all batteries that cannot be charged or discharged are on or off. The charging switch status value for disabled batteries is 01, 10, or 00. If the charging switch status value is 01, it indicates that all charging switches for all batteries that cannot be charged or discharged are on. If the charging switch status value is 10, it indicates that all charging switches for all batteries that cannot be charged or discharged are off. If the charging switch status value is 00, it indicates that some charging switches for all batteries that cannot be charged or discharged are not off.
[0047] Optionally, the enabling cells of the battery system include all cells in the battery system whose enabling variable is 1, that is, all cells in the battery system that can be charged and discharged. The currently enabling cells of the battery system are the enabling cells of the battery system at the current moment.
[0048] Optionally, the enable battery discharge switch status value is used to indicate whether the discharge switches of all batteries capable of charging and discharging are on or off. The enable battery discharge switch status value is 01, 10, or 00. If the enable battery discharge switch status value is 01, it indicates that all discharge switches of all batteries capable of charging and discharging are on. If the enable battery discharge switch status value is 10, it indicates that all discharge switches of all batteries capable of charging and discharging are off. If the enable battery discharge switch status value is 00, it indicates that not all discharge switches of all batteries capable of charging and discharging are off.
[0049] Optionally, the enabling battery charging switch status value is used to indicate whether the charging switches of all batteries capable of charging and discharging are on or off. The enabling battery charging switch status value is 01, 10, or 00. If the enabling battery charging switch status value is 01, it indicates that all charging switches of all batteries capable of charging and discharging are on. If the enabling battery charging switch status value is 10, it indicates that all charging switches of all batteries capable of charging and discharging are off. If the enabling battery charging switch status value is 00, it indicates that not all charging switches of all batteries capable of charging and discharging are off.
[0050] Optionally, determining the current charge / discharge state value sequence of the battery system based on the current battery information of the battery and the other batteries includes: performing the following operations through the state machine: determining the currently disabled battery and the currently enabled battery of the battery system based on the current battery enable variables of the battery and the other batteries; determining the discharge switch state value of the currently disabled battery, the charging switch state value of the currently disabled battery, the discharge switch state value of the currently enabled battery, and the charging switch state value of the currently enabled battery based on the current discharge switch state value and the current charging switch state value of the battery and the other batteries; and concatenating the discharge switch state value of the currently disabled battery, the charging switch state value of the currently disabled battery, the discharge switch state value of the currently enabled battery, and the charging switch state value of the currently enabled battery to obtain the current charge / discharge state value sequence of the battery system.
[0051] Optionally, based on the current battery enable variables of the battery and the other batteries, the currently disabled batteries and currently enabled batteries of the battery system are determined, including: determining all batteries in the battery and the other batteries whose current battery enable variables are 0 as the currently disabled batteries of the battery system; and determining all batteries in the battery and the other batteries whose current battery enable variables are 1 as the currently enabled batteries of the battery system.
[0052] Optionally, based on the current discharge switch state value and the current charging switch state value of the battery and the other batteries, the discharge switch state value of the currently disabled battery, the charging switch state value of the currently disabled battery, the discharge switch state value of the currently enabled battery, and the charging switch state value of the currently enabled battery are determined, including: if the current discharge switch state value of all batteries with a current battery enable variable of 0 in the battery and the other batteries is 1, then the discharge switch state value of the currently disabled battery is determined to be 01; if the current discharge switch state value of all batteries with a current battery enable variable of 0 in the battery and the other batteries is 0, then the discharge switch state value of the currently disabled battery is determined to be 10; if all batteries with a current battery enable variable of 0 in the battery and the other batteries include batteries with a current discharge switch state value of 1 and batteries with a current discharge switch state value of 0, then the discharge switch state value of the currently disabled battery is determined to be 00.
[0053] Optionally, it further includes: if the current charging switch state value of all batteries with a current battery enable variable of 0 in the battery and the other batteries is 1, then the charging switch state value of the currently disabled battery is determined to be 01; if the current charging switch state value of all batteries with a current battery enable variable of 0 in the battery and the other batteries is 0, then the charging switch state value of the currently disabled battery is determined to be 10; if the battery and the other batteries with a current battery enable variable of 0 include a battery with a current charging switch state value of 1, and also include a battery with a current charging switch state value of 0, then the charging switch state value of the currently disabled battery is determined to be 00.
[0054] Optionally, it further includes: if the current discharge switch state value of all batteries with a current battery enable variable of 1 in the battery and the other batteries is 1, then the discharge switch state value of the currently enabled battery is determined to be 01; if the current discharge switch state value of all batteries with a current battery enable variable of 1 in the battery and the other batteries is 0, then the discharge switch state value of the currently enabled battery is determined to be 10; if the battery and the other batteries with a current battery enable variable of 1 include a battery with a current discharge switch state value of 1 and also include a battery with a current discharge switch state value of 0, then the discharge switch state value of the currently enabled battery is determined to be 00.
[0055] Optionally, it further includes: if the current charging switch state value of all batteries with a current battery enable variable of 1 in the battery and the other batteries is 1, then the charging switch state value of the currently enabled battery is determined to be 01; if the current charging switch state value of all batteries with a current battery enable variable of 1 in the battery and the other batteries is 0, then the charging switch state value of the currently enabled battery is determined to be 10; if the battery and the other batteries with a current battery enable variable of 1 include a battery with a current charging switch state value of 1 and also include a battery with a current charging switch state value of 0, then the charging switch state value of the currently enabled battery is determined to be 00.
[0056] Optionally, after determining the state values of the discharge switch transistors of the currently disabled battery, the charging switch transistors of the currently disabled battery, the discharge switch transistors of the currently enabled battery, and the charging switch transistors of the currently enabled battery, these values are concatenated to obtain a numerical sequence. The resulting numerical sequence represents the current charge / discharge state sequence of the battery system.
[0057] In a specific example, the state value of the discharge switch of the currently disabled battery is determined to be 10, the state value of the charging switch of the currently disabled battery is 10, the state value of the discharge switch of the currently enabled battery is 10, and the state value of the charging switch of the currently enabled battery is 00. Connecting the state values of the discharge switch of the currently disabled battery, the charging switch of the currently disabled battery, the discharge switch of the currently enabled battery, and the charging switch of the currently enabled battery yields the current charge / discharge state value sequence of the battery system: 10101000.
[0058] Step 102: Using the state machine, determine the next charge / discharge state value sequence corresponding to the current charge / discharge state value sequence, and instruct the discharge switch and charging switch of the battery to be turned on or off according to the state value corresponding to the battery in the next charge / discharge state value sequence.
[0059] Optionally, the current state-of-charge (SOC) sequence is the sequence of SOC values for the battery system of the electric device at the current moment. The current SOC sequence includes the SOC state values of the discharge switch for currently disabled batteries, the SOC state values of the charge switch for currently disabled batteries, the SOC state values of the discharge switch for currently enabled batteries, and the SOC state values of the charge switch for currently enabled batteries. In other words, the current SOC sequence includes SOC values representing the discharge and charge states of disabled batteries in the battery system at the current moment, and SOC values representing the discharge and charge states of enabled batteries in the battery system at the current moment.
[0060] Optionally, the next charge / discharge state value sequence corresponding to the current charge / discharge state value sequence is a value sequence that includes state values representing the discharge and charge states that the unenabled battery in the battery system needs to be in at the next time after the current time, and state values representing the discharge and charge states that the enabled battery in the battery system needs to be in at the next time after the current time.
[0061] Optionally, before periodically acquiring the current battery information of the battery and other batteries through the state machine, the method further includes: acquiring the numerical sequence of each candidate charge / discharge state of the battery system, and the next charge / discharge state numerical sequence corresponding to each candidate charge / discharge state numerical sequence; and storing each candidate charge / discharge state numerical sequence and the next charge / discharge state numerical sequence corresponding to each candidate charge / discharge state numerical sequence to a preset storage location.
[0062] Optionally, the various alternative charge / discharge state value sequences of the battery system are different charge / discharge state value sequences that the state machine can determine based on the battery information of each battery under different conditions.
[0063] In a specific example, the numerical sequence of the various candidate charge / discharge states of the battery system includes: 10101010, 00010110, 01101000, 00101010, 00010100, 01101001, 10101000, 00010101, 01001010, 10101001, 10000001, 01001000, 10100000, 10010010, 01001001, 10100001, 10010000, 010110 10, 10000010, 10010001, 01011000, 10000000, 00100110, 01011001, 10001010, 10100110, 00101000, 01100001, 00011000, 00010000, 01000010, 00011001, 00010001, 01100000, 01100010, 01100110, 01000000, 00100101, 0110010 1, 01000001, 00000110, 01000110, 01010010, 00100100, 01100100, 01010000, 00000100, 01000100, 01010001, 00000101, 01000101, 00100001, 10001000, 01010110, 10001001, 10100101, 00001010, 10011010, 10000110, 00001000 , 10011000, 10000100, 00001001, 10011001, 10000101, 00011010, 00000000, 00100010, 10010110, 00000001, 10100010, 10010100, 00010010, 01101010, 10010101, 00100000, 01010101, 01010100, 10100100, 00101001, 00000010.
[0064] Optionally, the next charge / discharge state value sequence corresponding to the candidate charge / discharge state value sequence is a sequence of values that characterizes the state of discharge and charge that the unenabled battery in the battery system should be in at the next moment after the current time when the current charge / discharge state value sequence is the candidate charge / discharge state value sequence, and the state values that characterize the state of discharge and charge that the enabled battery in the battery system should be in at the next moment after the current time when the current charge / discharge state value sequence is the candidate charge / discharge state value sequence.
[0065] Optionally, the technician uploads the numerical sequences of each alternative charge / discharge state of the battery system, as well as the corresponding next charge / discharge state numerical sequence, to the battery management system. The battery management system obtains the numerical sequences of each alternative charge / discharge state of the battery system uploaded by the technician, and then stores them in a preset storage location.
[0066] Optionally, the preset storage location can be a file set in the battery management system for storing the numerical sequences of each alternative charge / discharge state of the battery system, as well as the next numerical sequence of charge / discharge state corresponding to each alternative charge / discharge state numerical sequence.
[0067] Optionally, determining the next charge / discharge state value sequence corresponding to the current charge / discharge state value sequence includes: performing the following operations through the state machine: querying a target candidate charge / discharge state value sequence that is the same as the current charge / discharge state value sequence from among the candidate charge / discharge state value sequences stored in a preset storage location; and determining the next charge / discharge state value sequence corresponding to the target candidate charge / discharge state value sequence as the next charge / discharge state value sequence corresponding to the current charge / discharge state value sequence.
[0068] Optionally, the target candidate charge / discharge state value sequence is the same as the current charge / discharge state value sequence. The target candidate charge / discharge state value sequence is the same as the current charge / discharge state value sequence. Therefore, the next charge / discharge state value sequence corresponding to the target candidate charge / discharge state value sequence is the next charge / discharge state value sequence corresponding to the current charge / discharge state value sequence.
[0069] Optionally, instructing the discharge switch and charging switch of the battery to be turned on or off based on the state value corresponding to the battery in the next charge / discharge state value sequence includes: performing the following operations through the state machine: if the battery is a currently disabled battery in the battery system, then extracting the state values of the discharge switch and charging switch of the disabled battery in the next charge / discharge state value sequence; instructing the discharge switch of the battery to be turned off based on the state value of the discharge switch of the disabled battery; and instructing the charging switch of the battery to be turned off based on the state value of the charging switch of the disabled battery.
[0070] Optionally, the discharge switch state value of the unenabled battery in the next charge / discharge state value sequence is a state value used to characterize the discharge state that the unenabled battery in the battery system needs to be in at the next moment after the current moment.
[0071] Optionally, based on the state value of the discharge switch transistor of the disabled battery, instructing the battery's discharge switch transistor to be turned off includes: if the current state value of the discharge switch transistor of the disabled battery is 10, instructing the battery's discharge switch transistor to be turned off. If the current state value of the discharge switch transistor of the disabled battery is 10, indicating that the disabled batteries in the battery system need to disable their discharge function at the next time after the current time, that is, the discharge switch transistors of all disabled batteries in the battery system need to be turned off, then instructing the battery's discharge switch transistor to be turned off.
[0072] Optionally, instructing the battery's discharge switch to turn off includes: performing the following operation through the state machine: sending a turn-off signal to the control terminal of the battery's discharge switch to instruct the battery's discharge switch to turn off.
[0073] Optionally, the state machine can instruct the battery's discharge and charging switches to be turned off by sending a shutdown signal to the control terminals of the battery's discharge and charging switches. The state machine can also instruct the battery's discharge and charging switches to be turned on by sending an on signal to the control terminals of the battery's discharge and charging switches. A shutdown signal indicates that the switches are turned off. An on signal indicates that the switches are turned on. Instructing the battery's discharge switch to be on means instructing the battery to start its discharge function. Instructing the battery's discharge switch to be off means instructing the battery to stop its discharge function. Instructing the battery's charging switch to be on means instructing the battery to start its charging function. Instructing the battery's discharge switch to be off means instructing the battery to stop its charging function.
[0074] Optionally, the charging switch state value of the unenabled battery in the next charge / discharge state value sequence is a state value used to characterize the charging state that the unenabled battery in the battery system needs to be in at the next moment after the current moment.
[0075] Optionally, instructing the charging switch of the disabled battery to turn off based on the state value of the charging switch of the disabled battery includes: instructing the charging switch of the battery to turn off based on the state value of the charging switch of the disabled battery, including: if the current state value of the charging switch of the disabled battery is 10, instructing the charging switch of the battery to turn off. If the current state value of the charging switch of the disabled battery is 10, it indicates that the disabled batteries in the battery system need to turn off their charging function in the next moment after the current moment, that is, the charging switches of all disabled batteries in the battery system need to be turned off, then instructing the charging switch of the battery to turn off.
[0076] Optionally, instructing the charging switch of the battery to turn off includes: performing the following operation through the state machine: sending a turn-off signal to the control terminal of the charging switch of the battery to instruct the charging switch of the battery to turn off.
[0077] Optionally, instructing the discharge switch and charging switch of the battery to be turned on or off based on the state value corresponding to the battery in the next charge / discharge state value sequence includes: performing the following operations through the state machine: if the battery is the currently enabled battery of the battery system, extracting the state values of the discharge switch and charging switch of the enabled battery in the next charge / discharge state value sequence; instructing the discharge switch of the battery to be turned on based on the state value of the discharge switch of the enabled battery; and instructing the charging switch of the battery to be turned on based on the state value of the charging switch of the enabled battery.
[0078] Optionally, the discharge switch state value of the enabling battery in the next charge / discharge state value sequence is a state value used to characterize the discharge state that the enabling battery in the battery system needs to be in at the next time after the current time.
[0079] Optionally, based on the state value of the discharge switch of the enabling battery, instructing the battery's discharge switch to be turned on includes: if the current state value of the discharge switch of the enabling battery is 01, instructing the battery's discharge switch to be turned on. If the current state value of the discharge switch of the enabling battery is 01, it indicates that the enabling battery in the battery system needs to start its discharge function at the next time after the current time, that is, all the discharge switches of the enabling batteries in the battery system need to be turned on, then instructing the battery's discharge switch to be turned on.
[0080] Optionally, instructing the discharge switch of the battery to be turned on includes: performing the following operation through the state machine: sending a turn-on signal to the control terminal of the discharge switch of the battery to instruct the discharge switch of the battery to be turned on.
[0081] Optionally, the charging switch state value of the enabled battery in the next charge / discharge state value sequence is a state value used to characterize the charging state that the enabled battery in the battery system needs to be in at the next moment after the current moment.
[0082] Optionally, instructing the charging switch of the battery to be turned on based on the state value of the enabling battery's charging switch includes: instructing the charging switch of the battery to be turned on based on the state value of the enabling battery's charging switch, including: if the current state value of the enabling battery's charging switch is 01, instructing the charging switch of the battery to be turned on. If the current state value of the enabling battery's charging switch is 01, it indicates that the enabling batteries in the battery system need to start charging at the next time after the current time, that is, all the charging switches of the enabling batteries in the battery system need to be turned on, then instructing the charging switch of the battery to be turned on.
[0083] Optionally, instructing the charging switch of the battery to be turned on includes: performing the following operation through the state machine: sending a turn-on signal to the control terminal of the charging switch of the battery to instruct the charging switch of the battery to be turned on.
[0084] The technical solution of this invention uses a state machine in the battery management system to periodically acquire the current battery enable variables, current discharge switch state values, and current charging switch state values of the battery and other batteries. Based on these values, the current charge / discharge state value sequence of the battery system is determined. Then, the state machine determines the next charge / discharge state value sequence corresponding to the current sequence. Based on the state value corresponding to the battery in the next sequence, the discharge and charging switches of the battery are instructed to be turned on or off. This solves the problem that related battery control schemes require an additional control unit for all batteries in the electric device. The use of a host computer to control the battery increases hardware costs and addresses the issue that individual batteries cannot autonomously switch between discharge and charge states. This paper addresses this problem by employing a state machine from a battery management system. This machine automatically determines the sequence of values representing the discharge and charge states of each battery in the system at the next moment, based on the battery enable variables, discharge switch state values, and charge switch state values at the current moment. It then automatically instructs the battery's discharge and charge switches to turn on or off according to the corresponding state values in the sequence. This allows the batteries to autonomously switch between discharge and charge states based on the system's overall charging and discharging status, eliminating the need for a separate host computer to control all batteries in the electric device.
[0085] Example 2
[0086] Figure 2 This is a flowchart illustrating a battery control method according to Embodiment 2 of the present invention. Embodiments of the present invention can be combined with various optional solutions from one or more of the above embodiments. For example... Figure 2 As shown, the method includes:
[0087] Step 201: Obtain the numerical sequence of each candidate charge / discharge state of the battery system, and the numerical sequence of the next charge / discharge state corresponding to each candidate charge / discharge state numerical sequence.
[0088] Step 202: Store each candidate charge / discharge state value sequence and the next charge / discharge state value sequence corresponding to each candidate charge / discharge state value sequence to a preset storage location.
[0089] Step 203: Using a state machine, periodically acquire the current battery information of the battery and other batteries, and determine the current charge / discharge state sequence of the battery system based on the current battery information of the battery and other batteries.
[0090] The current battery information includes: the current battery enable variable, the current discharge switch state value, and the current charging switch state value.
[0091] Step 204: Using the state machine, query the target candidate charge / discharge state value sequence that is the same as the current charge / discharge state value sequence from the candidate charge / discharge state value sequences stored in the preset storage location.
[0092] Step 205: Using the state machine, determine the next charge / discharge state value sequence corresponding to the target candidate charge / discharge state value sequence as the next charge / discharge state value sequence corresponding to the current charge / discharge state value sequence.
[0093] Step 206: Using the state machine, based on the state value corresponding to the battery in the next charge / discharge state value sequence, instruct the battery's discharge switch and charge switch to be turned on or off.
[0094] The technical solution of this invention can pre-store the numerical sequences of each candidate charge / discharge state of the battery system, as well as the numerical sequence of the next charge / discharge state corresponding to each candidate charge / discharge state. Based on the state machine in the battery management system, it can automatically determine the numerical sequence representing the discharge and charge states that each battery in the battery system needs to be in at the next moment, according to the battery information at the current moment, the numerical sequences of each candidate charge / discharge state of the battery system, and the numerical sequence of the next charge / discharge state corresponding to each candidate charge / discharge state. It can also automatically instruct the discharge switch and charge switch of the battery to be turned on or off according to the state value corresponding to the battery in the numerical sequence, thereby realizing the battery's autonomous switching between discharge and charge states according to the charge / discharge state of the battery system.
[0095] Example 3
[0096] Figure 3 This is a schematic diagram of a battery control device according to Embodiment 3 of the present invention. The device can be configured in the battery management system of a battery. Figure 3 As shown, the device includes: a numerical sequence determination module 301 and a switch tube indication module 302.
[0097] The numerical sequence determination module 301 is used to periodically acquire the current battery information of the battery and other batteries through a state machine, and determine the current charge / discharge state numerical sequence of the battery system based on the current battery information of the battery and other batteries. The current battery information includes: the current battery enable variable, the current discharge switch state value, and the current charging switch state value. The switch indicator module 302 is used to determine the next charge / discharge state numerical sequence corresponding to the current charge / discharge state numerical sequence through the state machine, and instruct the discharge switch and charging switch of the battery to be turned on or off based on the state value corresponding to the battery in the next charge / discharge state numerical sequence.
[0098] The technical solution of this invention uses a state machine in the battery management system to periodically acquire the current battery enable variables, current discharge switch state values, and current charging switch state values of the battery and other batteries. Based on these values, the current charge / discharge state value sequence of the battery system is determined. Then, the state machine determines the next charge / discharge state value sequence corresponding to the current sequence. Based on the state value corresponding to the battery in the next sequence, the discharge and charging switches of the battery are instructed to be turned on or off. This solves the problem that related battery control schemes require an additional control unit for all batteries in the electric device. The use of a host computer to control the battery increases hardware costs and addresses the issue that individual batteries cannot autonomously switch between discharge and charge states. This paper addresses this problem by employing a state machine from a battery management system. This machine automatically determines the sequence of values representing the discharge and charge states of each battery in the system at the next moment, based on the battery enable variables, discharge switch state values, and charge switch state values at the current moment. It then automatically instructs the battery's discharge and charge switches to turn on or off according to the corresponding state values in the sequence. This allows the batteries to autonomously switch between discharge and charge states based on the system's overall charging and discharging status, eliminating the need for a separate host computer to control all batteries in the electric device.
[0099] In an optional embodiment of the present invention, the numerical sequence determination module 301, when performing the operation of determining the current charge / discharge state numerical sequence of the battery system based on the current battery information of the battery and the other batteries, is specifically configured to: perform the following operations through the state machine: determine the currently disabled battery and the currently enabled battery of the battery system based on the current battery enable variables of the battery and the other batteries; determine the discharge switch state value of the currently disabled battery, the charging switch state value of the currently disabled battery, the discharge switch state value of the currently enabled battery, and the charging switch state value of the currently enabled battery based on the current discharge switch state value and the current charging switch state value of the battery and the other batteries; connect the discharge switch state value of the currently disabled battery, the charging switch state value of the currently disabled battery, the discharge switch state value of the currently enabled battery, and the charging switch state value of the currently enabled battery to obtain the current charge / discharge state numerical sequence of the battery system.
[0100] In an optional embodiment of the present invention, the battery control device may further include: a value sequence acquisition module, configured to acquire each candidate charge / discharge state value sequence of the battery system and the next charge / discharge state value sequence corresponding to each candidate charge / discharge state value sequence; and a value sequence storage module, configured to store each candidate charge / discharge state value sequence and the next charge / discharge state value sequence corresponding to each candidate charge / discharge state value sequence to a preset storage location.
[0101] In an optional embodiment of the present invention, the switch indicator module 302, when performing the operation of determining the next charge / discharge state value sequence corresponding to the current charge / discharge state value sequence, specifically performs the following operations through the state machine: querying a target candidate charge / discharge state value sequence that is the same as the current charge / discharge state value sequence from among the candidate charge / discharge state value sequences stored in a preset storage location; and determining the next charge / discharge state value sequence corresponding to the target candidate charge / discharge state value sequence as the next charge / discharge state value sequence corresponding to the current charge / discharge state value sequence.
[0102] In an optional embodiment of the present invention, the switch indicator module 302, when performing the operation of instructing the discharge switch and charging switch of the battery to be turned on or off according to the state value corresponding to the battery in the next charge / discharge state value sequence, is specifically configured to: perform the following operations through the state machine: if the battery is a currently disabled battery of the battery system, extract the discharge switch state value and charging switch state value of the disabled battery in the next charge / discharge state value sequence; instruct the discharge switch of the battery to be turned off according to the discharge switch state value of the disabled battery; instruct the charging switch of the battery to be turned off according to the charging switch state value of the disabled battery.
[0103] In an optional embodiment of the present invention, the switch indicator module 302, when performing the operation of instructing the discharge switch and charging switch of the battery to be turned on or off according to the state value corresponding to the battery in the next charge / discharge state value sequence, is specifically configured to: perform the following operations through the state machine: if the battery is the currently enabled battery of the battery system, extract the discharge switch state value and charging switch state value of the enabled battery in the next charge / discharge state value sequence; instruct the discharge switch of the battery to be turned on according to the discharge switch state value of the enabled battery; instruct the charging switch of the battery to be turned on according to the charging switch state value of the enabled battery.
[0104] In an optional embodiment of the present invention, the numerical sequence determination module 301 may be specifically configured to: acquire the current battery information of the battery and other batteries at preset time intervals when performing the operation of periodically acquiring the current battery information of the battery and other batteries.
[0105] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0106] The battery control device described above can execute the battery control method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the battery control method.
[0107] Example 4
[0108] Figure 4 A schematic diagram of an electronic device 10 that can be used to implement the battery control method of embodiments of the present invention is shown. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the invention described and / or claimed herein.
[0109] like Figure 4 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 and a random access memory (RAM) 13, which are network-communicated with the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer programs stored in the ROM 12 or constructed from storage units 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0110] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0111] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as battery control methods.
[0112] In some embodiments, the battery control method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or mounted on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is built into RAM 13 and executed by processor 11, one or more steps of the battery control method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the battery control method by any other suitable means (e.g., by means of firmware).
[0113] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0114] Computer programs for implementing the battery control method of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The computer programs can be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0115] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0116] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0117] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0118] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0119] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0120] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A battery control method characterized by, The application is applied to a battery management system of a battery, and comprises: acquiring current battery information of the battery and other batteries through a state machine at a timing, and determining a current charging and discharging state value sequence of a battery system according to the current battery information of the battery and the other batteries; determining a next charging and discharging state value sequence corresponding to the current charging and discharging state value sequence through the state machine, and instructing a discharging switch tube and a charging switch tube of the battery to be turned on or turned off according to a state value corresponding to the battery in the next charging and discharging state value sequence; wherein the current battery information comprises a current battery enabling variable, a current discharging switch tube state value and a current charging switch tube state value, and the current battery enabling variable is a value set in the battery system of the current battery for indicating whether the current battery is charged and discharged; the determining of the current charging and discharging state value sequence of the battery system according to the current battery information of the battery and the other batteries comprises: the state machine performs the following operations: determining a current non-enabled battery and a current enabled battery of the battery system according to the current battery enabling variables of the battery and the other batteries; determining a discharging switch tube state value of the current non-enabled battery, a charging switch tube state value of the current non-enabled battery, a discharging switch tube state value of the current enabled battery and a charging switch tube state value of the current enabled battery according to the current discharging switch tube state values and the current charging switch tube state values of the battery and the other batteries; connecting the discharging switch tube state value of the current non-enabled battery, the charging switch tube state value of the current non-enabled battery, the discharging switch tube state value of the current enabled battery and the charging switch tube state value of the current enabled battery to obtain the current charging and discharging state value sequence of the battery system.
2. The method of claim 1, wherein, before the acquiring of the current battery information of the battery and the other batteries through the state machine at the timing, the method further comprises: acquiring each alternative charging and discharging state value sequence of the battery system and a next charging and discharging state value sequence corresponding to each alternative charging and discharging state value sequence; storing each alternative charging and discharging state value sequence and the next charging and discharging state value sequence corresponding to each alternative charging and discharging state value sequence to a preset storage location.
3. The method of claim 2, wherein, the determining of the next charging and discharging state value sequence corresponding to the current charging and discharging state value sequence comprises: the state machine performs the following operations: querying a target alternative charging and discharging state value sequence identical to the current charging and discharging state value sequence from each alternative charging and discharging state value sequence stored in the preset storage location; determining the next charging and discharging state value sequence corresponding to the target alternative charging and discharging state value sequence as the next charging and discharging state value sequence corresponding to the current charging and discharging state value sequence.
4. The method of claim 1, wherein, the instructing of the discharging switch tube and the charging switch tube of the battery to be turned on or turned off according to the state value corresponding to the battery in the next charging and discharging state value sequence comprises: the state machine performs the following operations: if the battery is a current disabled battery of the battery system, extracting a discharge switch state value and a charge switch state value of the disabled battery in the next charge-discharge state value sequence; according to the discharge switch state value of the disabled battery, instructing the discharge switch of the battery to be turned off; according to the charge switch state value of the disabled battery, instructing the charge switch of the battery to be turned off.
5. The method of claim 1, wherein, The operation of instructing the discharge switch and the charge switch of the battery to be turned on or off according to the state value corresponding to the battery in the next charge-discharge state value sequence includes: The state machine performs the following operations: if the battery is a current enabled battery of the battery system, extracting a discharge switch state value and a charge switch state value of the enabled battery in the next charge-discharge state value sequence; according to the discharge switch state value of the enabled battery, instructing the discharge switch of the battery to be turned on; according to the charge switch state value of the enabled battery, instructing the charge switch of the battery to be turned on.
6. The method of claim 1, wherein, The operation of obtaining the current battery information of the battery and other batteries at a timing includes: obtaining the current battery information of the battery and other batteries at a timing according to a preset time interval.
7. A battery control device characterized by comprising: The battery management system configured in the battery includes: a value sequence determination module configured to obtain the current battery information of the battery and other batteries at a timing through a state machine, and determine a current charge-discharge state value sequence of a battery system according to the current battery information of the battery and the other batteries; wherein the current battery information includes a current battery enabling variable, a current discharge switch state value, and a current charge switch state value, and the current battery enabling variable is a value set in the battery system of the current battery to indicate whether the current battery is subjected to charging and discharging; a switch instruction module configured to determine a next charge-discharge state value sequence corresponding to the current charge-discharge state value sequence through the state machine, and instruct the discharge switch and the charge switch of the battery to be turned on or off according to the state value corresponding to the battery in the next charge-discharge state value sequence. The value sequence determination module is specifically configured to perform the following operations through the state machine: determining a current disabled battery and a current enabled battery of the battery system according to the current battery enabling variables of the battery and the other batteries; determining a discharge switch state value of the current disabled battery, a charge switch state value of the current disabled battery, a discharge switch state value of the current enabled battery, and a charge switch state value of the current enabled battery according to the current discharge switch state values and the current charge switch state values of the battery and the other batteries; and connecting the discharge switch state value of the current disabled battery, the charge switch state value of the current disabled battery, the discharge switch state value of the current enabled battery, and the charge switch state value of the current enabled battery to obtain the current charge-discharge state value sequence of the battery system.
8. An electronic device, comprising: The electronic device includes: at least one processor; and a memory in network communication with the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to perform the battery control method of any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer instructions for causing a processor to implement the battery control method of any one of claims 1-6 when executed.
Citation Information
Patent Citations
Battery charging and discharging management system and method
CN103051005A
Bicycle power supply system
CN109110038A
Method for operating a battery system, and battery system
WO2023072444A1