Battery SOC prediction method based on deep learning model
By combining CNN and BiLSTM layers in a hybrid neural network architecture, the limitations and overfitting problems of single models in battery SOC prediction are solved, achieving high-precision and high-stability multi-step rolling prediction, thus improving the prediction efficiency and accuracy of the battery management system.
Patent Information
- Application Number
- CN202511092343.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-05
- Publication Date
- 2025-12-05
AI Technical Summary
Existing battery SOC prediction methods suffer from limitations of single models, overfitting risks, and low computational efficiency, making it difficult to achieve high-precision and high-stability predictions under complex operating conditions.
A hybrid neural network architecture is adopted, combining CNN and BiLSTM layers. Through multi-head attention mechanism and L2 regularization, the feature extraction and noise resistance of the model are enhanced, and a sliding window is used to achieve multi-step prediction.
It improves the accuracy and stability of battery SOC prediction, reduces computational errors and resource consumption, and enhances the model's generalization ability and real-time performance.
Smart Images

Figure CN121069196A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of battery management systems, and particularly relates to a battery SOC prediction method based on deep learning. BACKGROUND
[0002] Battery SOC (State of Charge) prediction, as a core technology of battery management systems, its prediction accuracy plays a crucial role in battery life assessment and system safety. In the past, traditional prediction methods such as ampere-hour integration and open-circuit voltage method mainly rely on physical models. Although these methods have relatively simple principles, they have many drawbacks in practical applications. For example, they are easily disturbed by noise and have poor adaptability when facing complex dynamic working conditions, making it difficult to accurately reflect the true SOC state of the battery. In recent years, with the rapid development of deep learning technology, time series prediction methods based on deep learning have gradually emerged in the field of battery SOC prediction and become the mainstream research direction. However, the existing prediction methods based on deep learning still have some problems to be solved, such as:
[0003] Single model limitations: Many methods only use LSTM (Long Short-Term Memory) or CNN (Convolutional Neural Network) single models. Among them, the model using only LSTM has certain advantages in processing long-term sequence dependencies, but performs poorly in capturing local features; while the model using only CNN is good at extracting local features, but lacks the ability to capture long-term dependencies, making it difficult to effectively extract both local features and long-term dependencies.
[0004] Overfitting risk: In complex battery working conditions, data has high complexity and diversity, and existing deep learning models are prone to overfitting, resulting in insufficient generalization ability of the model. This makes the model's prediction accuracy greatly decrease when facing new, unseen data, and it is extremely sensitive to data noise.
[0005] Low computational efficiency: Traditional deep learning prediction methods accumulate errors as the number of time steps increases when performing long-term prediction. This not only leads to a growing deviation in the prediction results, but also consumes a large amount of time and computing resources in the calculation process, reducing the efficiency and real-time performance of the prediction.
[0006] In summary, the existing battery SOC prediction technology has many shortcomings in practical applications, and cannot meet the growing demand of battery management systems for high-precision and high-stability SOC prediction. Therefore, there is an urgent need for a new technical solution to solve these problems. SUMMARY
[0007] The application aims to provide a hybrid neural network architecture based on a deep learning model, which solves the problem of multi-scale feature extraction of long sequence SOC data, enhances the attention allocation ability of the model to key time nodes, improves the stability and noise resistance of the prediction results, and realizes high-precision multi-step rolling SOC prediction, so as to meet the demand of the battery management system for accurate battery SOC prediction in different application scenarios.
[0008] The battery SOC prediction method based on the deep learning model comprises the following steps:
[0009] S1: data preprocessing, sampling original data according to a specified step length, reading files and processing missing values, standardizing SOC values using StandardScaler, and generating sequence samples (X, y) with a window length of look_back=n;
[0010] S2: constructing a hybrid model architecture, the model comprising an input layer, a CNN feature extraction layer, a residual block, a max pooling layer, a BiLSTM layer, an attention mechanism layer and an output layer, the input layer receiving a time sequence with a shape of (n, 1), the CNN feature extraction layer extracting local space-time features by combining a convolution layer with 128 filters and a residual block, the max pooling layer compressing the feature dimension, the BiLSTM layer capturing the time sequence dependence in both directions, the attention mechanism layer focusing on key time steps through 4-head multi-head attention, and the output layer being a linear Dense layer for predicting SOC values;
[0011] S3: model training, dividing the data set into 80% training set and 20% validation set, enabling learning rate scheduling and early stopping callback mechanism, performing batch training with n samples per batch, and using RMSE, MAE and R 2 as evaluation indexes;
[0012] S4: multi-step prediction, taking the last n time steps as the initial sequence, cyclically predicting future values, adding the predicted values to the end of the sequence and removing the oldest values, de-normalizing the prediction results, and outputting the SOC prediction of the next n time steps at an interval of n seconds;
[0013] S5: visual display, displaying training data, actual values, validation prediction and future prediction results;
[0014] S6: result output: outputting the prediction results.
[0015] The hybrid model architecture comprises a feature extraction module, a time sequence processing module, an attention enhancement module, a regularization and optimization module and a rolling prediction module.
[0016] The feature extraction module adopts a combination of one-dimensional convolution layer (Conv1D) and residual block, extracts local space-time features through a convolution kernel, and prevents gradient disappearance through residual connection, and the calculation process is: x=Conv1D (filters=128, kernel_size=5,...) (inputs), x=residual_block (x, filters=128, kernel_size=5).
[0017] The time sequence processing module adopts a bidirectional LSTM layer (BiLSTM) to process forward and reverse time sequences in both directions, and captures long-term dependencies, and the calculation process is: x=Bidirectional (LSTM (128, return_sequences=True,...)) (x).
[0018] The attention enhancement module adopts a multi-head attention mechanism, captures the features of key time nodes through 4 attention heads in parallel, and the calculation process is: attention_output=MultiHeadAttention (num_heads=4...)) (x, x).
[0019] The regularization and optimization module adopts L2 regularization and dynamic learning rate to prevent overfitting and improve model generalization ability.
[0020] The rolling prediction module adopts a sliding window method to realize multi-step prediction capability.
[0021] In the S1 data preprocessing step, when sampling the original data, the specified step is determined according to the battery data change frequency and the prediction accuracy requirement, and the value range is 1-10 seconds.
[0022] In the S3 model training step, the learning rate reduction strategy is to multiply the learning rate by 0.5-0.8 when the validation loss stagnates each time.
[0023] Compared with the traditional LSTM method, the battery SOC prediction method of the deep learning model has a test set RMSE reduction of about 20%, and the long sequence processing capability of the model can effectively process a time window of more than 40 steps; it can be complementary to LSTM: after CNN extracts local features, BiLSTM captures long-term dependencies to form "local-global" feature fusion; the noise resistance performance is enhanced: through L2 regularization, the MAE is reduced by 20%. Training efficiency is optimized: early stopping mechanism reduces invalid training rounds by more than 30%. At the same time, it has multi-step prediction capability.
[0024] The technical scheme effectively solves the key technical problems of insufficient accuracy and long sequence processing difficulty in battery SOC prediction through an innovative deep learning architecture, and has important application value in battery safety management and energy storage systems.
[0025] Key points of the application:
[0026] 1. Hybrid architecture design: cascaded structure of CNN-BiLSTM-attention
[0027] 2. Residual attention mechanism: fusion of residual connection in spatio-temporal features
[0028] 3. Multi-dimensional regularization strategy: combination of inter-layer L2 regularization and Dropout
[0029] 4. Dynamic learning mechanism: adaptive learning rate adjustment based on validation loss
[0030] 5. Rolling prediction method: multi-step prediction implementation by iteratively updating input sequence
[0031] Protection points of the application:
[0032] 1. Hybrid neural network architecture based on CNN-BiLSTM-multi-head attention
[0033] 2. Spatio-temporal feature extraction method containing residual connection
[0034] 3. Training optimization method combining dynamic learning rate and early stopping mechanism
[0035] 4. Multi-step temperature prediction algorithm based on sliding window update
[0036] 5. Overall implementation scheme of battery SOC prediction system BRIEF DESCRIPTION OF DRAWINGS
[0037] Figure 1 Flowchart of a battery SOC prediction method based on a deep learning model
[0038] Figure 2 Full view of battery SOC prediction (I)
[0039] Figure 3 Full view of battery SOC prediction (II)
[0040] Figure 4 Full view of battery SOC prediction (III)
[0041] Figure 5 Full view of battery SOC prediction (IV) DETAILED DESCRIPTION
[0042] The application provides a battery SOC prediction method based on a deep learning model.
[0043] S1: data preprocessing, sampling original data according to a specified step, reading a file and processing missing values, standardizing SOC values by using StandardScaler, and generating sequence samples (X, y) with a window length of look_back=n;
[0044] S2: constructing a hybrid model architecture, the model comprising an input layer, a CNN feature extraction layer, a residual block, a max pooling layer, a BiLSTM layer, an attention mechanism layer and an output layer, the input layer receiving a time sequence with a shape of (n, 1), the CNN feature extraction layer combining a convolution layer with 128 filters and a residual block to extract local space-time features, the max pooling layer compressing feature dimensions, the BiLSTM layer capturing front and rear time sequence dependencies in a bidirectional manner, the attention mechanism layer focusing on key time steps through 4 multi-head attentions, and the output layer being a linear Dense layer for predicting SOC values;
[0045] S3: model training, dividing a data set into 80% training set and 20% validation set, enabling a learning rate scheduling and early stopping callback mechanism, performing batch training with n samples / batch, and using RMSE, MAE and R 2 as evaluation indexes;
[0046] S4: multi-step prediction, taking the last n time steps as an initial sequence, cyclically predicting future values, adding the predicted values to the end of the sequence and removing the oldest values, inversely normalizing the predicted results, and outputting SOC predictions at an interval of n seconds for the next n time steps;
[0047] S5: visual display, displaying training data, actual values, validation predictions and future prediction results;
[0048] S6: result output: outputting the prediction results.
[0049] The hybrid model architecture comprises a feature extraction module, a time sequence processing module, an attention enhancement module, a regularization and optimization module and a rolling prediction module.
[0050] The feature extraction module adopts a combination of a one-dimensional convolution layer (Conv1D) and a residual block, extracts local space-time features through a convolution kernel, and prevents gradient disappearance through residual connection, and the calculation process is: x=Conv1D(filters=128,kernel_size=5,...)(inputs), x=residual_block(x,filters=128,kernel_size=5).
[0051] The time sequence processing module adopts a bidirectional LSTM layer (BiLSTM) to process forward and reverse time sequences in two directions, and capture long-term dependencies, and the calculation process is: x = Bidirectional (LSTM (128, return_sequences = True,...)) (x).
[0052] The attention enhancement module adopts a multi-head attention mechanism, and four attention heads are used in parallel to capture the features of key time nodes, and the calculation process is: attention_output = MultiHeadAttention (num_heads = 4...) (x, x).
[0053] The regularization and optimization module adopts L2 regularization and a dynamic learning rate to prevent overfitting and improve the generalization ability of the model.
[0054] The rolling prediction module adopts a sliding window method to realize multi-step prediction capability.
[0055] In the S1 data preprocessing step, when sampling the original data, the specified step length is determined according to the battery data change frequency and the prediction accuracy requirement, and the value range is 1-10 seconds.
[0056] In the S3 model training step, the learning rate reduction strategy is to multiply the learning rate by 0.5-0.8 when the validation loss stagnates each time.
[0057] Figures 2 to 5 The full view of the battery SOC prediction is shown, wherein the blue dashed line shows the historical SOC, the green solid line marks the real SOC of the validation set, the orange dashed line shows the model prediction result, and the red solid line extends the future trend. At the same time, three commonly used accuracy measurement variables are introduced: MAE (mean absolute error), RMSE (root mean square error), and R 2 (the proportion of the variance explained by the model), by observing the changes of the three indicators, it can be known that the prediction model proposed in the application has high accuracy, long sequence processing capability and good noise resistance.
[0058] The above embodiments are only used to illustrate the present application, and are not limited to the present application. Those skilled in the art can make various changes and modifications without departing from the essence and scope of the present application, therefore all equivalent technical solutions also belong to the protection scope of the present application.
[0059] The contents not described in detail in the specification belong to the prior art known to those skilled in the art.
Claims
1. A battery SOC prediction method based on a deep learning model, characterized in that, The method comprises the following steps: S1: data preprocessing, sampling the original data according to the specified step length, reading the file and processing the missing values, standardizing the SOC value using StandardScaler, and generating sequence samples (X, y) with a window length of look_back=n; S2: constructing a hybrid model architecture, the model includes an input layer, a CNN feature extraction layer, a residual block, a max pooling layer, a BiLSTM layer, an attention mechanism layer, and an output layer, the input layer receives a time series with a shape of (n, 1), the CNN feature extraction layer uses a convolution layer with 128 filters combined with a residual block to extract local space-time features, the max pooling layer compresses the feature dimension, the BiLSTM layer captures the forward and backward time sequence dependencies, the attention mechanism layer focuses on key time steps through 4 multi-head attention, and the output layer is a linear Dense layer to predict the SOC value; S3: Model training, divide the dataset into 80% training set and 20% validation set, enable learning rate scheduling and early stopping callback mechanism, batch training with n samples / batch, use RMSE, MAE and R 2 as evaluation indicators; S4: multi-step prediction, taking the last n time steps as the initial sequence, cyclically predicting future values, adding the predicted values to the end of the sequence and removing the oldest values, de-normalizing the prediction results, and outputting the SOC prediction for the next n time steps at an interval of n seconds; S5: visual display, displaying the training data, actual values, validation predictions, and future prediction results; S6: result output: output the prediction results. 2.The battery SOC prediction method based on a deep learning model according to claim 1, wherein, The hybrid model architecture comprises a feature extraction module, a time series processing module, an attention enhancement module, a regularization and optimization module, and a rolling prediction module. 3.The battery SOC prediction method based on a deep learning model according to claim 2, characterized in that, The feature extraction module uses a combination of one-dimensional convolution layers (Conv1D) and residual blocks to extract local space-time features through convolution kernels, and residual connection to prevent gradient disappearance, the calculation process is: x=Conv1D(filters=128,kernel_size=5,...)(inputs), x=residual_block(x,filters=128,kernel_size=5). 4.The battery SOC prediction method based on a deep learning model according to claim 2, characterized in that, The time series processing module uses a bidirectional LSTM layer (BiLSTM) to process forward and backward time series in both directions, capturing long-term dependencies, the calculation process is: x=Bidirectional(LSTM(128,return_sequences=True,...))(x). 5.The battery SOC prediction method based on a deep learning model according to claim 2, characterized in that, The attention enhancement module uses a multi-head attention mechanism to capture features of key time nodes through 4 attention heads in parallel, the calculation process is: attention_output=MultiHeadAttention(num_heads=4...)(x,x). 6.The battery SOC prediction method based on a deep learning model according to claim 2, characterized in that, The regularization and optimization module uses L2 regularization and dynamic learning rate to prevent overfitting and improve model generalization. 7.The battery SOC prediction method based on a deep learning model according to claim 2, characterized in that, The rolling prediction module uses a sliding window approach to achieve multi-step prediction capability.
8. The battery SOC prediction method of claim 1, wherein In the S1 data preprocessing step, when sampling the original data, the specified step length is determined according to the battery data change frequency and prediction accuracy requirements, the value range is 1-10 seconds.
9. The battery SOC prediction method of claim 1, wherein In the S3 model training step, the learning rate reduction strategy is to multiply the learning rate by 0.5-0.8 when the validation loss stagnates each time.
Citation Information
Patent Citations
Automobile battery SOC multi-step prediction method and system based on multi-scale fusion GRU network
CN117630683A
Energy storage lithium battery SOC estimation method based on A-CNN-LSTM
CN117741443A
Lithium ion battery SOC estimation method based on hybrid neural network
CN117973442A
Systems and methods for forecasting battery state of charge
US10969436B1