Advancing the goals of carbon peak and carbon neutrality necessitates significant technological innovation, particularly in the transportation sector. The transition to electrified vehicles relies fundamentally on the performance and safety of their power source—the traction battery. The battery management system (BMS) serves as the critical “brain” of this power source, responsible for state monitoring, fault diagnosis, thermal management, and cell balancing. An intelligent and reliable BMS is paramount for maximizing battery efficiency, extending service life, and ensuring the safe operation of electric vehicles, including specialized utility vehicles like oil-water separation trucks. Early BMS technology, predominantly developed in countries like the United States, Japan, and Germany, provided foundational monitoring capabilities. However, these first-generation systems exhibited limitations in state estimation accuracy, adaptability to dynamic operating conditions, and intelligent management features. The recent integration of Artificial Intelligence (AI) and the Internet of Things (IoT) has shifted research focus towards high-precision state-of-charge (SOC) and state-of-health (SOH) estimation, intelligent fault diagnostics, and cloud-coordinated management.
Among the core algorithms in a BMS, accurate State of Charge (SOC) estimation is the most crucial for ensuring vehicle range prediction, battery safety, and lifespan. Traditional methods include direct measurement, battery model-based, and data-driven approaches. The Open Circuit Voltage (OCV) method is a classic direct measurement technique that estimates SOC based on the stable voltage after a long rest period, making it unsuitable for real-time, online BMS applications. Model-based methods, such as those employing Extended Kalman Filter (EKF) or Sliding Mode Observers (SMO) combined with equivalent circuit models (like the Thevenin model), offer online estimation but require complex parameter identification and can struggle with model inaccuracies under varying conditions. Data-driven methods, which leverage machine learning and deep learning, have gained prominence as they can learn complex, non-linear relationships from battery data without explicit physical models. Techniques like Convolutional Neural Networks (CNN), Long Short-Term Memory (LSTM) networks, and their hybrids (e.g., CNN-LSTM) have shown promising results. For instance, hybrid CNN-LSTM networks effectively capture both spatial and temporal features from battery data streams. Building upon this, enhancements like Bidirectional LSTM (BiLSTM) can model forward and backward temporal dependencies, while attention mechanisms can dynamically weigh the importance of different input features and timesteps. This paper presents an intelligent BMS solution tailored for a pure electric oil-water separation vehicle. The system features a novel, stackable distributed hardware architecture and a smart terminal platform. A key contribution is the proposal of an advanced data-driven model for SOC estimation, which integrates CNN, BiLSTM, and an attention mechanism to achieve superior accuracy with limited training data.

