A method for predicting the remaining life of lithium batteries based on gating and attention mechanisms

By introducing a deep learning model with gating and attention mechanisms, the problems of modeling difficulties and low accuracy in lithium battery life prediction are solved, and efficient and accurate prediction of the remaining life of lithium batteries is achieved.

CN115409263BActive Publication Date: 2026-03-10BEIHANG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-30
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

Existing methods for predicting the remaining life of lithium batteries suffer from difficulties in modeling, unsatisfactory prediction accuracy, and difficulty in effectively extracting multi-dimensional features and learning long-term series.

Method used

A deep learning model based on gating and attention mechanisms is adopted, including a feature extraction network, a self-attention mechanism network, a fully connected layer, and a summing unit. The feature information extraction capability and the prediction performance of long-term series are improved by gating residual networks and self-attention mechanisms.

Benefits of technology

It improves the accuracy and efficiency of lithium battery remaining life prediction, reduces the complexity of feature engineering and parameter tuning, and can effectively learn multi-dimensional observation data and process long-term series.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115409263B_ABST
    Figure CN115409263B_ABST
Patent Text Reader

Abstract

The application discloses a lithium battery residual life prediction method based on a gating and attention mechanism and belongs to the technical field of batteries. The method comprises the following steps: a deep learning model based on a gating and attention mechanism is built, the deep learning model comprises a feature extraction network, a network based on a self-attention mechanism, a first full connection layer, a second full connection layer and a summation unit which are sequentially connected; the summation unit sums up the output of the network based on the self-attention mechanism and the output of the second full connection layer to generate the output of the deep learning model based on the gating and attention mechanism as a predicted lithium battery capacity sequence; and the residual life of the lithium battery is obtained according to the predicted lithium battery capacity sequence and a specified lithium battery failure threshold. The application can effectively extract information in the case of multi-dimensional characteristics and strong causal long time series of the lithium battery, thereby improving the prediction accuracy of the residual life of the battery and realizing accurate evaluation of the future working state of the lithium battery.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of lithium-ion battery technology, specifically relating to a method for predicting the remaining life of lithium batteries based on gating and attention mechanisms. Background Technology

[0002] Faced with the pressing issues of environmental degradation and the energy crisis, the use of green energy and the promotion of new energy technology progress and innovation have become important topics for future development. Lithium-ion batteries, due to their advantages such as long lifespan, fast charging speed, high specific energy, high operating voltage, and good safety performance, have been widely used in various fields including mobile devices, power systems, base station services, and aerospace. Unlike traditional energy storage devices such as fuel tanks, the internal state of a battery is difficult to observe directly; usable capacity and remaining charge cannot be directly determined through observation. Furthermore, during energy storage and supply, batteries are subject to irreversible damage due to factors such as chemical side reactions, affecting normal use. Therefore, predicting the remaining usable life (RUL) of lithium batteries is particularly important, both to avoid safety accidents caused by battery failure and to prevent resource waste from premature battery replacement.

[0003] Methods for studying the remaining life of lithium-ion batteries are mainly divided into two categories: model-based and data-driven. Model-based prediction methods describe the internal mechanism of the battery through chemical theorems, physical formulas, and circuit equivalence. However, the complex reactions of the battery during charging and discharging make modeling difficult and result in poor portability to different types of batteries, leading to less than ideal prediction accuracy. With the maturity of machine learning and artificial intelligence technologies, data-driven methods have gradually become the mainstream. By analyzing the changing patterns of various observation data during the battery charging and discharging process, a predictive model for the remaining life of the battery can be established. At the same time, the dependence on data means that data-driven methods need to address issues such as noise, observation errors, and missing values ​​that occur during data acquisition in actual charging and discharging processes. Furthermore, the prediction model should have a certain degree of robustness to ensure predictive performance.

[0004] Currently, data-driven remaining battery life prediction methods mainly include classic machine learning algorithms such as Support Vector Regression (SVR) and deep learning algorithms such as Recurrent Convolutional Networks (RNNs). SVR and other machine learning algorithms have weak fitting capabilities to the nonlinear laws of lithium battery aging, and require time-consuming and labor-intensive feature engineering and parameter tuning processes, resulting in low efficiency; furthermore, they cannot learn the causal features within the time series. While RNNs, as a typical algorithm for time series prediction, overcome the shortcomings of machine learning, they suffer from gradient vanishing or exploding problems with long-term series, leading to weak learning ability and poor prediction results. Subsequent RNN variants, Long Short-Term Memory (LSTM) networks, have addressed the long-term dependency problem to some extent through gating mechanisms, but the gradient vanishing problem still exists. Furthermore, for multi-feature battery data, RNNs are less capable of information extraction than Convolutional Neural Networks (CNNs), while CNNs lack time series prediction capabilities.

