General Software Architecture
Illustrated by a layered BMS software architecture: from top to bottom, it consists of the Application Layer, Middle Service Layer, Base Support Modules, and Hardware Drivers at the bottom. Meanwhile, an RTOS on the left handles task scheduling support.
Part I: Detailed Layer Functions

1. Application Layer
The Application Layer can be developed based on a model-based software development process (MBD), where BMS functions (such as control strategies and algorithms) are first modeled and verified through Hardware-in-the-Loop (HiL) testing, after which code is automatically generated and integrated into the architecture.
As the functional core of the BMS, the Application Layer implements various battery management algorithms and strategies, including:
Measurements: Collecting critical parameters such as battery voltage, current, and temperature.
Relay control: Controlling the turn-on and turn-off of main circuit relays to achieve battery power-up, power-down, and protection.
Balancing strategy: Balancing the state-of-charge (SoC) differences among individual cells through active or passive balancing to extend battery life.
Charging strategy: Controlling charging stages such as constant current (CC) and constant voltage (CV) to ensure safe and efficient battery charging.
Diagnosis: Monitoring battery faults (e.g., overvoltage, undervoltage, overcurrent, thermal runaway) and triggering protection mechanisms.
Insulation detection: Detecting the insulation resistance between the battery system and the vehicle chassis to prevent high-voltage leakage risks.
SOC/SOH estimation: Estimating the battery's State of Charge (SOC) and State of Health (SOH) to provide a basis for user display and vehicle control.
Max power prediction: Predicting the maximum output or acceptance power based on the current state of the battery to support vehicle dynamics and powertrain decisions.
Thermal management: Controlling cooling or heating systems to maintain the battery temperature within the optimal operating range.
2. Middle Service Layer
Interactive layer: Handling command interactions for human-machine interfaces (HMI) or external equipment (such as diagnostic tools).
Diag. layer (Diagnostic Layer): Cooperating with the diagnostic functions of the Application Layer to manage diagnostic processes, such as fault code (DTC) storage and uploading.
Network layer: Responsible for communication protocol parsing, data transmission, and reception over in-vehicle networks (such as CAN and Ethernet), enabling information exchange between the BMS and the Vehicle Control Unit (VCU), chargers, and other components.
NM (Network Management): Managing the node states of the in-vehicle network to implement energy-saving strategies such as network wake-up and sleep.
Meas. & Cal. (Measurement & Calibration): Filtering and calibrating the collected battery parameters to improve measurement accuracy.
3. Base Support Modules
Providing fundamental bottom-layer functional support for the system:
Flash Bootloader: Enabling software upgrade functionality, supporting over-the-air (OTA) or wireline updates of the BMS program at the vehicle end.
Complex driver (CDD): Handling the driver logic for specialized hardware (such as high-precision ADCs or special communication interfaces) to make up for the limitations of standard hardware drivers.
4. Hardware Drivers
Serving as the interface layer between software and hardware, this layer converts high-level software commands into hardware-executable operations-such as controlling sensor acquisition, actuator movements, and chip register configurations-ensuring that the underlying functions of the hardware are correctly invoked.
Real-Time Operating System (RTOS)
The RTOS provides functions such as multitasking scheduling, time management, and memory management. It ensures that various BMS tasks (such as high-frequency data acquisition and real-time fault protection) are executed efficiently according to priority and timing, fulfilling the strict real-time requirements of battery management.
Part II: Core Algorithm Structure
A defining core characteristic of a Battery Management System lies in its ability to rely on a limited set of directly measurable parameters (such as voltage, current, and temperature) and, through model algorithms and data analysis, inversely deduce a broader range of critical internal state variables that are otherwise difficult to acquire directly (such as State of Charge [SOC], State of Health [SOH], State of Power [SOP], and internal temperature distribution).


