Life prediction method based on lithium battery characteristic relation and convolutional Transform neural network
Through the convolutional Transformer neural network method based on the characteristic relationship of lithium batteries, the problem of insufficient accuracy of lithium battery life prediction in the prior art is solved, and the accurate prediction of lithium battery life is achieved, and the reliability of prediction is improved.
Patent Information
- Application Number
- CN202510459309.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-14
- Publication Date
- 2025-05-13
AI Technical Summary
The prior art is difficult to accurately predict the remaining service life of lithium batteries, especially under large-scale data, and it is impossible to fully explore the complex relationship between the degradation characteristics of lithium batteries.
The life prediction method based on the lithium battery feature relationship and convolutional Transformer neural network is adopted. By obtaining the lithium battery feature vector, combining the convolutional attention mechanism and the Transformer network, the service life prediction model is built, and the model is trained to achieve accurate prediction.
The correlation between lithium battery characteristics at different time steps was successfully explored, effective prediction of lithium battery life was achieved, and the accuracy and reliability of prediction were improved.
Smart Images

Figure CN119989940A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of lithium battery life prediction, and more specifically to a life prediction method based on lithium battery characteristic relationship and convolutional Transformer neural network. Background Art
[0002] Lithium battery is one of the most common power batteries and is widely used in new energy vehicles, energy storage and other fields. An important part of ensuring the long-term safety of industrial production is the prediction of lithium battery life. Once a lithium battery fails, it will cause huge economic and time losses, and may even cause major accidents or casualties. Therefore, in order to prevent this situation, it is crucial to pursue a perfect life prediction method. During the operation of lithium batteries, capacity decay is an inevitable phenomenon. For electric vehicles, when the battery capacity drops below a certain threshold, the battery needs to be replaced or repaired to prevent battery failure. Therefore, in-depth exploration of the relationship between the degradation characteristics of lithium batteries at different time nodes has become a key factor in realizing lithium battery life prediction.
[0003] Transformer neural network is a deep learning method that is currently widely used in data mining. It uses the self-attention mechanism to capture the long-term dependencies between elements in the sequence, extracts features from the relationship between time series, and continuously learns the features through the neural network to achieve tasks such as sequence prediction. For lithium battery life prediction, Transformer neural network can effectively extract the relationship between lithium battery degradation features and achieve the task of life prediction. However, in reality, the amount of data is huge, and the relationship between lithium battery degradation features is complex. The general Transformer neural network cannot fully mine the feature relationship for lithium battery life prediction and cannot meet satisfactory requirements.
[0004] Therefore, how to propose a life prediction method based on lithium battery characteristic relationship and convolutional Transformer neural network to accurately predict the remaining service life is a problem that technical personnel in this field urgently need to solve. Summary of the invention
[0005] In view of this, the present invention provides a life prediction method based on lithium battery characteristic relationship and convolutional Transformer neural network, which can achieve the effect of accurately predicting the remaining service life of lithium batteries.
[0006] In order to achieve the above object, the present invention adopts the following technical solution: A life prediction method based on lithium battery feature relationship and convolutional Transformer neural network includes the following steps: Get the lithium battery feature vector; Dividing the lithium battery feature vector into a training set, a validation set and a test set; Constructing a service life prediction model, combining the convolutional attention mechanism and the Transformer network to obtain the service life prediction model; Using the training set to train the service life prediction model to obtain a trained service life prediction model; Inputting the verification set into the trained service life prediction model for verification to obtain a verified service life prediction model; The test set is input into the verified service life prediction model to obtain the service life prediction result of the lithium battery.
[0007] Preferably, obtaining the lithium battery feature vector includes: Obtain each time node of the lithium battery and the degradation characteristics corresponding to each time node to generate time series data; The time series data is sampled in sections according to a certain sampling interval using the segmented sampling method to obtain multiple subsequences; The multiple subsequences are concatenated together to generate a lithium battery feature vector.
[0008] Preferably, the characteristics of the lithium battery are discharge capacity, health index, and internal resistance, and each characteristic is a characteristic vector composed of the time series variable value of the current time step.
[0009] Preferably, the service life prediction model is obtained by combining the convolutional attention mechanism and the Transformer network, including: The lithium battery feature vector is processed by using a convolutional attention mechanism to calculate an attention parameter, an initial feature vector is obtained according to the attention parameter, and the initial feature vector is normalized to obtain a second feature vector; The second feature vector is globally accumulated using the Transformer network to obtain the node feature sum, and all time step features and variable features are obtained through an iterative process to obtain a final feature vector, and the final feature vector is input into a fully connected network for inference to obtain a predicted sequence.
[0010] Preferably, the service life prediction model is trained using the training set to obtain a trained service life prediction model, including: inputting the training set into the service life prediction model to obtain a trained data set, inputting the trained data set into the service life prediction model again, stopping the training when the number of inputs reaches a threshold, and obtaining a trained service life prediction model.
[0011] Preferably, the lithium battery feature vector is processed using a convolutional attention mechanism to calculate an attention parameter, an initial feature vector is obtained according to the attention parameter, and the initial feature vector is normalized to obtain a second feature vector, including: The variable convolution attention and the time-step convolution attention respectively process the lithium battery feature vector by calculation to generate three matrices, namely query, key, and value; Compute the similarity between the query and the key via a dot product and then scale the similarity; In the variable convolutional attention, a Softmax function is applied along the variable dimension to convert the similarity into a first weight; in the time step convolutional attention, a Softmax function is applied along the time dimension to convert the similarity into a second weight; The keys are weighted and summed according to the first weight to obtain the output of the variable convolutional attention mechanism; the keys are weighted and summed according to the second weight to obtain the output of the time step convolutional attention mechanism.
[0012] Preferably, the variable convolution attention processes the feature vector of the variable dimension by computing , generate the query matrix , key matrix , value matrix , the formula is as follows: ; in, A kernel representing a causal convolution of the time step with an appropriately padded kernel size, is a trainable parameter, , is the input dimension, N is the number of degradation features of lithium batteries, H is the length of the time series, and C is the number of subsequences into which the time series is divided; Time-stepped convolutional attention processes the feature vector of the time dimension by calculating , generate the query matrix , key matrix , value matrix , the formula is as follows: ; in, is a trainable parameter, , T represents the prediction time step.
[0013] Preferably, the final feature vector is input into a fully connected network to infer a predicted sequence, comprising: Use the loss function to complete the sequence prediction, the loss function The expression is as follows: ; in, is the prediction result of the model, is the real data, N represents the degradation feature number of lithium battery, T represents the prediction time step, Represents the weight of Loss, Represents the confidence of the model in the prediction result of step i, It is expressed as the uncertainty estimate of the model's dynamic prediction at the tth time step.
[0014] It can be seen from the above technical solutions that, compared with the prior art, the present invention discloses a life prediction method based on lithium battery characteristic relationship and convolutional Transformer neural network, which has the following beneficial effects: 1. The present invention establishes a convolutional Transformer neural network model, which focuses on predicting the remaining service life of lithium batteries. It converts the original data structure into a time series feature vector to reflect the data relationship between each time step. The feature vector is learned by the convolutional Transformer neural network, and the correlation between lithium battery characteristics at different time steps is successfully mined, thereby achieving effective prediction of life.
[0015] 2. The present invention utilizes the self-attention mechanism to mine the relationship between the degradation features of lithium batteries at various time nodes, and uses the improved Transformer method to realize the life prediction of lithium batteries; first, the variable encoding layer utilizes the convolutional attention mechanism to identify the importance of degradation features along the feature dimension, and the time encoding layer adopts the self-attention mechanism to capture information along the time dimension. The two layers collaboratively process the information of different features in the feature vector through a parallel structure, and then set new weights for each degradation feature at different time steps, which can not only more effectively capture the relationship between different time steps, but also reduce the impact of noise; secondly, through the improved Transformer network, time attention and variable attention are used to explore the feature vector respectively, which more accurately aggregates the features of each element in the multi-set, so that the time information of the feature vector and its variable correlation can be analyzed, and the sequence prediction is completed, thereby realizing the life prediction of lithium batteries under large-scale data. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0017] Figure 1 A schematic diagram of the method provided by the present invention; Figure 2 This is a schematic diagram of the structure of the service life prediction model provided by the present invention. DETAILED DESCRIPTION
[0018] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0019] The embodiment of the present invention discloses a life prediction method based on lithium battery characteristic relationship and convolutional Transformer neural network, such as Figure 1 As shown, the following steps are included: S1. Obtain lithium battery feature vector, including: S11. Obtain each time node of the lithium battery and the degradation characteristics corresponding to each time node to generate time series data.
[0020] S12. Use a segmented sampling method to segment the time series data according to a determined sampling interval to obtain multiple subsequences.
[0021] The segmented sampling method is used to obtain multiple subsequences from all time series according to the determined sampling interval. Mathematically, segmented sampling is defined as follows. For a time series of length H, it is divided into C subsequences, each of which has a length of The original time series is . subsequence is defined as follows: ; in, , each subsequence Contains a portion of the original time series data.
[0022] S13. Connect multiple subsequences together to generate a lithium battery feature vector.
[0023] The feature vectors of multiple subsequences are concatenated according to the segmented sampling characteristics to generate a lithium battery feature vector.
[0024] Specifically, concatenate C subsequences together to obtain the feature vector , whose dimensions are , specifically expressed as: ; Among them, the original time series , subsequence , the eigenvector .
[0025] In this embodiment, the characteristics of the lithium battery (i.e., lithium battery vector characteristics) are discharge capacity (Capacity), health index (SOH), and internal resistance (Resistance), and each feature is a feature vector composed of the time series variable value of the current time step.
[0026] S2. Divide the lithium battery feature vector into a training set, a validation set, and a test set in a ratio of 8:1:1.
[0027] S3. Construct a service life prediction model and combine the convolutional attention mechanism and Transformer network to obtain the service life prediction model.
[0028] The service life prediction model includes the time step variable encoding block stage and the feature fusion stage.
[0029] The time step variable encoding block stage includes: processing the lithium battery feature vector using the convolutional attention mechanism to calculate the attention parameter, obtaining the initial feature vector according to the attention parameter, and normalizing the initial feature vector to obtain the second feature vector.
[0030] Specifically, the structure diagram of the convolutional Transformer algorithm is as follows Figure 2 As shown, the time step variable encoding block stage includes variable convolution attention and time step convolution attention.
[0031] Variable convolution attention processes the feature vector of variable dimensions by calculating , generate the query matrix , key matrix , value matrix , the formula is as follows: ; in, A kernel representing a causal convolution of the time step with an appropriately padded kernel size, is a trainable parameter, , is the input dimension; The similarity between the query and the key is calculated by dot product, and then this similarity is scaled to ensure numerical stability; Finally, the Softmax function is applied along the variable dimension to convert the similarity into the first weight , the specific expression is as follows: ; in, ; According to weight The weighted sum of the values is performed to obtain the output of the attention mechanism of the feature dimension. The specific expression is as follows: ; Among them, the attention mechanism adopts a multi-head self-attention mechanism, which allows the model to pay attention to information from different positions. Its specific expression is as follows: ; Among them, the parameter matrix , h is the number of longs, .
[0032] Time-stepped convolutional attention processes the feature vector of the time dimension by calculating , generate the query matrix , key matrix , value matrix , the formula is as follows: ; in, is a trainable parameter, ; The similarity between the query and the key is calculated by dot product, and then this similarity is scaled to ensure numerical stability; Finally, the Softmax function is applied along the time dimension to convert it into the second weight , its specific expression is as follows: ; in, ; According to the second weight The weighted sum of the values is performed to obtain the output of the attention mechanism in the time dimension. The specific expression is as follows: ; Among them, the multi-head self-attention mechanism is adopted in the attention mechanism of the time dimension, allowing the model to pay attention to information from different positions. Its specific expression is as follows: ; Among them, the parameter matrix , h is the number of longs, .
[0033] The feature fusion stage includes: using the Transformer network to globally accumulate the second feature vector to obtain the node feature sum, obtaining all time step features and variable features through an iterative process to obtain the final feature vector, and inputting the final feature vector into the fully connected network to infer and obtain the predicted sequence.
[0034] Specifically, the feature fusion expression is: ; in, and are the extracted features, The model can capture and feature information.
[0035] Utilizing new features As the input of the decoder, the decoder is used to infer the prediction of the time series, and the loss function is used to complete the prediction of the sequence. The loss function expression is as follows: ; in, is the prediction result of the model, is the real data, N represents the degradation feature number of lithium battery, T represents the prediction time step, Represents the weight of Loss, Represents the confidence of the model in the prediction result of step i, It is expressed as the uncertainty estimate of the model's dynamic prediction at the tth time step.
[0036] S4. Use the training set to train the service life prediction model to obtain a trained service life prediction model.
[0037] The training set is input into the service life prediction model to obtain a trained data set, and the trained data set is input into the service life prediction model again. When the number of inputs reaches a threshold, the training is stopped to obtain a trained service life prediction model. In the model training step in this embodiment, the number of inputs is set to 100 times, and the number of internal iterations each time is 500 times.
[0038] S5. Input the validation set into the trained service life prediction model for validation, and obtain a validated service life prediction model; S6. Input the test set into the verified service life prediction model to obtain the life prediction result of the lithium battery.
[0039] This example verifies the effectiveness of the lithium battery life prediction method, and the process is as follows: First, the original lithium battery characterization data was collected. These batteries were all charged using the same charging scheme, specifically the standard constant current / constant voltage (CC / CV) scheme. The constant current rate was 0.5C until the voltage reached 4.2V, and then maintained at 4.2V until the charging current dropped below 0.05A. The discharge cut-off voltage of these batteries was set to 2.7V.
[0040] Secondly, in the embodiment, the specific parameter settings are shown in Table 1. The initial learning rate and epoch are 0.001 and 500 respectively. The split ratio of the training data set, the validation data set, and the test data set is 8:1:1. If the accuracy of the validation data set is not improved, the update of the training model will stop after 50 patience periods.
[0041] Table 1 Example parameter settings
[0042] Finally, we used the data for a complete experimental verification, obtained an effective feature vector using segmented sampling, applied the attention mechanism to the obtained weighted matrix, and finally used the Transformer network to fuse the global features and achieve sequence prediction.
[0043] In order to illustrate the superiority of the method of the present invention, this example compares the method of the present invention with four other basic methods. According to the setting of the parameters in Table 1, the three models were trained and tested respectively. In order to make a fair comparison in the experiment, we set the number of hidden layers to 32 for testing. The relative errors of different methods are shown in Table 2.
[0044] Table 2 Comparison of different models From the results of the comparative experiments, we can find that it is difficult for MLP to achieve satisfactory results for time series data, while technologies such as LSTM and GRU can achieve the purpose of learning. However, compared with other technologies, the performance of the CovTransformer involved is the best, which shows that our method fully exploits the characteristic relationship of the time series, is more conducive to predicting the time series and realizing the life prediction of lithium batteries.
[0045] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0046] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A life prediction method based on lithium battery characteristic relationship and convolutional Transformer neural network, characterized in that: The following steps are involved: Get the lithium battery feature vector; Dividing the lithium battery feature vector into a training set, a validation set and a test set; Constructing a service life prediction model, combining the convolutional attention mechanism and the Transformer network to obtain the service life prediction model; Using the training set to train the service life prediction model to obtain a trained service life prediction model; Inputting the verification set into the trained service life prediction model for verification to obtain a verified service life prediction model; The test set is input into the verified service life prediction model to obtain the service life prediction result of the lithium battery.
2. The life prediction method based on lithium battery characteristic relationship and convolutional Transformer neural network according to claim 1 is characterized in that: Get lithium battery feature vector, including: Obtain each time node of the lithium battery and the degradation characteristics corresponding to each time node to generate time series data; The time series data is sampled in sections according to a certain sampling interval using the segmented sampling method to obtain multiple subsequences; The multiple subsequences are concatenated together to generate a lithium battery feature vector.
3. The life prediction method based on lithium battery characteristic relationship and convolutional Transformer neural network according to claim 1 is characterized in that: The characteristics of lithium batteries are discharge capacity, health index, and internal resistance. Each feature is a feature vector composed of the time series variable values of the current time step.
4. The life prediction method based on lithium battery characteristic relationship and convolutional Transformer neural network according to claim 2 is characterized in that: The service life prediction model is obtained by combining the convolutional attention mechanism and the Transformer network, including: The lithium battery feature vector is processed by using a convolutional attention mechanism to calculate an attention parameter, an initial feature vector is obtained according to the attention parameter, and the initial feature vector is normalized to obtain a second feature vector; The second feature vector is globally accumulated using the Transformer network to obtain the node feature sum, and all time step features and variable features are obtained through an iterative process to obtain a final feature vector, and the final feature vector is input into a fully connected network for inference to obtain a predicted sequence.
5. The life prediction method based on lithium battery characteristic relationship and convolutional Transformer neural network according to claim 1 is characterized in that: The service life prediction model is trained using the training set to obtain a trained service life prediction model, including: inputting the training set into the service life prediction model to obtain a trained data set, inputting the trained data set into the service life prediction model again, stopping the training when the number of inputs reaches a threshold, and obtaining a trained service life prediction model.
6. The life prediction method based on lithium battery characteristic relationship and convolutional Transformer neural network according to claim 4 is characterized in that: The lithium battery feature vector is processed by using a convolutional attention mechanism to calculate an attention parameter, an initial feature vector is obtained according to the attention parameter, and the initial feature vector is normalized to obtain a second feature vector, including: The variable convolution attention and the time-step convolution attention respectively process the lithium battery feature vector by calculation to generate three matrices, namely query, key, and value; Compute the similarity between the query and the key via a dot product and then scale the similarity; In the variable convolutional attention, a Softmax function is applied along the variable dimension to convert the similarity into a first weight; in the time step convolutional attention, a Softmax function is applied along the time dimension to convert the similarity into a second weight; The keys are weighted and summed according to the first weight to obtain the output of the variable convolutional attention mechanism; the keys are weighted and summed according to the second weight to obtain the output of the time step convolutional attention mechanism.
7. The life prediction method based on lithium battery characteristic relationship and convolutional Transformer neural network according to claim 6 is characterized in that: Variable convolution attention processes the feature vector of variable dimensions by calculating , generate the query matrix , key matrix , value matrix , the formula is as follows: ; in, represents the causal convolution of the kernel of time step with the kernel size of padding, is a trainable parameter, , is the input dimension, N is the number of degradation features of lithium batteries, H is the length of the time series, and C is the number of subsequences into which the time series is divided; Time-stepped convolutional attention processes the feature vector of the time dimension by calculating , generate the query matrix , key matrix , value matrix , the formula is as follows: ; in, is a trainable parameter, , T represents the prediction time step.
8. The life prediction method based on lithium battery characteristic relationship and convolutional Transformer neural network according to claim 4 is characterized in that: The final feature vector is input into the fully connected network to infer the predicted sequence, including: Use the loss function to complete the sequence prediction, the loss function The expression is as follows: ; in, is the prediction result of the model, is the real data, N represents the degradation feature number of lithium battery, T represents the prediction time step, Represents the weight of Loss, Represents the confidence of the model in the prediction result of step i, It is expressed as the uncertainty estimate of the model's dynamic prediction at the tth time step.
Citation Information
Patent Citations
Lithium battery residual life probability prediction method based on time convolution attention mechanism
CN116381517A
Lithium ion battery life prediction method based on integrated Transform model
CN117148197A
Battery fault prediction model training method and device, and prediction method and device
CN118395370A
Lithium battery life prediction method, system, equipment and medium
CN118938061A