[0005] Therefore, how to effectively extract multi-dimensional features, predict time-series data, and have good learning ability for long-term series has become an issue that needs to be improved in battery RUL prediction. Summary of the Invention

[0006] To address the shortcomings of existing battery life prediction technologies, this invention provides a lithium battery RUL prediction method based on gating and attention mechanisms. The aim is to improve the ability to extract feature information by introducing convolutional layers with gating mechanisms, and to improve the performance of existing time-series prediction methods in handling long-term series based on self-attention mechanisms. This allows for accurate and efficient learning of the aging patterns of lithium batteries, thereby predicting the remaining lifespan of the lithium battery.

[0007] To address one or more of the aforementioned problems, according to embodiments of this application, a method for predicting the remaining lifespan of lithium batteries based on gating and attention mechanisms is provided, comprising: constructing a deep learning model based on gating and attention mechanisms, wherein the deep learning model includes a feature extraction network, a network based on a self-attention mechanism, a first fully connected layer, a second fully connected layer, and a summing unit connected in sequence; the feature extraction network processes the input data sequence X = [x... t-τ ,x t-τ+1 ,…,x t The resulting data sequence was obtained through processing. Where x j Let X represent the feature vector corresponding to the j-th charge-discharge cycle of the lithium battery, where t-τ <= j <= t, and t represents the number of charge-discharge cycles the lithium battery has undergone. The data sequence X includes τ+1 feature vectors. The feature extraction network includes a gated residual network, and the gated residual network extracts features from each input feature vector. Processed Where i represents the ordinal number of the feature in the feature vector, 1 <= i <= n, and n is the number of features in the feature vector; the network receiving data sequence based on the self-attention mechanism. Generate the corresponding output sequence H attn The first fully connected layer receives the output sequence H of the self-attention mechanism-based network. attn The first fully connected layer receives the output H1 from the second fully connected layer, generating an intermediate value H1. The output of the self-attention-based network is also provided to the summing unit through residual connections. The summing unit sums the output of the self-attention-based network with the output of the second fully connected layer to generate the output of the deep learning model based on gating and attention mechanisms as a predicted lithium battery capacity sequence. Based on the predicted lithium battery capacity sequence and a specified lithium battery failure threshold, the total number of usable charge-discharge cycles of the lithium battery is obtained. The number of charge-discharge cycles already experienced by the lithium battery is subtracted to obtain the remaining number of charge-discharge cycles of the lithium battery as the remaining lifespan of the lithium battery.

[0008] According to another aspect of this application, a method for predicting the remaining life of a lithium battery based on gating and attention mechanisms includes: Step 1: monitoring the operation of the lithium battery, obtaining various observation indicators during the charging and discharging process, and establishing a lithium battery aging database.

[0009] Step 2: Based on the obtained raw data, establish a mapping relationship with battery life, find data types with obvious correlation and extract health factors from them as input features for subsequent models; based on the raw data, retain and calculate the data sequences corresponding to the health factors, perform data preprocessing, remove outliers and missing values, and organize and merge them into result data that can be used by the model.

[0010] Step 3: Divide the data proportionally into data for model training and data for model testing. For the training data of the model, in order to ensure causality, that is, to use data from previous time moments to predict data from subsequent time moments, the training data is further divided into training set and validation set based on the time series prediction principle.

[0011] Step 4: Build a deep learning model based on gating and attention mechanisms, extract more effective feature information with emphasis from the feature and time dimensions, and then perform deeper learning through fully connected layers;

[0012] Step 5: Train the model using the training set and validation set. After obtaining a high accuracy on the training set, use it to predict the available capacity of the lithium battery, and combine it with the lithium battery aging threshold to obtain the prediction result of its remaining life.

[0013] Furthermore, the specific method of step 1 of the present invention is as follows:

[0014] By conducting charge-discharge cycle experiments on the battery, various observation indicators and charge-discharge capacity data of the battery are obtained. First, the basic parameters of the battery are determined, including the rated capacity, charge-discharge cutoff voltage, and capacity standard at which the battery fails. Second, charge-discharge cycle tests are conducted on the lithium battery using a constant current and constant voltage charge-discharge protocol. During the charging process, the battery is charged in constant current mode at the required test temperature until the battery reaches the target cutoff voltage, and then charged in constant voltage mode until the charging current drops to the expected small current. During the discharging process, the battery is discharged in constant current mode until the voltage drops to the discharge cutoff voltage. One charge and one discharge are combined as one charge-discharge cycle. As the number of cycles increases, the battery will gradually age. When the charge-discharge capacity of the lithium battery in a certain cycle is less than the battery failure definition value, the battery is considered to have failed and its service life has ended. Various observation data such as current, voltage, and time are collected during the cycle test, and corresponding charge-discharge capacity data are obtained to establish a raw database of lithium battery aging.

[0015] Furthermore, the specific method of step 2 of the present invention is as follows:

[0016] Step 2.1: Based on the original lithium battery aging database, establish the mapping relationship between various observation data and cycle life, select sampling points in the early, middle and late stages of life, and intuitively filter the observation data related to cycle life through image visualization;

[0017] Step 2.2: Based on the visualization results, extract the observational data that are significantly correlated with cycle life as health factors, i.e., the input features ξ of the subsequent model. (i) ,i=1,2,…,n, where n is the number of features;

[0018] Step 2.3: Preprocess the data to remove outliers and missing values: During charge-discharge cycle tests, noise and sensor measurement errors may cause abnormal data values; at the same time, there may be missing data at sampling points. Therefore, it is necessary to preprocess the obtained feature data. A sliding window operation is used to apply the feature data with the parameter τ as the window size. The mean and standard deviation of the data within the window are calculated. Data that exceeds the critical value calculated by the window are removed as outliers. Linear interpolation is used at the missing value positions to obtain a complete and usable dataset D.

[0019] Furthermore, the specific method of step 3 of the present invention is as follows:

[0020] Step 3.1: Divide the dataset D into training set D according to a certain ratio. train With test set D test Two parts;

[0021] Step 3.2: Employ the k-fold cross-validation method suitable for time series data to cross-validate the training set D. train The model is divided into multiple groups based on different splitting methods, consisting of a training subset and a validation set. The model is then trained on the training subset and scored on the corresponding validation set. The average score of all combinations is used as the evaluation result of the model parameters.

[0022] Furthermore, the specific method of step 4 of the present invention is as follows:

[0023] Step 4.1: Input layer input data sequence X = [x t-τ ,x t-τ+1 ,…,x t ],in It is the feature vector input at time t. This represents the i-th feature input at time t;

[0024] Step 4.2: The input sequence is processed by a gated feature selection network to extract feature information with emphasis along the feature dimension. Specifically, the feature selection network is mainly composed of a gated residual network (GRN) module. By expanding the input data at a certain time step and passing it through the gated residual network, the softmax activation function is used to perform a weighted summation of each feature to extract effective feature information. The calculation formula is as follows:

[0025]

[0026] ω t =Softmax(GRN(Ξ) t ))

