A method for predicting the capacity of a retired battery based on an XGBoost algorithm

CN116593899BActive Publication Date: 2026-08-18安徽国麒科技有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310688140.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-12
Publication Date
2026-08-18
Estimated Expiration
2043-06-12

AI Technical Summary

Technical Problem

因其在使用过程中影响电池状态的因素太多,上述方法很难完全表达出来;另一方面,需对蓄电池进行多次的充电-静置-放电循环,耗时较长且受设备精度、空间环境等因素的影响分容结果的准确度无法保证,很难达到快速分容的目的

Benefits of technology

[0070] This invention significantly shortens the capacity assessment time by collecting partial charging data for feature extraction and model training. Verification using multiple sets of laboratory data shows that the model's average capacity prediction error is ≤1%. Utilizing the capacity prediction technology of this invention can greatly reduce initial one-time equipment investment and lower subsequent operating costs, as this technology significantly shortens the capacity assessment time and reduces charging and discharging energy consumption, thus saving on electricity costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116593899B_ABST
    Figure CN116593899B_ABST
Patent Text Reader

Abstract

The present application relates to a kind of methods for predicting the capacity of retired battery based on XGBoost algorithm, comprising the following steps: S1, the real-time current, voltage, capacity data of a plurality of retired battery cells during charging and discharging process are collected to construct features, and feature data set is obtained after screening, training set and validation set are constructed;S2, battery capacity prediction model is constructed based on improved XGBoost algorithm, the battery capacity prediction model constructed is trained according to training set and validation set, and the trained model is obtained;S3, for the retired battery cell to be predicted, the battery capacity of the retired battery cell is predicted using the trained model.The present application greatly shortens the capacity grading time by collecting part of the charging data for feature extraction and model training, and the average error of capacity prediction is ≤1%.The initial one-time equipment investment can be greatly reduced, and the operating cost will also be reduced in the later period.This method greatly shortens the capacity grading time, reduces the charging and discharging energy consumption, and saves the electricity cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of retired battery capacity prediction technology, specifically relating to a method for predicting the capacity of retired batteries based on the XGBoost algorithm. Background Technology

[0002] Typically, when the remaining capacity of a new energy vehicle's power battery drops to 70%-80% of its initial capacity, it can no longer meet the requirements for on-board use and becomes a retired battery. With the increasing number of new energy vehicles both domestically and internationally, the peak in the number of retired power batteries is approaching. However, after testing, screening, and reassembly, retired batteries still have the capability to be used in fields with lower battery performance requirements.

[0003] Predicting the capacity of retired batteries is a crucial step. Commonly used methods for battery capacity prediction include ampere-hour metering, open-circuit voltage (OCV) method, internal resistance method, and Kalman filtering method. These methods infer the remaining capacity of the battery by detecting certain parameters, such as voltage, current, and temperature. However, the capacity calculated by these methods is not linear with these parameters, and the relationship is complex. Furthermore, some parameters, such as battery capacity, are closely related to resting time and temperature. Because there are too many factors affecting the battery's state during use, these methods cannot fully represent them. On the other hand, multiple charge-rest-discharge cycles are required, which is time-consuming and the accuracy of the capacity assessment results cannot be guaranteed due to factors such as equipment precision and spatial environment, making it difficult to achieve rapid capacity assessment. Summary of the Invention

[0004] To address the problems in the background art, this invention proposes a method for predicting the capacity of retired batteries based on the XGBoost algorithm.

[0005] The present invention achieves the above objectives through the following technical solutions:

[0006] A method for predicting the capacity of retired batteries based on the XGBoost algorithm includes the following steps:

[0007] S1. Collect real-time current, voltage, and capacity data of multiple retired battery cells during charging and discharging processes from different sources to construct features. After filtering out the data, obtain the feature dataset and use it to construct the training set and validation set.

[0008] S2. Construct a battery capacity prediction model based on the improved XGBoost algorithm. Train the constructed battery capacity prediction model according to the training set and validation set to obtain a trained battery capacity prediction model. The improved XGBoost algorithm optimizes the loss function of the XGBoost algorithm based on the ASR optimization algorithm.

[0009] S3. For the battery cell to be retired, use the trained battery capacity prediction model to predict the battery capacity of the retired battery cell.

[0010] As a further optimization of the present invention, the feature construction in S1 is specifically as follows: in the constant current charging stage, the current value decreases by ΔI as the inflection point, and in the constant voltage charging stage, the voltage value decreases by ΔV as the inflection point, and the maximum slope of the curve, the area enclosed by the curve, the standard deviation, the kurtosis, the skewness, the extreme values, and the mean of the real-time data of current, voltage, and capacity are calculated.

