Lithium ion battery health state prediction method and system
By using a self-attention timing modeling method with long and short-term memory networks and relative position encoding in the health status prediction of lithium-ion batteries, the problems of complex decay mechanisms and error accumulation in the prior art are solved, and high-precision and efficient ultra-long-range prediction are achieved.
Patent Information
- Application Number
- CN202510429793.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-08
- Publication Date
- 2025-05-30
AI Technical Summary
When predicting the health status of lithium-ion batteries, the prior art faces problems such as complex decay mechanisms, poor model adaptability caused by different charging and discharging strategies, difficulty in accurately modeling the nonlinear decay process, and accumulation of ultra-long-range prediction errors.
A self-attention timing modeling method based on long and short-term memory networks and relative position coding is adopted. By relying on feature prediction models and multivariate autoregressive target feature prediction models, a complex ultra-long-range timing data model is constructed to reduce error accumulation in iterative prediction.
It significantly improves the accuracy and efficiency of ultra-long-range early prediction of the healthy status of lithium-ion batteries, adapts to a variety of charging and discharging strategies, and reduces the computational complexity.
Smart Images

Figure CN120065042A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of intelligent prediction of battery health status, and particularly to a method and system for predicting the health status of lithium-ion batteries. Background Art
[0002] Lithium-ion batteries are widely used in electric vehicles, renewable energy storage, and electronic devices. However, their health status gradually deteriorates with charge and discharge cycles, affecting the performance and lifespan of the devices. Accurately predicting the battery health status is crucial for optimizing management and extending the service life.
[0003] Existing methods still face challenges in dealing with complex degradation mechanisms and different operating conditions. First, different charge and discharge strategies lead to differences in aging paths, making it difficult for a unified prediction model to adapt. Second, the battery degradation process has non-linear characteristics and is affected by multiple factors, making it difficult for existing methods to accurately model. In addition, ultra-long-term prediction relies on iterative prediction methods, which are prone to error accumulation, reducing prediction accuracy and stability.
[0004] Existing methods include physical modeling and data-driven methods. However, the former has high complexity and low generality, while the latter still has problems such as high computational cost and insufficient feature extraction in long-term prediction. In addition, the generalization ability of the model under different operating conditions still needs to be improved. Therefore, how to improve prediction accuracy, reduce error accumulation, and adapt to various charge and discharge strategies remains a core issue in this field. Summary of the Invention
[0005] The purpose of the present application is to provide a method and system for predicting the health status of lithium-ion batteries to improve the prediction accuracy of battery health status, reduce error accumulation, and adapt to various charge and discharge strategies.
[0006] To achieve the above purpose, the present application provides the following solutions.
[0007] In a first aspect, the present application provides a method for predicting the health status of lithium-ion batteries, including:
[0008] Based on the full-life cycle monitoring data of an experimental lithium-ion battery, obtaining the original time-series data of the experimental lithium-ion battery that depends on features, as the first original time-series data, and obtaining the original time-series data of the health status of the experimental lithium-ion battery, as the second original time-series data; the dependent feature is a data feature whose correlation coefficient with the health status is greater than the correlation threshold;
[0009] Training a time-series prediction neural network model using the first original time-series data and the second original time-series data respectively to obtain a dependent feature prediction model and a multi-variable autoregressive target feature prediction model;
[0010] Obtain the original time series data of the dependent features and the original time series data of the health state of the lithium-ion battery to be measured, and construct the initial dependent feature input data and comprehensive feature input data;
[0011] Input the dependent feature input data into the dependent feature prediction model to obtain dependent feature prediction data;
[0012] Input the comprehensive feature input data into the multi-variable autoregressive target feature prediction model to obtain health state prediction data;
[0013] Use the dependent feature prediction data at the current prediction time step to update the dependent feature input data at the current prediction time step, and use the dependent feature prediction data and health state prediction data at the current prediction time step to update the comprehensive feature input data at the current prediction time step to obtain the dependent feature input data and comprehensive feature input data at the next prediction time step, and return to the step of "inputting the dependent feature input data into the dependent feature prediction model to obtain dependent feature prediction data" until the health state prediction data indicates that the lithium-ion battery to be measured fails.
[0014] In a second aspect, the present application provides a lithium-ion battery health state prediction system. The lithium-ion battery health state prediction system applies the above-mentioned lithium-ion battery health state prediction method. The lithium-ion battery health state prediction system includes:
[0015] A monitoring data acquisition module, configured to obtain the original time series data of the dependent features of the experimental lithium-ion battery as the first original time series data and the original time series data of the health state of the experimental lithium-ion battery as the second original time series data based on the full-life cycle monitoring data of the experimental lithium-ion battery; the dependent feature is a data feature whose correlation coefficient with the health state is greater than the correlation threshold;
[0016] A model training module, configured to train a time series prediction neural network model using the first original time series data and the second original time series data respectively to obtain a dependent feature prediction model and a multi-variable autoregressive target feature prediction model;
[0017] An initialization module, configured to obtain the original time series data of the dependent features and the original time series data of the health state of the lithium-ion battery to be measured, and construct the initial dependent feature input data and comprehensive feature input data;
[0018] A dependent feature prediction module, configured to input the dependent feature input data into the dependent feature prediction model to obtain dependent feature prediction data;
[0019] A health state prediction module, configured to input the comprehensive feature input data into the multi-variable autoregressive target feature prediction model to obtain health state prediction data;
[0020] A data update module is used to predict data to update the dependent feature input data of the current prediction time step by using the dependent features of the current prediction time step, predict data and health state prediction data by using the dependent features of the current prediction time step to update the comprehensive feature input data of the current prediction time step, obtain the dependent feature input data and comprehensive feature input data of the next prediction time step, and return to the dependent feature prediction module until the health state prediction data indicates that the lithium-ion battery to be tested fails.
[0021] According to the specific embodiments provided by the present application, the present application has the following technical effects.
[0022] The present application provides a method and system for predicting the health state of a lithium-ion battery. The present application sets up a dependent feature prediction model and a multivariate autoregressive target feature prediction model. First, the dependent feature prediction is completed by using the dependent feature prediction model, and then the predicted dependent features are applied to the comprehensive feature input data, and the health state is predicted by using the multivariate autoregressive target feature prediction model. The present application sets up a two-step prediction method, which can effectively model complex ultra-long-range time series data, reduce the error accumulation in iterative prediction, and significantly improve the accuracy and efficiency of the ultra-long-range early prediction of the health state of the lithium-ion battery, providing reliable technical support for the management and maintenance of the battery. Description of the Drawings
[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0024] Figure 1 It is a schematic flowchart of a method for predicting the health state of a lithium-ion battery provided by an embodiment of the present application.
[0025] Figure 2 It is a schematic diagram of the principle of a method for predicting the health state of a lithium-ion battery provided by an embodiment of the present application.
[0026] Figure 3 It is a schematic diagram of the principle of the dependent feature prediction process provided by an embodiment of the present application.
[0027] Figure 4 It is a schematic diagram of the principle of the health state prediction process provided by an embodiment of the present application. Detailed Embodiments
[0028] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0029] To make the above objects, features, and advantages of the present application more obvious and understandable, the present application will be further described in detail below in conjunction with the drawings and specific embodiments.
[0030] In the application of lithium-ion batteries, accurately predicting their state of health is crucial for ensuring the safe use of the batteries, extending their service life, and optimizing energy management. As the battery usage time increases, its state of health will gradually decline, and accurately predicting this change trend early can take measures in advance to avoid the risks brought by the sudden deterioration of battery performance. Traditional time series prediction models have problems in effectively capturing complex time series patterns and cumulative iterative prediction errors when dealing with ultra-long-range data of lithium-ion batteries. The model proposed in this application aims at these problems and improves the prediction performance through innovative architecture design and algorithm optimization.
[0031] The embodiment of the present application provides a self-attention time series modeling method based on long short-term memory network and relative position encoding for the field of lithium-ion battery state of health prediction, belonging to the technical field of intelligent prediction of battery state of health. The embodiment of the present application first preprocesses the battery cycle data, extracts the key health feature sequence, and then constructs a self-attention model integrating long short-term memory network and relative position encoding to strengthen the time series feature extraction ability. The trained model can efficiently capture the long-term change trend of the battery state of health and be used for the downstream ultra-long-range state of health prediction task to improve the prediction accuracy and enhance the generalization ability of the model.
[0032] The embodiment of the present application provides a method and system for predicting the state of health of a lithium-ion battery, which is an ultra-long-range early prediction method and system for the state of health of a lithium-ion battery based on long short-term memory network and relative position encoding, capable of improving the accuracy of ultra-long-range early prediction of the state of health of a lithium-ion battery, reducing the cumulative error in iterative prediction, adapting to the data characteristics under different charge and discharge strategies, and balancing the computational complexity and prediction performance.
[0033] In an exemplary embodiment, a method for predicting the state of health of a lithium-ion battery is provided. This method is an ultra-long-range early prediction method for the state of health of a lithium-ion battery based on long short-term memory network and relative position encoding, as Figure 1 shown, including the following steps 101-step 106.
[0034] Step 101: Based on the full-life cycle monitoring data of the experimental lithium-ion battery, obtain the original time-series data of the dependent features of the experimental lithium-ion battery as the first original time-series data, and obtain the original time-series data of the health state of the experimental lithium-ion battery as the second original time-series data; the dependent features are data features whose correlation coefficient with the health state is greater than the correlation threshold.
[0035] Step 102: Use the first original time-series data and the second original time-series data to train the time-series prediction neural network model respectively, and obtain the dependent feature prediction model and the multivariate autoregressive target feature prediction model.
[0036] Step 103: Obtain the original time-series data of the dependent features and the original time-series data of the health state of the lithium-ion battery to be measured, and construct the initial dependent feature input data and the comprehensive feature input data.
[0037] Step 104: Input the dependent feature input data into the dependent feature prediction model to obtain the dependent feature prediction data.
[0038] Step 105: Input the comprehensive feature input data into the multivariate autoregressive target feature prediction model to obtain the health state prediction data.
[0039] Step 106: Update the dependent feature input data at the current prediction time step with the dependent feature prediction data at the current prediction time step, and update the comprehensive feature input data at the current prediction time step with the dependent feature prediction data and the health state prediction data at the current prediction time step to obtain the dependent feature input data and the comprehensive feature input data at the next prediction time step, and return to the step of "inputting the dependent feature input data into the dependent feature prediction model to obtain the dependent feature prediction data" until the health state prediction data indicates that the lithium-ion battery to be measured fails.
[0040] In another exemplary embodiment, in the above step 101, first obtain the original time-series data that is related to the health state of the lithium-ion battery and changes significantly with the charge and discharge cycles as the dependent features, and obtain the original time-series data of the health state of the lithium-ion battery. The specific method for obtaining the dependent features is as follows: First, collect the original time-series data features of the lithium-ion battery. Then, calculate the mutual information value between each data feature and the battery health state to quantify the dependence degree between the feature and the health state. At the same time, calculate the correlation coefficient between the two, and visually analyze the correlation between the data feature and the health state with the help of scatter plots and heat maps. Screen out the closely related features and initially determine the dependent features. For the case where the data feature dimension is high, use principal component analysis (PCA) for dimensionality reduction to remove redundant information.
[0041] The data of lithium-ion batteries contains various features, among which the dependent features are those closely related to the battery health state and show significant changes with charge-discharge cycles. For example, the changes in parameters such as the cut-off voltage and electrochemical impedance during the charge-discharge process of the battery at different cycle stages can reflect the physical and chemical processes inside the battery, and thus have an internal connection with the battery health state. The battery health state is usually measured by dividing the current maximum discharge capacity by the initial maximum discharge capacity, which intuitively reflects the health degree of the battery.
[0042] In another exemplary embodiment, it further includes the step of normalizing the original time-series data of the dependent features and health state of the obtained lithium-ion battery. This step requires collecting historical data from different lithium-ion batteries under various charge-discharge conditions to ensure the integrity and accuracy of the data. The data sources can be battery test equipment, battery monitoring systems in actual application scenarios, etc. The collected data is initially cleaned to remove outliers and missing values, and then normalized to unify the data into a specific range, providing a reliable data basis for subsequent model training. The normalization method can adopt min-max normalization to map the data to the [0,1] interval.
[0043] In another exemplary embodiment, in step 102 above, a two-stage training strategy is adopted for training and testing.
[0044] Step 201, training and testing of dependent features.
[0045] This application adopts a two-stage training strategy. In the dependent feature training and testing stage, as Figure 3 shown, first, the dependent feature data is obtained. Then, the battery data under each charge-discharge strategy is divided into time windows with a length of (seqLen + predLen). Here, seqLen is the length of the input time window, and predLen is the length of the prediction time window. Each window moves backward one round each time until the charge-discharge cycle ends. Subsequently, these time windows are shuffled. The first seqLen cycles of each window are used as the true values, and the subsequent predLen cycles are used as the prediction values, and then input into the model for training. Then, preliminary extraction of time-series information is carried out. The long short-term memory network is used to preprocess the data, and the hidden state is connected with the data by residual connection. After that, relative position encoding is introduced, and then processed through an encoder-decoder to finally obtain the dependent feature prediction result. This can make full use of the data features of the battery at different stages.
[0046] Training stage: During training, the battery data under each charge-discharge strategy is divided into time windows of length (seqLen + predLen), where seqLen is the length of the input time window and predLen is the length of the prediction time window. Each time window moves backward by one round each time until the charge-discharge cycle ends. Subsequently, these time windows are shuffled. The first seqLen cycles of each window are used as the true values, and the subsequent predLen cycles are used as the prediction values, and then they are input into the model for training.
[0047] Testing stage: Input the true values of the dependent features of the first seqLen cycles of the battery to be predicted to predict the values of the next predLen cycles. Then, the window moves backward by predLen cycles, and the values of the just-predicted predLen cycles are added to the true values of the dependent features of the (seqLen - predLen)-th cycle to form a new time window of length seqLen. Repeat this process to iteratively predict the next predLen rounds of cycles until the charge-discharge cycle ends. Finally, all the test results are concatenated and compared with the true values, and parameters such as the mean squared error are calculated to evaluate the performance of the model in dependent feature prediction.
[0048] Step 202: Training and testing of the target feature (health state):
[0049] During the training and testing stage of the target feature (battery health state), as Figure 4 shown, first obtain the prediction results of the dependent features and the health state feature data, and then perform time window division. Then, perform preliminary extraction of temporal information, use a long short-term memory network to preprocess the data, and perform residual connection between the hidden state and the data. After that, introduce relative position encoding, and then process through an encoder-decoder to finally obtain the prediction results of the target feature (battery health state). During training, input the true values of the dependent features and the target feature (battery health state) in the training set into the target feature model for training. After training, input the previously generated test results of the dependent features (including the true values of the first seqLen cycles and the iterative prediction values of the subsequent (totalSeqLen - seqLen) cycles) and the true values of the first seqLen cycles of the test battery capacity into the target feature model for iterative prediction, and finally output the capacity test results (including the true values of the first seqLen cycles and the prediction values of the subsequent (totalSeqLen - seqLen) cycles). Through this two-stage training strategy, it is possible to better adapt to the inconsistent data distributions under different charge-discharge strategies of lithium-ion batteries and improve the accuracy of battery health state prediction.
[0050] In another exemplary embodiment, during the model training process, selecting an appropriate loss function is crucial for optimizing model performance. In the embodiments of the present application, the mean squared error is used as the loss function, and the mean squared error can measure the mean of the squares of the differences between the model prediction values and the true values. Its calculation formula is:
[0051]
[0052] where y i is the true value, is the predicted value, and n is the number of samples. The smaller the value of the mean squared error, the closer the predicted value of the model is to the true value, and the better the prediction performance of the model. By continuously adjusting the parameters of the model to minimize the mean squared error, the model can better fit the changing trend of the health state of the lithium-ion battery.
[0053] When evaluating the model performance, in addition to the mean squared error, other metrics such as the mean absolute error, mean absolute percentage error, and coefficient of determination can also be used. The mean absolute error can reflect the average of the absolute errors between the predicted values and the true values, the mean absolute percentage error measures the size of the prediction error from a percentage perspective, and the coefficient of determination is used to evaluate the goodness of fit of the model to the data. By comprehensively using these metrics, the performance of the model in the ultra-long-range early prediction task of the health state of the lithium-ion battery can be evaluated more comprehensively.
[0054] In the embodiments of the present application, the battery data used for training and testing is divided according to the battery number. The data of each charge-discharge cycle contains dependent features and corresponding health state values, and these data form the basis for model training and prediction.
[0055] In another exemplary embodiment, the above-mentioned time series prediction neural network model includes, connected in sequence: a long short-term memory network model, a first fully connected layer, a fusion layer, an encoding and decoding module, and a second fully connected layer;
[0056] The long short-term memory network model is used to extract time series information from the model input data to obtain the hidden state time series data corresponding to the model input data.
[0057] The first fully connected layer and the fusion layer are used to fuse the model input data and the hidden state time series data to obtain fusion data.
[0058] The encoding and decoding module is used to obtain the model prediction data corresponding to the model input data based on the fusion data by using the multi-attention relative position encoding method.
[0059] The second fully connected layer is used to output the model prediction data.
[0060] In another exemplary embodiment, the relative position encoding formula includes relative position encoding for even dimensions and relative position encoding for counting dimensions.
[0061] The relative position encoding formula for even dimensions is:
[0062]
[0063] The relative position encoding formula for odd dimensions is:
[0064]
[0065] where r is the relative position, i.e., the distance r between two positions ij = j - i, representing the relative distance between position j and position i; k is the dimension index of the position encoding, indicating the k-th dimension of the position encoding in the model, and the value range of k is 0 <= k < d model / 2; dmodel is the dimension of the model, i.e., the dimension of the encoding vector for each position; 10000 is a constant that determines the frequency range of the position encoding, which ensures that smaller relative positions correspond to larger frequencies, while larger relative positions correspond to smaller frequencies.
[0066] In another exemplary embodiment, the encoding and decoding module includes an encoder and a decoder.
[0067] The encoder includes a first embedding layer, a first relative position encoding layer, a first multi-head relative position encoding self-attention mechanism layer, a first feed-forward network, and a residual connection and layer normalization layer connected in sequence.
[0068] First embedding layer: The input features are first mapped to vectors of a fixed dimension through the first embedding layer.
[0069] First relative position encoding layer: Since the encoder-decoder itself does not consider the order of the input data, position encoding is added to the input embedding to retain the order information of the time series.
[0070] First multi-head relative position encoding self-attention mechanism layer: The purpose of calculating self-attention is to capture the relationships between various nodes in the input sequence. For each input vector, the attention scores are calculated through the following steps:
[0071] Calculate Query, Key, Value: The input vector generates Query, Key, and Value vectors through linear mapping.
[0072] Generate sparse attention: Through the self-attention mechanism, calculate the correlations between nodes at different positions (through the attention score matrix). Then, generate a sparse attention matrix, only retaining the most relevant part for the output, and replacing the rest with the average value.
[0073] Softmax and weighted summation: Calculate the weighted summation at each position to generate the final attention output.
[0074] The first feed-forward network (FFN): After the self-attention output, each position is further processed by a feed-forward neural network.
[0075] Residual connection and layer normalization layer: Each sub-layer adds the input through a residual connection and then performs layer normalization.
[0076] The decoder includes a second embedding layer, a second relative position encoding layer, a masked multi-head relative position encoding self-attention mechanism layer, a second multi-head relative position encoding self-attention mechanism layer, a second feed-forward network, and a linear layer connected in sequence.
[0077] The second embedding layer and the second relative position encoding layer are used for target sequence embedding and relative position encoding. Similar to the encoder, the input of the decoder (target sequence) will first go through embedding and position encoding.
[0078] Masked multi-head relative position encoding self-attention mechanism layer: The self-attention mechanism in the decoder is different from that in the encoder. To prevent the decoder from seeing future data, the self-attention mechanism in the decoder will be masked, that is, when calculating attention, future data is hidden.
[0079] The second multi-head relative position encoding self-attention mechanism layer: The decoder combines the information of the target sequence with the output of the encoder through cross-attention. The query comes from the input of the decoder, while the key and value come from the output of the encoder. The calculation process is similar to self-attention, but the goal is to integrate the context information of the encoder into the generation process of the decoder.
[0080] The second feed-forward neural network: After the attention output, it is further processed by the second feed-forward neural network.
[0081] The linear layer is used to generate the target sequence. The final output of the decoder will pass through a linear layer to obtain the predicted value at each time step and output the prediction result through Softmax.
[0082] The working principle of the time series prediction neural network model in the embodiments of this application is as follows:
[0083] Extract time series information: In the embodiments of this application, a long short-term memory network model is used to preprocess the original data. By modeling the time dependence between data, effective time series information is extracted from the input data. The output hidden state is processed through a fully connected layer and is residually connected with the original data in the fusion layer:
[0084] z t = Fusion(x t , FC(LSTM(x t , h t-1 )))
[0085] Among them, z t is the fusion data at time t, x t is the model input data at time t, representing the input time series features, Fusion() is the fusion layer, FC() is the first fully connected layer, LSTM() is the long short-term memory network model, and h t-1 is the hidden state time series data at time t-1, representing the long short-term memory network hidden state. Finally, the fused data is input into the encoder for further deep feature extraction and modeling.
[0086] As Figure 2 shown, the time series information extraction part uses the long short-term memory network to preprocess the original lithium-ion battery data. The long short-term memory network has memory units and can effectively capture the long-term dependencies in the time series data. In the embodiment of this application, the long short-term memory network is used to process the input dependency features and the time series data of the battery health state to extract effective time series information. The output hidden state is processed by the first fully connected layer, and the first fully connected layer can perform a linear transformation on the data to adjust the dimension and feature representation of the data. Then, in the fusion layer, the hidden state processed by the first fully connected layer is connected with the normalized original data in a residual connection. The role of the residual connection is to ensure the integrity of information transmission and avoid information loss during the processing. In this way, an output that fuses the time series information and the original data features is obtained, providing richer information for the subsequent encoding and decoding processes.
[0087] Perform time data encoding and decoding: Embed the fusion data obtained in the first part twice and map it to the target domain through one-dimensional convolution. The multi-head self-attention mechanism is used for data encoding and decoding, and relative position encoding is introduced during this process to supplement the time series information. The calculation method of the attention score is as follows:
[0088]
[0089] Among them, x i and x j respectively represent the feature vectors of the i-th and j-th time nodes in the input sequence; and are the feature embedding vectors of x i and x j respectively; R i-jrepresents the relative position encoding between the i-th and j-th time nodes, encoding information such as the relative distance between two positions; W q denotes the Query matrix, which is used to convert the input feature vector into a query vector and is used to calculate the similarity with other vectors in the attention mechanism; W k,E denotes the Key matrix W k the content-related part after decomposition, which is used to process the input feature embedding vector, and is multiplied to calculate the content-related attention score; W k,R denotes the Key matrix W k the relative position-related part after decomposition, which is used to process the relative position encoding R i-j and R i-j are multiplied to calculate the relative position-related attention score; u and v represent two new learnable parameter vectors. u is used to consider the importance of K from the content perspective, and v is used to consider the importance of K from the relative position perspective. This calculation method first decomposes W k into W k,E and W k,R , so that the input feature vector and the position encoding no longer share weights, thereby enhancing the model's adaptation ability at different information levels. In addition, relative position encoding is used instead of absolute position encoding, and two new learnable parameters u and v are introduced to replace the original U i T W q T , so that the importance of K can be considered from the content level, the time series level of the long short-term memory network, and the relative position level.
[0090] To reduce the computational complexity and further simplify, when simplifying the relative position encoding attention calculation formula, only the relative position encoding of key nodes is calculated, and the rest is filled with the mean value. Given that in time series data, not every two data points have a strong correlation, and some data points contribute little to the correlation and feature extraction of the overall data. Processing these data points will waste a lot of computing resources. We can find more critical data points as key nodes in the following way: First, randomly select a part of the data points from the time window, and then calculate the degree of association score between each data point and these randomly selected data points. For these scores of each data point, select the maximum value and the average value among them to calculate the difference. Then, arrange all the data points in descending order according to this difference, and select the data points with larger differences as key nodes. The remaining non-key nodes are replaced with the average value of the corresponding vectors of all data points. In theory, not all data points in time series data are equally important for the prediction result. Usually, some key data points carry more information and have a greater impact on the prediction. Therefore, only calculating the information of key nodes can effectively reduce the computational overhead without significantly losing key information. At the same time, filling non-key nodes with the mean value is a reasonable approximation. In time series data, adjacent data points often have a certain correlation and smoothness. Therefore, replacing non-key node information with the mean value can still retain the overall characteristics of the data to a certain extent while significantly reducing the computational complexity.
[0091]
[0092] Among them, M is the attention score, Q represents the query matrix, which is obtained by linearly transforming the input feature vector; K represents the key matrix, which is obtained by linearly transforming the input feature vector; K r represents the relative position key matrix, which is obtained from the relative position encoding result; U represents the learnable parameter matrix associated with the input feature vector, and V represents the learnable parameter matrix associated with the relative position encoding result; K p represents the relative position key matrix of key nodes, and the superscript T represents the transpose.
[0093] In the above formula, Q is used to calculate the similarity; K reflects the content information; K r represents the relative position key matrix, which incorporates the relative position information; U and V are respectively associated with the content and relative position level information; K p is used to reduce the computational amount. Q and K are generated by embedding and linearly transforming the input features; K r 、K p are obtained based on the position information encoding of the input features; while U and V are adjusted according to the input features and target values during the training process.
[0094] During the process of encoding and decoding the time data, the data after the extraction of timing information enters the time data encoding and decoding section. First, secondary data embedding is performed on the fused data. Data embedding can transform the data into a suitable feature space to facilitate better learning and processing by the model. The embedded data is mapped to the target domain through one-dimensional convolution. One-dimensional convolution can extract features from the data in the time dimension and capture the local features of the data in the time series. Then, a multi-head self-attention mechanism is used for data encoding and decoding. The multi-head self-attention mechanism can simultaneously focus on different parts of the data and extract data features from multiple perspectives. In this process, relative position encoding is introduced to supplement the timing information. Traditional absolute position encoding has deficiencies in dealing with the ultra-long-range early prediction task of lithium-ion batteries because the performance indicators of the battery are not only affected by the time series but also closely related to the previous state. Relative position encoding can eliminate information redundancy and focus on the relative time relationship between data points, thereby better mining the internal relationship of the battery health state data. When calculating the attention score, the present invention optimizes the calculation method and comprehensively considers the importance of K from the content level, the timing level of the long short-term memory network, and the relative position level. This calculation method significantly reduces the computational overhead while ensuring the prediction accuracy by only calculating the relative position encoding of the key nodes and filling the rest with the mean value.
[0095] Finally, the second fully connected layer outputs all the time prediction results of the current batch at one time, completing the iterative prediction process.
[0096] In the embodiments of the present application, relative position encoding is introduced to replace absolute position encoding for the following reasons:
[0097] First, from the perspective of data coupling and information redundancy, the time information extracted by the long short-term memory network is coupled to a certain extent with the position information provided by the absolute position encoding. During the charge and discharge stages of lithium-ion batteries, their performance indicators are not only affected by the time series but also closely related to the previous state. If absolute position encoding is still used, it will lead to redundant position information, while relative position encoding can eliminate this redundancy and focus on the relative time relationship between data points, thereby better mining the internal relationship of the data of the lithium-ion battery health state.
[0098] Second, in terms of the iterative prediction accuracy, the long-range battery health state prediction often relies on iterative calculations. In this case, the method of uniformly encoding the corresponding positions in different windows by absolute position encoding is not applicable. Relative position encoding can more accurately reflect the dynamic changes in the actual operation process of lithium-ion batteries. It can adaptively adjust the model's capture of time information according to the relative position relationship between the current data point and the surrounding data points, thereby reducing the accumulation of prediction errors and improving the prediction accuracy.
[0099] Third, in terms of modeling complex time patterns, during the aging process of lithium-ion batteries, the rate of capacity decay is not constant but shows different trends at different stages. Relative position encoding can capture the relative relationships between these trends more sensitively, providing the model with richer time position information, thereby improving the accuracy of battery health state prediction.
[0100] To illustrate the specific implementation process of the solution provided by the embodiments of the present application, the embodiments of the present application set the following examples.
[0101] The training set consists of data from two batteries, and the test set contains data from one battery. Each battery undergoes 200 charge-discharge cycles. We adopt a two-stage training and testing method to train two models: a single-variable dependent feature prediction model and a multi-variable autoregressive target feature prediction model.
[0102] Dependent feature prediction model: First, select the dependent features and divide the training data. In the experiment, the window length is set to 20, the prediction length is 10, and the batch size is 8. Therefore, the shape of each training data batch_x is [8, 20, 1], and the shape of the prediction result is [8, 10, 1]. Starting from the starting position, the first training data consists of the data of the 1st - 20th cycles, and the output is the data of the 21st - 30th cycles. The window moves backward by one cycle each time. The last training data is the data of the 171st - 190th cycles, and the output is the data of the 191st - 200th cycles. One battery can generate 171 training data, and two batteries can generate a total of 342 training data for the training process.
[0103] In the test stage, input the dependent feature data of the first 20 cycles of the test battery. The model predicts the dependent feature data of the 21st - 30th cycles. Then add the prediction result to the initial 20-cycle data to form window1. Subsequently, input the values of the 11th - 30th cycles in window1 into the model, and the model outputs the prediction results of the 31st - 40th cycles. Continuously add these prediction results to window1. Repeat this iterative process until the prediction of 200 cycles is completed. Finally, window1 stores the true values of the first 20 rounds and the iterative prediction values of the last 180 rounds of the dependent features.
[0104] Multi-variable autoregressive target feature prediction model: During the training process, the shape of each training data batch_x is [8, 20, 2], where the last dimension 2 represents the dependent feature and the battery health state. The training method is the same as that of the single-variable prediction model.
[0105] During the testing process, the true values of the dependent features and the battery health state for the first 20 cycles of the test battery are input. The model outputs the predicted battery health state values for the 21st - 30th cycles. These predicted battery health state values are concatenated with the predicted values of the dependent features for the 21st - 30th cycles in window1 and stored in window2. This step is repeated until the prediction for 200 cycles is completed. Finally, by taking [:,:,-1] of window2, the true values of the first 20 cycles and the iterative predicted values of the last 180 cycles of the battery health state are obtained, which are used to calculate the mean squared error, mean absolute error, mean absolute percentage error, and coefficient of determination.
[0106] According to the specific embodiments provided by the present invention, the following technical effects are disclosed:
[0107] An embodiment of the present invention provides a method and system for ultra-long-range early prediction of the health state of a lithium-ion battery based on a long short-term memory network and relative position encoding. The method uses a long short-term memory network to extract temporal information and combines it with relative position encoding to model complex ultra-long-range temporal data. By optimizing the calculation of the attention score and comprehensively considering the temporal information extracted by the long short-term memory network and the relative position encoding information, not only is unified modeling made possible, but also the error accumulation in the iterative prediction of ultra-long-range temporal data can be effectively reduced. The adoption of a two-stage training strategy solves the problem that it is difficult for single-variable prediction to fit the battery health state curve with significantly different data distributions, and improves the accuracy of ultra-long-range early prediction of the health state of lithium-ion batteries. At the same time, the simplification of the attention score calculation balances the computational complexity and prediction performance on the premise of ensuring the prediction accuracy, making the model more feasible and efficient in practical applications.
[0108] In an exemplary embodiment, a system for predicting the health state of a lithium-ion battery is provided. The system for predicting the health state of a lithium-ion battery applies the method for predicting the health state of a lithium-ion battery in the above embodiment. The system for predicting the health state of a lithium-ion battery includes:
[0109] A monitoring data acquisition module, configured to obtain the original temporal data of the dependent features of the experimental lithium-ion battery as the first original temporal data and the original temporal data of the health state of the experimental lithium-ion battery as the second original temporal data based on the full-life cycle monitoring data of the experimental lithium-ion battery; the dependent feature is a data feature whose correlation coefficient with the health state is greater than the correlation threshold;
[0110] A model training module, configured to train a temporal prediction neural network model using the first original temporal data and the second original temporal data respectively to obtain a dependent feature prediction model and a multi-variable autoregressive target feature prediction model;
[0111] An initialization module, configured to obtain the original time-series data of the dependent features and the original time-series data of the health state of the lithium-ion battery to be tested, and construct the initial dependent feature input data and the comprehensive feature input data;
[0112] A dependent feature prediction module, configured to input the dependent feature input data into the dependent feature prediction model to obtain dependent feature prediction data;
[0113] A health state prediction module, configured to input the comprehensive feature input data into a multi-variable autoregressive target feature prediction model to obtain health state prediction data;
[0114] A data update module, configured to update the dependent feature input data at the current prediction time step by using the dependent feature prediction data at the current prediction time step, and update the comprehensive feature input data at the current prediction time step by using the dependent feature prediction data and the health state prediction data at the current prediction time step, so as to obtain the dependent feature input data and the comprehensive feature input data at the next prediction time step, and return to the dependent feature prediction module until the health state prediction data indicates that the lithium-ion battery to be tested fails.
[0115] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope recorded in this specification.
[0116] Specific examples are used in this article to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application; at the same time, for those of ordinary skill in the art, according to the idea of the present application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present application.
Claims
1. A method for predicting the health status of a lithium-ion battery, characterized in that: include: Based on the full life cycle monitoring data of the experimental lithium-ion battery, original time series data of the dependency feature of the experimental lithium-ion battery is obtained as the first original time series data, and original time series data of the health state of the experimental lithium-ion battery is obtained as the second original time series data; the dependency feature is a data feature whose correlation coefficient with the health state is greater than a correlation threshold; The first original time series data and the second original time series data are used to train a time series prediction neural network model respectively to obtain a dependent feature prediction model and a multivariate autoregressive target feature prediction model; Obtaining original time series data of dependent features and original time series data of health status of the lithium-ion battery to be tested, and constructing initial dependent feature input data and comprehensive feature input data; Inputting the dependent feature input data into the dependent feature prediction model to obtain dependent feature prediction data; Inputting the comprehensive feature input data into a multivariate autoregressive target feature prediction model to obtain health status prediction data; The dependent feature prediction data of the current prediction time step is used to update the dependent feature input data of the current prediction time step, and the dependent feature prediction data and health status prediction data of the current prediction time step are used to update the comprehensive feature input data of the current prediction time step, to obtain the dependent feature input data and comprehensive feature input data of the next prediction time step, and return to the step of "inputting the dependent feature input data into the dependent feature prediction model to obtain the dependent feature prediction data", until the health status prediction data indicates that the lithium ion battery to be tested has failed.
2. The method for predicting the health status of a lithium-ion battery according to claim 1, characterized in that: The dependency features are obtained in the following manner: Based on the full life cycle monitoring data of the experimental lithium-ion battery, the correlation coefficient between the data characteristics and health status of the experimental lithium-ion battery is calculated; Data features whose correlation coefficients are greater than the correlation threshold are selected as dependent features.
3. The method for predicting the health status of a lithium-ion battery according to claim 1 or 2, characterized in that: When the number of dependent features is greater than the quantity threshold, the principal component analysis method is used to reduce the dimension of the original time series data of each dependent feature.
4. The method for predicting the health status of a lithium-ion battery according to claim 1, characterized in that: The method of respectively using the first original time series data and the second original time series data to train the time series prediction neural network model to obtain the dependent feature prediction model and the multivariate autoregressive target feature prediction model specifically includes: The first original time series data and the second original time series data are divided into the same time window and the same sliding step, and the first original time series data of a time window is used as a first sample data to construct a first sample set, and the first original time series data and the second original data of a time window are used as second sample data to construct a second sample set; the time window is composed of an input time window and a prediction time window, the first original time series data of the input time window in the first sample data is the model input data, the first original time series data of the prediction time window in the first sample data is the label, the first original time series data and the second original time series data of the input time window in the second sample data are the model input data, and the second original time series data of the prediction time window in the second sample data is the label; Using the first sample set to train the time series prediction neural network model to obtain the dependent feature prediction model; The time series prediction neural network model is trained using the second sample set to obtain the multivariate autoregressive target feature prediction model.
5. The method for predicting the health status of a lithium-ion battery according to claim 4, characterized in that: The time series prediction neural network model is trained using the first sample set, and the loss function used in the process of obtaining the dependent feature prediction model is: one or more of mean square error, mean absolute error, mean absolute percentage error and determination coefficient; The time series prediction neural network model is trained using the second sample set, and the loss function used in the process of obtaining the multivariate autoregressive target feature prediction model is: one or more of mean square error, mean absolute error, mean absolute percentage error and determination coefficient.
6. The method for predicting the health status of a lithium-ion battery according to claim 5, characterized in that: The time series prediction neural network model includes: a long short-term memory network model, a first fully connected layer, a fusion layer, a coding and decoding module, and a second fully connected layer connected in sequence; The long short-term memory network model is used to extract time series information from the model input data to obtain hidden state time series data corresponding to the model input data; The first fully connected layer and the fusion layer are used to perform residual connection on the model input data and the hidden state time series data to obtain fused data; The encoding and decoding module is used to obtain model prediction data corresponding to model input data based on fusion data by adopting multi-head attention relative position encoding; The second fully connected layer is used to output the model prediction data.
7. The method for predicting the health status of a lithium-ion battery according to claim 6, characterized in that: The formula for the fusion data is expressed as: z t =Fusion(x t ,FC(LSTM(x t ,h t-1 ))); Among them, z t is the fused data at time t, x t is the model input data at time t, Fusion() is the fusion layer, FC() is the first fully connected layer, LSTM() is the long short-term memory network model, and h t-1 is the hidden state time series data at time t-1.
8. The method for predicting the health status of a lithium-ion battery according to claim 6, characterized in that: The encoding and decoding module includes an encoder and a decoder; The encoder comprises a first embedding layer, a first relative position encoding layer, a first multi-head relative position encoding self-attention mechanism layer, a first feedforward network and a residual connection and layer normalization layer connected in sequence; The decoder includes a second embedding layer, a second relative position encoding layer, a masked multi-head relative position encoding self-attention mechanism layer, a second multi-head relative position encoding self-attention mechanism layer, a second feedforward network and a linear layer connected in sequence.
9. The method for predicting the health status of a lithium-ion battery according to claim 8, characterized in that: The calculation formula for the attention score of the first multi-head relative position encoding self-attention mechanism layer is: Where M is the attention score, Q is the query matrix, which is obtained by linearly transforming the input feature vector; K is the key matrix, which is obtained by linearly transforming the input feature vector; K r represents the relative position key matrix, which is obtained through the relative position encoding result; U represents the learnable parameter matrix associated with the input feature vector, and V represents the learnable parameter matrix associated with the relative position encoding result; K p It represents the key matrix of relative positions of key nodes, and the superscript T represents transpose.
10. A lithium-ion battery health status prediction system, characterized in that: The lithium-ion battery health status prediction system applies the lithium-ion battery health status prediction method according to any one of claims 1 to 9, and the lithium-ion battery health status prediction system comprises: A monitoring data acquisition module, for acquiring original time series data of a dependency feature of the experimental lithium-ion battery based on the full life cycle monitoring data of the experimental lithium-ion battery as first original time series data, and acquiring original time series data of a health state of the experimental lithium-ion battery as second original time series data; the dependency feature is a data feature whose correlation coefficient with the health state is greater than a correlation threshold; A model training module, used to train a time series prediction neural network model using the first original time series data and the second original time series data respectively, to obtain a dependent feature prediction model and a multivariate autoregressive target feature prediction model; An initialization module, used to obtain the original time series data of the dependent characteristics and the original time series data of the health status of the lithium-ion battery to be tested, and to construct initial dependent characteristic input data and comprehensive characteristic input data; A dependency feature prediction module, used for inputting the dependency feature input data into the dependency feature prediction model to obtain dependency feature prediction data; A health status prediction module, used for inputting the comprehensive feature input data into a multivariate autoregressive target feature prediction model to obtain health status prediction data; A data updating module is used to update the dependent feature input data of the current prediction time step using the dependent feature prediction data of the current prediction time step, update the comprehensive feature input data of the current prediction time step using the dependent feature prediction data and health status prediction data of the current prediction time step, obtain the dependent feature input data and comprehensive feature input data of the next prediction time step, and return to the dependent feature prediction module until the health status prediction data indicates that the lithium-ion battery to be tested has failed.