[0027]

[0028]

[0029] The GRN module consists of fully connected layers, activation functions, gating mechanisms, and residual connections. The specific calculation formula is as follows:

[0030] GRN(a)=LayerNorm(a+GLU(η1))

[0031] η1=W1η2+b1

[0032] η2=ELU(W2a+b2)

[0033] Where GLU stands for Gated Linear Unit, the specific calculation formula is as follows:

[0034] GLU(γ)=σ(W3γ+b3)⊙(W4γ+b4)

[0035] In the above formula, matrix W and vector b are both weight matrix and bias vector, σ is sigmoid activation function, and ⊙ represents the multiplication operation of corresponding elements in the same position of the matrix.

[0036] Step 4.3: The new feature vectors described above are processed by a network based on a self-attention mechanism. Weights are then assigned to different features at different time steps in the global time dimension. The calculation formula for the attention mechanism is as follows:

[0037] H attn =Attn(Q,K,V)=A(Q,K)V

[0038]

[0039] Where Q, K, and V are the query vector matrix, key vector matrix, and value vector matrix, respectively. Each row of these three matrices represents an object vector, which is formed by multiplying the input sequence X by a random matrix W. q W k and W v get;

[0040] Step 4.4: The output sequence obtained above is passed through two fully connected layers and a residual connection to finally obtain the expected output result. The specific calculation formula is as follows:

[0041] Y = H attn +Dense(H1)

[0042] H1 = Dense(H attn )

[0043] Where Y is the final expected output, H attn H1 and H2 are the output matrix of the attention module and the intermediate value between the two fully connected layers, respectively.

[0044] Furthermore, the specific method of step 5 of the present invention is as follows:

