Energy storage battery management system simulation debugging method and system based on QEMU
By using QEMU-based virtual machine simulation technology, the hardware dependency and multi-level debugging challenges of energy storage battery management systems have been solved, enabling comprehensive system-level debugging and testing, reducing costs and improving reliability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HEFEI GUOXUAN HIGH TECH POWER ENERGY
- Filing Date
- 2026-01-20
- Publication Date
- 2026-05-12
AI Technical Summary
In the existing technology, energy storage battery management systems (BMS) are highly dependent on hardware, difficult to debug in multiple stages, have insufficient test coverage, and are difficult to simulate the interaction of multi-level systems and complex hardware anomalies on real hardware. Moreover, existing simulators cannot meet the dedicated simulation and debugging requirements of multi-level BMS architectures.
A QEMU-based simulation and debugging method is adopted. By creating an independent QEMU virtual machine instance for each BMS node, virtual hardware links and communication networks are constructed. Data and faults are injected using a simulation agent program to realize the simulation and debugging of multi-level BMS systems and support the collaborative work of different operating systems.
It enables efficient, secure, and comprehensive system-level debugging and testing without the need for real hardware, reducing development costs, accelerating the development cycle, and improving test coverage and system reliability.
Smart Images

Figure CN122019374A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of embedded system simulation and debugging technology, and in particular to a simulation and debugging method and system for an energy storage battery management system based on QEMU. Background Technology
[0002] The Battery Management System (BMS) is a core component ensuring the safe, stable, and efficient operation of batteries. Modern large-scale energy storage systems typically employ a multi-level distributed architecture, such as a complex structure like "Master-Slave" or "Top-Level Manager (TBMU)-Battery Management Unit (BMU)-Battery Monitoring Unit (CMU)." The development of such systems faces the following challenges:
[0003] 1. High hardware dependence: Traditional debugging heavily relies on actual BMS hardware circuit boards (such as MCU-based controllers, AFE analog front-end acquisition chips, etc.). Hardware failure and iterative changes can significantly impact software development and debugging progress.
[0004] 2. Difficulty in multi-level debugging: In a multi-level architecture, each BMS may run different operating systems, such as FreeRTOS, Linux, RT-Thread, etc., requiring them to work together. Building a complete multi-level debugging environment on real hardware is costly, complex in connection, and makes it difficult to reproduce specific fault scenarios.
[0005] 3. Insufficient test coverage: Testing under extreme and abnormal conditions (such as battery overvoltage, short circuit, communication interruption, etc.) poses a risk and can easily damage real hardware, making many test cases difficult to execute or lacking repeatability.
[0006] While some microcontroller emulators (such as JTAG and ICE) exist in the current technology, they can usually only debug single boards and cannot simulate the interaction of the entire multi-level system and complex hardware anomalies. QEMU, as a general-purpose open-source machine emulator, can be used to simulate single-board environments, but it lacks a dedicated simulation and debugging solution for multi-level BMS architectures.
[0007] Therefore, there is an urgent need for a simulation and debugging solution that is efficient, safe, and can cover multi-level BMS systems, free from specific hardware limitations. Summary of the Invention
[0008] The purpose of this invention is to overcome the shortcomings of existing technologies and provide a simulation and debugging method and system for an energy storage battery management system based on QEMU. This method can efficiently simulate the hardware environment of multi-level BMS, supports different operating systems, and achieves convenient, safe, and comprehensive system-level debugging and testing.
[0009] To achieve the above objectives, the present invention adopts the following technical solution:
[0010] This invention provides a simulation and debugging method for an energy storage battery management system based on QEMU, comprising:
[0011] Simulation debugging and configuration are performed based on QEMU, creating an independent QEMU virtual machine instance for each BMS node;
[0012] Virtual hardware links are built for QEMU virtual machine instances of each BMS node to construct a virtual communication network with the same topology as the real energy storage battery management system;
[0013] Create a simulation agent program to inject simulation data and faults into the virtual communication network;
[0014] Start all QEMU virtual machine instances on all BMS nodes in parallel and perform debugging operations through the simulation agent program;
[0015] Monitor and analyze the simulation debugging process.
[0016] The above technical solution, based on QEMU, enables flexible simulation of multi-level BMS systems with arbitrary topologies, without relying on real BMS hardware, significantly reducing development and debugging costs and accelerating the development cycle.
[0017] Preferably, the configuration of the QEMU virtual machine instance includes:
[0018] Simulated CPU architecture
[0019] Simulated memory size and address space mapping;
[0020] Simulated peripherals,
[0021] Additionally, specify the operating system image to run for each QEMU virtual machine instance.
[0022] The above technical solution virtualizes each level of the BMS into an independent QEMU virtual machine instance through QEMU virtual machine instance configuration, thereby realizing the simulation of the BMS based on software.
[0023] Preferably, the simulated peripherals include:
[0024] CAN controller: Used to simulate CAN bus communication between BMS nodes at various levels and between BMS nodes and external devices;
[0025] SPI / I2C controller: used to simulate communication between the BMS master control chip and the AFE acquisition chip and EEPROM slave device;
[0026] General Purpose Input / Output (GPIO): Used for analog switching signals and indicator lights;
[0027] Analog-to-digital converter (ADC): used for inputting analog voltage and temperature signals;
[0028] Ethernet controller: Used for network communication or debugging.
[0029] The above technical solution uses a CAN controller, SPI / I2C controller, GPIO, ADC and Ethernet controller to form a simulation peripheral, providing hardware support for building a virtual communication network and data injection.
[0030] Preferably, the step of establishing virtual hardware links for the QEMU virtual machine instances of each BMS node includes:
[0031] The virtual network functionality provided by QEMU can be used to connect the simulation peripherals of each independent QEMU virtual machine instance to build a virtual communication network with the same topology as the real energy storage battery management system.
[0032] The above technical solution connects the various QEMU virtual machines through a CAN bus, constructing a virtual communication network with the same topology as the real energy storage battery management system, thus completing the deployment of the virtual environment.
[0033] Preferably, the simulation agent program is used to implement:
[0034] Simulate AFE behavior: Inject simulated battery cell voltage and temperature sensor data into the QEMU virtual machine instance representing the battery monitoring unit (CMU);
[0035] Simulated faults: dynamically injecting abnormal operating conditions;
[0036] Simulate load and environmental changes: Dynamically adjust the injected analog quantity data based on the charge and discharge curves.
[0037] The above technical solution enables source code-level debugging of each node through a simulation agent program on the host side.
[0038] Preferably, the abnormal operating conditions include: communication interruption, signal timeout, sensor value exceeding limits, short circuit, and open circuit.
[0039] The above technical solution, through the host-side simulation agent program, can safely, conveniently, and repeatably simulate various normal and extreme test conditions, greatly improving test coverage and system reliability.
[0040] Preferably, the simulation agent interacts with the QEMU virtual machine instance of the specified BMS node through QEMU's qtest protocol or a custom virtual device model.
[0041] The above technical solution enables the interaction between the host-side emulation agent program and the QEMU virtual machine instance.
[0042] Preferably, during the simulation debugging process, all QEMU virtual machine instances share the host's clock source to achieve cross-node synchronization, where the host refers to the host where the QEMU virtual machine instances are deployed.
[0043] The above technical solution allows all virtual machines to share the host's clock source, which facilitates the analysis of cross-node synchronization issues.
[0044] Preferably, the monitoring and analysis of the simulation debugging process includes:
[0045] During simulation and debugging, the communication messages of all BMS nodes on the virtual CAN bus are monitored, the BMS behavior is recorded and analyzed, and the logical correctness and fault tolerance of the BMS software at each level are verified.
[0046] The above technical solution enables monitoring of the collaborative operation status of the entire BMS, making it easier to locate complex interaction problems.
[0047] This invention also provides a QEMU-based simulation and debugging system for an energy storage battery management system, comprising:
[0048] Configuration Management Module: Used to create and load configuration files that describe the various levels of BMS nodes in a multi-level BMS architecture. The configuration file refers to the configuration file of the QEMU virtual machine instance created for each BMS node.
[0049] QEMU virtual machine cluster: consists of multiple QEMU processes started according to configuration files, each process emulating a BMS node;
[0050] Virtual network switch: A virtual communication network implemented by the internal network function of QEMU, which is a simulated peripheral device of QEMU virtual machine instances that connects all BMS nodes via CAN bus;
[0051] Simulation Agent and Injection Module: The simulation agent program running on the host is responsible for injecting simulation data and faults into the QEMU virtual machine cluster;
[0052] Debugger Integration Interface: Provides a standard connection interface for external debuggers;
[0053] Monitoring and Analysis Module: Monitors and analyzes the simulation debugging process.
[0054] The above technical solution, based on QEMU, enables flexible simulation of multi-level BMS systems with arbitrary topologies and supports different operating systems running at each level of the BMS. This perfectly matches the technical characteristics of energy storage BMS, significantly reduces development and debugging costs, and accelerates the development cycle.
[0055] The beneficial effects of this invention are as follows:
[0056] (1) Hardware decoupling and low cost: This invention is based entirely on software simulation and does not rely on real BMS hardware, which greatly reduces development and debugging costs and speeds up the development cycle.
[0057] (2) Supports complex multi-level architecture: This invention can flexibly simulate multi-level BMS systems with arbitrary topologies and support different operating systems (such as bare metal, RTOS, Linux) for each level of BMS, which perfectly matches the technical characteristics of energy storage BMS.
[0058] (3) Comprehensive testability: This invention can safely, conveniently and repeatably simulate various normal and extreme test conditions, including those conditions that are difficult to construct or are high-risk on real hardware, which greatly improves test coverage and system reliability.
[0059] (4) Powerful debugging capabilities: This invention supports source code-level debugging of each node in a distributed system and can observe the collaborative operation status of the entire system, making it easier to locate complex interaction problems. Attached Figure Description
[0060] Figure 1 This invention provides a schematic flowchart of a simulation and debugging method for an energy storage battery management system based on QEMU. Detailed Implementation
[0061] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the embodiments and accompanying drawings. Here, the illustrative embodiments and descriptions of this invention are used to explain the invention, but are not intended to limit the invention.
[0062] It should also be noted that, in order to avoid obscuring the invention with unnecessary details, only the structures and / or processing steps closely related to the solution according to the invention are shown in the accompanying drawings, while other details that are not closely related to the invention are omitted.
[0063] It should be emphasized that the term "including / comprises" as used herein refers to the presence of a feature, element, step, or component, but does not exclude the presence or addition of one or more other features, elements, steps, or components.
[0064] It should also be noted that, unless otherwise specified, the term "connection" in this article can refer not only to a direct connection, but also to an indirect connection involving an intermediary.
[0065] In the following description, embodiments of the invention will be illustrated with reference to the accompanying drawings. In the drawings, the same reference numerals represent the same or similar parts, or the same or similar steps.
[0066] It should be emphasized here that the step markers mentioned below are not a limitation on the order of the steps, but should be understood as meaning that the steps can be executed in the order mentioned in the embodiments, or in a different order than in the embodiments, or several steps can be executed simultaneously.
[0067] This invention provides a simulation and debugging method for an energy storage battery management system based on QEMU, comprising the following steps:
[0068] Step 1: Configure and debug the simulation based on QEMU, creating an independent QEMU virtual machine instance for each BMS node.
[0069] In this step, based on the hardware architecture of the target multi-level BMS, BMS nodes at each level (such as TBMU, BMU, CMU) are defined, and an independent QEMU virtual machine instance is created for each node. The configuration of each QEMU virtual machine instance includes:
[0070] Simulated CPU architectures (such as ARM Cortex-M series, RISC-V, x86, etc.);
[0071] Simulated memory size and address space mapping;
[0072] Simulated peripherals include, but are not limited to:
[0073] CAN controller: Used to simulate CAN bus communication between BMS nodes at various levels and between BMS nodes and external devices (such as PCS);
[0074] SPI / I2C controller: used to simulate communication between the BMS master control chip and slave devices such as AFE acquisition chip (the core component of BMS) and EEPROM;
[0075] GPIO (General Purpose Input / Output): Used for analog switching signals, indicator lights, etc.
[0076] ADC (Analog-to-Digital Converter): Used for inputting analog signals such as voltage and temperature;
[0077] Ethernet controller: Used for network communication or debugging of nodes running advanced operating systems such as Linux;
[0078] Specify the operating system image to run for each QEMU virtual machine instance (such as a bare-metal program, FreeRTOS firmware, Linux kernel, etc.).
[0079] Step 2: Establish a virtual hardware link, constructing a virtual communication network consistent with the real BMS topology.
[0080] In this step, the virtual network functions provided by QEMU (such as socket and hubport) are used to connect the simulation peripherals (mainly the CAN bus) of the various independent QEMU virtual machine instances created in step 1, and to build a virtual communication network that is consistent with the real hardware topology.
[0081] For example, connect the CAN0 port of a BMU virtual machine instance to the CAN0 ports of multiple CMU virtual machine instances on the same virtual CAN bus.
[0082] Step 3: Inject simulation data and faults into the virtual communication network constructed in Step 2.
[0083] In this step, an emulation agent is run on the host side. This agent interacts with the specified BMS virtual machine instance via QEMU's qtest protocol or a custom virtual device model. This agent is capable of:
[0084] Simulate AFE behavior: Inject simulated battery cell voltage, temperature and other sensor data into a virtual machine instance representing the CMU. The data can come from predefined scripts or a real-time database.
[0085] Simulated faults: Dynamically inject abnormal operating conditions such as communication interruption, signal timeout, sensor value exceeding limits (such as overvoltage, undervoltage, high temperature), short circuit, and open circuit.
[0086] Simulate load and environmental changes: Dynamically adjust the injected analog quantity data based on the charge and discharge curves.
[0087] Step 4: Perform simulation debugging in parallel.
[0088] In this step, QEMU virtual machine instances are started in parallel on all BMS nodes. Developers can use standard debugging tools (such as GDB) to connect to the debug port of each virtual machine instance (such as the -gdb tcp:XXXX parameter provided by QEMU) to perform source code-level step-by-step debugging, variable monitoring, and other operations on the BMS software at each level.
[0089] It should be noted that all virtual machines share the host's clock source, which facilitates the analysis of cross-node synchronization issues.
[0090] Step 5: Monitor and analyze the simulation debugging process.
[0091] In this step, throughout the simulation and debugging process, the communication messages of all BMS nodes on the virtual CAN bus are monitored, the system behavior is recorded and analyzed, and the logical correctness and fault tolerance of the BMS software at each level are verified.
[0092] The following is a detailed explanation of the simulation and debugging method for the QEMU-based energy storage battery management system disclosed above, using a specific implementation case:
[0093] This implementation case simulates a three-level BMS system containing one master control unit (MMU) and two slave control units (BMU). The simulation and debugging process is as follows:
[0094] Step 1: Environmental Preparation
[0095] Hardware: A Linux server or PC.
[0096] Software: QEMU, GCC cross-compilation toolchain (arm-none-eabi-gcc, riscv64-unknown-elf-gcc), GDB debugger.
[0097] BMS firmware:
[0098] BMU firmware: Bare-metal programs compiled for ARM Cortex-M4 or FreeRTOS-based programs.
[0099] MMU firmware: A system image compiled for a RISC-V 64-bit processor and running embedded Linux.
[0100] Step 2: Virtual Machine Configuration and Startup Script
[0101] Create a script named `start_bms_sim.sh`.
[0102] #! / bin / bash
[0103] # --- Start the battery model (a separate process) ---
[0104] python battery_model.py --cells 16 --output / tmp / batt_sim_data &
[0105] BATT_MODEL_PID=$!
[0106] # --- Start BMU 1 (ARM) ---
[0107] qemu-system-arm \
[0108] -M netduinoplus2 \
[0109] -kernel bmu_firmware.elf \
[0110] -nographic
[0111] -gdb tcp::1234
[0112] -qmp unix: / tmp / qmp-bmu1,server,nowait
[0113] -device virtio-net-pci,netdev=net0
[0114] -netdev socket,id=net0,mcast=230.0.0.1:1234
[0115] -device bms_afe,backend= / tmp / batt_sim_data
[0116] &
[0117] # --- Start BMU 2 (ARM) ---
[0118] qemu-system-arm
[0119] -M netduinoplus2
[0120] -kernel bmu_firmware.elf
[0121] -nographic
[0122] -gdb tcp::1235
[0123] -qmp unix: / tmp / qmp-bmu2,server,nowait
[0124] -device virtio-net-pci,netdev=net1
[0125] -netdev socket,id=net1,mcast=230.0.0.1:1234
[0126] -device bms_afe,backend= / tmp / batt_sim_data
[0127] &
[0128] # --- Start MMU (RISC-V Linux) ---
[0129] qemu-system-riscv64 \
[0130] -M virt \
[0131] -kernel linux_image.bin \
[0132] -append "root= / dev / vda rw console=ttyS0" \
[0133] -drive file=rootfs.ext4,format=raw,id=hd0 \
[0134] -device virtio-blk-device,drive=hd0 \
[0135] -nographic \
[0136] -gdb tcp::1236 \
[0137] -qmp unix: / tmp / qmp-mmu,server,nowait \
[0138] -netdev socket,id=net2,mcast=230.0.0.1:1234 \
[0139] &
[0140] Step 3: Implementation of the virtual hardware device bms_afe
[0141] Using QEMU's TYPE_PCI_DEVICE or TYPE_SYS_BUS_DEVICE as the base class, implement a virtual device named bms_afe in C. This device:
[0142] During initialization, it receives a path to a backend data source (such as ` / tmp / batt_sim_data`).
[0143] The simulated voltage and temperature values are periodically read from this data source.
[0144] These values are written into its internal virtual register.
[0145] When the BMS firmware inside the virtual machine reads these registers through the memory-mapped address, it returns the latest simulation data.
[0146] Step 4: Debugging process
[0147] 41) Run the script: Execute . / start_bms_sim.sh, and the virtual machines and battery simulators of the three BMS nodes will start simultaneously. They communicate via a shared bus simulated by UDP multicast.
[0148] 42) Connecting to the slave debugger: In the new terminal, run gdb-multiarch, then enter targetremote :1234 to connect to the BMU 1 debug session. You can then set breakpoints on the BMU's ADC driver and equalization logic.
[0149] 43) Connecting to the main controller debugger: Simultaneously, in another terminal, run gdb-multiarch, enter targetremote :1236, and connect to the MMU. You can then debug its CAN / Ethernet communication protocol stack or SOC estimation algorithm.
[0150] 44) Fault Injection: Overvoltage of a single battery cell can be simulated via the qmp interface (a machine-readable JSON protocol provided by QEMU) or by directly modifying the output of battery_model.py. For example, the battery model can be made to output a voltage value of 4.5V. At this time, it can be observed whether BMU 1 can correctly detect the overvoltage and send an alarm message upwards via the virtual CAN bus, and whether MMU can correctly receive and process the alarm.
[0151] Through the above embodiments, the present invention fully demonstrates how to utilize QEMU and its scalability to build a pure software simulation and debugging platform that supports multi-level, heterogeneous BMS architecture, achieving hardware decoupling, system-level collaborative debugging, and automated test injection.
[0152] Based on the same inventive concept, this invention also provides a QEMU-based simulation and debugging system for an energy storage battery management system, comprising:
[0153] Configuration Management Module: Used to create and load configuration files that describe the various levels of BMS nodes in a multi-level BMS architecture. These configuration files refer to the configuration files of the QEMU virtual machine instances created for each BMS node.
[0154] QEMU virtual machine cluster: consists of multiple QEMU processes started according to configuration files, each process emulating a BMS node;
[0155] Virtual network switch: A virtual communication network implemented by the internal network function of QEMU, which is a simulated peripheral device of QEMU virtual machine instances that connects all BMS nodes via CAN bus;
[0156] Simulation Agent and Injection Module: The simulation agent program running on the host is responsible for injecting data and faults into the QEMU virtual machine cluster;
[0157] Debugger integration interface: Provides a standard connection interface for external debuggers (such as GDB), supporting multi-session concurrent debugging;
[0158] Monitoring and Analysis Module: Monitors and analyzes the simulation debugging process.
[0159] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0160] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0161] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0162] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0163] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A simulation and debugging method for an energy storage battery management system based on QEMU, characterized in that, include: Simulation debugging and configuration are performed based on QEMU, creating an independent QEMU virtual machine instance for each BMS node; Virtual hardware links are built for QEMU virtual machine instances of each BMS node to construct a virtual communication network with the same topology as the real energy storage battery management system; Create a simulation agent program to inject simulation data and faults into the virtual communication network; Start QEMU virtual machine instances on all BMS nodes in parallel and perform debugging operations through the simulation agent program; Monitor and analyze the simulation debugging process.
2. The simulation and debugging method for an energy storage battery management system based on QEMU according to claim 1, characterized in that, The configuration of the QEMU virtual machine instance includes: Simulated CPU architecture Simulated memory size and address space mapping; Simulated peripherals, Additionally, specify the operating system image to run for each QEMU virtual machine instance.
3. The simulation and debugging method for an energy storage battery management system based on QEMU according to claim 2, characterized in that, The peripherals for the simulation include: CAN controller: Used to simulate CAN bus communication between BMS nodes at various levels and between BMS nodes and external devices; SPI / I2C controller: used to simulate communication between the BMS master control chip and the AFE acquisition chip and EEPROM slave device; General Purpose Input / Output (GPIO): Used for analog switching signals and indicator lights; Analog-to-digital converter (ADC): used for inputting analog voltage and temperature signals; Ethernet controller: Used for network communication or debugging.
4. The simulation and debugging method for an energy storage battery management system based on QEMU according to claim 1, characterized in that, The process of building virtual hardware links for QEMU virtual machine instances on each BMS node includes: The virtual network functionality provided by QEMU can be used to connect the simulation peripherals of each independent QEMU virtual machine instance to build a virtual communication network with the same topology as the real energy storage battery management system.
5. The simulation and debugging method for an energy storage battery management system based on QEMU according to claim 1, characterized in that, The simulation agent program is used to achieve: Simulate AFE behavior: Inject simulated battery cell voltage and temperature sensor data into the QEMU virtual machine instance representing the battery monitoring unit (CMU); Simulated faults: dynamically injecting abnormal operating conditions; Simulate load and environmental changes: Dynamically adjust the injected analog quantity data based on the charge and discharge curves.
6. The simulation and debugging method for an energy storage battery management system based on QEMU according to claim 5, characterized in that, The abnormal operating conditions include: communication interruption, signal timeout, sensor value exceeding limits, short circuit, and open circuit.
7. The simulation and debugging method for an energy storage battery management system based on QEMU according to claim 5, characterized in that, The simulation agent program interacts with the QEMU virtual machine instance of the specified BMS node through QEMU's qtest protocol or a custom virtual device model.
8. The simulation and debugging method for an energy storage battery management system based on QEMU according to claim 1, characterized in that, The monitoring and analysis of the simulation debugging process includes: During simulation and debugging, the communication messages of all BMS nodes on the virtual CAN bus are monitored, the BMS behavior is recorded and analyzed, and the logical correctness and fault tolerance of the BMS software at each level are verified.
9. The simulation and debugging method for an energy storage battery management system based on QEMU according to claim 8, characterized in that, During the simulation and debugging process, all QEMU virtual machine instances share the host's clock source to achieve cross-node synchronization. The host refers to the host where the QEMU virtual machine instances are deployed.
10. A simulation and debugging system for an energy storage battery management system based on QEMU, characterized in that, include: Configuration Management Module: Used to create and load configuration files that describe the various levels of BMS nodes in a multi-level BMS architecture. The configuration file refers to the configuration file of the QEMU virtual machine instance created for each BMS node. QEMU virtual machine cluster: consists of multiple QEMU processes started according to configuration files, each process emulating a BMS node; Virtual network switch: A virtual communication network implemented by the internal network function of QEMU, which is a simulated peripheral device of QEMU virtual machine instances that connects all BMS nodes via CAN bus; Simulation Agent and Injection Module: The simulation agent program running on the host is responsible for injecting simulation data and faults into the QEMU virtual machine cluster; Debugger Integration Interface: Provides a standard connection interface for external debuggers; Monitoring and Analysis Module: Monitors and analyzes the simulation debugging process.