A method for estimating the remaining capacity of a lithium battery in a variable temperature environment
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-11
- Publication Date
- 2026-08-14
AI Technical Summary
[0007]本发明的目的在于提供一种变温环境锂电池剩余电量估计方法,以解决现有SOC估计技术在动态环境温度下存在的精度不足、模型适应性差以及无法显式建模温度耦合影响的问题
本发明通过特征调制门控机制,使环境温度能够动态地重新加权电压、电流、表面温度等特征,显著增强了网络对温度影响信号的捕捉能力;
Smart Images

Figure CN122568321A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of lithium battery state monitoring technology, specifically to a method for estimating the remaining capacity of a lithium battery in a variable temperature environment. Background Technology
[0002] The State of Charge (SOC) of a power battery is a core control parameter of the Battery Management System (BMS). The SOC estimation result directly determines the calculation of the electric vehicle's driving range, charge and discharge protection strategies, and equalization control logic, and is a key basis for the safe and efficient operation of the power battery. Due to the highly nonlinear characteristics of the electrochemical reactions inside lithium batteries, SOC cannot be directly collected and measured by sensors. Furthermore, factors such as dynamic fluctuations in ambient temperature, random changes in load current, and battery aging and degradation continuously interfere with the battery's output electrical parameters, significantly increasing the difficulty of SOC estimation. Among these factors, the variable temperature environment is the primary factor causing existing estimation algorithms to fail and estimation errors to surge.
[0003] Currently, mainstream SOC estimation techniques are divided into two main categories: traditional mechanistic algorithms and artificial intelligence deep learning algorithms, each with its own inherent shortcomings. 1. Traditional mechanism estimation algorithms have significant limitations. The ampere-hour integration method relies on current integration to calculate the remaining capacity. Small errors in sampling current accumulate over time with charging and discharging, leading to a continuous amplification of estimation deviations over long-term operation. The open-circuit voltage method requires the battery to be idle for several hours or more, which cannot meet the online estimation requirements for dynamic vehicle operation. Algorithms based on equivalent circuit models combined with extended Kalman filtering and unscented Kalman filtering rely entirely on the identification results of battery equivalent circuit parameters. Under low and high temperature environments, the battery's ohmic internal resistance and polarization parameters shift significantly, causing model parameters to fail and resulting in a precipitous drop in estimation accuracy in variable temperature scenarios.
[0004] 2. Conventional deep learning algorithms cannot characterize the nonlinear coupling effect of temperature. Long Short-Term Memory (LSTM) neural networks are widely used in SOC timing estimation due to their advantages in extracting time-series features. Existing conventional LSTM schemes only treat ambient temperature, terminal voltage, operating current, and battery surface temperature as input features of equal dimension, sharing the same feature mapping network. They do not establish a separate coupling constraint relationship between temperature and electrical parameters, and cannot quantify the intrinsic effects of ambient temperature changes on battery capacity decay, polarization characteristics, etc., resulting in poor fitting performance under sudden temperature changes.
[0005] 3. Insufficient adaptability of fixed-parameter attention mechanisms In SOC estimation models incorporating traditional attention mechanisms, the attention weights are permanently fixed after network training, and the attention allocation logic no longer adjusts with changes in the external environment. When the ambient temperature rises or falls rapidly, the influence weights of voltage and current features on SOC change non-linearly. The fixed attention weights cannot dynamically adapt to the feature importance with temperature changes, ultimately leading to a significant increase in SOC estimation error in varying temperature ranges.
[0006] In summary, existing SOC estimation techniques are difficult to adapt to dynamic operating conditions across the entire temperature range, and there is an urgent need for a lithium battery SOC estimation method that uses ambient temperature as a control condition and dynamically optimizes feature weights in real time. Summary of the Invention
[0007] The purpose of this invention is to provide a method for estimating the remaining capacity of lithium batteries in variable temperature environments, so as to solve the problems of insufficient accuracy, poor model adaptability, and inability to explicitly model the temperature coupling effect in existing SOC estimation techniques under dynamic environmental temperatures.
[0008] To achieve the above objectives, the technical solution provided by this invention is: a method for estimating the remaining capacity of a lithium battery in a variable temperature environment, comprising the following steps: S1. Data Acquisition and Preprocessing: Collect lithium battery time-series data under different ambient temperatures and dynamic operating conditions; use min-max normalization to standardize the collected data; construct time-series samples through a fixed-length sliding window with 400 sampling points; and use the actual remaining SOC at the end of the corresponding window as the sample label. S2. Construct an MPAA-LSTM neural network model, wherein the MPAA-LSTM neural network model is provided sequentially along the data flow direction as a feature modulation gating layer, a position coding layer, a multi-head parameter adaptive attention layer, an LSTM layer, a Dropout layer, and a fully connected output layer; S3. Network training optimization: Select mean squared error as the loss function, use the Adam optimization algorithm to iteratively train the network, use the Dropout mechanism to suppress overfitting, until the network converges, and save the trained MPAA-LSTM neural network model. S4. Online SOC estimation: Real-time lithium battery operating data is collected and preprocessed according to the rules in step S1, then input into the trained MPAA-LSTM neural network model. The MPAA-LSTM neural network model outputs the real-time remaining capacity estimate of the lithium battery under variable temperature conditions.
[0009] Furthermore, the time-series data includes main variable data such as terminal voltage, operating current, and battery surface temperature, as well as covariate data such as ambient temperature.
[0010] Furthermore, in the feature modulation gating layer: the main variable is linearly transformed to obtain high-dimensional features, the ambient temperature is linearly transformed and activated by Sigmoid to generate a gating matrix, and the high-dimensional features are multiplied element by element by the gating matrix to obtain the temperature-modulated features; The multi-head parameter adaptive attention layer: the query matrix Q and numerical matrix V of each attention head are generated from the modulated main variable features, and the key matrix K is generated in real time from the ambient temperature through linear transformation. The attention weight is calculated in real time based on Q, K, and V to realize the adaptive change of attention parameters with ambient temperature. The LSTM layer is a single layer with 128 neurons, used to extract temporal dependent features; The dropout rate of the Dropout layer is set to 0.5; The fully connected output layer, in conjunction with the Sigmoid activation function, outputs an estimated SOC value.
[0011] Furthermore, the multi-head parameter adaptive attention layer is configured with four parallel attention heads.
[0012] Furthermore, the dynamic operating conditions include the UDDS, LA92, and HWFET standard vehicle driving cycle operating conditions.
[0013] Furthermore, the ambient temperature for data acquisition covers a dynamic temperature range of 10℃ to 25℃, and the extended test temperature range is -10℃ to 45℃.
[0014] The advantages of this invention compared to the prior art are: This invention utilizes a feature modulation gating mechanism to dynamically reweight features such as voltage, current, and surface temperature based on ambient temperature, significantly enhancing the network's ability to capture temperature-affected signals. The key matrix in the multi-head attention mechanism of this invention is generated in real time by the ambient temperature, which enables the attention score to be adaptively adjusted with changes in ambient temperature, effectively solving the problem of fixed attention patterns in traditional methods. After training and testing under various standard driving cycles and variable temperature conditions, the model of this invention exhibits excellent cross-condition performance and has extremely high practical application value. Attached Figure Description
[0015] Figure 1 This is a flowchart of a method for estimating the remaining capacity of a lithium battery in a variable temperature environment, according to the present invention.
[0016] Figure 2 This is a flowchart of the iterative training and parameter optimization of the MPAA-LSTM neural network model. Detailed Implementation
[0017] Various exemplary embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be noted that, unless otherwise specifically stated, the relative arrangement, numerical expressions, and values of the components and steps set forth in these embodiments do not limit the scope of the present invention.
[0018] The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit the invention or its application or use.
[0019] Techniques, methods, and equipment known to those skilled in the art may not be discussed in detail, but where appropriate, such techniques, methods, and equipment should be considered part of the specification.
[0020] In all examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not as limitations. Therefore, other examples of exemplary embodiments may have different values.
[0021] The following detailed description of the method for estimating the remaining capacity of a lithium battery in a variable temperature environment, in conjunction with the accompanying drawings, further illustrates this invention.
[0022] Combined with appendix Figure 1-2 The specific implementation process of the method for estimating the remaining capacity of a lithium battery in a variable temperature environment according to the present invention is as follows: A method for estimating the remaining capacity of a lithium battery in a variable temperature environment includes the following steps: S1: Multi-source time-series data acquisition and standardization preprocessing 1) Test data acquisition: Select the lithium iron phosphate / ternary lithium battery cell or battery pack to be tested, and simulate a full-range temperature variation environment of -10℃ to 45℃ in a temperature-controlled environment chamber. Apply national standard vehicle dynamic driving conditions such as UDDS, LA92, and HWFET, and use voltage sensors, current sensors, patch temperature sensors, and ambient temperature probes to synchronously and continuously collect time-series data. The collected parameters include: real-time battery terminal voltage, instantaneous charge and discharge operating current, battery surface temperature (main characteristic variable), and real-time ambient temperature (conditional covariate).
[0023] 2) Data Normalization: Min-max normalization is used to linearly scale all collected data, mapping all feature values to the [0, 1] range to eliminate network training interference caused by differences in the physical dimensions of voltage, current, and temperature. The normalization calculation formula is as follows: ; in, This is the original sampled data. The maximum value of a single-class feature data. For the minimum value of a single-class feature data, This is the normalized data.
[0024] 3) Construction of time series samples: The normalized time series dataset is sliced and grouped using a sliding window with a step size of 1 and a fixed window length of 400 continuous sampling points. Each window sequence is used as a set of model input samples. The actual measured SOC values at the sampling time at the end of the corresponding window are used as sample labels. The dataset is divided into training set, validation set and test set with a ratio of 7:1:2.
[0025] S2: Constructing the MPAA-LSTM deep neural network model The model is sequentially connected along the data forward propagation direction: Feature modulation gating layer → Position encoding layer → Multi-head parameter adaptive attention layer → LSTM feature extraction layer → Random deactivation layer → Fully connected output layer; the specific structure and operational logic of each layer are as follows: 1) Feature modulation gating layer The principal variable feature tensor, composed of terminal voltage, operating current, and battery surface temperature, is mapped to a high-dimensional feature space through a fully connected linear transformation. The ambient temperature data is independently extracted and a temperature gating matrix with values in the range of 0 to 1 is generated through a single-layer linear transformation and a Sigmoid activation function. The high-dimensional principal feature tensor is multiplied element by element with the temperature gating matrix to complete the feature weighting modulation based on real-time ambient temperature, thereby realizing the dynamic constraint screening of electrical features by ambient temperature.
[0026] 2) Location coding layer By superimposing sine and cosine position codes on the time-series features after temperature modulation, the sequential sampling position information is marked, which makes up for the lack of temporal position perception in the attention mechanism itself and enhances the network's ability to capture the pattern of temporal change.
[0027] 3) Multi-head parameter adaptive attention layer This layer uses N parallel attention heads (preferably N=4). The feature mapping rules within each attention head are differentiated: the query matrix Q and the numerical matrix V are generated from the position-encoded principal features through independent linear mapping; the key matrix K is no longer fixed in its initialization but is generated in real-time by a separate linear transformation of the real-time input ambient temperature; attention scores and weighted feature outputs are calculated in real-time based on Q, K, and V. Attention score: It enables real-time adaptive updates of attention weights as the ambient temperature changes, breaking free from the limitations of fixed attention parameters in traditional approaches; and it combines the output features of all attention heads to complete multi-head feature fusion.
[0028] 4) LSTM Feature Extraction Layer A single-layer LSTM network was configured with 128 hidden layer neurons. The forget gate, input gate, and output gate structure of the LSTM cell unit were used to mine the charging and discharging time-series dependencies within long-term samples and extract the implicit time-series features of SOC evolution.
[0029] 5) Dropout layer A Dropout layer is connected in series with the output of the LSTM layer, with a fixed random deactivation ratio of 0.5. During the training phase, half of the neuron parameters are randomly masked to suppress model overfitting and improve the model's generalization ability across different working conditions.
[0030] 6) Fully connected output layer A single-layer fully connected network is used for feature dimensionality reduction, and the Sigmoid activation function is used to constrain the output result to the interval [0, 1]. The output value is the estimated SOC of the lithium battery at the corresponding time.
[0031] S3: Neural Network Iterative Training and Parameter Optimization 1) The loss function is the mean squared error (MSE), which quantifies the deviation between the estimated SOC and the true labeled SOC. The loss function expression is as follows: ; For model estimates, This represents the actual measured value. This represents the number of samples in a single batch.
[0032] 2) The optimizer uses the Adam adaptive momentum optimization algorithm to dynamically adjust the learning rate, with an initial learning rate set at 1×10⁻⁶. -3 Set the maximum number of iterations to 150 rounds. After each round of training, use the validation set to check the model error. If the loss on the validation set no longer decreases after 15 consecutive rounds, the model is considered to have converged. Then, terminate the iteration and save the optimal model weight file.
[0033] S4: Real-time online SOC estimation under variable temperature operating conditions During the actual vehicle operation phase of the power battery, the on-board BMS hardware collects the battery terminal voltage, operating current, battery surface temperature, and ambient temperature in real time. It standardizes and constructs real-time time-series window samples in real time according to the S1 preprocessing rules, and imports them into the trained MPAA-LSTM model. The model outputs the current lithium battery SOC estimation result in real time. The BMS completes charge and discharge limit control, range calculation, and fault warning based on the SOC value.
[0034] The present invention and its embodiments have been described above. This description is not restrictive, and the accompanying drawings are only one embodiment of the present invention; the actual structure is not limited thereto. In conclusion, if those skilled in the art are inspired by this description and design similar structures and embodiments without departing from the spirit of the invention, such designs should fall within the protection scope of the present invention.
Claims
1. A method for estimating the remaining capacity of a lithium battery in a variable temperature environment, characterized in that: Includes the following steps: S1. Data Acquisition and Preprocessing: Collect lithium battery time-series data under different ambient temperatures and dynamic operating conditions; use min-max normalization to standardize the collected data; construct time-series samples through a fixed-length sliding window with 400 sampling points; and use the actual remaining SOC at the end of the corresponding window as the sample label. S2. Construct an MPAA-LSTM neural network model, wherein the MPAA-LSTM neural network model is provided sequentially along the data flow direction as a feature modulation gating layer, a position coding layer, a multi-head parameter adaptive attention layer, an LSTM layer, a Dropout layer, and a fully connected output layer; S3. Network training optimization: Select mean squared error as the loss function, use the Adam optimization algorithm to iteratively train the network, use the Dropout mechanism to suppress overfitting until the network converges, and save the trained MPAA-LSTM neural network model. S4. Online SOC estimation: Real-time lithium battery operating data is collected and preprocessed according to the rules in step S1, then input into the trained MPAA-LSTM neural network model. The MPAA-LSTM neural network model outputs the real-time remaining capacity estimate of the lithium battery under variable temperature conditions.
2. The method for estimating the remaining capacity of a lithium battery in a variable temperature environment according to claim 1, characterized in that: The time-series data includes master variable data for terminal voltage, operating current, and battery surface temperature, as well as covariate data for ambient temperature.
3. The method for estimating the remaining capacity of a lithium battery in a variable temperature environment according to claim 2, characterized in that: The feature modulation gating layer: the main variable is linearly transformed to obtain high-dimensional features, the ambient temperature is linearly transformed and Sigmoid activation is added to generate a gating matrix, and the high-dimensional features are multiplied element by element by the gating matrix to obtain the temperature-modulated features; The multi-head parameter adaptive attention layer: the query matrix Q and numerical matrix V of each attention head are generated from the modulated main variable features, and the key matrix K is generated in real time from the ambient temperature through linear transformation. The attention weight is calculated in real time based on Q, K, and V to realize the adaptive change of attention parameters with ambient temperature. The LSTM layer is a single layer with 128 neurons, used to extract temporal dependent features; The dropout rate of the Dropout layer is set to 0.5; The fully connected output layer, in conjunction with the Sigmoid activation function, outputs an estimated SOC value.
4. The method for estimating the remaining capacity of a lithium battery in a variable temperature environment according to claim 3, characterized in that: The multi-head parameter adaptive attention layer is configured with four parallel attention heads.
5. The method for estimating the remaining capacity of a lithium battery in a variable temperature environment according to claim 4, characterized in that: The dynamic operating conditions include the UDDS, LA92, and HWFET standard vehicle driving cycle conditions.
6. The method for estimating the remaining capacity of a lithium battery in a variable temperature environment according to claim 5, characterized in that: The ambient temperature range for data acquisition covers a dynamic temperature range of 10℃ to 25℃, and the extended test temperature range is -10℃ to 45℃.