[0045] Step 5.1: Train the model using the dataset, minimizing the mean squared error (MSE) loss function as the optimization objective. Use the RMSprop optimizer to adjust the model parameters, reduce errors during training, and obtain ideal model parameters. Use root mean square error (RMSE), mean absolute error (MAE), and mean absolute percentage error (MAPE) as evaluation metrics. The specific calculation formulas are as follows:

[0046]

[0047]

[0048]

[0049]

[0050] Where y j For the true value, The value is the predicted value, and m is the number of samples.

[0051] Step 5.2: Based on the predicted capacity sequence obtained from the trained model, the battery cycle life is derived by combining it with the defined battery failure threshold. Subtracting the number of charge-discharge cycles already completed at the current moment, the remaining cycle life of the lithium battery can be obtained.

[0052] The beneficial effects of this invention are:

[0053] 1) In terms of model performance, this invention has a more effective information extraction capability. In terms of feature dimension, it utilizes the superior information extraction performance of convolutional neural networks and the filtering function of gating mechanisms to retain feature information more valuable to the expected output. In terms of time dimension, it introduces a self-attention mechanism to adjust the degree of attention given to different features at different time steps. Simultaneously, the self-attention mechanism effectively solves the gradient vanishing and gradient exploding problems caused by long-term sequence learning in RNN and LSTM networks, using a larger receptive field to learn the temporal correlation information during battery aging. Therefore, this invention can effectively improve the prediction accuracy of lithium battery RUL.

[0054] 2) In practical applications, this invention can effectively learn from multi-dimensional observation data in lithium battery aging datasets and still has good prediction performance in long-term series. At the same time, compared with traditional machine learning, it does not require complex feature engineering and manual parameter tuning, and has fast training speed, high computational efficiency and simple operation. Attached Figure Description

[0055] Figure 1 This is a flowchart illustrating the overall method of the present invention.

[0056] Figure 2 A diagram illustrating the dataset partitioning method.

[0057] Figure 3 This is a diagram of the internal structure of the deep learning model of this invention.

[0058] Figure 4 The images provided in this embodiment of the invention depict the discharge capacity degradation during the aging process of a lithium battery. The left image is from the NASA dataset, and the right image is from the CALCE dataset.

[0059] Figure 5 The left and right graphs show the prediction results of the method described in this invention in the embodiments and the comparison with other conventional methods. The left graph shows the prediction result of lithium battery B0018, and the right graph shows the prediction result of lithium battery CS2_36. Detailed Implementation

[0060] The technical solution of the present invention will be clearly and completely described below with reference to the accompanying drawings and embodiments. Obviously, the described embodiments are only used to explain the present invention and are not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0061] Please see Figure 1 A method for predicting the remaining lifespan of lithium batteries based on gating and attention mechanisms can be divided into the following steps:

[0062] Step 1: Monitor the operation of the lithium battery, obtain various observation indicators during the charging and discharging process, and establish a lithium battery aging database:

[0063] In this embodiment of the invention, various observation indicators and battery charge / discharge capacity data of the battery are obtained by conducting charge / discharge cycle experiments. First, the basic parameters of the battery are determined, including the rated capacity, charge / discharge cutoff voltage, and capacity standard at which the battery fails. Second, the lithium battery is subjected to charge / discharge cycle tests using a constant current and constant voltage charge / discharge protocol. During the charging process, the battery is charged in a constant current mode at the required test temperature until the battery reaches the target cutoff voltage, and then charged in a constant voltage mode until the charging current drops to the expected small current. During the discharging process, the battery is discharged in a constant current mode until the voltage drops to the discharge cutoff voltage. One charge and one discharge of the battery are combined as one charge / discharge cycle. As the number of cycles increases, the battery will gradually age. When the charge / discharge capacity of the lithium battery in a certain cycle is less than the battery failure definition value, the battery is considered to have failed and its service life has ended. Various observation data such as current, voltage, and time are collected during the cycle test, and the corresponding charge / discharge capacity data are obtained to establish a raw database of lithium battery aging.

[0064] Step 2: Based on the obtained raw data, establish a mapping relationship with battery life, identify data types with significant correlation, and extract health factors from them as input features for subsequent models; based on the raw data, retain and calculate the data sequences corresponding to the health factors, perform data preprocessing, remove outliers and missing values, and organize and merge the data into results that can be used by the model.

