A method, device and medium for jointly estimating state of charge and health status of lithium battery
By combining least squares filtering and normalization processing with iTransFormer model and improved LSO algorithm, the problem of low prediction accuracy of lithium batteries is solved, and high-precision joint estimation of lithium batteries is realized. The battery is improved. Management system stability and security.
Patent Information
- Application Number
- CN202410489542.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-23
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2044-04-23
AI Technical Summary
In the prior art, the prediction accuracy of lithium batteries is not high and the stability is poor, making it difficult to effectively monitor and predict the charge and health status of lithium batteries.
The initial data is preprocessed by using the least squares filtering algorithm and normalization method. Combined with the iTransFormer model and the improved LSO algorithm, the search strategy is optimized and the model hyperparameters are realized. and joint estimates of health status.
It significantly improves the accuracy and stability of the lithium battery state of charge and health status estimation model, provides more accurate prediction of lithium battery health status, extends the battery life and improves safety.
Smart Images

Figure CN118393359B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of joint detection of the state of charge and health state of a lithium battery, and specifically designs a method, device and medium for joint prediction of the state of charge and health state of a lithium battery. Background Art
[0002] One of the core parameters of the battery management system (BMS) is the state of charge (SOC). BMS aims to prevent battery damage caused by overcharging or over-discharging while ensuring efficient operation of the battery by monitoring and estimating SOC. Accurate SOC estimation helps to make full use of the power provided by the battery, improve battery efficiency, and extend the life of the battery pack. SOH (State of Health) refers to the health state of the battery, which reflects the degree of performance and capacity of the battery relative to its initial state. SOH is usually expressed as a percentage. 100% SOH means that the battery performance and capacity are equivalent to a new battery, while a lower SOH value indicates the degree of battery performance and capacity degradation. The calculation of SOH is usually based on factors such as the number of charge and discharge cycles of the battery, the operating temperature, and the charge and discharge rate. By monitoring and analyzing the battery health state, we can understand the performance changes of the battery during actual use and provide a basis for battery maintenance. After understanding the battery health state, we can formulate corresponding management strategies for different batteries, such as adjusting the charging rate, the number of charging times, etc., so as to extend the battery life. Through real-time monitoring of the battery health status, potential safety hazards of the battery, such as overcharging, over-discharging, and increased temperature, can be discovered, and timely measures can be taken to avoid accidents.
[0003] To this end, the present invention provides a method for jointly estimating the state of charge and health state of a lithium-ion battery, which is suitable for predicting the state of charge and health state of a lithium battery working under different working conditions. The joint estimation integrates the state of charge and health state of a lithium battery in a specific way, aiming to obtain better results than single state prediction. This joint estimation method fully considers the internal chemical reactions during the battery operation process and can accurately simulate the dynamic response of the outside of the battery. This method is closer to reality and provides a new idea for predicting the health status of lithium batteries. Summary of the invention
[0004] Purpose of the invention: In order to solve the problem that the existing single prediction of lithium battery SOC has low prediction accuracy and poor stability, the present invention provides a method, device and medium for jointly predicting the state of charge and health state of a lithium battery, which significantly improves the accuracy of the estimation model of the state of charge and health state of a lithium battery.
[0005] Technical solution: A method for jointly predicting the state of charge and health status of a lithium battery according to the present invention comprises the following steps:
[0006] (1) Collecting initial battery data of lithium-ion batteries and preprocessing the initial data using a least squares filtering algorithm and a normalization method;
[0007] (2) The relationship between SOC and SOH is obtained according to the definitions of SOC and SOH, ensuring that the lithium battery state of charge estimation model can learn information about the battery health status during the training process;
[0008] (3) Construct a lithium battery state of charge estimation model based on iTransFormer, using the SOC value after considering the battery SOH as the data of the model training set;
[0009] (4) Improve the spectrum optimizer LSO algorithm, use the Logistic-Tent mapping method to optimize the population initialization, and use the adaptive adjustment search strategy to optimize the algorithm search phase to obtain the ILSO algorithm;
[0010] (5) Using the ILSO algorithm to optimize the hyperparameters of the lithium battery state of charge estimation model based on iTransFormer, the optimal hyperparameters are obtained, and the lithium battery state of charge is estimated using the optimized model to obtain the state result of the lithium battery state of charge;
[0011] (6) Using the SOC estimation value and the battery aging information contained in the model output in step (5), the SOH value at the current aging level is further calculated through the SOC and SOH joint estimation formula to achieve SOH estimation and realize the joint estimation of the lithium battery state of charge and health state.
[0012] Furthermore, the initial data in step (1) includes charge and discharge data, open circuit voltage, temperature, internal resistance, capacity, and operating current data.
[0013] Furthermore, in step (1), the initial data is preprocessed using the least squares filtering algorithm and the normalization method. The specific implementation process is as follows:
[0014] Take M points before and after a certain point in the lithium battery data to be processed, multiply these 2M+1 points by the coefficient, add them up, and then replace this point after averaging;
[0015] Assume that the j-th output of the least square sliding filter is:
[0016]
[0017] Where i = M + 1, ...; W i(k) is the smoothing coefficient; W(k) / (2M+1) is the weight based on the least square sliding filter algorithm; for each signal indicator for which an approximation must be found, a signal window is defined so that the relevant point is located in the center of the space, resulting in a window length of 2M+1;
[0018] The least square sliding filter algorithm is to fit the continuous (2M+1) data points (xi, yi) in the sampled data with a polynomial fitting of order d to obtain the filter value, and then move the window backward. The smoothed data Y is expressed in vector form:
[0019]
[0020] Assume the objective function is I, the least squares fitting is to minimize the sum of squares of the above formula, that is, to find the coefficients c of the polynomial that meet the conditions i ;
[0021]
[0022] Find the minimum value of the objective function, respectively for c0, c1, ..., c d Find the partial derivative, with respect to c m Find the partial derivative, and we get the following formula:
[0023]
[0024] Let each partial derivative be zero, and the matrix equation system is:
[0025]
[0026] This is equivalent to the equation:
[0027] S T Sc=S T y
[0028] Then the optimal solution is:
[0029] c=(S T S) ·l S τ y
[0030] Let matrix G be:
[0031] G=S(S T S) ·I S T =[g i-M ,g i-M+1 ,...,g i ,...,g i+M ]
[0032] Substituting the optimal solution into the smoothed data Y yields:
[0033] Y=Sc=S(S T S) -1 S T y=Gy
[0034] Then the filtered value of the i-th output is:
[0035]
[0036] From the filtered value outputted for the i-th time, it can be seen that the matrix G is equivalent to the matrix of the combination of W(k) / (2M+1) in the above formula, that is, the matrix G is the weight of the sliding average filtering algorithm;
[0037] Shift the filter window backward by one data point, that is, add a new sampling data point at the end of the window, and remove an old data point at the beginning of the window. The new data of the window is shown as follows:
[0038] y→[y i-M+1 ,y i-M+2 ,...,y i+1 ,...,y i+M+1 ] T
[0039] The data set obtained after the least squares filtering algorithm is normalized by z-score, specifically:
[0040]
[0041] Among them, y is the data to be normalized, y' is the normalized data, μ is the mean value of the data, and S is the standard deviation of the data.
[0042] Furthermore, the implementation process of step (2) is as follows:
[0043] SOC is defined as the ratio between the current remaining power of the battery and the actual capacity, calculated based on the power that the battery has released:
[0044]
[0045] In the formula, I represents the current, the integral of I on [0,1] represents the amount of electricity discharged by the battery, and C m is the actual capacity of the battery at present;
[0046] SOH is defined as the percentage of the actual capacity of the battery to the rated capacity:
[0047]
[0048] In the formula, C0 represents the rated capacity of the battery when it leaves the factory;
[0049] Combining SOC and SOH, we can get:
[0050]
[0051] From the combined formula, we know that there is a close connection between the battery state of charge and the health state. The estimation of SOC needs to consider the influence of SOH. To ensure that the battery SOC estimation model can learn the information of battery aging during the training process, the formula SOC2(t) is used to calculate the state of charge of lithium batteries.
[0052] Furthermore, the implementation process of step (3) is as follows:
[0053] The pre-processed lithium battery data is unitized, that is, J consecutive data collection points of each characteristic data of the lithium battery are taken as a group as input, the sampling time interval is preset, and the SOC value corresponding to each J data collection points is taken as output;
[0054] The multi-layer perceptron works on the last dimension, embedding the input lithium battery data sequence into the variable token:
[0055]
[0056] For the input time series, input length T, prediction length S, number of variables N, dimension D, iTransFormer block number L;
[0057] Run the iTransFormer module to apply self-attention to the embedded variable labeling:
[0058]
[0059] Feed-forward networks are used for sequence representation:
[0060]
[0061] The lithium battery characteristic series representation uses LayerNorm to reduce variable differences;
[0062] Back to the prediction sequence:
[0063]
[0064] Returns the lithium battery state of charge prediction result
[0065] Furthermore, the implementation process of step (4) is as follows:
[0066] (41) Set the population size of the LSO algorithm, as well as the upper and lower limits of the search space;
[0067] (42) Initialize the population position of the algorithm using the Logistic-Tent mapping method. The improved formula is as follows:
[0068]
[0069] Where P is the system variable and r is the control parameter;
[0070] Optimize the search phase of the algorithm using an adaptive adjustment search strategy. The improvement process is as follows:
[0071] An individual selects a random search update method according to the probability threshold H, and the probability threshold is defined as:
[0072]
[0073] Among them, represents the average fitness value of the current population; f min is the best fitness value in the current population; f max is the worst fitness value in the current population; for each individual, a random number q between [0,1] is numerically compared with the calculated probability threshold H; if q < H, the randomly selected individual p rand updates its position according to the formula, and the positions of other individuals remain unchanged; in the early stage of iteration, other individuals will update their positions according to the basic formula:
[0074] p rand = p jmin + r·(p jmax - p jmin )
[0075] Where r is a random number between [0,1]; p jmin and p jmax are the minimum and maximum values of the variable p rand respectively;
[0076] (43) After initialization, determine the internal refraction Internal reflection External refraction The normal vector is calculated as:
[0077]
[0078]
[0079]
[0080] Among them, is the solution randomly selected from the current population at iteration t, is the current solution at iteration t, is the global best solution ever found, norm(.) represents the normalized value of the vector and is calculated as follows:
[0081]
[0082] Where d represents the dimension of the optimization problem; is the input vector of the norm function, used to normalize it, x j is the input vector The jth dimension in ; for the incident ray, it is calculated as follows:
[0083]
[0084]
[0085] in is the incident light, X mean is the average value of the current solution population N is the population size;
[0086] Then, the vectors for the inner and outer refracted and reflected rays are calculated:
[0087]
[0088]
[0089]
[0090] in, and They are internal refraction, internal reflection and external refraction light; k r represents the refractive index, in k red and k violet Randomly update between, define the random spectrum color as:
[0091] k r =k red +RV1(k violet -k red )
[0092] Among them, RV1 is a uniform random number randomly generated between [0,1];
[0093] (44) After calculating the ray direction, LSO calculates the candidate solution according to the probability value p randomly generated between 0 and 1; in particular, if the value of p is less than a randomly generated number between 0 and 1, the new candidate solution will be calculated as:
[0094]
[0095] Otherwise, the new candidate solution is calculated as:
[0096]
[0097] in, is the newly generated candidate solution, is the current candidate solution at iteration t; r1, r2, r3, and r4 are the indices of four solutions randomly selected from the current population; and is a vector of uniform random numbers generated between [0,1]; ε is a scaling factor used for calculation; GI is an adaptive control factor based on the inverse incomplete gamma function, calculated as:
[0098] GI=a×r -1 ×P -1 (a,1)
[0099] where GI is an adaptive control factor; r is a uniform random number between [0,1], which is inverted to promote the exploration operator throughout the optimization process, and P -1 is the inverse incomplete gamma function for the corresponding value of a:
[0100]
[0101] Where t is the current iteration number, RV2 is a scalar value of a uniform random number generated between [0,1], and Tmax is the maximum number of function evaluations;
[0102] (45) The mathematical model of the current solution for ambient scattering is as follows:
[0103]
[0104] in This is the best solution so far. and are two solutions randomly selected from the current population; RV3 consists of numbers randomly selected in the interval between 0 and 1; is a vector of randomly generated numbers between 0 and 1; the second scattering stage is based on generating rays at new positions based on the best solution so far and finding the current solution according to the following formula:
[0105]
[0106] where r1 is a randomly generated value; π represents the ratio of the circumference of a circle to its diameter; and the switching between the first and second scattering stages is based on a predefined probability P e It is implemented as shown below:
[0107]
[0108] where R is a randomly generated number between 0 and 1; the final scattering phase is based on generating new solutions based on a randomly selected solution from the population and the current solution:
[0109]
[0110] where RV5 is a scalar value of a normally distributed random number with mean zero and standard deviation equal to 1, is a vector containing random values 0 and 1. The exchange between equations (45) and (46) is based on calculating the difference between the fitness value of each solution and the fitness value of the best solution so far, and normalizing this difference between 0 and 1 according to (47);
[0111] If the difference is less than a randomly generated threshold R1 between 0 and 1, then apply (45); otherwise, apply (46);
[0112]
[0113] Among them, F, F b and F w denote the fitness values of the current solution, the best solution so far, and the worst solution, respectively; however, when the value of F′ is high, the probability of applying (45) is small; the exchange between (45) and (46) is also applicable to the predefined probability Ps to further promote the first and second scattering stages, thereby accelerating the convergence to the best solution so far; finally, the exchange between these two equations is expressed as the following formula:
[0114]
[0115] Where R and R1 are randomly generated numbers between 0 and 1.
[0116] Furthermore, the steps are implemented as follows:
[0117] (51) Determine the hyperparameters of the deep learning model that need to be optimized, including the number of training times, learning rate, number of neurons, and search optimization range;
[0118] (52) Initializing relevant parameters of the spectral optimizer algorithm, including individual population, dimension, maximum number of iterations, upper and lower limits of the search space, and current number of iterations;
[0119] (53) The actual state of charge value Y of the lithium battery i The predicted output SOC value O i The mean square error is used as the fitness function:
[0120]
[0121] (54) Update the ray direction and population by calculating the fitness function value;
[0122] (55) Repeat steps (53) and (54) until the maximum number of iterations;
[0123] (56) Output the optimal network hyperparameters, that is, the best particle position, and substitute these hyperparameters into the iTransFormer model for state of charge prediction.
[0124] Furthermore, the implementation process of step (6) is as follows:
[0125] According to the definition of SOC, during the battery discharge process, the SOC expressions at t = t1 and t = t2 are shown as follows:
[0126]
[0127]
[0128] where t1 < t2; subtracting the two formulas can derive the SOH calculation formula:
[0129]
[0130] Select the time at t1 as the time corresponding to the 15th data unit of the model, and select t2 as the end time of discharge. Obtaining the SOC prediction values at these two times and the amount of electricity released during the discharge process can complete the estimation of SOH.
[0131] An apparatus according to the present invention includes a memory and a processor, wherein:
[0132] The memory is used to store a computer program that can run on the processor;
[0133] The processor is used to execute the steps of a method for jointly predicting the state of charge and health state of a lithium battery as described above when running the computer program.
[0134] A storage medium according to the present invention stores a computer program, and when the computer program is executed by at least one processor, it implements the steps of a method for jointly predicting the state of charge and health state of a lithium battery as described above.
[0135] Advantageous effects: Compared with the prior art, the advantageous effects of the present invention are:
[0136] First, the voltage, current, temperature and capacity data of the lithium battery during the charging and discharging process are obtained, and the least square sliding filter algorithm and normalization method are used to preprocess the data set to improve the data quality and model performance, while improving the efficiency and accuracy of data processing; then, the population of the spectrum optimizer algorithm is initialized by Logistic-Tent mapping, the diversity of the population is increased, the global search ability of the algorithm is improved, and ILSO is obtained. The iTransFormer model is optimized by ILSO to improve the performance and generalization ability of the model, and the advantages of iTransFormer in processing timing problems are fully utilized; when establishing the SOC estimation model, the data form of the data unit is introduced, and the model is trained using sample data containing capacity information, so that the trained model can accurately estimate the SOC under any aging degree; finally, the capacity information contained in the SOC estimation value output by the model is mined to realize the estimation of SOH; the joint estimation method provided by the present invention combines the advantages of single lithium battery state prediction, has higher accuracy and stability, and realizes a more accurate joint estimation of the state of charge and health state of the lithium battery. BRIEF DESCRIPTION OF THE DRAWINGS
[0137] Figure 1 The flowchart of the joint prediction method of lithium battery state of charge and health state. DETAILED DESCRIPTION
[0138] The present invention will be further described in detail below in conjunction with the accompanying drawings.
[0139] like Figure 1 As shown, the present invention proposes a method for jointly estimating the state of charge and health of a lithium battery to realize a method for jointly estimating the state of charge and health of a battery. First, the voltage, current, temperature, and capacity data of the lithium battery charge and discharge are obtained, and the lithium battery data set is processed using the least square sliding filter algorithm and the normalization method; the population of the spectrum optimizer algorithm is initialized using the Logistic-Tent mapping to obtain ILSO; the iTransFormer model is optimized using ILSO, and the advantages of iTransFormer in processing timing problems are used to establish an SOC estimation model based on iTransFormer, and the data form of data units is introduced into the model. Sample data containing aging information is used to train the model, and the trained model can realize SOC estimation under any aging degree; finally, the aging information contained is mined through the SOC estimation value output by the model to realize the estimation of SOH; the joint estimation method provided by the present invention takes into account the advantages of single lithium battery state prediction, has higher accuracy and stability, and realizes more accurate joint estimation of the state of charge and health of lithium batteries. The specific steps are as follows:
[0140] Step 1: Obtain the voltage, current, temperature, and capacity data of lithium battery charging and discharging, and process the lithium battery data set using the least squares sliding filter algorithm and normalization method. The specific implementation process is as follows:
[0141] Step 1.1: Take M points before and after a certain point of the lithium battery data to be processed, multiply these 2M+1 points by the corresponding coefficients, add them together, and then replace this point after averaging.
[0142] Assume that the j-th output of the least square sliding filter can be expressed as:
[0143]
[0144] Where i = M + 1, ...; Wi(k) is the smoothing coefficient; W(k) / (2M+1) is the weight based on the least square sliding filter algorithm. For each signal indicator for which an approximation must be found, a signal window is defined so that the relevant point is located at the center of the space. This is achieved by symmetrically taking the data points on both sides of the signal point, resulting in a window length of 2M+1.
[0145] The least square sliding filter algorithm is a method for sampling the continuous (2M+1) data points (x i ,y i ), select a polynomial fitting of order d to obtain the filter value, and then move the window backward. Suppose the data in the window constitutes a vector y, as shown in the following formula:
[0146] y=[y i-M ,y i-M+1 ,...,y i ,...,y i+M ] T (2)
[0147] For each point in the sampled data, a polynomial fitting with an order of d can be used. The fitting formula is shown as follows:
[0148] Y i =c0+c1x i+k +...+c d x i+k d (3)
[0149] Among them, -M≤k≤M i=M+1,......; taking this point as the center, the above formula is applied to each of the M data before and after to form 2M+1 equations, which can also be expressed in the form of a matrix, as shown in the following formula:
[0150]
[0151] Definition Sm ,m=0,1....d:
[0152]
[0153] Define the dimension matrix S:
[0154] S=[s0,s1,...,s d ] (6)
[0155] Define a 1×(d+1)-dimensional matrix C:
[0156] C=[c0,c1,...,c d ] (7)
[0157] The smoothed data Y is expressed in vector form:
[0158]
[0159] Assume the objective function is I, and the expression of I is the above formula. The least squares fitting is to minimize the sum of squares of the above formula, that is, to find the coefficients c of each polynomial that meets the conditions. i .
[0160]
[0161] Find the minimum value of the objective function, respectively for c0, c1, ..., c d Find the partial derivative, with respect to c m Find the partial derivative, and we can get the following formula:
[0162]
[0163] Let each partial derivative be zero, and the matrix equation system is:
[0164]
[0165] This is equivalent to the equation:
[0166] S T Sc=S T y (12)
[0167] Then we can get the optimal solution: c=(S T S) ·l S τ y (13)
[0168] Let matrix G: G = S (S T S) ·I S T =[g i-M ,g i-M+1 ,...,g i ,...,gi+M ] (14)
[0169] Substituting the optimal solution into the smoothed data Y yields:
[0170] Y=Sc=S(S T S) -1 S T y=Gy (15)
[0171] Then the filtered value of the i-th output is:
[0172]
[0173] It can be seen from the above formula that the matrix G is equivalent to the matrix of the combination of W(k) / (2M+1) in the above formula, that is, the matrix G is the weight of the sliding average filtering algorithm.
[0174] Shift the filter window backward by one data point, that is, add a new sampling data point at the end of the window, and remove an old data point at the beginning of the window. The new data of the window is shown as follows:
[0175] y→[y i-M+1 ,y i-M+2 ,...,y i+1 ,...,y i+M+1 ] T (17)
[0176] Step 1.2: Perform z-score normalization on the data set obtained after the least squares filtering algorithm, specifically:
[0177]
[0178] Among them, y is the data to be normalized, y' is the normalized data, μ is the mean value of the data, and S is the standard deviation of the data.
[0179] Step 2: Obtain the relationship between SOC and SOH based on the definitions of SOC and SOH to ensure that the lithium battery state of charge estimation model can learn information about the battery health status during the training process.
[0180] SOC is defined as the ratio between the current remaining charge of the battery and the actual capacity, and is calculated based on the amount of charge that has been released from the battery.
[0181]
[0182] In the formula, I represents the current, the integral of I on [0,1] represents the amount of electricity discharged by the battery, and C m is the actual capacity of the battery at present.
[0183] SOH is defined as the percentage of the actual capacity of the battery to the rated capacity.
[0184]
[0185] Where C0 represents the rated capacity of the battery when it leaves the factory.
[0186] Combining SOC and SOH, we can get:
[0187]
[0188] From the joint formula, we can know that there is a close connection between the battery state of charge and the health state, and the estimation of SOC needs to consider the influence of SOH. Therefore, in order to ensure that the battery SOC estimation model can learn the information of battery aging during the training process, the calculation of SOC uses this formula.
[0189] Step 3: Build a lithium battery state of charge (SOC) estimation model based on iTransFormer, and use the SOC value after considering the battery SOH as the data of the model training set.
[0190] Step 3.1: Unitize the preprocessed lithium battery data, that is, input 10 consecutive data collection points of each characteristic data of the lithium battery as a group, with a sampling interval of 1s, and the SOC value corresponding to every 10 data collection points is output.
[0191] Step 3.2: Multilayer Perceptron works on the last dimension to embed the sequence into variable tokens.
[0192]
[0193] in, For the input time series, the input length is T, the prediction length is S, the number of variables is N, and the dimension is D.
[0194] Step 3.3: Run the iTransFormer module.
[0195] Apply self-attention to embedded variable labels:
[0196]
[0197] Feed-forward networks are used for sequence representation:
[0198]
[0199] The series representation uses LayerNorm to reduce variable variance.
[0200] Step 3.4: Return to the prediction sequence.
[0201]
[0202] Return the prediction result That is, the SOC prediction result
[0203] Step 4: Improve the LSO algorithm of the spectral optimizer. Use the Logistic-Tent mapping method to initialize and optimize the population to obtain the ILSO algorithm, and optimize the deep learning model to obtain a more accurate SOC estimate. The steps are as follows:
[0204] Step 4.1: Set the population size of the LSO algorithm and the upper and lower limits of the search space
[0205] Step 4.2: Use the Logistic-Tent mapping method to initialize the population position of the algorithm. The improved formula is as follows:
[0206]
[0207] In the formula, X is the system variable and r is the control parameter
[0208] Optimize the search stage of the algorithm using an adaptive adjustment search strategy. The improvement process is as follows:
[0209] An individual selects a random search update method according to the probability threshold H, and the probability threshold is defined as:
[0210]
[0211] where represents the average fitness value of the current population; f min is the best fitness value in the current population; f max is the worst fitness value in the current population. For each individual, a random number q between [0,1] is numerically compared with the calculated probability threshold H. If q < H, the randomly selected individual p rand updates its position according to the formula, and the positions of other individuals remain unchanged; in the early stage of iteration, other individuals will update their positions according to the basic formula. This design helps the algorithm to have a greater probability of randomly generating a set of solutions globally, avoiding the situation where individuals gather together and lead to insufficient population diversity, thereby enhancing the global search ability of the algorithm
[0212] p rand = p jmin + r·(p jmax - p jmin ) (28)
[0213] where r is a random number between [0,1]; p jmin and p jmax are the minimum and maximum values of the variable p rand value respectively
[0214] Step 4.3: After initialization, determine the internal refraction of the spectral optimizer algorithm Internal reflection External Refraction The normal vector is calculated as:
[0215]
[0216]
[0217]
[0218] in is a solution randomly selected from the current population at iteration t, is the current solution at iteration t, is the global best solution ever found, norm(.) represents the normalized value of the vector and is calculated as follows:
[0219]
[0220] Where d represents the dimension of the optimization problem. is the input vector to the norm function, used to normalize it. j is the input vector For the incident ray, the calculation is as follows:
[0221]
[0222]
[0223] in is the incident light, X mean is the average value of the current solution population N is the population size.
[0224] Then, the vectors for the inner and outer refracted and reflected rays are calculated:
[0225]
[0226]
[0227]
[0228] in, and They are internal refraction, internal reflection and external refraction rays. r represents the refractive index, in k red and k violet Randomly update between, define the random spectrum color as:
[0229] k r =k red +RV1(k violet -k red ) (38)
[0230] Where RV1 is a uniform random number randomly generated between [0,1].
[0231] Step 4.4: After calculating the ray direction, LSO calculates candidate solutions based on a randomly generated probability value (called p) between 0 and 1. In particular, if the value of p is less than a randomly generated number between 0 and 1, the new candidate solution is calculated as:
[0232]
[0233] Otherwise, the new candidate solution is calculated as:
[0234]
[0235] in is the newly generated candidate solution, is the current candidate solution at iteration t. r1, r2, r3, and r4 are the indices of four solutions randomly selected from the current population. and is a vector of uniform random numbers generated between [0,1]. ε is a scaling factor used for calculation. GI is an adaptive control factor based on the inverse incomplete gamma function, calculated as:
[0236] GI=a×r -1 ×P -1 (a,1) (41)
[0237] GI is an adaptive control factor. r is a uniform random number between [0,1], which is inverted to promote the exploration operator throughout the optimization process, because inverting any random value will generate a new decimal number greater than 1, which may take the current solution to a farther area within the search space to find a better solution; P -1 is the inverse incomplete gamma function for the corresponding value of a.
[0238]
[0239] Where t is the current iteration number, RV2 is a scalar numeric value of a uniform random number generated between [0,1], and Tmax is the maximum number of function evaluations.
[0240] Step 4.5: The mathematical model of the current solution surrounding scattering is as follows:
[0241]
[0242] in, This is the best solution so far. and are two solutions randomly selected from the current population. RV3 consists of numbers randomly selected in the interval between 0 and 1. is a vector of randomly generated numbers between 0 and 1. The second scattering phase is based on generating rays at new locations based on the best solution so far and finding the current solution according to the following formula:
[0243]
[0244] Where r1 is a randomly generated value ranging from 0 to 1, and π represents the ratio of the circumference of a circle to its diameter. The switching between the first and second scattering stages is based on a predefined probability P e It is implemented as shown below:
[0245]
[0246] Where R is a randomly generated number between 0 and 1. The final scattering phase generates new solutions based on randomly selected solutions from the population and the current solution (according to the following formula):
[0247]
[0248] where RV5 is a scalar value of a normally distributed random number with mean zero and standard deviation equal to 1, is a vector containing random values 0 and 1. The exchange between equations (45) and (46) is based on calculating the difference between the fitness value of each solution and the fitness value of the best solution so far, and normalizing this difference between 0 and 1 according to (47).
[0249] If the difference is less than a randomly generated threshold R1 between 0 and 1, then (45) is applied; otherwise, (46) is applied.
[0250]
[0251] Among them, F, F b and F w denote the fitness values of the current solution, the best solution so far, and the worst solution, respectively. However, when the value of F′ is high, the probability of applying (45) is smaller. The exchange between (45) and (46) is also applied to the predefined probability Ps to further promote the first and second scattering stages, thereby accelerating the convergence to the best solution so far. Finally, the exchange between these two equations is expressed as the following formula
[0252]
[0253] Where R and R1 are randomly generated numbers between 0 and 1.
[0254] Step 5: Use the ILSO algorithm to optimize the hyperparameters of the iTransFormer model in step 3 to obtain the optimal hyperparameters. The steps are as follows:
[0255] Step 5.1: Preprocess the lithium battery voltage, temperature, and capacity data and divide them into training and test sets in a ratio of 7:3.
[0256] Step 5.2: Determine the deep learning model hyperparameters that need to be optimized (number of training sessions, learning rate, number of neurons) and the search range.
[0257] Step 5.3: Initialize the relevant parameters of the spectral optimizer algorithm, including the individual population, dimension, maximum number of iterations, upper and lower limits of the search space, and the current number of iterations.
[0258] Step 5.4: Set the actual state of charge value of the lithium battery to Y i The predicted output SOC value O i The mean square error is used as the fitness function.
[0259]
[0260] Step 5.5: Update the ray direction and population by calculating the fitness function value.
[0261] Step 5.6: Repeat steps 5.4 and 5.5 until the maximum number of iterations is reached.
[0262] Step 5.7: Output the optimal network hyperparameters (optimal particle positions) and substitute these hyperparameters into the iTransFormer model for charge state prediction.
[0263] Step 6: Using the SOC estimation value and the battery aging information contained in the model output in step 5, further calculate the SOH value under the current aging degree through the SOC and SOH joint estimation formula to achieve SOH estimation and realize the joint estimation of the lithium battery state of charge and health state. The steps are as follows:
[0264] Step 6.1: From the definition of SOC, during the battery discharge process, the SOC expressions at t = t1 and t = t2 are as follows: <t2
[0265]
[0266]
[0267] Step 6.2: Subtracting the two equations, we can derive the SOH calculation formula:
[0268]
[0269] Select t1 as the moment corresponding to the 15th data unit of the model, and select t2 as the moment when the discharge ends. The SOC prediction values at these two moments and the amount of electricity released during the discharge process can be obtained to complete the estimation of SOH.
[0270] The present invention also provides a device, including a memory and a processor, wherein: the memory is used to store a computer program that can be run on the processor; the processor is used to execute the steps of the above-mentioned method for jointly predicting the state of charge and health status of a lithium battery when running the computer program.
[0271] The present invention also provides a storage medium having a computer program stored thereon, and when the computer program is executed by at least one processor, the steps of the method for jointly predicting the state of charge and health state of a lithium battery as described above are implemented.
[0272] The above embodiments are only for illustrating the technical concept and features of the present invention, and their purpose is to enable people familiar with the technology to understand the content of the present invention and implement it accordingly, and they cannot be used to limit the protection scope of the present invention. Any equivalent transformation or modification made according to the spirit of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for jointly estimating the state of charge and health state of a lithium battery, characterized in that: The following steps are involved: (1) Collecting initial battery data of lithium-ion batteries and preprocessing the initial data using a least squares filtering algorithm and a normalization method; (2) The relationship between SOC and SOH is obtained according to the definitions of SOC and SOH, ensuring that the lithium battery state of charge estimation model can learn information about the battery health status during the training process; (3) Construct a lithium battery state of charge estimation model based on iTransFormer, using the SOC value after considering the battery SOH as the data of the model training set; (4) Improve the spectrum optimizer LSO algorithm, use the Logistic-Tent mapping method to optimize the population initialization, and use the adaptive adjustment search strategy to optimize the algorithm search phase to obtain the ILSO algorithm; (5) Using the ILSO algorithm to optimize the hyperparameters of the lithium battery state of charge estimation model based on iTransFormer, the optimal hyperparameters are obtained, and the lithium battery state of charge is estimated using the optimized model to obtain the state result of the lithium battery state of charge; (6) Using the SOC estimation value and the battery aging information contained in the model output in step (5), the SOH value at the current aging level is further calculated through the SOC and SOH joint estimation formula to achieve SOH estimation and realize the joint estimation of the lithium battery state of charge and health state.
2. A method for jointly estimating state of charge and health status of a lithium battery according to claim 1, characterized in that: The initial data in step (1) includes charge and discharge data, open circuit voltage, temperature, internal resistance, capacity, and operating current data.
3. A method for jointly estimating state of charge and health status of a lithium battery according to claim 1, characterized in that: In step (1), the initial data is preprocessed using the least squares filtering algorithm and the normalization method. The specific implementation process is as follows: Take M points before and after a certain point in the lithium battery data to be processed, multiply these 2M+1 points by the coefficient, add them up, and then replace this point after averaging; Assume that the j-th output of the least square sliding filter is: Where i = M + 1, ...; W i (k) is the smoothing coefficient; W(k) / (2M+1) is the weight based on the least square sliding filter algorithm; for each signal indicator for which an approximation must be found, a signal window is defined so that the relevant point is located in the center of the space, resulting in a window length of 2M+1; The least square sliding filter algorithm is to fit the continuous (2M+1) data points (xi, yi) in the sampled data with a polynomial fitting of order d to obtain the filter value, and then move the window backward. The smoothed data Y is expressed in vector form: Assume the objective function is I, the least squares fitting is to minimize the sum of squares of the above formula, that is, to find the coefficients c of the polynomial that meet the conditions i ; Find the minimum value of the objective function, respectively for c0, c1, ..., c d Find the partial derivative, with respect to c m Find the partial derivative, and we get the following formula: Let each partial derivative be zero, and the matrix equation system is: This is equivalent to the equation: S T Sc=S T y Then the optimal solution is: c=(S T S) l S τ y Let matrix G be: G=S(S T S) ·I S T =[g i-M ,g i-M+1 ,...,g i ,...,g i+M ] Substituting the optimal solution into the smoothed data Y yields: Y=Sc=S(S T S) -1 S T y=Gy Then the filtered value of the i-th output is: AND i =g i T and From the filter value outputted for the i-th time, it can be seen that the matrix G is equivalent to the matrix of the combination of W(k) / (2M+1) in the above formula, that is, the matrix G is the weight of the sliding average filter algorithm; Shift the filter window backward by one data point, that is, add a new sampling data point at the end of the window, and remove an old data point at the beginning of the window. The new data of the window is shown as follows: and→[and i-M+1 ,and i-M+2 ,...,and i+1 ,...,and i+M+1 ] T The data set obtained after the least squares filtering algorithm is normalized by z-score, specifically: Among them, y is the data to be normalized, y' is the normalized data, μ is the mean value of the data, and S is the standard deviation of the data.
4. A method for jointly estimating state of charge and health status of a lithium battery according to claim 1, characterized in that: The implementation process of step (2) is as follows: SOC is defined as the ratio between the current remaining power of the battery and the actual capacity, calculated based on the power that the battery has released: In the formula, I represents the current, the integral of I on [0,1] represents the amount of electricity discharged by the battery, and C m is the actual capacity of the battery at present; SOH is defined as the percentage of the actual capacity of the battery to the rated capacity: In the formula, C0 represents the rated capacity of the battery when it leaves the factory; Combining SOC and SOH, we can get: From the combined formula, we know that there is a close connection between the battery state of charge and the health state. The estimation of SOC needs to consider the influence of SOH. To ensure that the battery SOC estimation model can learn the information of battery aging during the training process, the formula SOC2(t) is used to calculate the state of charge of lithium batteries.
5. A method for jointly estimating state of charge and health status of a lithium battery according to claim 1, characterized in that: The implementation process of step (3) is as follows: The pre-processed lithium battery data is unitized, that is, J consecutive data collection points of each characteristic data of the lithium battery are taken as a group as input, the sampling time interval is preset, and the SOC value corresponding to each J data collection points is taken as output; The multi-layer perceptron works on the last dimension, embedding the input lithium battery data sequence into the variable token: H 0 =MLP(X) H 0 ∈R N×D X∈RT×N is the input time series, input length T, prediction length S, number of variables N, dimension D, iTransFormer block number L; Run the iTransFormer module to apply self-attention to the embedded variable labeling: H l-1 =LayerNorm(H l-1 +Self-Attn(H l-1 )) H l-1 ∈R N×D Feed-forward networks are used for sequence representation: H l =LayerNorm(H l-1 +Feed-Forward(H l-1 )) H l ∈R N×D The lithium battery characteristic series representation uses LayerNorm to reduce variable differences; Back to the prediction sequence: Returns the lithium battery state of charge prediction result 6. A method for jointly estimating state of charge and health status of a lithium battery according to claim 1, characterized in that: The implementation process of step (4) is as follows: (41) Set the population size of the LSO algorithm, as well as the upper and lower limits of the search space; (42) The Logistic-Tent mapping method is used to initialize the population position of the algorithm. The improved formula is as follows: In the formula, P is the system variable and r is the control parameter; Adaptive adjustment of the search strategy is used to optimize the algorithm search phase. The improvement process is as follows: The individual selects the update method of random search according to the probability threshold H, which is defined as: Among them, represents the average fitness value of the current population; f min is the best fitness value in the current population; f max is the worst fitness value in the current population; for each individual, a random number q between [0, 1] is numerically compared with the calculated probability threshold H; if q < H, the randomly selected individual p rand updates its position according to the formula, and the positions of other individuals remain unchanged; in the early stage of iteration, other individuals will update their positions according to the basic formula: p rand =p jmin +r·(p jmax -p jmin ) Among them, r is a random number between [0,1]; p jmin and p jmax The variables p rand The minimum and maximum values; (43) After initialization, determine the internal refraction of the spectrum optimizer algorithm Internal reflection External Refraction The normal vector is calculated as: in, is a solution randomly selected from the current population at iteration t, is the current solution at iteration t, is the global best solution ever found, norm(.) represents the normalized value of the vector and is calculated as follows: Where d represents the dimension of the optimization problem; is the input vector of the norm function, used to normalize it, x j is the input vector The jth dimension in ; for the incident ray, it is calculated as follows: in is the incident light, X mean is the average value of the current solution population N is the population size; Then, the vectors for the inner and outer refracted and reflected rays are calculated: in, and They are internal refraction, internal reflection and external refraction rays; k r represents the refractive index, in k red and k violet Randomly update between, define the random spectrum color as: k r =k red +RV1(k violet -k red ( Among them, RV1 is a uniform random number randomly generated between [0,1]; (44) After calculating the ray direction, LSO calculates the candidate solution according to the probability value p randomly generated between 0 and 1; in particular, if the value of p is less than a randomly generated number between 0 and 1, the new candidate solution will be calculated as: Otherwise, the new candidate solution is calculated as: in, is the newly generated candidate solution, is the current candidate solution at iteration t; r1, r2, r3, and r4 are the indices of four solutions randomly selected from the current population; RV1 n and RV1 n is a vector of uniform random numbers generated between [0,1]; ò is a scaling factor calculated using; GI is an adaptive control factor based on the inverse incomplete gamma function, calculated as: GI=a×r -1 ×P -1 (a,1) (41) where GI is an adaptive control factor; r is a uniform random number between [0,1], which is inverted to promote the exploration operator throughout the optimization process, and P -1 is the inverse incomplete gamma function for the corresponding value of a: Where t is the current iteration number, RV2 is a scalar value of a uniform random number generated between [0,1], and Tmax is the maximum number of function evaluations; (45) The mathematical model of the current solution for ambient scattering is as follows: in This is the best solution so far. and are two solutions randomly selected from the current population; RV3 consists of numbers randomly selected in the interval between 0 and 1; is a vector of randomly generated numbers between 0 and 1; the second scattering stage is based on generating rays at new positions based on the best solution so far and finding the current solution according to the following formula: where r1 is a randomly generated value; π represents the ratio of the circumference of a circle to its diameter; and the switching between the first and second scattering stages is based on a predefined probability P e It is implemented as shown below: where R is a randomly generated number between 0 and 1; the final scattering phase is based on generating new solutions based on a randomly selected solution from the population and the current solution: where RV5 is a scalar value of a normally distributed random number with mean zero and standard deviation equal to 1, is a vector containing random values 0 and 1. The exchange between equations (45) and (46) is based on calculating the difference between the fitness value of each solution and the fitness value of the best solution so far, and normalizing this difference between 0 and 1 according to (47); If the difference is less than a randomly generated threshold R1 between 0 and 1, then apply (45); otherwise, apply (46); Among them, F, F b and F w denote the fitness values of the current solution, the best solution so far, and the worst solution, respectively; however, when the value of F′ is high, the probability of applying (45) is small; the exchange between (45) and (46) is also applicable to the predefined probability Ps to further promote the first and second scattering stages, thereby accelerating the convergence to the best solution so far; finally, the exchange between these two equations is expressed as the following formula: Where R and R1 are randomly generated numbers between 0 and 1.
7. A method for jointly estimating state of charge and health status of a lithium battery according to claim 1, characterized in that: The implementation process of step (5) is as follows: (51) Determine the hyperparameters of the deep learning model that need to be optimized, including the number of training times, learning rate, number of neurons, and search optimization range; (52) Initializing relevant parameters of the spectral optimizer algorithm, including individual population, dimension, maximum number of iterations, upper and lower limits of the search space, and current number of iterations; (53) The actual state of charge value Y of the lithium battery i The predicted output SOC value O i The mean square error is used as the fitness function: (54) Update the ray direction and population by calculating the fitness function value; (55) Repeat steps (53) and (54) until the maximum number of iterations is reached; (56) The optimal network hyperparameters, i.e., the optimal particle positions, are output and these hyperparameters are substituted into the iTransFormer model for state of charge prediction.
8. A method for jointly estimating state of charge and health status of a lithium battery according to claim 1, characterized in that: The process of implementing step (6) is as follows: From the definition of SOC, we can know that during the battery discharge process, the SOC expressions at t=t1 and t=t2 are as follows: Among them, t1<t2; the SOH calculation formula can be derived by subtracting the two formulas: Select t1 as the moment corresponding to the 15th data unit of the model, and select t2 as the moment when the discharge ends. The SOC prediction values at these two moments and the amount of electricity released during the discharge process can be obtained to complete the estimation of SOH.
9. A device, characterized in that: comprising a memory and a processor, wherein: A memory for storing computer programs that can be run on the processor; A processor is used to execute the steps of a method for jointly estimating the state of charge and health state of a lithium battery as described in any one of claims 1 to 8 when running the computer program.
10. A storage medium, characterized in that: The storage medium stores a computer program, which, when executed by at least one processor, implements the steps of a method for jointly estimating the state of charge and health state of a lithium battery as described in any one of claims 1 to 8.
Citation Information
Patent Citations
SOC and SOH joint estimation method
CN110554324A
Joint estimation method for state of health and state of charge of lithium battery based on machine learning
CN112946499A
SOC-SOH joint estimation method based on lithium battery model and fractional order theory
CN115219911A
Lithium battery state-of-charge and state-of-health joint estimation method based on deep learning
CN116298914A
Lithium ion battery SOC and SOH joint estimation method and device
CN117647741A