State of Charge Estimation Based on Enhanced Hybrid Neural Network
Accurate and robust SOC estimation forms the intellectual core of a modern battery management system (BMS). To address the challenges of modeling complex battery dynamics under varying operational profiles and with limited data availability, this study develops an advanced hybrid neural network architecture.
Enhanced Sequential Modeling with BiLSTM
The Long Short-Term Memory (LSTM) network is adept at learning long-term dependencies in sequential data, making it suitable for time-series battery data like voltage, current, and temperature. For effective learning with smaller datasets, a single-layer LSTM structure with 300 neurons is employed to balance model capacity and complexity. Key hyperparameters are optimized: a timestep of 60 captures sufficient historical context, a batch size of 64 ensures stable gradient updates, and an initial learning rate of 0.001 with the Adam optimizer ($$\beta_1=0.9, \beta_2=0.999$$) facilitates adaptive tuning. Dropout and gradient clipping techniques are incorporated to prevent overfitting. Empirical results indicate that 300 training epochs achieve a good balance between convergence and generalization. To further enhance temporal feature extraction, a Bidirectional LSTM (BiLSTM) is integrated into the hybrid model. Unlike a standard LSTM that processes sequences only in the forward direction, a BiLSTM consists of two separate LSTM layers: one processes the input sequence from past to future (forward layer), and the other processes it from future to past (backward layer). This dual-path architecture allows the model to capture contextual information from both past and future states for any given point in the sequence. The outputs (hidden states) from these two layers are typically concatenated at each timestep, providing a more comprehensive representation. This is particularly beneficial for battery SOC estimation, where the future trend of current can provide valuable context for the present state. The output of the BiLSTM layer at time $$t$$ is computed as:
$$
\vec{y_t} = \sigma(W_y \cdot [\vec{h_t}, \overleftarrow{h_t}] + b_y)
$$
where $$\vec{h_t}$$ is the forward hidden state, $$\overleftarrow{h_t}$$ is the backward hidden state, $$W_y$$ is the weight matrix, $$b_y$$ is the bias term, and $$\sigma$$ is an activation function.
Dynamic Feature Weighting with Attention Mechanism
While BiLSTM captures comprehensive temporal patterns, not all features or historical timesteps contribute equally to the SOC estimation at a given moment. The attention mechanism addresses this by allowing the model to dynamically focus on the most relevant parts of the encoded input sequence. For an input sequence $$X = \{x_1, x_2, …, x_N\}$$, the mechanism operates using Query (Q), Key (K), and Value (V) vectors derived from the input via learnable weight matrices: $$Q = XW_Q$$, $$K = XW_K$$, $$V = XW_V$$. The calculation involves three steps: First, a similarity score (e.g., dot product) is computed between the Query and each Key, resulting in unnormalized attention scores $$s_i$$. Second, these scores are normalized into a probability distribution using the softmax function, yielding the attention weights $$\alpha_i$$:
$$
\alpha_i = \text{softmax}(s_i) = \frac{e^{s_i}}{\sum_{j=1}^{N} e^{s_j}}
$$
Third, a weighted sum of the Value vectors is calculated using these attention weights to produce the final context vector, which becomes the focused input for the subsequent layer:
$$
\text{Attention}((K,V), Q) = \sum_{i=1}^{N} \alpha_i \times V_i
$$
In the context of a BMS, this allows the model to, for example, pay more attention to recent high-current discharge events or specific voltage plateaus when estimating the current SOC.
A-HyBiLSTM Model Architecture
Building upon the CNN-LSTM hybrid foundation, this paper proposes an Attention-based Hybrid Bidirectional LSTM (A-HyBiLSTM) model, specifically designed for robust performance with limited battery data samples. The architecture follows a three-stage feature processing pipeline, as illustrated in the conceptual design figure. The first stage employs a one-dimensional Convolutional Neural Network (1D-CNN) layer. This layer acts as a local feature extractor, scanning across the temporal dimension of input parameters (voltage, current, temperature) to identify localized patterns and correlations that are crucial for understanding instantaneous battery behavior. The extracted spatial features are then passed to the second stage, which consists of a BiLSTM layer. This layer performs deep bidirectional temporal modeling, learning the long-range dependencies and complex evolution of battery states over time by analyzing the sequence both forwards and backwards. The rich, context-aware feature sequence generated by the BiLSTM is then fed into the third stage: an attention layer. This layer dynamically computes a weight distribution over the BiLSTM output sequence, effectively amplifying the influence of the most relevant temporal features for the current SOC estimation while suppressing less informative or noisy elements. Finally, the weighted feature vector is passed through fully connected (dense) layers to perform regression and output the final SOC estimate. This hierarchical design—spatial feature extraction, followed by bidirectional temporal modeling, and concluded with adaptive feature weighting—enables the A-HyBiLSTM model to achieve high estimation accuracy even when trained on smaller datasets, making it highly suitable for embedded BMS applications where data collection may be constrained.
Design of the Stackable BMS for the Oil-Water Separation Vehicle
The physical realization of the intelligent battery management system for the target vehicle requires a robust, scalable, and cost-effective hardware and software architecture. This design is centered around a modular, distributed approach.
Daisy-Chain Distributed Architecture Based on BQ79616
The core of the proposed BMS hardware is a “daisy-chain” distributed topology built using Texas Instruments’ BQ79616 integrated battery front-end (AFE) chips. This architecture is ideal for applications like the oil-water separation vehicle, where battery pack capacity might need future expansion. In this structure, multiple BQ79616 devices are connected in a serial communication chain (the daisy chain), with each device responsible for monitoring a single battery module (e.g., 16 cells in series). Only the device at the base of the chain (the “base device”) communicates directly with the central Microcontroller Unit (MCU) via a UART interface, which is isolated using an ISO7742 digital isolator chip for robustness and safety. Commands and data cascade up and down this serial chain. This design significantly reduces the number of communication lines and isolation components compared to a centralized or star-topology BMS, lowering hardware cost, simplifying wiring harnesses, and improving scalability. To ensure reliability in the vehicle’s potentially harsh electromagnetic environment, the printed circuit board (PCB) is coated with conformal coating, key chip areas are shielded, and robust electrical protection (over-voltage, short-circuit) is implemented on power and communication lines, aiming for compliance with automotive EMC standards like ISO 11452-4.
Circuit Design for Data Acquisition and Balancing
The BQ79616 AFE chip provides comprehensive monitoring and management functions. For cell voltage measurement, the chip’s main Analog-to-Digital Converter (ADC) sequentially polls each cell. The raw 16-bit measurement results are read by the MCU from specific registers (VCELL*_HI/LO) and converted to microvolts using a predefined conversion formula. Passive cell balancing is implemented using external 300Ω power resistors connected to the dedicated CB* pins of the BQ79616, capable of supporting balance currents up to approximately 600mA per cell. Each balancing circuit includes an LED indicator for visual confirmation of active balancing. The BQ79616 incorporates intelligent thermal management that automatically pauses balancing if the chip’s internal die temperature or an external NTC thermistor temperature exceeds a safe threshold (e.g., 105°C), resuming once the temperature drops below a recovery level. Pack current measurement is achieved via a shunt resistor (e.g., 2mΩ) placed in series with the main battery loop. The voltage drop across the shunt is amplified by a precision differential amplifier circuit. The amplified signal (VOUT) is then sampled by an auxiliary ADC (AUXADC) on the BQ79616. The current $$I_x$$ is calculated as:
$$
I_x = \frac{(V_{out} – V_{ref})}{R_s \times Gain}
$$
where $$R_s$$ is the shunt resistance, $$Gain$$ is the amplifier gain, and $$V_{ref}$$ is the amplifier’s reference voltage. The BQ79616 also features two internal die temperature sensors, measured directly by its ADC, providing critical data for the BMS’s thermal management strategy.
BMS Hardware and Embedded Software Implementation
The key hardware components of the implemented BMS slave module are summarized in the table below. The GigaDevice GD32F130C8T6, an ARM Cortex-M3 based MCU, serves as the local controller, handling communication with the BQ79616 AFE and executing core BMS algorithms. It is chosen for its automotive-grade suitability and sufficient computational resources.
| Component | Model/Specification | Description |
|---|---|---|
| MCU | GD32F130C8T6 | ARM Cortex-M3 core, automotive-grade. |
| AFE Chip | BQ79616 | Monitors up to 16 series-connected cells. |
| Communication Isolator | ISO7742 | Provides UART signal isolation for safety. |
| Balancing Resistor | 300Ω | For passive cell balancing circuits. |
| Current Sensing | Differential Amplifier + 2mΩ Shunt | Measures pack current. |
| Temperature Sensing | BQ79616 Internal Sensor / NTC | Primary and optional temperature monitoring. |
The embedded software for the BMS is designed with a modular, three-layered architecture based on the real-time operating system RT-Thread Nano to ensure reliability and maintainability. The Hardware Abstraction Layer (HAL) provides low-level drivers for the MCU peripherals, the BQ79616 AFE, and communication interfaces (UART, I2C, CAN). The System Service Layer, built on RT-Thread Nano kernel, manages tasks, thread scheduling, memory, and inter-thread communication. The Application Layer implements the core BMS business logic, structured as prioritized tasks (threads). These include a periodic Data Acquisition Task that reads cell voltages, temperatures, and current from the BQ79616 registers; a Protection & Control Task that evaluates the data against safety thresholds (over-voltage, under-voltage, over-current, over-temperature) and controls balancing FETs; and a Communication Task that packages the data and sends it to the central BMS terminal via CAN or UART. The main program flow for the battery state monitoring business logic initializes the system and the BQ79616, then enters a loop where it continuously triggers ADC conversions, reads the results, processes the data (including basic checks), and transmits it.
Intelligent BMS Terminal Platform Design
The intelligent BMS terminal acts as the vehicle’s central human-machine interface and data processing hub for the battery system. It receives, processes, stores, and visualizes data from the distributed BMS modules and runs advanced algorithms like the A-HyBiLSTM model for state estimation.
The terminal’s hardware is built around a powerful ARM processor running a Linux operating system. The block diagram encompasses several key modules: a User Interaction Module with a touchscreen LCD (e.g., 7-inch, 1024×600) and physical buttons; a Signal Processing Unit (the ARM CPU); a Communication Module with CAN controllers, UART, and 4G/WiFi for vehicle network and cloud connectivity; a Storage Module using embedded MultiMediaCard (eMMC) or SD cards; and a robust Power Management Module providing stable, filtered power from the vehicle’s low-voltage system. The software architecture for the terminal is also layered. The Hardware Adaptation Layer includes drivers for the LCD, touch controller, CAN bus, and network interfaces. The System Layer consists of the Linux kernel and essential libraries. The Application Framework Layer utilizes the Qt framework to build the graphical user interface (GUI). Finally, the Application Layer contains the main business logic: data communication with the BMS modules, database management, the intelligent algorithm engine (hosting the A-HyBiLSTM model), and the GUI application.
Data management is handled by a lightweight SQLite database, chosen for its zero-configuration, serverless, and cross-platform nature. The database schema typically includes tables for pack-level information (total voltage, current, SOC, SOH) and cell-level details (individual cell voltage, temperature, balance status). This allows for efficient storage, querying, and historical analysis of battery data, which is also used for continuous learning and refinement of the estimation algorithms. The GUI, developed with Qt, provides a comprehensive and user-friendly monitoring interface. It is organized into distinct functional zones: a Real-time Data Display Zone showing key parameters numerically and through virtual instruments; a Cell Status Matrix Zone presenting voltage and temperature of each cell in a color-coded grid for quick anomaly detection; a Historical Trend Graph Zone plotting SOC, voltage, and current over time; and a System Control & Setting Zone with buttons for system control, data export, and parameter configuration. The interface is updated at a rate of 1 Hz via Qt timers to ensure real-time responsiveness.
Experimental Analysis and Results
The performance of the proposed A-HyBiLSTM model and the overall BMS design was validated through experimental analysis. Battery cycling data under standard driving schedules—Federal Urban Driving Schedule (FUDS), Dynamic Stress Test (DST), and US06—at different temperatures were used. Training datasets consisted of one complete discharge cycle from each of the FUDS, DST, and US06 profiles at varying temperatures. The independent test set was a complete DST discharge cycle at a different temperature. The total training sample size was approximately 7500 data points, simulating a constrained data scenario typical for initial BMS deployment. Key model parameters were set as follows: input feature dimension of 4 (voltage, current, temperature, maybe a derived feature), 64 convolutional filters of size 3, a learning rate of 0.001 with the Adam optimizer ($$\beta_1=0.9, \beta_2=0.999$$), a batch size of 64, a timestep of 60, and 300 training epochs.
The SOC estimation results were compared against a baseline CNN-BiLSTM model (without attention). Under the FUDS test condition, both models demonstrated competent performance, but the A-HyBiLSTM model consistently produced a prediction curve that more closely tracked the reference SOC, especially during complex current transients. Similar superior tracking was observed for the DST and US06 cycles. The quantitative analysis of prediction errors on the DST test set is presented in the table below. The metrics used are Mean Absolute Error (MAE), Root Mean Square Error (RMSE), and the Coefficient of Determination (R²).
| Model (Trained on) | MAE (%) | RMSE (%) | R² |
|---|---|---|---|
| CNN-BiLSTM (FUDS) | 0.5089 | 0.6486 | 0.9995 |
| A-HyBiLSTM (FUDS) | 0.4527 | 0.5430 | 0.9997 |
| CNN-BiLSTM (DST) | 0.4322 | 0.5443 | 0.9996 |
| A-HyBiLSTM (DST) | 0.3773 | 0.4628 | 0.9997 |
| CNN-BiLSTM (US06) | 0.4823 | 0.6339 | 0.9995 |
| A-HyBiLSTM (US06) | 0.4179 | 0.5384 | 0.9997 |
The results clearly show that the proposed A-HyBiLSTM model outperforms the CNN-BiLSTM baseline across all training scenarios. On average, the A-HyBiLSTM achieves an approximately 11-13% reduction in MAE and a 15-16% reduction in RMSE, while maintaining an R² value extremely close to 1. This demonstrates that the integration of the attention mechanism effectively enhances feature selection and model focus, leading to more accurate and robust SOC estimations, even when the model is trained on data from a different driving cycle (e.g., training on FUDS data and testing on DST). Furthermore, tests conducted with the DST cycle at different ambient temperatures confirmed that the A-HyBiLSTM model maintains its estimation error within a 2% bound, showcasing its robustness to temperature variations—a critical requirement for a practical battery management system.
Conclusion
This study presented a comprehensive design for an intelligent battery management system tailored for a pure electric oil-water separation vehicle. The system addresses key requirements of scalability, intelligence, and reliability. The hardware core is a cost-effective, stackable, distributed BMS architecture based on a daisy-chain topology using the BQ79616 AFE chip, which simplifies expansion for different battery pack configurations. The embedded software, structured on the RT-Thread Nano real-time operating system, ensures robust and timely execution of monitoring, protection, and control tasks. The intelligent BMS terminal platform, built on ARM-Linux with a Qt-based GUI and SQLite database, provides advanced data handling, visualization, and serves as the host for sophisticated estimation algorithms. The primary algorithmic contribution is the novel A-HyBiLSTM model for SOC estimation. By synergistically combining 1D-CNN for spatial feature extraction, BiLSTM for bidirectional temporal modeling, and an attention mechanism for dynamic feature weighting, the model achieves superior accuracy compared to a standard CNN-BiLSTM model. Experimental validation under various driving cycles (FUDS, DST, US06) and temperatures demonstrated consistent performance improvement, with estimation errors significantly reduced and maintained within a 2% bound. This integrated solution—encompassing innovative hardware architecture, robust software, and an advanced AI-driven estimation core—provides an effective and practical technological pathway for the intelligent upgrade of battery management systems in specialized electric utility vehicles, contributing to their safety, efficiency, and operational readiness.