[0065] Step 2.1: Based on the original lithium battery aging database, establish a mapping relationship between various observation data and cycle life. Select sampling points in the early, middle, and late stages of the lifespan, and filter observation data related to cycle life through visualization or correlation analysis. Specific visualization objects include, for example, the voltage and current curves corresponding to the charge-discharge curves after different battery cycle numbers, the curve showing the change in internal resistance with the increase of battery cycle number, and the curves showing the change in constant current and constant voltage charge-discharge time with the increase of cycle number.

[0066] Step 2.2: Based on the screening results of the previous step, extract the observational data that are significantly correlated with cycle life as health factors, i.e., the input features ξ of the subsequent model. (i) Let i = 1, 2, ..., n, where n is the number of features and i represents the ordinal number of the feature in the feature vector. Specific health factors and features that may be used as input to the feature vector include: voltage curve slope. Where V1 and V2 represent the preset voltage change range boundary values, t1 and t2 are the corresponding times when the two voltage values ​​V1 and V2 are obtained, and T is the charging / discharging time corresponding to the voltage changing from V1 to V2. V =|t2-t1|; Constant current charging time T I And internal resistance r, battery capacity, etc. Understandably, these characteristics are related to the number of charge-discharge cycles of the battery.

[0067] Step 2.3: Preprocess the data to remove outliers and missing values: During charge-discharge cycle tests, noise and sensor measurement errors may cause data anomalies; simultaneously, missing data at sampling points may occur. Therefore, preprocessing is necessary. A sliding window operation is used, with a parameter τ as the window size, to extract missing features from specific features of each feature vector (e.g., multiple internal resistance r features from various feature vectors) or replace features with outliers. For example, the mean and standard deviation of multiple feature data within the sliding window are calculated. Data exceeding the calculated threshold are removed as outliers. Linear interpolation is used at the numerical gaps to obtain the missing features, supplementing the feature vectors with missing features, resulting in a complete and usable dataset D.

[0068] Step 3: Divide the dataset D proportionally into training data for model training and testing data for model testing. For the training data, to ensure causality (i.e., using data from previous time steps to predict data from subsequent time steps), the training data is further divided into a training subset and a validation set based on time-series prediction principles. See the diagram below for the partitioning diagram. Figure 2 ;

[0069] Step 3.1: Divide the dataset D into training set D according to a certain ratio. train With test set D test Two parts;

[0070] Step 3.2: Employ the k-fold cross-validation method suitable for time series data to cross-validate the training set D. train The model is divided into multiple groups based on different splitting methods, consisting of a training subset and a validation set. The model is then trained on the training subset and scored on the corresponding validation set. The average score of all combinations is used as the evaluation result of the model parameters.

[0071] Step 4: Build a deep learning model based on gating and attention mechanisms to extract more effective feature information from the feature and time dimensions, and then perform deeper learning through fully connected layers. The specific deep learning model structure is as follows: Figure 3 As shown:

[0072] Step 4.1: Input layer input data sequence X = [x t-τ ,x t-τ+1 ,…,x t ],in It is the feature vector obtained from the t-th charge-discharge cycle. The i-th feature of the t-th charge-discharge cycle includes the slope of the voltage curve, the discharge duration, and the internal resistance, etc.; thus, the input data X provided to the input layer of the deep learning model according to the embodiments of this application is a feature sequence from multiple (e.g., τ+1) consecutive charge-discharge cycles.

[0073] Step 4.2: The input data is processed by a gating-based feature extraction network to extract feature information with emphasis on the feature dimension. Specifically, the feature extraction network includes multiple gated residual networks (GRNs). By expanding the input data at a certain time and passing it through the gated residual networks, the softmax activation function is used to perform a weighted summation of each feature to extract effective feature information. The calculation formula is as follows:

[0074]

[0075] ω t =Softmax(GRN(Ξ) t ))

[0076]

[0077]

[0078] Where i indicates the i-th feature in the feature vector;

[0079] The GRN module consists of fully connected layers, activation functions, gating mechanisms, and residual connections. The specific calculation formula is as follows:

[0080] GRN(a)=LayerNorm(a+GLU(η1))

[0081] η1=W1η2+b1

[0082] η2=ELU(W2a+b2)

[0083] Where ELU is an activation function, η1 and η2 are intermediate variables, and a is the input; GLU is a gated linear unit, and its specific calculation formula is as follows:

[0084] GLU(γ)=σ(W3γ+b3)⊙(W4γ+b4)

[0085] In the above formula, matrix W and vector b are weight matrix and bias vector, respectively, γ is the input, σ is the sigmoid activation function, and ⊙ represents the multiplication operation of corresponding elements in the same position of the matrix.

