Lithium battery life prediction method based on self-attention mechanism
By constructing a cross-cycle feature extraction network based on multi-head attention and cross-attention methods with self-attention mechanism, the challenge of predicting lithium battery life under limited early cycle data is solved, and more accurate and flexible prediction results are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-24
- Publication Date
- 2026-03-24
AI Technical Summary
Existing technologies struggle to accurately predict lithium battery lifespan when early-stage data is limited, and data-driven methods rely on manual feature extraction and constant current processes, making prediction results susceptible to operating conditions.
A multi-head attention mechanism based on self-attention is used to extract features, and a cross-attention method is used for feature fusion. The feature extraction network is then combined with a multilayer perceptron for prediction.
It enables accurate prediction of lithium battery life even with limited early-cycle data, improving the flexibility and robustness of predictions and reducing dependence on operating conditions.
Smart Images

Figure CN118033454B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of lithium battery life prediction technology, and more specifically, relates to a method for predicting the early life of lithium batteries based on a self-attention mechanism. Background Technology
[0002] Lithium-ion batteries play a crucial role in powering applications such as portable electronic devices and electric vehicles. To shorten research timelines, accurately predicting the lifespan of lithium-ion batteries using early-cycle data is of great importance.
[0003] However, predicting battery life remains challenging when only limited early-cycle data is available, as capacity changes in the nonlinear degradation modes of early cycles are not significant. Data-driven approaches, offering greater flexibility by not requiring specific models or extensive electrochemical knowledge, have gained wider application. However, data-driven algorithm frameworks often rely on manually extracted features and prior experience, limiting their ability to utilize data effectively. Furthermore, existing methods are often based on constant-current operation, particularly discharge, while degradation performance can be significantly influenced by operating conditions. Summary of the Invention
[0004] The purpose of this invention is to overcome the shortcomings of the prior art and provide a lithium battery life prediction method based on a self-attention mechanism. This method uses a multi-head attention mechanism to extract features, then uses a cross-attention method to fuse the features, and finally uses a multilayer perceptron to predict the lithium battery life.
[0005] To achieve the above-mentioned objectives, the present invention provides a lithium battery lifetime prediction method based on a self-attention mechanism, characterized by comprising the following steps:
[0006] (1) Data acquisition and preprocessing;
[0007] (1.1) Data acquisition;
[0008] Accelerate the life test of M lithium batteries until the lithium battery capacity reaches the failure threshold C. During the experiment, collect the characteristic data of each lithium battery in each charge-discharge cycle, as well as the discharge capacity at the end of each charge-discharge cycle.
[0009] Let the characteristic data of the k-th lithium battery during the i-th charge-discharge cycle be denoted as . n represents the number of feature data collected within one charge-discharge cycle. This represents the feature data collected at time j. These represent the voltage, current, and temperature collected at the j-th time point, respectively.
[0010] Let the discharge capacity of the k-th lithium battery at the end of the i-th charge-discharge cycle be . The discharge capacity sequence of the k-th lithium battery collected throughout the entire lifespan experiment is represented as follows: N is the number of charge-discharge cycles of the k-th lithium battery;
[0011] (1.2) Data preprocessing;
[0012] (1.2.1) Let the complete characteristic data collected by the k-th lithium battery in the life test be denoted as .
[0013] (1.2.2) Using an average gradient smoothing filter for X k Perform smoothing filtering, then linear interpolation and normalization.
[0014] (2) Construct a cross-period feature extraction network based on self-attention mechanism;
[0015] Cross-period feature extraction networks based on self-attention mechanisms include: intra-period feature extraction networks, inter-period feature extraction networks, and feature fusion and prediction networks;
[0016] The intra-cycle feature extraction network includes: an input layer, a concatenation layer, a positional encoding layer, a serial transformer module, a feature extraction and processing layer, a normalization and linear processing layer, and an output layer; the transformer module includes a normalization layer, a multi-head self-attention module, and a feedforward network; the feedforward network uses two symmetrical linear layers.
[0017] The periodic feature extraction network includes: input layer, multilayer perceptron, splicing layer, serial transformer module, multi-head self-attention module, feature extraction and processing layer, normalization and linear processing layer, and output layer;
[0018] The feature fusion and prediction network employs a multi-head self-attention module with a cross-attention mechanism;
[0019] (3) Training a cross-cycle feature extraction network based on self-attention mechanism;
[0020] (3.1) Feature extraction network during training period;
[0021] (3.1.1) After preprocessing the complete feature data of the kth lithium battery, the voltage, current and temperature data in the first m charge and discharge cycles are used to form a three-dimensional feature matrix P;
[0022]
[0023] in, Let these represent the voltage, current, and temperature vectors of the k-th lithium battery during the m-th charge / discharge cycle, respectively.
[0024] (3.1.2) Input the three-dimensional feature matrix P into the periodic feature extraction network through the input layer, then randomly generate a 1×m vector in the concatenation layer, and concatenate the transposed vector to the front of the matrix P to obtain a matrix E of size m×4.
[0025] (3.1.3) The position coding layer uses a random position coding matrix P to encode matrix E, resulting in matrix Z. p ;
[0026] Z p =E+P
[0027] (3.1.4) In the serial transformer module of layer N1, matrix Z p After one layer of normalization, we obtain
[0028] Subsequently, based on the multi-head attention mechanism... The following steps will be taken to process the issue:
[0029] Will The transformation results of the three parallel linear layers are denoted as A, B, and C, respectively.
[0030] The three sets of transformation results are then processed using multi-head attention operations:
[0031] The three sets of transformation results A, B, and C are input into multiple parallel dot product attention modules, and the operation of each dot product attention module is as follows:
[0032]
[0033] Where input_dim represents matrix Z p The dimension;
[0034] After concatenating the results of all dot product attention modules, a linear layer transformation is applied to obtain the matrix Z. p Transformation matrices of the same dimension
[0035] After the multi-head attention operation is completed, With Z p The output Z is obtained by adding them together. P ', Z P After a normalization layer, the input is fed into a feedforward network, where Z is extracted. P The characteristics of ', and finally with Z PThe summation is used as input to the next transformer module, ultimately yielding the output matrix of the last transformer module. N1 represents the number of transformer modules;
[0036] (3.1.5) Matrix H N1 After being input into the feature extraction and processing layer, the extraction matrix H is obtained. N1 The first line is denoted as sequence H. C Then for sequence H C Attached is the learnable weight matrix W C Thus, matrix F is obtained. C ;
[0037] F C =W C ·H C
[0038] (3.1.6) Matrix F C After normalization and linear processing layers, a two-dimensional vector F1 is obtained. Finally, the two-dimensional vector F1 is input into the feature fusion and prediction network through the output layer.
[0039] (3.2) Feature extraction network during training cycles;
[0040] (3.2.1) In the discharge capacity sequence Q of the k-th lithium battery, the discharge capacity of the first m charge-discharge cycles is taken and denoted as...
[0041] (3.2.2), the sequence The input is fed into a multilayer perceptron machine through the input layer. After processing by the multilayer perceptron, the output matrix A is obtained. k ;
[0042] (3.2.3) Randomly generate a 1×m vector in the splicing layer, and then transpose the vector and splice it into matrix A. k At the very front, we obtain the matrix. Then, the matrix is processed through the random position encoding matrix P. Encode to obtain a matrix
[0043]
[0044] (3.2.4) In the serial transformer module of layer N2, the matrix is processed according to the method in step (3.1.4). Processing is performed, assuming the output of the last transformer module is a matrix. N2 is the number of transformer modules;
[0045] (3.2.5) Following step (3.1.4), the matrix is processed using a multi-head attention mechanism. After further processing, the final output matrix H is obtained after multi-head attention operation. S ;
[0046] (3.2.6) Perform the following steps (3.1.5) to (3.1.6) on matrix H. S Feature extraction, normalization, and linear transformation are performed to obtain the two-dimensional vector F2 output by the periodic feature extraction network, which is then input into the feature fusion and prediction network.
[0047] (3.3) Training feature fusion and prediction network;
[0048] A cross-attention mechanism is used to perform multi-head attention processing on F1 and F2. The processing procedure is as follows:
[0049] F1 is transformed through a linear layer, and the transformation result is denoted as A.
[0050] F2 is transformed through two parallel linear layers, and the transformation results are denoted as B and C.
[0051] Following the method in step (3.1.4), the three sets of transformation results A, B, and C are processed using multi-head attention operations to predict the discharge capacity of the k-th lithium battery at the end of the (m+1)-Nth charge-discharge cycle.
[0052] Compare The discharge capacity at the end of each charge-discharge cycle is compared with the failure threshold C. The number of charge-discharge cycles that are greater than the failure threshold C is counted and used as the remaining life of the k-th lithium battery.
[0053] (3.4) Repeatedly train the cross-cycle feature extraction network based on the self-attention mechanism according to the methods in steps (3.1) to (3.4) until the model converges;
[0054] (4) Lifetime prediction of the lithium battery under test;
[0055] The system collects feature data of the lithium battery under test in the first m charge-discharge cycles and discharge capacity at the end of each charge-discharge cycle in real time. After preprocessing, the data is input into a trained cross-cycle feature extraction network based on self-attention mechanism, which outputs the discharge capacity of the lithium battery under test at the end of subsequent charge-discharge cycles. Then, the number of charge-discharge cycles with discharge capacity greater than the failure threshold C is counted to determine the lifespan of the lithium battery under test.
[0056] The objective of this invention is achieved as follows:
[0057] This invention presents a lithium battery life prediction method based on a self-attention mechanism. First, a cross-cycle feature extraction network based on a self-attention mechanism is constructed. Then, the network is trained using a collected dataset until convergence. When predicting the life of the lithium battery under test based on the converged network, features are extracted using a multi-head attention mechanism, and then a cross-attention method is used for feature fusion. Finally, based on the fused features, a multilayer perceptron is used to predict the lithium battery life, thereby obtaining more comprehensive lithium battery aging features and making the prediction more accurate. Attached Figure Description
[0058] Figure 1 This is a flowchart of the lithium battery lifetime prediction method based on the self-attention mechanism of the present invention.
[0059] Figure 2 This is a diagram of a cross-period feature extraction network structure based on a self-attention mechanism;
[0060] Figure 3 This is a diagram of the transformer module structure;
[0061] Figure 4 This is a structural diagram of the multi-head self-attention mechanism module;
[0062] Figure 5 This is a graph showing the effect of predicting lithium battery life using the method described in this invention. Detailed Implementation
[0063] The specific embodiments of the present invention will now be described with reference to the accompanying drawings to enable those skilled in the art to better understand the invention. It should be particularly noted that in the following description, detailed descriptions of known functions and designs that might obscure the main content of the invention will be omitted here.
[0064] Figure 1 This is a flowchart of the lithium battery lifetime prediction method based on the self-attention mechanism of the present invention.
[0065] In this embodiment, as Figure 1 As shown, the present invention provides a lithium battery lifetime prediction method based on a self-attention mechanism, comprising the following steps:
[0066] S1. Data acquisition and preprocessing;
[0067] S1.1 Data Acquisition;
[0068] Accelerate the life test of M lithium batteries until the lithium battery capacity reaches the failure threshold C. During the experiment, collect the characteristic data of each lithium battery in each charge-discharge cycle, as well as the discharge capacity at the end of each charge-discharge cycle.
[0069] Let the characteristic data of the k-th lithium battery during the i-th charge-discharge cycle be denoted as . k∈[1,M], where n represents the number of feature data collected within one charge-discharge cycle. This represents the feature data collected at time j. These represent the voltage, current, and temperature collected at the j-th time point, respectively.
[0070] Let the discharge capacity of the k-th lithium battery at the end of the i-th charge-discharge cycle be . The discharge capacity sequence of the k-th lithium battery collected throughout the entire lifespan experiment is represented as follows: N is the number of charge-discharge cycles of the k-th lithium battery;
[0071] S1.2, Data preprocessing;
[0072] S1.2.1, Let the complete characteristic data collected for the k-th lithium battery in the life test be denoted as .
[0073] S1.2.2, Using an average gradient smoothing filter for X k Perform smoothing filtering, then linear interpolation and normalization.
[0074] In this embodiment, an average gradient smoothing filter is used for X. k Perform smoothing filtering on X k The data (voltage (V), current (I), temperature (T)) is used to identify outlier data points by comparing the gradient calculated between two adjacent values with a threshold ζ. After identification, the average gradient value of the previous and next points is calculated to replace the outlier value. Finally, one-dimensional linear interpolation and normalization are performed, and the length after linear interpolation is 1024.
[0075] S2. Construct a cross-period feature extraction network based on self-attention mechanism;
[0076] like Figure 2 As shown, the cross-period feature extraction network based on the self-attention mechanism includes: an intra-period feature extraction network, an inter-period feature extraction network, and a feature fusion and prediction network;
[0077] The intra-cycle feature extraction network includes: an input layer, a concatenation layer, a positional encoding layer, a serial transformer module, a feature extraction and processing layer, a normalization and linear processing layer, and an output layer.
[0078] like Figure 3The transformer module shown includes a normalization layer, a multi-head self-attention module, and a feedforward network. The feedforward network uses two symmetrical linear layers, with the dimension transformation being a->b and b->a. For example, in this embodiment, the dimension transformation is 1024->2048 and 2048->1024, which ensures that the dimensions of the input and output remain unchanged.
[0079] like Figure 4 As shown, the multi-head self-attention mechanism module includes multiple linear layers, multiple dot product attention modules, and a splicing layer;
[0080] The periodic feature extraction network includes: input layer, multilayer perceptron, splicing layer, serial transformer module, multi-head self-attention module, feature extraction and processing layer, normalization and linear processing layer, and output layer;
[0081] The feature fusion and prediction network employs a multi-head self-attention module with a cross-attention mechanism;
[0082] S3. Train a cross-cycle feature extraction network based on a self-attention mechanism;
[0083] S3.1 Feature extraction network during training cycle;
[0084] S3.1.1 After preprocessing the complete feature data of the kth lithium battery, the voltage, current and temperature data in the first m charge and discharge cycles are used to form a three-dimensional feature matrix P;
[0085]
[0086] in, Let these represent the voltage, current, and temperature vectors of the k-th lithium battery during the m-th charge / discharge cycle, respectively.
[0087] In this embodiment, the size of the three-dimensional feature matrix P is m×3×1024;
[0088] S3.1.2 Input the three-dimensional feature matrix P into the periodic feature extraction network through the input layer, then randomly generate a 1×m×1024 vector in the concatenation layer, and concatenate the transposed vector to the front of the matrix P to obtain a matrix E of size m×4×1024.
[0089] S3.1.3, The positional coding layer uses a random positional coding matrix P to encode matrix E, resulting in matrix Z. p ;
[0090] Z p =E+P
[0091] In this embodiment, P,Z p It has the same dimension as E, which is m×4×1024;
[0092] S3.1.4 In the serial transformer module of layer N1, matrix Z p After one layer of normalization, we obtain
[0093] Subsequently, based on the multi-head attention mechanism... The following steps will be taken to process the issue:
[0094] Will The transformation results of the three parallel linear layers are denoted as A, B, and C, respectively.
[0095] The three sets of transformation results are then processed using multi-head attention operations:
[0096] The three sets of transformation results A, B, and C are input into multiple parallel dot product attention modules, and the operation of each dot product attention module is as follows:
[0097]
[0098] Where SDA(·) represents the result of the dot product attention operation, and input_dim represents matrix Z. p The dimension;
[0099] After concatenating the results of all dot product attention modules, a linear layer transformation is applied to obtain the matrix Z. p Transformation matrices of the same dimension
[0100] After the multi-head attention operation is completed, With Z p The output Z is obtained by adding them together. P ', Z P After a normalization layer, the input is fed into a feedforward network, where Z is extracted. P The characteristics of ', and finally with Z P The summation is used as input to the next transformer module, ultimately yielding the output matrix of the last transformer module. N1 represents the number of transformer modules;
[0101] S3.1.5, Matrix H N1 After being input into the feature extraction and processing layer, the extraction matrix is obtained. The first line is denoted as sequence H. C Then for sequence H C Attached is the learnable weight matrix W C Thus, matrix F is obtained. C ;
[0102] F C =W C ·H C
[0103] S3.1.6, Matrix F C After normalization and linear processing layers, a two-dimensional vector F1 is obtained. Finally, the two-dimensional vector F1 is input into the feature fusion and prediction network through the output layer.
[0104] S3.2 Feature extraction network during training cycle;
[0105] S3.2.1 In the discharge capacity sequence Q of the k-th lithium battery, take the discharge capacity of the first m charge-discharge cycles, denoted as .
[0106] S3.2.2, the sequence The input is fed into a multilayer perceptron machine through the input layer. After processing by the multilayer perceptron, the output matrix A is obtained. k ;
[0107] S3.2.3. Randomly generate a 1×m vector in the splicing layer, and then transpose the vector and splice it into matrix A. k At the very front, we obtain the matrix. Then, the matrix is processed through the random position encoding matrix P. Encode to obtain a matrix
[0108]
[0109] S3.2.4 In the serial transformer module of layer N2, process the matrix according to the method in step S3.1.4. Processing is performed, assuming the output of the last transformer module is a matrix. N2 is the number of transformer modules;
[0110] S3.2.5, Following the multi-head attention mechanism in step S3.1.4, process the matrix... After further processing, the final output matrix H is obtained after multi-head attention operation. S ;
[0111] S3.2.6. Perform the following steps on matrix H: S3.1.5 to S3.1.6. S Feature extraction, normalization, and linear transformation are performed to obtain the two-dimensional vector F2 output by the periodic feature extraction network, which is then input into the feature fusion and prediction network.
[0112] S3.3 Training Feature Fusion and Prediction Network;
[0113] A cross-attention mechanism is used to perform multi-head attention processing on F1 and F2. The processing procedure is as follows:
[0114] F1 is transformed through a linear layer, and the transformation result is denoted as A.
[0115] F2 is transformed through two parallel linear layers, and the transformation results are denoted as B and C.
[0116] Following the method in step S3.1.4, the three sets of transformation results A, B, and C are processed using multi-head attention operations to predict the discharge capacity of the k-th lithium battery at the end of the (m+1)-Nth charge-discharge cycle.
[0117] Compare The discharge capacity at the end of each charge-discharge cycle is compared with the failure threshold C. The number of charge-discharge cycles that are greater than the failure threshold C is counted and used as the remaining life of the k-th lithium battery.
[0118] S3.4. Repeatedly train the cross-cycle feature extraction network based on the self-attention mechanism according to the methods in steps S3.1 to S3.3 until the model converges;
[0119] S4. Lifetime prediction of the lithium battery under test;
[0120] The system collects feature data of the lithium battery under test in the first m charge-discharge cycles and discharge capacity at the end of each charge-discharge cycle in real time. After preprocessing, the data is input into a trained cross-cycle feature extraction network based on self-attention mechanism, which outputs the discharge capacity of the lithium battery under test at the end of subsequent charge-discharge cycles. Then, the number of charge-discharge cycles with discharge capacity greater than the failure threshold C is counted to determine the lifespan of the lithium battery under test.
[0121] To illustrate the technical effects of this invention, the MIT dataset was used, which cyclically processed 124 commercial LFP / graphite batteries (A123 system, APR18650M1A type, 1.1Ah nominal capacity). The dataset was collected in a temperature-controlled environment chamber set to 30°C under different fast-charging conditions but the same discharge conditions (4C–2.0V, where 1C is 1.1A). Cycle life was defined as the number of cycles to 80% of the nominal capacity. The battery life ranged from 150 to 2300 cycles, with the overall data containing approximately 96,700 cycles using 72 different charging conditions. This dataset can be used to evaluate the accuracy of cycle life prediction under different charging strategies. The dataset was divided into training and test sets in a 7:3 ratio. The training data was used to learn the model's structure and parameter values, while the test data was used to evaluate the model's generality. The battery data was taken from the first 100 cycles, i.e., m = 100.
[0122] Table 1 compares the results of this invention with existing methods based on Mean Absolute Percentage Error (MAPE), Mean Absolute Error (MAE), and Root Mean Square Error (RMSE). All methods in the table were trained and tested using the first 100 cycles of the MIT dataset. It can be clearly seen that this invention achieves a MAPE of 8%, and MAE and RMSE of 58 and 79 cycles respectively, lower than other published results. Furthermore, while some methods use features constructed based on human experience, the feature matrices of this invention are directly extracted from battery curve data, resulting in stronger universality and robustness. Figure 5 (a) shows the prediction results for the overall data. The closer the point is to the fitted regression line, the better the prediction effect. Figure 5 (b) The results of the test data are shown separately, which makes the predictive performance of the invention more apparent. Figure 5 (c) This reflects the MAPE of the overall data. This invention performs comprehensive and in-depth extraction of data features, and the results further confirm the robustness and accuracy of the method.
[0123] method MAPE (%) MAE (period) RMSE (period) This invention 8.0 58 79 Data-driven prediction 10.7 - 214 Elastic Networks 9.1 - 121 Gaussian regression 8.9 - 119 Gradient-enhanced regression tree 11.0 77 118 Long Short-Term Memory Network 8.6 - 120 Stacked Denoising Autoencoder - 77 120
[0124] Table 1
[0125] Although the illustrative specific embodiments of the present invention have been described above to enable those skilled in the art to understand the invention, it should be understood that the invention is not limited to the scope of the specific embodiments. For those skilled in the art, various changes are obvious as long as they are within the spirit and scope of the invention as defined and determined by the appended claims, and all inventions utilizing the concept of the present invention are protected.
Claims
1. A method for predicting the lifetime of lithium batteries based on a self-attention mechanism, characterized in that, Includes the following steps: (1) Data acquisition and preprocessing; (1.1) Data acquisition; Accelerate the life test of M lithium batteries until the lithium battery capacity reaches the failure threshold C. During the experiment, collect the characteristic data of each lithium battery in each charge-discharge cycle, as well as the discharge capacity at the end of each charge-discharge cycle. Let the characteristic data of the k-th lithium battery during the i-th charge-discharge cycle be denoted as . k∈[1,M], where n represents the number of feature data collected within one charge-discharge cycle. This represents the feature data collected at time j. These represent the voltage, current, and temperature collected at the j-th time point, respectively. Let the discharge capacity of the k-th lithium battery at the end of the i-th charge-discharge cycle be . The discharge capacity sequence of the k-th lithium battery collected throughout the entire lifespan experiment is represented as follows: N is the number of charge-discharge cycles of the k-th lithium battery; (1.2) Data preprocessing; (1.2.1) Let the complete characteristic data collected by the k-th lithium battery in the life test be denoted as . (1.2.2) Using an average gradient smoothing filter for X k Perform smoothing filtering, then linear interpolation and normalization. (2) Construct a cross-period feature extraction network based on self-attention mechanism; Cross-period feature extraction networks based on self-attention mechanisms include: intra-period feature extraction networks, inter-period feature extraction networks, and feature fusion and prediction networks; The intra-cycle feature extraction network includes: an input layer, a concatenation layer, a positional encoding layer, a serial transformer module, a feature extraction and processing layer, a normalization and linear processing layer, and an output layer; the transformer module includes a normalization layer, a multi-head self-attention module, and a feedforward network; the feedforward network uses two symmetrical linear layers. The periodic feature extraction network includes: input layer, multilayer perceptron, splicing layer, serial transformer module, multi-head self-attention module, feature extraction and processing layer, normalization and linear processing layer, and output layer; The feature fusion and prediction network employs a multi-head self-attention module with a cross-attention mechanism; (3) Training a cross-cycle feature extraction network based on self-attention mechanism; (3.1) Feature extraction network during training period; (3.1.1) After preprocessing the complete feature data of the kth lithium battery, the voltage, current and temperature data in the first m charge and discharge cycles are used to form a three-dimensional feature matrix P; in, Let these represent the voltage, current, and temperature vectors of the k-th lithium battery during the m-th charge / discharge cycle, respectively. (3.1.2) Input the three-dimensional feature matrix P into the periodic feature extraction network through the input layer, then randomly generate a 1×m vector in the concatenation layer, and concatenate the transposed vector to the front of the matrix P to obtain a matrix E of size m×4. (3.1.3) The position coding layer uses a random position coding matrix P to encode matrix E, resulting in matrix Z. p ; With p =E+P (3.1.4) In the serial transformer module of layer N1, matrix Z p After one layer of normalization, we obtain Subsequently, based on the multi-head attention mechanism... The following steps will be taken to process the issue: Will The transformation results of the three parallel linear layers are denoted as A, B, and C, respectively. The three sets of transformation results are then processed using multi-head attention operations: The three sets of transformation results A, B, and C are input into multiple parallel dot product attention modules, and the operation of each dot product attention module is as follows: Where input_dim represents matrix Z p The dimension; After concatenating the results of all dot product attention modules, a linear layer transformation is applied to obtain the matrix Z. p Transformation matrices of the same dimension After the multi-head attention operation is completed, With Z p The output Z is obtained by adding them together. P ', Z P After a normalization layer, the input is fed into a feedforward network, where Z is extracted. P The characteristics of ', and finally with Z P The summation is used as input to the next transformer module, ultimately yielding the output matrix of the last transformer module. N1 represents the number of transformer modules; (3.1.5) The matrix After being input into the feature extraction and processing layer, the extraction matrix is obtained. The first line is denoted as sequence H. C Then for sequence H C Attached is the learnable weight matrix W C Thus, matrix F is obtained. C ; F C =W C ·H C (3.1.6) Matrix F C After normalization and linear processing layers, a two-dimensional vector F1 is obtained. Finally, the two-dimensional vector F1 is input into the feature fusion and prediction network through the output layer. (3.2) Feature extraction network during training cycles; (3.2.1) In the discharge capacity sequence Q of the k-th lithium battery, the discharge capacity of the first m charge-discharge cycles is taken and denoted as... (3.2.2), the sequence The input is fed into a multilayer perceptron machine through the input layer. After processing by the multilayer perceptron, the output matrix A is obtained. k ; (3.2.3) Randomly generate a 1×m vector in the splicing layer, and then transpose the vector and splice it into matrix A. k At the very front, we obtain the matrix. Then, the matrix is processed through the random position encoding matrix P. Encode to obtain a matrix (3.2.4) In the serial transformer module of layer N2, the matrix is processed according to the method in step (3.1.4). Processing is performed, assuming the output of the last transformer module is a matrix. N2 is the number of transformer modules; (3.2.5) Following step (3.1.4), the matrix is processed using a multi-head attention mechanism. After further processing, the final output matrix H is obtained after multi-head attention operation. S ; (3.2.6) Perform the following steps (3.1.5) to (3.1.6) on matrix H. S Feature extraction, normalization, and linear transformation are performed to obtain the two-dimensional vector F2 output by the periodic feature extraction network, which is then input into the feature fusion and prediction network. (3.3) Training feature fusion and prediction network; A cross-attention mechanism is used to perform multi-head attention processing on F1 and F2. The processing procedure is as follows: F1 is transformed through a linear layer, and the transformation result is denoted as A. F2 is transformed through two parallel linear layers, and the transformation results are denoted as B and C. Following the method in step (3.1.4), the three sets of transformation results A, B, and C are processed using multi-head attention operations to predict the discharge capacity of the k-th lithium battery at the end of the (m+1)-Nth charge-discharge cycle. Compare The discharge capacity at the end of each charge-discharge cycle is compared with the failure threshold C. The number of charge-discharge cycles that are greater than the failure threshold C is counted and used as the remaining life of the k-th lithium battery. (3.4) Repeatedly train the cross-cycle feature extraction network based on the self-attention mechanism according to the methods in steps (3.1) to (3.4) until the model converges; (4) Lifetime prediction of the lithium battery under test; The system collects feature data of the lithium battery under test in the first m charge-discharge cycles and discharge capacity at the end of each charge-discharge cycle in real time. After preprocessing, the data is input into a trained cross-cycle feature extraction network based on self-attention mechanism, which outputs the discharge capacity of the lithium battery under test at the end of subsequent charge-discharge cycles. Then, the number of charge-discharge cycles with discharge capacity greater than the failure threshold C is counted to determine the lifespan of the lithium battery under test.
Citation Information
Patent Citations
Method for predicting remaining service life of lithium-ion battery employing WDE-optimized LSTM network
WO2020191800A1
System and method for estimating state of health and remaining useful life of a battery
WO2023052910A1