[0011] As a further optimization of the present invention, the specific formulas for calculating the maximum slope of the curves, the area enclosed by the curves, the standard deviation, kurtosis, skewness, extreme values, and mean values ​​of the real-time data of current, voltage, and capacity are as follows:

[0012] Curve slope:

[0013] Area enclosed by the curve:

[0014] Standard deviation:

[0015] Kuroshi:

[0016] Skewness:

[0017] Where μ is the mean and σ is the variance.

[0018] As a further optimization of the present invention, the screening process in S1 is as follows:

[0019] The correlation coefficient is calculated using the following formula:

[0020]

[0021] Where COV(x,y) is the covariance. Let Variance be the variance; then, the variance inflation coefficient is calculated using the following formula:

[0022]

[0023] Features with vif < 10 are removed from the sample features to obtain the feature dataset.

[0024] As a further optimization of the present invention, the improved XGBoost algorithm in S2 is specifically as follows:

[0025] Step 2.1: Define the XGBoost objective function using the following formula:

[0026]

[0027] The first term of the objective function Let y represent the loss of the entire strong learner, where n represents the total number of samples, and y represents the loss of the entire strong learner. i ,y′ i These are the label value and predicted value of the i-th sample, respectively, and the second term... This represents the complexity of K weak learners in a strong learner;

[0028] The complexity of each weak learner can be expressed by the following formula:

[0029]

[0030] Where T in γT represents the number of leaf nodes in a tree, and γ is the adjustment coefficient λ||ω|| for this term. 2 In this context, ω represents the vector composed of the output values ​​of the leaf nodes, and λ is the adjustment coefficient for this term.

[0031] Step 2.2: Simplify the objective function using Taylor's formula.

[0032] Step 2.2.1, for Performing a second-order Taylor expansion, we obtain the following approximate formula:

[0033]

[0034] Among them, g i and h i These are the first and second derivatives of the loss function, respectively:

[0035]

[0036] The simplified result is:

[0037]

[0038] Then Ω(f) t Expand, and the result is as follows:

[0039]

[0040] Among them: g i h represents the first derivative for each sample. i Represents each sample Second derivative g i f t (x i ) represents the predicted value of the sample; T represents the number of leaf nodes; ||ω|| 2 The modulus of the vector composed of the values ​​of the leaf nodes;

[0041] g i ft (x i The predicted value of the sample is represented by ), which is converted into the following form:

[0042]

[0043] Where: ω j G represents the value of the j-th leaf node. i Represent the first derivative of each sample;

[0044] Step 2.2.2: Simplify the objective function