[0086] See also Figure 3 Each feature vector (x) of the input data t-τ ,x t-τ+1 ,…,x t The feature vectors (e.g., x) are respectively provided to the feature extraction network. In the feature extraction network, the feature vectors (e.g., x) are... t The various characteristics of ) Provided to the gated residual network (GRN), and the corresponding... The feature extraction network also generates Ξ based on the current feature vector. t The weights corresponding to each feature are obtained through a gated residual network (GRN) and a softmax activation function. The feature extraction network also processes each feature With corresponding weights Weighted summation yields the feature-weighted result.

[0087] Optionally, multiple feature extraction networks are used based on the input feature vector (e.g., x) they process. t Output the corresponding feature-weighted result (e.g.) These features, after being weighted, form a new sequence of feature vectors. Alternatively, a single feature extraction network can be used to process each input feature vector in a time-sharing manner.

[0088] Step 4.3: The new feature vector sequence described above This is provided to a network based on a self-attention mechanism, which assigns weights to different features at different time steps (corresponding to charge-discharge cycles) in the global time dimension. The calculation formula for the attention mechanism is as follows:

[0089] H attn =Attn(Q,K,V)=A(Q,K)V

[0090]

[0091] Where Q, K, and V are the query vector matrix, key vector matrix, and value vector matrix, respectively. Each row of these three matrices represents an object vector, which is generated from the input sequence. Multiply by the random matrix W respectively q W k and Wv We get d attn Let H be the dimension of each vector in Q. attn This is the output of this layer;

[0092] Step 4.4: Obtain the output sequence H through a network based on a self-attention mechanism. attn Then, through two fully connected layers and residual connections, the expected output result is finally obtained. The specific calculation formula is as follows:

[0093] Y = H attn +Dense(H1)

[0094] H1 = Dense(H attn )

