BMS software design system based on hierarchical state machine
By adopting a design system based on hierarchical state machine in the BMS software design, problems such as state management complexity, insufficient processing capabilities for complex scenarios, and inflexible state transition logic in the existing technology are solved, and the simplification and flexibility of system design are achieved. , enhance the fault diagnosis capability and improve the testing efficiency.
Patent Information
- Application Number
- CN202411436239.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-15
- Publication Date
- 2025-02-07
AI Technical Summary
In the design of existing BMS software, there are problems such as increasing state management complexity, difficulty in dealing with complex scenarios, inflexible state transition logic, insufficient fault diagnosis and protection mechanisms, and difficulty in system integration and testing.
The BMS software design system is adopted based on hierarchical state machine, and a multi-fork tree data structure is formed for the root node through the top-level state, which simplifies state management and conversion logic, enhances fault diagnosis and protection capabilities, and improves system integration and testing efficiency.
It simplifies system design and maintenance, improves system flexibility and adaptability, enhances fault diagnosis and protection capabilities, improves system integration and testing efficiency, and optimizes energy management strategies.
Smart Images

Figure CN119396364A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of BMS battery management system software design, and in particular to a BMS software design system based on a hierarchical state machine. Background Art
[0002] Known and potential technology / product application areas and how they are applied:
[0003] New energy vehicle field:
[0004] Electric Vehicles (EV): In electric vehicles, BMS is a key system to ensure safe and efficient operation of the battery pack. The BMS software design method based on the hierarchical state machine can significantly improve the complex event processing capability of BMS, optimize the battery charging and discharging strategy, improve energy efficiency, and enhance the response speed of fault diagnosis and protection mechanisms.
[0005] Hybrid Electric Vehicle (HEV): For hybrid electric vehicles, BMS needs to manage the coordinated operation of multiple energy systems (such as batteries, internal combustion engines, etc.) at the same time. The hierarchical state machine model can clearly divide the state transition logic under different working modes to ensure seamless switching and efficient coordination between systems.
[0006] Energy storage system:
[0007] Grid energy storage: In smart grids, large-scale energy storage systems are of great significance for balancing grid loads and improving grid stability. The BMS software design method based on the hierarchical state machine can optimize the charging and discharging strategy of the energy storage system, flexibly adjust the working state according to grid demand, and improve the overall efficiency of the energy storage system.
[0008] Home energy storage: With the popularization of renewable energy, home energy storage systems have gradually become a hot market. The hierarchical state machine model can help design more intelligent and easy-to-use home energy storage BMS software to achieve efficient management and self-sufficiency of home energy.
[0009] Industrial automation field:
[0010] Robots and automation equipment: In the field of industrial automation, robots and automation equipment require stable power supply and sophisticated energy management. The BMS software design method based on the hierarchical state machine can ensure that these devices maintain the optimal battery state under different workloads, extend the service life of the equipment, and improve production efficiency.
[0011] Industrial Internet of Things (IIoT): In the Industrial Internet of Things, BMS is one of the key nodes responsible for monitoring and managing the energy status of the entire system. The hierarchical state machine model can enhance the remote monitoring and fault diagnosis capabilities of BMS and realize the intelligent operation and maintenance of the Industrial Internet of Things system.
[0012] Medical electronic equipment:
[0013] Portable medical devices: such as mobile electrocardiographs and portable ultrasound devices, require compact, lightweight, and long-lasting battery systems. The BMS software design method based on the hierarchical state machine can improve the battery life and safety of these devices and ensure the reliability of medical devices at critical moments.
[0014] Hospital Energy Management System: In large medical institutions such as hospitals, BMS can be used to manage the power supply and energy distribution of various medical equipment. The hierarchical state machine model can help hospitals achieve efficient use and refined management of energy and reduce operating costs.
[0015] In each of the above fields, the BMS software design method based on the hierarchical state machine is mainly applied in the following ways:
[0016] 1. Model construction: According to the needs of specific application scenarios, build a hierarchical state machine model to clarify the system's state division, state transition logic, and behavior definition in each state.
[0017] 2. Software design: Based on the constructed hierarchical state machine model, carry out detailed design of BMS software, including algorithm implementation, interface definition, data management, etc.
[0018] 3. System integration and testing: Integrate the designed BMS software into the target system and conduct comprehensive testing and verification to ensure the functionality, stability and reliability of the software.
[0019] 4. Operation, maintenance and optimization: During system operation, necessary operation, maintenance and optimization work shall be performed on the BMS software according to actual conditions to improve the overall performance of the system and user experience.
[0020] Although the above existing technologies have improved the efficiency of BMS software design and increased the stability of the system to a certain extent, the following problems are still exposed in the increasingly complex BMS products:
[0021] 1. Increased complexity of state management: With the continuous expansion and complexity of BMS functions, the traditional state machine model has become increasingly complex in state management and state transition logic. Especially when dealing with battery packs composed of multiple batteries, a large number of states and transition relationships need to be defined, which not only increases the difficulty of software design, but also reduces the maintainability and scalability of the system.
[0022] 2. Difficulty in dealing with complex scenarios: In complex application scenarios such as electric vehicles and energy storage systems, BMS needs to handle state transitions and collaborative work in multiple working modes. Traditional state machine models are unable to cope with these complex scenarios and it is difficult to accurately describe and manage the behavior of the system.
[0023] 3. Inflexible state transition logic: The state transition logic in the traditional state machine model is usually fixed and difficult to flexibly adjust according to actual needs. This limits the adaptability and flexibility of the BMS in dealing with different working conditions and user needs.
[0024] 4. Inadequate fault diagnosis and protection mechanisms: In BMS, fault diagnosis and protection mechanisms are key to ensuring battery safety and extending battery life. However, traditional state machine models often have deficiencies in the design of fault diagnosis and protection mechanisms, making it difficult to fully cover various fault scenarios and provide timely and effective protection measures.
[0025] 5. Difficulty in system integration and testing: BMS software based on the traditional state machine model also faces great challenges in the system integration and testing process. Due to the complexity of state management and the inflexibility of state transition logic, the workload of system integration and testing has increased significantly, and it is difficult to ensure the stability and reliability of the system. Summary of the invention
[0026] The purpose of the present invention is to overcome the shortcomings of the prior art, adapt to the actual needs, and provide a BMS software design system based on a hierarchical state machine to solve the increasing complexity of current state management: With the continuous expansion and complexity of BMS functions, the traditional state machine model becomes more and more complex in state management and state transition logic. In particular, when dealing with a battery pack composed of multiple batteries, a large number of states and transition relationships need to be defined, which not only increases the difficulty of software design, but also reduces the maintainability and scalability of the system, and it is difficult to cope with complex scenarios: In complex application scenarios such as electric vehicles and energy storage systems, BMS needs to handle state transitions and collaborative work under multiple working modes. The traditional state machine model seems to be powerless in dealing with these complex scenarios, and it is difficult to accurately describe and manage the behavior of the system. The state transition logic is not flexible: the state transition logic in the traditional state machine model is usually fixed and difficult to flexibly adjust according to actual needs. This limits the adaptability and flexibility of BMS in dealing with different working conditions and user needs, and the fault diagnosis and protection mechanism is insufficient: In BMS, the fault diagnosis and protection mechanism is the key to ensuring battery safety and extending battery life. However, traditional state machine models often have deficiencies in the design of fault diagnosis and protection mechanisms, making it difficult to fully cover various fault scenarios and provide timely and effective protection measures. System integration and testing are difficult: BMS software based on traditional state machine models also faces great challenges in the system integration and testing process. Due to the complexity of state management and the inflexibility of state transition logic, the workload of system integration and testing has increased significantly, and it is difficult to ensure the technical problems of system stability and reliability.
[0027] In order to achieve the purpose of the present invention, the technical solution adopted by the present invention is: designing a BMS software design system based on a hierarchical state machine, dividing the state and the state level according to the product requirements and hardware solutions of the BMS,
[0028] S1. The current BMS system based on the hierarchical state machine forms a multi-tree data structure with the top-level state as the root node. The child nodes and root nodes except the leaf nodes are all composite states, and the states on the leaf nodes are simple states.
[0029] S2. When the state runs, it always ends up in a simple state. The composite state exists based on the commonality of the child nodes. For example, multiple child nodes focus on the same event, multiple child nodes have a common entry action, and multiple child nodes have a common exit action. The active states of the state machine are all simple states in the leaf nodes.
[0030] S3, the transition activity between states first receives the trigger event of state transition, then executes the exit action of the current active state and the parent state, and finally executes the entry action after the transition state; the exit action of the active state needs to be executed from the end of the active state to the same level as the transition state; the entry action of the transition state needs to be executed from the same level as the parent state of the active state to the final active state leaf node;
[0031] S4. The event processing execution flow of the state is to first find the event subscription list of the current active state after the event is released, and perform the corresponding event processing according to the subscription list; if the triggering event is not in the subscription list of the current activity, the parent state subscription list of the active state will be queried in turn until the top-level state.
[0032] Preferably, the event conversion action of the state machine includes three elements: trigger, guard condition, and activity action. For example, in the current BMS system, the trigger event for entering the charging state is the event of detecting charger access, the condition is that the current system is not fully charged and charging is allowed, and the execution action is to play a reminder tone for starting charging.
[0033] Preferably, the root node of the top-level state is divided into two sub-nodes, namely, the power-on state and the power-off state. The power-on state is the first node after the state machine is started, and the idle node, the sub-node of the power-on state, is the first active state node started by the state machine; the state machine exits operation through the power-off state.
[0034] Preferably, the sub-node of the power-on state is divided into working state, idle state, test state and fault state according to the state of the user using the product, wherein the test state is the state when the R&D and operation and maintenance personnel perform diagnostic tests on the product. When entering the test state, the tester can send preset test instructions to execute the test items according to the test requirements.
[0035] Preferably, the fault state can be entered from the working state or the idle state, and is entered when a fault event is detected in the working state or the idle state, and can only enter the idle state when a fault recovery event occurs.
[0036] Preferably, the charging state is divided into three sub-states according to different environmental parameter characteristics of the BMS system: trickle charging, constant current charging, and constant voltage charging; when entering the charging state, the entry action of the charging state is executed: the sub-state to be entered is determined according to the temperature, power and other information of the BMS system, and then the entry action of the sub-state is executed.
[0037] Preferably, the state transition types of the hierarchical state machine include smooth transition and event triggering. Smooth transition means that after the current active state is executed to a certain stage, the state is directly changed without judging external events; event triggering means that after the active state receives an event, the state needs to be switched according to the event processing logic.
[0038] Preferably, the fault detection and power-on states are concurrent states, which means that any activity state in the power-on state needs to perform concurrent services of fault detection.
[0039] Compared with the prior art, the present invention has the following beneficial effects:
[0040] 1. Simplify system design and maintenance: By introducing a hierarchical state machine model, the complex BMS software design is divided into multiple levels and sub-state machines, greatly simplifying the system design process. This modular and hierarchical design method makes each sub-state machine responsible for a relatively independent functional module, reduces the overall coupling of the system, and improves the maintainability and scalability of the system. When the system needs to be upgraded or maintained, operations can be performed on specific sub-state machines without making large-scale changes to the entire system.
[0041] 2. Improve system flexibility and adaptability: The hierarchical state machine model allows the definition of flexible state transition logic between different levels, so that the BMS software can better adapt to different application scenarios and working conditions. For example, in electric vehicles, the battery management strategy can be dynamically adjusted according to the different driving modes and driving conditions of the vehicle to achieve optimal energy efficiency and safety performance. In addition, the hierarchical state machine also supports the dynamic addition or deletion of states to adapt to changes or expansions in system functions.
[0042] 3. Enhanced fault diagnosis and protection capabilities: The method of this patent provides a richer and more flexible means of implementing fault diagnosis and protection mechanisms by finely dividing the state hierarchy and clarifying the state transition conditions. The system can monitor the battery status in real time, and quickly locate the problem according to the preset fault judgment logic, and take corresponding protection measures to prevent the fault from expanding or causing more serious problems. This enhanced fault diagnosis and protection capability helps to improve the reliability and safety of the BMS and ensure the long-term stable operation of the battery system.
[0043] 4. Ensure that the system integration and testing efficiency is improved: The BMS software design method based on the hierarchical state machine also shows significant advantages in the system integration and testing phase. Since the system is divided into multiple independent sub-state machines, they can be debugged and verified one by one during the integration process, reducing the complexity and risk of the overall integration. At the same time, the hierarchical design makes the testing work more organized and targeted, and unit testing and comprehensive testing can be performed on each sub-state machine, improving the testing efficiency and accuracy.
[0044] 5. Optimize energy management strategy: Through the design of hierarchical state machines, BMS can more accurately control the battery charging and discharging process and optimize energy management strategies. The system can dynamically adjust the charging and discharging strategy according to the actual state of the battery and user needs, improve energy efficiency and extend battery life. This is especially important for application scenarios with high requirements for energy management, such as electric vehicles and energy storage systems.
[0045] In summary, the BMS software design system based on hierarchical state machine proposed in the present invention shows significant beneficial effects in simplifying system design and maintenance, improving system flexibility and adaptability, enhancing fault diagnosis and protection capabilities, improving system integration and testing efficiency, and optimizing energy management strategies, which is of great significance for promoting the development and application of BMS technology. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 It is a schematic diagram of the hierarchical state machine of the BMS system of the present invention;
[0047] Figure 2 It is a multi-tree structure diagram of the BMS system hierarchical state machine of the present invention;
[0048] Figure 3 This is an example flow chart of the BMS system conversion activity of the present invention;
[0049] Figure 4 This is an example diagram of BMS system event processing of the present invention. DETAILED DESCRIPTION
[0050] The present invention is further described below in conjunction with the accompanying drawings and embodiments:
[0051] Example 1: BMS software design system based on hierarchical state machine, state division and state level division according to BMS product requirements and hardware solutions, see Figures 1 to 4 , S1. The current BMS system based on the hierarchical state machine forms a multi-tree data structure with the top-level state as the root node. The child nodes and root nodes except the leaf nodes are all composite states, and the states on the leaf nodes are simple states; S2. When the state runs, it always ends up in a simple state. The composite state is based on the common existence of the child nodes (such as multiple child nodes paying attention to the same events, multiple child nodes have common entry actions, and multiple child nodes have common exit actions). The active states of the state machine are all simple states in the leaf nodes; S3. The transition activity between states first receives the trigger event of the state transition, and then executes the current active state and the parent state The exit action, and finally the entry action after the transition state; the exit action of the active state needs to be executed from the very end of the active state to the same level as the transition state (the sub-state of the intersection node); the entry action of the transition state needs to be executed from the same level as the parent state of the active state (the sub-state of the intersection node) to the final active state leaf node; S4, the event processing execution flow of the state is to first find the event subscription list of the current active state after the event is released, and execute the corresponding event processing according to the subscription list; if the triggering event is not in the subscription list of the current activity, the parent state subscription list of the active state will be queried in turn until the top-level state.
[0052] For details, see Figures 1 to 4 The event transition action of the state machine includes three elements: trigger, guard condition, and activity action. For example, in the current BMS system, the trigger event for entering the charging state is the charger access detection event. The condition is that the current system is not fully charged and charging is allowed. The execution action is to play the charging start prompt tone.
[0053] For more details, see Figures 1 to 4 The root node of the top-level state is divided into two child nodes: the power-on state and the power-off state. The power-on state is the first node after the state machine is started. The idle node, the child node of the power-on state, is the first active state node started by the state machine; the state machine exits operation through the power-off state.
[0054] For further information, see Figures 1 to 4 The sub-nodes of the power-on state are divided into working state, idle state, test state and fault state according to the state of the user using the product. The test state is the state when the R&D and operation and maintenance personnel perform diagnostic tests on the product. When entering the test state, the tester can send preset test instructions to execute the test items according to the test requirements.
[0055] Further, see Figures 1 to 4The fault state can be entered from the working state or the idle state. It is entered when a fault event is detected in the working state or the idle state. It can only enter the idle state when a fault recovery event occurs.
[0056] It is worth noting that see Figures 1 to 4 The charging state is divided into three sub-states according to the different environmental parameter characteristics of the BMS system: trickle charging, constant current charging, and constant voltage charging; when entering the charging state, the entry action of the charging state is executed: according to the temperature, power and other information of the BMS system, the sub-state to be entered is determined, and then the entry action of the sub-state is executed.
[0057] It is worth noting that see Figures 1 to 4 The state transition types of the hierarchical state machine include smooth transition and event triggering. Smooth transition means that after the current active state is executed to a certain stage, the state transition is directly performed without judging external events; event triggering means that after the active state receives an event, the state needs to be switched according to the event processing logic.
[0058] It is worth mentioning that see Figures 1 to 4 ,Fault detection and power-on state are concurrent states, which means that any active state in the power-on state needs to perform concurrent business of fault detection.
[0059] In addition, the components designed in the present invention are all universal standard parts or components known to technical personnel in this field. Their structures and principles can be known to technical personnel through technical manuals or through conventional experimental methods. They can be fully implemented by technical personnel in this field. Needless to say, the content protected by the present invention does not involve improvements to internal structures and methods.
[0060] The embodiments of the present invention disclose preferred embodiments, but are not limited thereto. A person skilled in the art can easily understand the spirit of the present invention based on the above embodiments and make different extensions and changes. However, as long as they do not deviate from the spirit of the present invention, they are all within the protection scope of the present invention.
Claims
1. The BMS software design system based on the hierarchical state machine divides the state and the state level according to the product requirements and hardware solutions of the BMS, and is characterized by: S1. The current BMS system based on the hierarchical state machine forms a multi-tree data structure with the top-level state as the root node. The child nodes and root nodes except the leaf nodes are all composite states, and the states on the leaf nodes are simple states. S2. When the state runs, it always ends up in a simple state. The composite state exists based on the commonality of the child nodes. For example, multiple child nodes focus on the same event, multiple child nodes have a common entry action, and multiple child nodes have a common exit action. The active states of the state machine are all simple states in the leaf nodes. S3, the transition activity between states first receives the trigger event of state transition, then executes the exit action of the current active state and the parent state, and finally executes the entry action after the transition state; the exit action of the active state needs to be executed from the end of the active state to the same level as the transition state; the entry action of the transition state needs to be executed from the same level as the parent state of the active state to the final active state leaf node; S4. The event processing execution process of the state is to first find the event subscription list of the current active state after the event is published, and execute the corresponding event processing according to the subscription list; If the triggering event is not in the subscription list of the current activity, the subscription list of the parent state of the active state will be queried in sequence until the top-level state.
2. The BMS software design system based on a hierarchical state machine according to claim 1, characterized in that: The event conversion action of the state machine includes three elements: trigger, guard condition, and activity action. For example, in the current BMS system, the trigger event for entering the charging state is the event of detecting the charger access, the condition is that the current system is not fully charged and charging is allowed, and the execution action is to play the charging start prompt tone.
3. The BMS software design system based on a hierarchical state machine according to claim 1, characterized in that: The root node of the top-level state is divided into two sub-nodes, namely, the power-on state and the power-off state. The power-on state is the first node after the state machine is started. The idle node, the sub-node of the power-on state, is the first active state node started by the state machine. The state machine exits operation through the power-off state.
4. The BMS software design system based on a hierarchical state machine as claimed in claim 3, characterized in that: The sub-nodes of the power-on state are divided into working state, idle state, test state and fault state according to the state of the user using the product. The test state is the state when the R&D and operation and maintenance personnel perform diagnostic tests on the product. When entering the test state, the tester can send preset test instructions to execute the test items according to the test requirements.
5. The BMS software design system based on a hierarchical state machine as claimed in claim 4, characterized in that: The fault state can be entered from the working state or the idle state. The fault state is entered when a fault event is detected in the working state or the idle state. When a fault recovery event occurs, the idle state can only be entered.
6. The BMS software design system based on a hierarchical state machine as claimed in claim 2, characterized in that: The charging state is divided into three sub-states according to different environmental parameter characteristics of the BMS system: trickle charging, constant current charging, and constant voltage charging; when entering the charging state, the entry action of the charging state is executed: the sub-state to be entered is determined according to the temperature, power and other information of the BMS system, and then the entry action of the sub-state is executed.
7. The BMS software design system based on a hierarchical state machine according to claim 1, characterized in that: The state transition types of the hierarchical state machine include smooth transition and event triggering. Smooth transition means that after the current active state is executed to a certain stage, the state is directly changed without judging external events; event triggering means that after the active state receives an event, the state needs to be switched according to the event processing logic.
8. The BMS software design system based on a hierarchical state machine as claimed in claim 4, characterized in that: The fault detection and power-on states are concurrent states, which means that any activity state in the power-on state needs to perform concurrent services of fault detection.