[0045] h is calculated according to the following formula i f t 2 (x i Convert to a leaf node:

[0046]

[0047] λ||ω|| 2 Since it is viewed from the perspective of a leaf, let's transform it into a different representation:

[0048]

[0049] Define f above t (x)=ω q(x) ,ωR T ,q:R d →{1, 2, ..., T},q represents a mapping relationship, i.e., the leaf node corresponding to each data sample, and I is defined. j ={i|q(x i )=j} represents the set to which a certain sample is mapped;

[0050] The revised formula is as follows:

[0051]

[0052] make:

[0053]

[0054] G i H represents the sum of the first derivatives of the samples. i This represents the sum of the second derivatives of the samples. When the loss function is determined, the result is obtained through calculation:

[0055]

[0056] At this point, the formula can be viewed as a quadratic function of ω with respect to the leaf node. Taking the derivative of ω and setting it equal to 0 yields the optimal value of ω. Substituting this value into the formula simplifies the above formula again.

[0057]

[0058] ω i Substituting these values ​​into the formula, we get:

[0059]

[0060] Step 2.3: Optimize the loss function of the XGBoost algorithm using the ASR optimization algorithm. Because the dataset L may be affected by noise, p is related to x. l The expected prediction can be expressed as:

[0061] p ~ (x l )=E[p(x l ;L)]

[0062] In the above formula, y l It's a collection of tags, y t It is x l The actual labels, L represents the dataset, p(x) l ;L) represents the model pair x l The prediction;

[0063] The expected generalization error can be expressed as:

[0064]

[0065] The average performance of p on the noisy dataset is calculated using Euclidean distance. The above formula can be decomposed as follows:

[0066]

[0067] In the above formula, E L [2(p(x l ;L)-p ~ (x l ))(p ~ (x l )-y t )]、E L [2((p ~ (x l )-y l )(y l -y t When expanded, all values ​​are 0;

[0068] After decomposition, the expected generalization error consists of three terms, where E L [((p(xl ;L)-p ~ (x l )) 2 E represents the prediction variance caused by the disturbance. L [((p ~ (x l )-y l ) 2 )] represents the deviation between the predicted expectation and the labels in the dataset; E L [((y l -y t ) 2 )] indicates noise in the label

[0069] The beneficial effects of this invention are as follows:

[0070] This invention significantly shortens the capacity assessment time by collecting partial charging data for feature extraction and model training. Verification using multiple sets of laboratory data shows that the model's average capacity prediction error is ≤1%. Utilizing the capacity prediction technology of this invention can greatly reduce initial one-time equipment investment and lower subsequent operating costs, as this technology significantly shortens the capacity assessment time and reduces charging and discharging energy consumption, thus saving on electricity costs. Attached Figure Description

[0071] Figure 1 This is a flowchart of the present invention. Detailed Implementation

[0072] The present application will now be described in further detail with reference to the accompanying drawings. It should be noted that the following specific embodiments are only used to further illustrate the present application and should not be construed as limiting the scope of protection of the present application. Those skilled in the art can make some non-essential improvements and adjustments to the present application based on the above application content.

[0073] Example 1

[0074] like Figure 1 As shown in this embodiment, a method for predicting the capacity of retired batteries based on the XGBoost algorithm includes the following steps:

[0075] Step 1: Training data collection. Data preprocessing is performed by setting filtering conditions such as the charging and discharging conditions of each retired battery cell must be complete and consistent, the capacity value in the discharged state must not be less than any real-time capacity value in the charging stage, and the number of records in the charging state must not be less than 50. Data sets that meet the requirements are then selected.

[0076] Step 2: Based on the real-time changes in charging current and voltage, during the constant current charging stage, the inflection point is determined by the decrease in current value ΔI or the decrease in voltage value ΔV during the constant voltage charging stage. The calculation formulas are as follows: The maximum slope of the real-time data curves for current, voltage, and capacity are calculated, along with relevant features such as the curve area, standard deviation, kurtosis, skewness, extreme values, and mean.

[0077] Formula for curve slope:

[0078] Formula for the area under a curve:

[0079] Standard deviation formula:

[0080] Kurtosis calculation formula:

[0081] Skewness calculation formula:

[0082] Where μ is the mean and σ is the variance.

[0083] Step 3: Use the variance inflation factor (VIF) correlation analysis method on the series of features generated in Step 2 to screen out relevant features with a VIF less than 10. The correlation calculation formula is as follows:

[0084]

[0085] Where COV(x,y) is the covariance. Let Variance be the variance; then, the variance inflation coefficient is calculated using the following formula:

[0086]

[0087] Step 4: The training set filtered in Step 3 is divided using the hold-out method, with 20% of the dataset used as the validation set and the remaining 80% used as the training set.

[0088] Step 5: Train the XGBoost+ASR optimization algorithm model using the training set from Step 4. The specific process is as follows:

[0089] Derivation of the XGBoost objective function

[0090]

[0091] The first term of the objective function represents the loss of the entire strong learner, where n represents the total number of samples, and y i ,y′ iThe first part represents the label value and the second part represents the predicted value of the i-th sample, respectively. The second part represents the complexity of the K weak learners in the strong learner. The complexity of each weak learner in XGBoost is mainly considered from two aspects:

[0092]

[0093] 1. In γT, T represents the number of leaf nodes in a tree, and γ is the adjustment coefficient for this term;

[0094] 2.λ||ω|| 2 In this context, ω represents the vector composed of the output values ​​of the leaf nodes, and λ is the adjustment coefficient for this term.

[0095] Solving the objective function directly is difficult, so we use Taylor expansion to give it an approximate representation. Next, we will... Performing a second-order Taylor expansion, we obtain the following approximate formula:

[0096]

[0097] Among them, g i and h i These are the first and second derivatives of the loss function, respectively:

[0098]

[0099] The simplified result is:

[0100]

[0101] Then Ω(f) t Expand, and the result is as follows:

[0102]

[0103] Among them: g i h represents the first derivative for each sample. i G represents the second derivative of each sample; i f t (x i ) represents the predicted value of the sample; T represents the number of leaf nodes; ||ω|| 2 The modulus of the vector composed of the values ​​of the leaf nodes;

[0104] g i f t (x i The ) represents the predicted value of the sample, which we convert to the following form:

[0105]

[0106] Where: ωj G represents the value of the j-th leaf node. i Represent the first derivative of each sample;

[0107] Simplify the objective function: h i f t 2 (x i The problem of converting a node into a leaf node is as follows:

[0108]

[0109] λ||ω|| 2 Since it is viewed from the perspective of a leaf, let's transform it into a different representation:

[0110]

[0111] Define f above t (x)=ω q(x) ,ωR T ,q:R d →{1, 2, ..., T},q represents a mapping relationship, i.e., the leaf node corresponding to each data sample, and I is defined. j ={i|q(x i )=j} represents the set to which a certain sample is mapped;

[0112] The revised formula is as follows:

[0113]

[0114] make:

[0115]

[0116] G i H represents the sum of the first derivatives of the samples. i This represents the sum of the second derivatives of the samples. When the loss function is determined, the result can be obtained through calculation:

[0117]

[0118] At this point, the formula can be viewed as a quadratic function of ω in one variable. By differentiating ω and setting it equal to 0, we can obtain the optimal value of ω. Substituting this value into the formula further simplifies the above formula:

[0119]

[0120] ω i Substituting these values ​​into the formula, we get:

[0121]

[0122] Considering that label values ​​may not be accurate during data collection, leading to significant bias in the final model training and affecting its generalization ability, the ASR optimization algorithm is used to optimize the loss function of the XGBoost algorithm. This effectively improves the label imbalance problem and enhances the model's generalization and accuracy. Bias-variance decomposition is used to intuitively analyze its impact on the model's generalization performance. Since the dataset L may be affected by noise, p is related to x. l The expected prediction can be expressed as:

[0123] p ~ (x l )=E[p(x l ;L)]

[0124] In the formula, y l It's a collection of tags, y t It is x l The true label, L represents the dataset p(x) l ;L) represents the model trained on L for x l The prediction.

[0125] The expected generalization error can be expressed as:

[0126]

[0127] The average performance of p on the noisy dataset is calculated using Euclidean distance. The above formula can be decomposed as follows:

[0128]

[0129] In the formula E L [2(p(x l ;L)-p ~ (x l ))(p ~ (x l )-y t )]、E L [2((p ~ (x l )-y l )(y k -y t After expansion, all values ​​are 0.

[0130] After decomposition, the expected generalization error consists of three terms; where E L [((p(x l ;L)-p ~ (x l )) 2 E represents the prediction variance caused by the disturbance. L [((p~ (x l )-y l ) 2 )] represents the deviation between the predicted expectation and the labels in the dataset; E L [((y k -y t ) 2 The )] represents noise in the labels. The ASR optimization algorithm minimizes the derivative of the objective function for each input sample, thereby reducing the first error; it balances the second error through λ weights to prevent overfitting. Therefore, the ASR optimization algorithm actually improves the model's generalization performance by reducing prediction variance and balancing prediction bias.

[0131] Step 6: Take the validation set from Step 4 and input it into the model trained in Step 5. Calculate the model accuracy by taking the mean absolute error (MAE) between the model's output value and the corresponding capacity labels in the validation set. The calculation formula is as follows:

[0132]

[0133] In the formula: n is the total number of samples; y′ i y is the predicted value of the frequency feature in the i-th sample; i This is the target value.

[0134] Step 7: Obtain the final capacity of the battery cell to be retired under discharge (D_CC) state, and the current, voltage, and capacitance data under charging (C_CV) state. Complete the feature construction of the data according to the relevant operations in Steps 1 to 4 above, and input it into the XGBoost algorithm model constructed in Step 5 for capacity prediction.

[0135] This method is based on an improved XGBoost algorithm. By collecting partial charging data for feature extraction and model training, the capacity prediction time is greatly shortened. The average error of the model's capacity prediction is ≤1% through verification of multiple sets of data in the laboratory.

[0136] The above-described embodiments are merely illustrative of several implementations of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention.

Claims

1. A method for predicting the capacity of retired batteries based on the XGBoost algorithm, characterized in that, Includes the following steps: S1. Collect real-time current, voltage, and capacity data of multiple retired battery cells during charging and discharging processes from different sources to construct features. After filtering out the data, obtain the feature dataset and use it to construct the training set and validation set. S2. Construct a battery capacity prediction model based on the improved XGBoost algorithm. Train the constructed battery capacity prediction model according to the training set and validation set to obtain a trained battery capacity prediction model. The improved XGBoost algorithm optimizes the loss function of the XGBoost algorithm based on the ASR optimization algorithm. S3. For the battery cell to be retired, use the trained battery capacity prediction model to predict the battery capacity of the retired battery cell. The improved XGBoost algorithm in S2 is specifically as follows: Step 2.1: Define the XGBoost objective function using the following formula: ; The first term of the objective function Let n represent the loss of the entire strong learner, where n represents the total number of samples. These are the label value and predicted value of the i-th sample, respectively, and the second term... This represents the complexity of K weak learners in a strong learner; The complexity of each weak learner can be expressed by the following formula: ; in, In This represents the number of leaf nodes in a tree. It is the adjustment coefficient for this item. In This represents a vector composed of the output values ​​of the leaf nodes. It is the adjustment coefficient for this item; Step 2.2: Simplify the objective function using Taylor's formula: Step 2.2.1, for Performing a second-order Taylor expansion, we obtain the following approximate formula: ; in, and These are the first and second derivatives of the loss function, respectively: ; The simplified result is: ; Then Expand, and the result is as follows: ; in: This represents the first derivative for each sample. This represents the second derivative for each sample; Represents the predicted value of the sample; Indicates the number of leaf nodes; The modulus of the vector composed of the values ​​of the leaf nodes; The predicted value of the sample is represented by the following form: ; in: Indicates the first The value of each leaf node Represent the first derivative of each sample; Step 2.2.2: Simplify the objective function: According to the following formula Convert to a leaf node: ; Since it is viewed from the perspective of a leaf, let's transform it into a different representation: ; Define the above , This represents a mapping relationship, namely, the leaf node corresponding to each data sample, and defines... This represents the set to which a given sample is mapped. The revised formula is as follows: ; make: ; This represents the sum of the first derivatives of the samples. This represents the sum of the second derivatives of the samples. When the loss function is determined, the result is obtained through calculation: ; At this point, the formula can be viewed as relating to the leaf nodes. A quadratic function in one variable, for Taking the derivative and setting it to 0, we get Find the optimal value, substitute it into the formula, and the above formula can be simplified again: ; Will Substituting these values ​​into the formula, we get: ; Step 2.3: Optimize the loss function of the XGBoost algorithm using the ASR optimization algorithm: Due to dataset It may be affected by noise, therefore right The expected prediction can be expressed as: ; In the above formula, These are collected tags. yes The real label, Represents a dataset, Represented as model pairs The prediction; The expected generalization error can be expressed as: ; Calculation using Euclidean distance The average performance on noisy datasets can be decomposed into the following formula: ; In the above formula , After expansion, all values ​​are 0; After decomposition, the expected generalization error consists of three terms, among which... The prediction variance caused by the disturbance; This represents the deviation between the predicted expectation and the labels in the dataset; This indicates noise in the label; The ASR optimization algorithm minimizes the derivative of the objective function for each input sample, thereby reducing the first error; it then uses λ weights to balance the second error to prevent overfitting.

2. The method for predicting the capacity of retired batteries based on the XGBoost algorithm according to claim 1, characterized in that, The feature construction in S1 is specifically as follows: in the constant current charging stage, the current value decreases by ∆I as the inflection point, and in the constant voltage charging stage, the voltage value decreases by ∆V as the inflection point. The maximum slope of the curve, the area enclosed by the curve, the standard deviation, the kurtosis, the skewness, the extreme values, and the mean of the real-time data of current, voltage, and capacity are calculated.

3. The method for predicting the capacity of retired batteries based on the XGBoost algorithm according to claim 2, characterized in that, The specific formulas for calculating the maximum slope, area enclosed by the curve, standard deviation, kurtosis, skewness, extreme values, and mean of real-time current, voltage, and capacity data are as follows: Curve slope: ; Area enclosed by the curve: ; Standard deviation: ; Kuroshi: ; Skewness: ; in: The mean, Let Variance be the variance.

4. The method for predicting the capacity of retired batteries based on the XGBoost algorithm according to claim 1, characterized in that, The screening process in S1 is as follows: The correlation coefficient is calculated using the following formula: ; in, For covariance, Let Variance be the variance; then, the variance inflation coefficient is calculated using the following formula: ; Screening sample features The features are used to obtain the feature dataset.

Citation Information

Patent Citations

  • Lithium battery residual life prediction method based on XGBoost algorithm

    CN111999649A

  • Evaluation method for health state of retired battery based on Bayesian deep learning

    CN115792680A