[0095] Where Y is the final expected output, meaning based on the input data sequence X = [x t-τ ,x t-τ+1 ,…,x t The resulting sequence of predicted battery capacity for one or more charge-discharge cycles, where Dense() represents fully connected layer processing and H1 is the intermediate value between two fully connected layers.

[0096] Step 5: Train the model using the training subset and validation set. After obtaining a high accuracy on the training set, use it to predict the available capacity of the lithium battery, and combine it with the lithium battery aging threshold to obtain the prediction result of its remaining life.

[0097] Step 5.1: Train the model using the dataset, minimizing the mean squared error (MSE) loss function as the optimization objective. Use the RMSprop optimizer to adjust the model parameters, reduce errors during training, and obtain ideal model parameters. Use root mean square error (RMSE), mean absolute error (MAE), and mean absolute percentage error (MAPE) as evaluation metrics. The specific calculation formulas are as follows:

[0098]

[0099]

[0100]

[0101]

[0102] Where y j This represents the true value of the battery capacity sequence corresponding to the same one or more charge-discharge cycles in the training samples. The predicted value output from step 4.4 is , where m is the number of samples;

[0103] Step 5.2: Based on the predicted battery capacity sequence obtained from the trained model, the total number of charge-discharge cycles available for the battery is derived by combining the defined battery failure threshold. The number of charge-discharge cycles already performed at the current moment is subtracted to obtain the remaining number of charge-discharge cycles of the lithium battery as the remaining lifespan value.

[0104] Example:

[0105] To demonstrate the process and estimation performance of the lithium battery remaining life prediction method based on gating and attention mechanisms proposed in this invention, an example is provided below:

[0106] The effectiveness of the method of the present invention was verified using a test dataset consisting of lithium batteries B0005, B0006, B0007, and B0018 from NASA (see https: / / ti.arc.nasa.gov / tech / dash / pcoe / prognostic-data-repository / battery) and a test dataset consisting of lithium batteries CS2_35, CS2_36, CS2_37, and CS2_38 from the Center for Advanced Life Cycle Engineering (CACLE) at the University of Maryland (see https: / / calce.umd.edu / data). NASA's experimental environment was as follows: At 24°C, charging was performed in constant current (CC) mode at 1.5A until the voltage reached 4.2V, then switching to constant voltage (CV) mode until the charging current dropped to 20mA; followed by discharging in CC mode at 2A until the voltages of datasets B0005, B0006, B0007, and B0018 dropped to 2.7V, 2.5V, 2.2V, and 2.5V, respectively. CACLE's experimental environment was as follows: At 1°C, charging was performed in CC mode to 4.2V, then in CV mode until the current dropped to 20mA; finally, discharging was performed in CC mode until the voltage dropped to 2.7V. The battery life termination standard for both was a decrease in rated capacity to 30% of the initial capacity. Based on this data, the life prediction algorithm provided by this invention was applied, with the following specific steps:

[0107] (1) Obtain two types of datasets to obtain the characteristic sequences of voltage, current, time, temperature, internal resistance, voltage change slope, and battery capacity during charging and discharging, and establish a battery aging dataset.

[0108] (2) In addition to the battery capacity calculation results for each charge-discharge cycle, select the slope K of the voltage curve and the voltage change time T within a fixed range. V Constant current charge / discharge duration T I The internal resistance *r*, as a health factor indicator, together constitute the input feature sequence; outliers are removed using a sliding window method, and missing values ​​are supplemented using linear interpolation to obtain usable data. Taking volume data as an example, Figure 4 The curves showing the battery capacity decay data of each battery in the two datasets after data preprocessing are displayed.

[0109] For example, the input data corresponding to the t-th charge-discharge cycle is: Choose τ iterations as the data input window size, K t Let be the slope of the voltage curve in the t-th cycle. Let r be the charging or discharging time of the t-th cycle. t Let be the internal resistance of the battery in the t-th cycle, and let be the final predicted battery capacity sequence of a certain length. In the battery capacity sequence, the capacity of the j-th battery represents the battery capacity after the j-th charge-discharge cycle.

[0110] (3) In this embodiment, datasets B0018 and CS2_36 are used as test datasets to predict the remaining lifespan of the batteries represented by datasets B0018 and CS2_36, respectively. Therefore, the first 50% of the data from the remaining three sets of battery datasets (B0005, B0006, and B0007, and CS2_35, CS2_37, and CS2_38) and the current set of battery datasets (B0018 and CS2_36) are used as training sets.

[0111] The test set consists of the last 50% of the data in this battery dataset (B0018 and CS2_36). The training set is partitioned using k-fold cross-validation, a method suitable for time series data; see the diagram below. Figure 2 Set the window size τ for the prediction sequence, according to the input sequence X = [x t-σ ,x t-τ+1 ,…,x t ] and the output sequence Y = [y1, ..., y m The dataset format is adjusted in the manner described by [] (m is the number of predicted battery capacities in the output sequence, and yj represents the replay loop corresponding to the battery capacity, y j+1 The replay cycles corresponding to the battery capacities represented are adjacent in ordinal number. Optionally, m can be 1 or other positive integers.

[0112] (4) The structure of a deep learning model is as follows Figure 3 As shown, the modules and parameters have been explained. Further, optionally, this embodiment adds a LeakyReLU activation function after the Dense layer to ensure non-linear learning, and a dropout layer to avoid overfitting.

[0113] (5) Minimizing the mean squared error (MSE) loss function is used as the optimization objective, and accuracy is used as the metric. The RMSprop optimizer is used to adjust the model parameters to obtain ideal model parameters. Finally, the remaining battery life is predicted through the capacity degradation prediction sequence. The capacity prediction error is represented by RMSE, MAE, and MAPE. The visualization results are as follows: Figure 5 As shown, the left side shows the prediction results based on dataset B0018, and the right side shows the prediction results based on dataset CS2_36. Figure 5 The comparison shows the prediction results of battery capacity using traditional RNN and LSTM algorithms versus the algorithm provided in the embodiments of this application.

[0114] Table 1 compares the prediction results of traditional RNN and LSTM algorithms with those of the algorithm proposed in this application on two datasets. The results show that on the NASA dataset B0018, the algorithm proposed in this invention improves the prediction accuracy compared to traditional methods, while on the CALCE dataset CS2_36, which has denser data points, the algorithm proposed in this invention significantly reduces the prediction error.

[0115] In summary, the deep learning model based on gating and attention mechanisms proposed in this invention has better prediction performance.

[0116]

[0117] Table 1

[0118] Those skilled in the art will readily understand that the above description is only for demonstrating the actual effects of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principle of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for predicting the remaining life of a lithium battery based on a gating and attention mechanism, comprising: building a deep learning model based on a gating and attention mechanism, the deep learning model comprising a feature extraction network, a network based on a self-attention mechanism, a first fully connected layer, a second fully connected layer, and a summation unit connected in sequence; The feature extraction network is used for processing an input data sequence to obtain a data sequence , wherein represents a feature vector corresponding to the jth charge-discharge cycle of the lithium battery, , t represents the serial number of the charge-discharge cycle, and the data sequence includes feature vectors; wherein the feature extraction network includes a gated residual network, and the gated residual network is used for processing features of each feature vector input to obtain , wherein i represents the serial number of the features in the feature vector, 1≤i≤n, and n is the number of features in the feature vector. The self-attention mechanism-based network receives a data sequence , generates a corresponding output sequence ; the first fully connected layer receives the output sequence of the self-attention mechanism-based network , generates an intermediate value , the second fully connected layer receives the output of the first fully connected layer ; the output of the self-attention mechanism-based network is also provided to the summing unit through a residual connection, and the summing unit sums the output of the self-attention mechanism-based network and the output of the second fully connected layer, generates the output of the deep learning model based on the gating and attention mechanisms as a predicted lithium battery capacity sequence; obtaining the total available charge-discharge cycle number of the lithium battery according to the predicted lithium battery capacity sequence and the specified lithium battery failure threshold, subtracting the charge-discharge cycle number that the lithium battery has experienced, and obtaining the remaining charge-discharge cycle number of the lithium battery as the remaining life of the lithium battery.

2. The method of claim 1, further comprising: obtaining a data set for training the deep learning model based on a gating and attention mechanism, the training samples of the data set comprising feature vectors corresponding to multiple charge-discharge cycles of the lithium battery; wherein the feature vectors are constructed by implementing multiple charge-discharge cycles on the lithium battery and obtaining multiple observation indicators during the charge-discharge cycles of the lithium battery; Among the multiple observation indexes in the charging and discharging cycle process of the lithium battery, the observation index related to the charging and discharging cycle number of the lithium battery is selected as a feature in the feature vector wherein is the feature number; and the training sample further comprises a battery capacity observation value corresponding to the charging and discharging cycle of the lithium battery.

3. The method of claim 2, further comprising: preprocessing the data set to remove outliers and missing values therein; performing sliding window calculation on specified features of the feature vectors from consecutive multiple charge-discharge cycles, removing feature data that exceeds the critical value obtained by the sliding window calculation as outliers, generating missing values by interpolation, and obtaining a complete data set.

4. The method of claim 3, further comprising: dividing the training samples of the data set into a training set and a test set, dividing the training set into multiple training subsets and validation sets using a k-fold cross-validation method; training the deep learning model based on a gating and attention mechanism using the training subsets, scoring the prediction results of the deep learning model based on a gating and attention mechanism using the validation sets, and taking the mean of the scoring results of the deep learning model based on a gating and attention mechanism trained and validated by the multiple training subsets and validation sets as the evaluation result.

5. The method of claim 4, wherein in training and validating the deep learning model based on a gating and attention mechanism, minimizing the mean square error (MSE) loss function is taken as the optimization objective, the RMSprop optimizer is used to adjust the model parameters, and the root mean square error (RMSE), the mean absolute error (MAE), and / or the mean absolute percentage error (MAPE) are taken as the evaluation indicators. ; ; ; ; wherein a lithium battery capacity sequence corresponding to one or more consecutive charge and discharge cycles from a training sample used in the training, a predicted lithium battery capacity sequence output by the deep learning model based on the gating and attention mechanism, m is the number of training samples.

6. The method of any one of claims 1-5, wherein The gating residual network computes and wherein ; ; ; where ELU is an activation function, and is an intermediate variable, is an input quantity; GLU is a gated linear unit, ; matrix bias vector are weight matrix and bias vector for calculating respectively, matrix bias vector are weight matrix and bias vector for calculating respectively, matrix and bias vector and are weight matrix and bias vector for Gated Linear Unit GLU, is input quantity, is sigmoid activation function, denotes matrix multiplication operation.

7. The method of claim 6, wherein the feature extraction network is configured to extract features according to ; ; generating a same corresponding weights and computing a feature vector a feature-weighted result wherein .

8. The method of claim 7, wherein The network based on a self-attention mechanism receives a data sequence , according to ; ; generating a corresponding output sequence , wherein, , and are the query vector matrix, the key vector matrix and the value vector matrix, respectively, obtained by multiplying the data sequence by the random matrices , and respectively, is the dimension of each vector in .

9. An information processing apparatus comprising a storage, a processor, and a program stored on the storage and capable of running on the processor, characterized by the processor implements the method of any one of claims 1-7 when executing the program.

Citation Information

Patent Citations

  • Lithium battery residual life prediction method based on long-term and short-term memory network

    CN111999648A

  • Bearing remaining service life prediction method based on convolution gating circulation network

    CN113051689A