Lithium battery capacity prediction method considering degradation stage characteristics
By constructing an LSTM model with embedded stage coding and introducing physical constraint terms, the problems of insufficient data matching accuracy and transfer effect in lithium battery capacity prediction are solved, achieving high-precision capacity prediction that is applicable to different batteries in service with both speed and accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-18
- Publication Date
- 2026-03-13
AI Technical Summary
Existing technologies for lithium battery capacity prediction suffer from problems such as low data matching accuracy, insufficient feature utilization, poor transfer effect, and poor final prediction accuracy. In particular, during the selection of test batteries that match the service batteries, the known capacity data of the service batteries are in the early degradation stage, while the test batteries have usually gone through the early, middle, and late degradation stages.
An LSTM prediction model based on embedded stage coding is adopted, which integrates battery degradation stage features and introduces physical constraints during training. Battery matching is performed through the dual Bacon-Watts method, and pre-training and fine-tuning are carried out using transfer learning. The prediction model is optimized by combining TWED distance filtering and physical penalty terms.
It improves the high consistency between the data source domain and the target domain, enhances the model's perception ability and prediction accuracy, improves the accuracy and adaptability of capacity prediction, and enhances the model's generalization ability.
Smart Images

Figure CN121656844A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of lithium battery capacity prediction, and more specifically to a lithium battery capacity prediction method that takes into account the characteristics of degradation stages. Background Technology
[0002] With the global energy structure transformation and low-carbon development, lithium batteries, with their outstanding advantages such as high energy density and environmental friendliness, have become core energy storage components in new energy vehicles, energy storage systems, and other fields. However, it is worth noting that during long-term cyclic use or storage, lithium batteries inevitably undergo irreversible chemical changes, such as the collapse of the positive electrode material structure, damage and reformation of the negative electrode SEI film, and electrolyte decomposition. This leads to a gradual decline in battery capacity, directly affecting the device's range, operational safety, and overall lifespan. Accurately predicting the capacity degradation pattern of lithium batteries is a crucial foundation for conducting battery state of health (SOH) assessments, estimating remaining useful life (RUL), and developing battery cascade utilization and recycling programs. It plays a vital role in ensuring safe equipment operation, optimizing battery management strategies, and reducing total lifecycle costs.
[0003] Currently, existing technologies have conducted extensive research on the laws governing battery capacity degradation and have made some progress in the application of transfer learning. However, there are still shortcomings in the practical application of transfer learning for battery capacity prediction: In selecting test batteries to match service batteries, existing solutions often use the full lifecycle capacity data of the test batteries to match the service batteries, without considering that the known capacity data of service batteries often indicates an early degradation stage, while test batteries typically have already experienced early, middle, and late degradation stages. This matching method may lead to a low feature matching degree between the two, thus affecting the accuracy of the prediction model. Furthermore, when constructing the prediction model, targeted extraction and in-depth analysis of the stage-specific characteristics exhibited during the battery capacity degradation process are not performed. Summary of the Invention
[0004] The main objective of this invention is to provide a lithium battery capacity prediction method that takes into account the characteristics of the degradation stage, thereby solving the technical problems of low data matching accuracy, insufficient feature utilization, poor transfer effect and poor final prediction accuracy in the prior art.
[0005] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is: a lithium battery capacity prediction method taking into account the characteristics of degradation stages, comprising the following steps: S1: Obtain the capacity data of the test battery and the service battery, and perform battery matching based on the capacity data of the test battery and the service battery; S2: Construct a prediction model based on LSTM with embedded stage coding. The model integrates battery degradation stage features and introduces physical constraints based on the physical laws of battery degradation during training. S3: Using transfer learning, the model is pre-trained using matched test battery data, and the pre-trained model is fine-tuned based on in-service battery data. S4: Predict the full life cycle capacity of the battery using the fine-tuned model.
[0006] In the preferred embodiment, step S1, which involves matching batteries based on capacity data of the test battery and the service battery, is a phased matching of test batteries based on the twist edit distance, including: S11: Collect the capacity data of the test batteries from the same batch as the batteries to be predicted for service, and use the dual Bacon-Watts method to detect the inflection point of the capacity degradation process of the test batteries throughout their entire life cycle, dividing it into three degradation stages: early, middle and late. S12: Based on early capacity degradation data of the test battery, a two-step screening criterion that takes into account the degradation stage is used to quantitatively evaluate and determine the test battery with the highest matching degree with the service battery.
[0007] In the preferred scheme, the double Bacon-Watts method is specifically as follows: The early and mid-stage inflection points p and the mid-stage and late-stage inflection points q are obtained by fitting with the least squares method, and then p and q are obtained by rounding down. This approximates the integer cycle corresponding to the two inflection points in the capacity degradation process. The double Bacon-Watts expression is as follows: ; In the formula, c 1 represents the initial capacity. p * , q * Initialize to 0.3 respectively. N and 0.7 N , α 1 represents the linear degradation slope. α 1. α 2. Controlling nonlinear changes; γ A scale factor to control the smooth transition of the degradation stage; Z The random disturbance term is of zero mean and normally distributed.
[0008] In the preferred embodiment, the two-step screening criteria in S12 are specifically as follows: Step 1: Perform initial screening based on the TWED distance δ of the capacity sequence. Calculate the TWED distance δ between the capacity sequence of the service battery and the early capacity sequence of each test battery. Sort the distance indicators in ascending order and select the top five test batteries with the smallest distance. Step 2: Based on the TWED distance ζ of the capacity degradation rate sequence, perform a second screening, calculate the TWED distance ζ between the capacity degradation rate sequence of the service battery and the degradation rate sequence of the test battery selected in the first screening, and select the optimal test battery as the matching battery based on the minimum value of the distance ζ. The TWED distance recursive formula is as follows: ; In the formula: Let TWED be the distance between the first p elements in A and the first q elements in B; Operational penalty term; hyperparameter and For more information, please refer to the references.
[0009] In the preferred embodiment, in step S2, the model integrates battery degradation stage characteristics, including: S21: Encode the battery capacity degradation stage by inputting the initial encoded features into a multilayer perceptron pooling to generate stage encoded features; S22: Embed the pooled stage coding features into the input layer of the improved LSTM unit, enabling the LSTM to simultaneously capture capacity temporal information and stage features. The specific formula is as follows: ; In the formula, f t , i t , o t , C t These are the outputs of the forget gate, input gate, output gate, and update gate, respectively. S23: Build a prediction model with two layers of improved LSTM and two layers of fully connected layers, and introduce a physical penalty term into the loss function.
[0010] In the preferred embodiment, the encoding of the battery capacity degradation stage in S21 specifically involves: Define a phase identifier vector g and a relative cyclic vector r, where: including: The expression for the stage identifier vector g is: ; In the formula, the underlined notes indicate the number of iterations for each code; The expression for the relative cyclic vector r is: ; Normalize the stage codes: Will g The inner elements are mapped to the interval [-0.5, 0.5]. The relative cyclic vector r is divided into r1, r2, and r3 according to different stage identifiers, and each is normalized using the following formula: ; In the formula, l g for r The maximum values of the elements in each stage are as follows: p , q - p , N - q ; remember The normalized vectors are concatenated as follows: Together, they serve as inputs to the MLP; The model output is: ; In the formula: W 1. W 2 is the weight matrix. b 1. b 2 represents the bias terms, all of which are learnable parameters; σ This represents the linear rectifier function.
[0011] In the preferred embodiment, the improved LSTM unit in S22 is specifically as follows: The pooled stage coding features are combined with the input gating signal from the previous time step. i t-1 Feature fusion is performed, and the features are jointly passed to the update gate for computation. The gating mechanism formula is as follows: ; In the formula, f t , i t , o t , C t σ represents the outputs of the forget gate, input gate, output gate, and update gate, respectively; W and b are the weight matrix and bias term, respectively; and σ is the sigmoid function.
[0012] In the preferred embodiment, the physical penalty term in S23 is configured to penalize prediction results that do not conform to the capacity accelerated degradation characteristics, specifically as follows: A series of rolling subsequences of increasing length are generated based on the predicted capacity sequence. A quadratic function is fitted to each subsequence to obtain the coefficients of the quadratic term. a t ; like a tA value less than 0 indicates that the prediction capacity exhibits accelerated degradation, and no penalty is applied; otherwise, a penalty term is introduced. ; The loss function that takes into account the accelerated degradation characteristics can be expressed as: ; In the formula: θ These are the parameters used to balance the two constraints; in, L mse To predict the mean squared error, the formula is as follows: ; The formula is given, where θ is the equilibrium parameter.
[0013] In the preferred embodiment, step S3 employs transfer learning, pre-training the model using matched test battery data, and fine-tuning the pre-trained model based on in-service battery data, including: S31: The model is pre-trained by using test battery capacity data that matches the service battery and combining it with the stage encoding of the embedded neural network prediction model. S32: Using known service battery capacity data, retrain the pre-trained model and fine-tune the parameters to adapt the model to the service battery.
[0014] In the preferred embodiment, the parameter fine-tuning in S32 introduces the maximum mean difference as a domain adaptive regularization term, with the following formula: ; In the formula: X and Y These are features obtained by mapping the capacity of the test battery and the service battery through the first fully connected layer, respectively. N and M For the length of the feature sample, φ Let be the mapping function; where, Ψ The Gaussian kernel function has the following formula: ; In the formula: μ is the width parameter of the Gaussian kernel function; Total loss during the fine-tuning phase It can be represented as: ; In the formula, L MMD For cross-domain regular expressions, parameters β This is the weighting factor.
[0015] This invention provides a lithium battery capacity prediction method that takes into account degradation stage characteristics, comprising: S1: acquiring capacity data of test batteries and service batteries, and performing battery matching based on the capacity data of the test batteries and service batteries; S2: constructing a prediction model based on LSTM with embedded stage coding, wherein the model integrates battery degradation stage characteristics and introduces physical constraints based on the physical laws of battery degradation during training; S3: using transfer learning, pre-training the model with the matched test battery data, and fine-tuning the pre-trained model based on service battery data; S4: using the fine-tuned model to predict the full life cycle capacity of the service battery; improving the high consistency between the data source domain and the target domain, overcoming the problem of poor transfer effect caused by large differences in data distribution in traditional full life cycle matching methods, enhancing the model's perception ability and prediction accuracy, improving the physical rationality and credibility of the model output results, improving the speed and accuracy of adapting to different service batteries, improving generalization ability, and improving the accuracy of capacity prediction. Attached Figure Description
[0016] The present invention will be further described below with reference to the accompanying drawings and embodiments: Figure 1 This is a flowchart of the lithium battery capacity prediction method that takes into account the characteristics of the degradation stage in this invention. Figure 2 This is a flowchart illustrating the phased matching of test batteries based on twist edit distance in this invention; Figure 3 This is a diagram of the improved LSTM unit structure for embedding stage coding in this invention; Figure 4 This is a graph showing the generation of physical loss subsequences in this invention; Figure 5 This is a flowchart illustrating the process of using transfer learning in this invention to predict the full lifecycle capacity of a battery in service. Figure 6 This is a batch classification diagram of a portion of the battery capacity data in the dataset of this invention; Figure 7 The results are the predictions for each in-service battery based on the method proposed in this invention. Detailed Implementation
[0017] Example 1 like Figure 1-7 As shown, a lithium battery capacity prediction method that takes into account degradation stage characteristics includes the following steps: S1: Obtain the capacity data of the test battery and the service battery, and perform battery matching based on the capacity data of the test battery and the service battery.
[0018] S2: Construct a prediction model based on LSTM with embedded stage coding. The model integrates battery degradation stage features and introduces physical constraints based on the physical laws of battery degradation during training.
[0019] S3: Using transfer learning, the model is pre-trained using matched test battery data, and the pre-trained model is fine-tuned based on in-service battery data.
[0020] S4: Predict the full life cycle capacity of the battery using the fine-tuned model.
[0021] This embodiment acquires capacity data from test batteries and service batteries, performs battery matching based on the corresponding data, constructs a prediction model based on embedded stage coding of LSTM, introduces physical constraints, and uses transfer learning to pre-train the model using the matched test battery data, followed by fine-tuning. Finally, the fine-tuned model is used to predict the full life-cycle capacity of the service battery. This improves the high consistency between the data source domain and the target domain, overcomes the problem of poor transfer effect caused by large differences in data distribution in traditional full life-cycle matching methods, enhances the model's perception ability and prediction accuracy, improves the physical rationality and credibility of the model's output results, improves the speed and accuracy of adapting to different service batteries, enhances generalization ability, and improves the accuracy of capacity prediction.
[0022] This embodiment describes the capacity prediction function in detail according to the steps.
[0023] Step S1: Test battery phase matching based on Twist Edit Distance (TWED).
[0024] like Figure 2 As shown, the specific method for phased matching of test batteries based on distortion edit distance is as follows: S11: Collect the capacity data of test batteries from the same batch as the batteries to be predicted for service, and record the maximum number of cycles for a certain test battery as... N The time series of capacity changes with the number of iterations is as follows: C =( c 1, c 2,…, c N ).in, c i For the first i ( i =1,2,…, N The battery capacity was tested during the [number]th cycle. Record the [number]th cycle. p * The second cycle serves as an inflection point in the early and middle stages of capacity degradation. q *The next cycle serves as the inflection point between the middle and late stages of capacity degradation. The double Bacon-Watts method is applied, and the result is obtained through least squares fitting. p * , q * And then round down to get p , q This approximates the integer cycles corresponding to the two inflection points in the capacity degradation process. The battery capacity sequences tested can be divided into early capacity sequences. C 1=( c 1, c 2,…, c p ), medium-term capacity sequence C 2=( c p+1 , c p+2 ,…, c q ) and end-stage capacity sequence C 3=( c q+1 , c q+2 ,…, c N ).
[0025] Repeat the above steps to achieve the desired result. K The capacity sequences of the test batteries were divided into stages to obtain the early, middle, and late capacity sequences of each group of test batteries. Ck 1. Ck 2. Ck 3, of which, k =1,2,…, K The double Bacon-Watts expression is as follows: ; In the formula, c 1 represents the initial capacity. p * , q * Initialize to 0.3 respectively. N and 0.7 N , α 1 represents the linear degradation slope. α 1. α 2. Controlling nonlinear changes. γ A scale factor to control the smooth transition of the degradation stage. Z The random disturbance term is of zero mean and normally distributed.
[0026] S12: Calculate the TWED distance between the test battery and the service battery based on capacity and capacity degradation rate. δ and ζ The degradation rate is approximately equal to the difference in capacity between adjacent cycles. The TWED distance recursive formula is as follows: ; In the formula: Let TWED be the distance between the first p elements in A and the first q elements in B; This is a penalty item for operations. Hyperparameters. and For more information, please refer to the references.
[0027] Two-step screening process for test batteries: 1) Based on distance δ The initial screening was conducted. The service battery capacity sequence was calculated separately. C * Early capacity sequence of each tested battery Ck TWED distance between 1 δ ,get K After determining the distance index of the test batteries, sort the index in ascending order and select the top five test batteries with the smallest distance index for the next screening step.
[0028] 2) Based on distance ζ Further filtering is performed. The difference in capacity between two consecutive cycle numbers in the capacity sequence yields the service battery capacity degradation rate sequence. S * =( c* 2- c* 1, c* 3- c* 2,…, c* M - c* M-1 ), and the five sets of test battery degradation rate sequences selected in the initial screening. S 1, S 2,…, S 5. Calculate separately S * and S 1, S 2,…, S 5 TWED distance ζ After obtaining the distance indicators of 5 sets of test batteries, the optimal battery sample is selected as the matching test battery based on the minimum distance indicator value.
[0029] Step S2: Construct an LSTM with embedded stage encoding and introduce physical constraint terms into the loss function.
[0030] Step S21: Encode the battery capacity degradation stage during testing, input the initial encoded features into MLP pooling, and realize feature dimensionality reduction and key information extraction.
[0031] After identifying the matching test batteries, stage coding is performed based on the stage division. g This is a stage identifier vector used to represent the degradation stage corresponding to each iteration number. r This is a relative cycle vector, representing the relative cycle position of each cycle number within its respective degradation stage. The specific encodings for both are shown below: ; In the formula, the underlined notes represent the number of iterations for each code.
[0032] ; When performing maximum-minimum normalization on the stage code, it can be g The inner elements are mapped to the interval [-0.5, 0.5]; while for r The value of an element is determined by the number of cycles in each stage, and the maximum value of an element in different stages may vary considerably.
[0033] If r Performing overall normalization will mask the encoding. r Some information needs to be based on r The stage identifiers corresponding to each element in the middle g ( g =1,2,3) are different, will r Divided into r 1. r 2. r 3. Then perform normalization.
[0034] ; In the formula, l g for r The maximum values of the elements in each stage are as follows: p , q - p , N - q .
[0035] remember The normalized vectors are concatenated as follows: Both serve as inputs to the MLP.
[0036] The model output is: ; In the formula: W 1. W 2 is the weight matrix. b 1. b 2 represents the bias terms, all of which are learnable parameters; σ This represents the linear rectifier function.
[0037] This embodiment introduces a dual Bacon-Watts inflection point detection model to achieve objective and quantitative stage division of the battery's full life cycle capacity degradation curve, accurately identify key inflection points in the early, middle and late stages, improve the accuracy of stage coding and precise matching, avoid the subjectivity of manual division, and improve the reliability and consistency of stage feature extraction.
[0038] Step S22: Embed the pooled stage coding features into the input layer of the improved LSTM unit, so that the LSTM can simultaneously capture capacity time-series information and stage features.
[0039] like Figure 3 As shown in the red dashed box, by adjusting the gating mechanism, the... We introduce LSTM-based gating computation and state update processes. Specifically, this involves encoding the degradation stage. It is not simply concatenated directly to the model input layer, but rather serves as a feature reflecting the degraded physical state inside the battery, along with the input gating signal from the previous time step. i t-1 After feature fusion, the features are jointly passed to the update gate for subsequent calculations. This connection design enables... By directly influencing the gating decisions through the weight matrices of the input gate, forget gate, and output gate, the model can proactively adjust its forgetting, input, and output strategies for key information in battery capacity time-series data based on the degradation stage encoding containing physical features, rather than passively relying on implicit, physically uninterpretable feature patterns in the time-series data.
[0040] The current design logic can be intuitively represented by the mathematical expressions in the second and third rows of the formula below. The working principle of the rest of the model is consistent with the traditional LSTM unit structure, and the specific formulas are as follows: ; In the formula, f t , i t , o t , C t These are the outputs of the forget gate, input gate, output gate, and update gate, respectively.
[0041] This embodiment constructs an improved LSTM model with embedded stage coding, enabling the prediction model to dynamically perceive battery degradation stages. It deeply integrates the pooled stage coding features with the LSTM gating mechanism. The model actively adjusts its processing strategy for capacity time-series information according to the different degradation stages of the battery, solving the problem that traditional models treat the degradation process as a "black box" or a homogenized process. This improves the precision and accuracy of obtaining the capacity degradation trajectory of the battery throughout its entire life cycle, enhancing the model's perception capability and prediction accuracy.
[0042] Step S23: Build a prediction model of "two-layer improved LSTM + two-layer fully connected layers" and introduce a physical penalty term into the loss function to ensure that the prediction conforms to the actual degradation law.
[0043] The model uses a batch training strategy, with the batch size set to [value missing]. H Within each batch, capacity data is arranged chronologically according to the number of battery cycles to ensure the temporal correlation of capacity degradation data. The model applies a sliding prediction method, taking the previous... T The capacity data from the previous cycle is input into the model in this paper to predict the capacity of the next cycle.
[0044] Taking a certain batch as an example, such as Figure 4 As shown in (a), the iterative prediction process is achieved by sliding the window. The green portion represents the input capacity data, and the orange portion represents the output predicted capacity. For the predicted values within this batch, they are integrated into a time-series prediction sequence based on the number of iterations, as follows: Figure 4 As shown in (b), a series of rolling subsequences of increasing length are generated in the order from top to bottom in the diagram. Figure 4 As shown in blue in (b), the first subsequence The second subsequence contains the predicted values from the first three cycles. Including the predicted values from the first 4 iterations, and so on, the last subsequence It includes the entire predicted sequence. I To predict the length of the sequence, a quadratic function is then fitted to each subsequence, and the coefficients of the quadratic term are solved using least squares. a t .
[0045] ; like a t A value less than 0 indicates that the predicted capacity within this batch exhibits accelerated degradation characteristics; conversely, a value greater than 0 indicates that the predicted capacity does not meet this characteristic and should be penalized.
[0046] The penalty items are designed as follows: .
[0047] Finally, the loss function that takes into account the accelerated degradation characteristics can be expressed as: ; In the formula: θ These are the parameters used to balance the two constraints. L mse To predict the mean square error.
[0048] L mse The formula is: .
[0049] This embodiment introduces a physical penalty term into the loss function to constrain prediction results that do not conform to the physical laws of accelerated capacity decay, thereby improving the physical rationality and credibility of the model output. In other words, it injects physical prior knowledge into the data-driven model, avoids the risk of violating common sense due to data noise or overfitting, and enhances the engineering practical value of the prediction results and the robustness of the model.
[0050] Step S3: Use transfer learning to predict the full life cycle capacity of the battery in service.
[0051] like Figure 5 As shown, the specific method for predicting the full life-cycle capacity of a battery using transfer learning is as follows: Step S31: Use the test battery capacity data that matches the service battery, and combine it with the stage encoding of the embedded LSTM to pre-train the model.
[0052] The battery capacity prediction model in this embodiment adopts a dual-input, single-output structure. Its core design lies in integrating two types of key input features: time-series capacity data and degradation stage codes. Specifically, the model is trained and its parameters are saved using the full life-cycle capacity data of the test battery (after being normalized to maximum and minimum values) and the corresponding stage codes, so that the model can initially learn the time-series patterns and stage correlation characteristics of capacity degradation.
[0053] Step S32: Using known service battery capacity data, retrain the pre-trained model and fine-tune the parameters to adapt the model to the service battery.
[0054] The weight parameters of the two LSTM layers in the saved pre-trained model are frozen, and it is retrained using partial in-service battery capacity data to fine-tune the trainable parameters of the model, serving as the base model for subsequent transfer learning. During the fine-tuning phase, the Mean Squared Error (MMD) is introduced as a domain-adaptive regularization term. MMD achieves corrected alignment and adaptive optimization of in-service battery features by comparing the distribution consistency between test batteries and in-service battery samples in the feature space, thereby reducing the impact of domain bias on prediction performance. The specific formula is: ; In the formula: X and Y These are features obtained by mapping the capacity of the test battery and the service battery through the first fully connected layer, respectively. N and M For the length of the feature sample, φ For mapping functions, Ψ This is the Gaussian kernel function.
[0055] Ψ calculation The formula is: ; In the formula: μ is the width parameter of the Gaussian kernel function.
[0056] Total loss during the fine-tuning phase It can be represented as: ; In the formula, L MMD This is a cross-domain regular expression. Parameters β This is a weighting factor used to balance the influence of target domain fitting and cross-domain alignment.
[0057] Step S4: Using the fine-tuned model, iteratively predict the future capacity of the battery in service using a sliding window approach until its entire lifespan is predicted. The battery capacity is predicted iteratively using the fine-tuned model, and the prediction accuracy is evaluated using three metrics: MAPE, MAE, and RMSE. The formulas are as follows: ; In the formula, It is the predicted capacity value. This is the actual capacity value. N It represents the number of loops.
[0058] ; ; Furthermore, the iterative prediction employs a sliding prediction method, specifically as follows: Input the capacity data from the previous T iterations into the model to predict the capacity for the next iteration.
[0059] Iterative prediction is achieved by sliding the window, generating an increasing-length rolling subsequence for calculating the physical penalty term.
[0060] This embodiment effectively addresses the distributional discrepancy between the source domain (test battery) and the target domain (service battery) by employing a two-stage transfer learning strategy and introducing a maximum mean difference (MMD) regularization term. The strategy first uses full-scale test battery data to teach the model general degradation patterns, then fine-tunes and adapts the model to the domain using a small amount of service battery data and MMD constraints. This achieves efficient knowledge transfer, enabling the model to quickly and accurately adapt to different service batteries and improving the method's generalization ability. Simultaneously, the use of a sliding window iterative prediction method ensures the consistency and practicality of the prediction process.
[0061] This embodiment collects a lithium battery dataset from accelerated aging tests conducted by MIT, which includes 124 lithium batteries undergoing cycle tests under fast charging conditions. Detailed specifications of the batteries used in the dataset can be found in Table 1.
[0062] Table 1 Battery Specifications
[0063] The capacity degradation curves of some lithium batteries in the dataset are as follows: Figure 6 As shown, the dataset can be divided into three batches, each defined by a "batch date". Different batches have different operating conditions in the experimental design.
[0064] In this embodiment, five groups of batteries were randomly selected from the battery dataset as the service batteries to be predicted. Then, the battery matching criteria proposed in this paper were applied to select test batteries that matched each service battery from 149 test battery groups. The specific matching results are shown in Table 2.
[0065] Table 2 Battery matching results
[0066] 068_CH38, 015_CH44, 002_CH34 and 067_CH41 were selected as service batteries, and their capacities were predicted using the model proposed in this invention. Figure 7 The prediction results for each in-service battery are shown. As can be seen, the capacity prediction curve closely matches the actual capacity curve. This observation indicates that the model of the present invention has high prediction accuracy.
[0067] To evaluate the effectiveness of the capacity prediction model proposed in this invention, three different methods are compared: WOA-VMD-LSTM, TL-CNN-AT, and WOA-VMD-LSTM. It is worth noting that, among the above models, only WOA-VMD-LSTM is a traditional non-transfer learning model, while the other two are transfer learning models.
[0068] This embodiment uses three prediction accuracy indicators, MAPE, MAE and RMSE, to calculate the prediction accuracy of the above three different capacity prediction methods for 068_CH38. The results are shown in Table 3.
[0069] Table 3 Capacity prediction error indices for different models
[0070] Table 3 shows that the model proposed in this embodiment outperforms the comparative models in all three metrics: MAPE, MAE, and RMSE. This fully demonstrates the significant advantages of the model in terms of prediction accuracy and applicability. Among them, the two transfer models, although not as good as the model in this paper, still show a certain level of accuracy, while WOA-VMD-LSTM performed the worst.
[0071] This embodiment proposes a transfer learning method that takes into account the characteristics of the degradation stage. Compared with existing models, its key inventive point is: (1) By applying the degradation stage division of dual Bacon-Watts and the TWED dual-dimensional screening mechanism, the test battery and the service battery were accurately matched, providing prior knowledge support for the subsequent model transfer process.
[0072] (2) Introduce physical constraint loss to make the model follow the physical constraints during training, thereby enhancing the reliability and physical interpretability of the model's prediction results.
[0073] (3) An LSTM network architecture with embedded stage coding was designed, which enables the network to effectively capture feature information of different degradation stages, optimize the information processing flow, and significantly improve the overall prediction performance of the model.
[0074] The above embodiments are merely preferred technical solutions of the present invention and should not be considered as limitations on the present invention. The scope of protection of the present invention should be limited to the technical solutions described in the claims, including equivalent substitutions of the technical features described in the claims. That is, equivalent substitutions and improvements within this scope are also within the scope of protection of the present invention.
Claims
1. A method for predicting the capacity of a lithium battery that takes into account the characteristics of the degradation stage, characterized in that, Includes the following steps: S1: Obtain the capacity data of the test battery and the service battery, and perform battery matching based on the capacity data of the test battery and the service battery; S2: Construct a prediction model based on LSTM with embedded stage coding. The model integrates battery degradation stage features and introduces physical constraints based on the physical laws of battery degradation during training. S3: Using transfer learning, the model is pre-trained using matched test battery data, and the pre-trained model is fine-tuned based on in-service battery data. S4: Predict the full life cycle capacity of the battery using the fine-tuned model.
2. The lithium battery capacity prediction method considering degradation stage characteristics according to claim 1, characterized in that, In step S1, the matching between batteries based on capacity data of the test battery and the service battery is a phased matching of test batteries based on the twist edit distance, including: S11: Collect the capacity data of the test batteries from the same batch as the batteries to be predicted for service, and use the dual Bacon-Watts method to detect the inflection point of the capacity degradation process of the test batteries throughout their entire life cycle, dividing it into three degradation stages: early, middle and late. S12: Based on early capacity degradation data of the test battery, a two-step screening criterion that takes into account the degradation stage is used to quantitatively evaluate and determine the test battery with the highest matching degree with the service battery.
3. The lithium battery capacity prediction method considering degradation stage characteristics according to claim 2, characterized in that, The aforementioned dual Bacon-Watts method is specifically as follows: The early and mid-stage inflection points p and the mid-stage and late-stage inflection points q are obtained by fitting with the least squares method, and then p and q are obtained by rounding down. This approximates the integer cycle corresponding to the two inflection points in the capacity degradation process. The double Bacon-Watts expression is as follows: ; In the formula, c 1 represents the initial capacity. p * , q * Initialize to 0.3 respectively. N and 0.7 N , α 1 represents the linear degradation slope. α 1. α 2. Controlling nonlinear changes; γ A scale factor to control the smooth transition of the degradation stage; Z The random disturbance term is of zero mean and normally distributed.
4. The lithium battery capacity prediction method considering degradation stage characteristics according to claim 2, characterized in that, The two-step screening criteria mentioned in S12 are as follows: Step 1: Perform initial screening based on the TWED distance δ of the capacity sequence. Calculate the TWED distance δ between the capacity sequence of the service battery and the early capacity sequence of each test battery. Sort the distance indicators in ascending order and select the top five test batteries with the smallest distance. Step 2: Based on the TWED distance ζ of the capacity degradation rate sequence, perform a second screening, calculate the TWED distance ζ between the capacity degradation rate sequence of the service battery and the degradation rate sequence of the test battery selected in the first screening, and select the optimal test battery as the matching battery based on the minimum value of the distance ζ. The TWED distance recursive formula is as follows: ; In the formula: Let TWED be the distance between the first p elements in A and the first q elements in B; Operational penalty term; hyperparameter and For more information, please refer to the references.
5. The lithium battery capacity prediction method considering degradation stage characteristics according to claim 1, characterized in that, In S2, the model integrates battery degradation stage characteristics, including: S21: Encode the battery capacity degradation stage by inputting the initial encoded features into a multilayer perceptron pooling to generate stage encoded features; S22: Embed the pooled stage coding features into the input layer of the improved LSTM unit, enabling the LSTM to simultaneously capture capacity temporal information and stage features. The specific formula is as follows: ; In the formula, f t , i t , o t , C t These are the outputs of the forget gate, input gate, output gate, and update gate, respectively. S23: Build a prediction model with two layers of improved LSTM and two layers of fully connected layers, and introduce a physical penalty term into the loss function.
6. The lithium battery capacity prediction method considering degradation stage characteristics according to claim 5, characterized in that, In step S21, the coding of the battery capacity degradation stage is specifically as follows: Define a phase identifier vector g and a relative cyclic vector r, where: including: The expression for the stage identifier vector g is: ; In the formula, the underlined notes indicate the number of iterations for each code; The expression for the relative cyclic vector r is: ; Normalize the stage codes: Will g The inner elements are mapped to the interval [-0.5, 0.5]. The relative cyclic vector r is divided into r1, r2, and r3 according to different stage identifiers, and each is normalized using the following formula: ; In the formula, l g for r The maximum values of the elements in each stage are as follows: p , q - p , N - q ; remember The normalized vectors are concatenated as follows: Together, they serve as inputs to the MLP; The model output is: ; In the formula: W 1. W 2 is the weight matrix. b 1. b 2 represents the bias terms, all of which are learnable parameters; σ This represents the linear rectifier function.
7. The lithium battery capacity prediction method considering degradation stage characteristics according to claim 5, characterized in that, The improved LSTM unit in S22 is specifically as follows: The pooled stage coding features are combined with the input gating signal from the previous time step. i t-1 Feature fusion is performed, and the features are jointly passed to the update gate for computation. The gating mechanism formula is as follows: ; In the formula, f t , i t , o t , C t σ represents the outputs of the forget gate, input gate, output gate, and update gate, respectively; W and b are the weight matrix and bias term, respectively; and σ is the sigmoid function.
8. The lithium battery capacity prediction method considering degradation stage characteristics according to claim 5, characterized in that, The physical penalty term mentioned in step S23 is configured to penalize prediction results that do not conform to the capacity accelerated degradation characteristics, specifically as follows: A series of rolling subsequences of increasing length are generated based on the predicted capacity sequence. A quadratic function is fitted to each subsequence to obtain the coefficients of the quadratic term. a t ; like a t A value less than 0 indicates that the prediction capacity exhibits accelerated degradation, and no penalty is applied; otherwise, a penalty term is introduced. ; The loss function that takes into account the accelerated degradation characteristics can be expressed as: ; In the formula: θ These are the parameters used to balance the two constraints; in, L mse To predict the mean squared error, the formula is as follows: ; The formula is given, where θ is the equilibrium parameter.
9. The lithium battery capacity prediction method considering degradation stage characteristics according to claim 1, characterized in that, In step S3, a transfer learning approach is employed to pre-train the model using matched test battery data, and then fine-tuning the pre-trained model based on in-service battery data, including: S31: The model is pre-trained by using test battery capacity data that matches the service battery and combining it with the stage encoding of the embedded neural network prediction model. S32: Using known service battery capacity data, retrain the pre-trained model and fine-tune the parameters to adapt the model to the service battery.
10. The lithium battery capacity prediction method considering degradation stage characteristics according to claim 9, characterized in that, In S32, the parameter fine-tuning introduces the maximum mean difference as a domain adaptive regularization term, with the following formula: ; In the formula: X and Y These are features obtained by mapping the capacity of the test battery and the service battery through the first fully connected layer, respectively. N and M For the length of the feature sample, φ For mapping functions; in, Ψ The Gaussian kernel function has the following formula: ; In the formula: μ is the width parameter of the Gaussian kernel function; Total loss during the fine-tuning phase It can be represented as: ; In the formula, L MMD For cross-domain regular expressions, parameters β This is the weighting factor.