Lithium battery SOC estimation method based on hybrid algorithm and error compensation network
By combining the AE-DE hybrid algorithm and LSTM network for error compensation, the problem of lithium battery SOC estimation easily getting trapped in local optima is solved, achieving high-precision and high-robust SOC estimation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NANTONG UNIV
- Filing Date
- 2026-01-26
- Publication Date
- 2026-05-12
AI Technical Summary
Traditional lithium battery SOC estimation methods are prone to getting trapped in local optima, resulting in large estimation errors. Existing algorithms have shortcomings in parameter identification and accuracy.
A hybrid algorithm and error compensation network were adopted, combining intermittent constant current discharge experiments, dynamic stress tests and second-order RC equivalent circuit models. The AE-DE hybrid algorithm optimization framework was used for parameter identification, and after preliminary estimation by EKF, the LSTM network was used for residual learning and error compensation.
It significantly improves the accuracy and robustness of lithium battery SOC estimation, effectively avoids local optima, and enhances the precision of parameter identification and the accuracy of SOC estimation.
Smart Images

Figure CN122017632A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of lithium battery estimation technology, specifically involving a lithium battery SOC estimation method based on a hybrid algorithm and an error compensation network. Background Technology
[0002] State of charge (SOC) estimation for lithium-ion batteries is a core function of battery management systems (BMS). Accurate SOC information not only ensures the safe and stable operation of the battery system but also helps optimize battery performance and provides crucial information for energy management and safety control of electric vehicles.
[0003] Establishing an accurate and applicable battery model is fundamental to SOC estimation. Common battery models include electrochemical models, equivalent circuit models, and fractional-order models. Among these, the equivalent circuit model uses a network of common components such as resistors, capacitors, and constant voltage sources to simulate the dynamic characteristics of the battery. This model has a simple structure, readily available parameters, and good accuracy, making it widely used. Parameter identification methods are mainly divided into two types: offline identification and online identification. Traditional online identification methods can correct parameters and estimate the state in real time, but they can experience large errors or failures in certain situations. Offline identification, on the other hand, can utilize a large amount of historical data, resulting in relatively high accuracy and a significant advantage in precision. Various swarm intelligence algorithms are widely used in the field of offline identification, but single algorithms are prone to getting trapped in local optima, preventing the attainment of the optimal solution.
[0004] A suitable SOC estimation method is crucial. Currently, mainstream methods can be broadly categorized into two types: model-based methods and data-based methods. Model-based methods mainly include various filtering algorithms, which have advantages such as theoretical rigor, strong interpretability, and high computational efficiency. However, their accuracy heavily depends on the accuracy of the battery model and their adaptability to complex nonlinear characteristics is limited. Data-based methods do not require an accurate physical model and can directly learn complex nonlinear mappings and long-term dependencies from data, exhibiting good generalization ability. However, their interpretability is poor, and they have high requirements for data quality and quantity. Summary of the Invention
[0005] This application provides a lithium battery SOC estimation method based on a hybrid algorithm and an error compensation network to solve the technical problem that traditional methods are prone to getting trapped in local optima, resulting in large SOC estimation errors.
[0006] To address the aforementioned technical problems, this application adopts the following technical solution: a lithium battery SOC estimation method based on a hybrid algorithm and error compensation network, comprising:
[0007] S1. Based on intermittent constant current discharge experiments, the SOC-OCV curve of lithium batteries was obtained;
[0008] S2. Perform dynamic stress test (DST) on the lithium battery to obtain the terminal voltage and load current of the lithium battery;
[0009] S3. Based on battery characteristics, establish a second-order RC equivalent circuit model for lithium batteries;
[0010] S4. Based on the Alpha Evolution (AE) algorithm and combined with the Differential Evolution (DE) algorithm, an AE-DE hybrid algorithm optimization framework is constructed, and parameter identification is performed on the second-order RC equivalent circuit model to obtain the model parameters;
[0011] S5. Construct an extended Kalman filter (EKF) to make a preliminary estimate of the SOC of the lithium battery and obtain a preliminary estimate;
[0012] S6. Construct a Long Short-Term Memory (LSTM) network to learn and compensate for errors in the residuals of the initial estimate, and obtain the final SOC estimate.
[0013] Furthermore, the method in step S3 includes:
[0014] Based on formula (1), the second-order RC equivalent circuit model is obtained; where formula (1) is:
[0015] (1);
[0016] in: This is the open-circuit voltage of a lithium-ion battery. This refers to the terminal voltage of the lithium battery. and for and The voltage at both ends, This is the ohmic internal resistance of the lithium battery. and The parallel connection represents the electrochemical polarization reaction of the lithium battery. and The parallel connection represents the concentration polarization reaction in lithium-ion batteries. It represents electric current.
[0017] SOC is defined as the ratio of remaining capacity to nominal capacity, and the calculation formula is as follows:
[0018] (2);
[0019] in, and t and SOC value at time t, This is the battery's rated capacity;
[0020] Based on the functional equations of the dual-polarization model and the ampere-hour integral method, with current as input and terminal voltage as output, the continuous state-space expression is obtained as follows:
[0021] (3);
[0022] (4).
[0023] Furthermore, the method in step S4 includes:
[0024] S41. Obtain the initial solution based on the AE algorithm;
[0025] S42. Perform alpha evolution on the initial solution to obtain the evolution matrix;
[0026] S43. Based on the distance halving method and the greedy selection algorithm, boundary constraints and policy selection are applied to the evolution matrix to obtain the evolution vector;
[0027] S44. Based on evolutionary vectors, incorporate the three strategies of mutation, crossover, and selection from the DE algorithm to construct an AE-DE hybrid algorithm optimization framework and obtain model parameters.
[0028] Furthermore, the method in step S41 includes:
[0029] Based on formula (5), the continuous state space expression is obtained; where formula (5) is:
[0030] (5);
[0031] in: Let be the i-th candidate solution, with a range of i = 1, 2, 3, ..., D, where D represents the dimension, and ub and lb represent the upper and lower bounds, respectively. This indicates that the elements of the generated 1×D dimensional random matrix satisfy a uniform distribution within (0,1).
[0032] Furthermore, the method in step S42 includes:
[0033] Based on formula (6), N sampling and replacement operations are performed on the initial solution to obtain the evolution matrix E to be evolved; where formula (6) is:
[0034] (6);
[0035] Based on formula (7), the alpha operator is obtained; where formula (7) is:
[0036] (7);
[0037] in, Let P be the i-th evolutionary solution at the (t+1)-th iteration, and let P be the basic vector that determines the starting position of the evolution. It is the attenuation coefficient used in the exploration and development of control algorithms. Let i be the i-th random step size. To control the parameters of the difference vector, and All are sample solutions in X.
[0038] Furthermore, the method in step S43 includes:
[0039] Based on formula (8), the boundary constraint formula is obtained; where formula (8) is:
[0040] (8);
[0041] in, Let i be the i-th element and j-th element of the evolutionary matrix E and the evolutionary solution.
[0042] Based on formula (9), a greedy selection algorithm is used to judge and select the evolutionary solution; where formula (9) is:
[0043] (9).
[0044] Furthermore, the method in step S5 includes:
[0045] Based on formula (10), the state equation and observation equation of the nonlinear system are obtained; where formula (10) is:
[0046] (10);
[0047] in, For state variables, For input variables, For observed variables, and The noise is Gaussian white noise with variances Q and R, respectively.
[0048] Furthermore, the method in step S6 includes:
[0049] Construct an LSTM error compensation network;
[0050] Based on the model parameters and preliminary estimates, the LSTM error compensation network performs residual estimation and learning error compensation. The network is trained with current, voltage, voltage change rate, current change rate and preliminary estimates as inputs to obtain the final SOC estimate.
[0051] The beneficial effects of this application are as follows: Based on the single AE algorithm, this application incorporates the mutation, crossover, and selection strategies of the differential evolution algorithm to construct an AE-DE hybrid algorithm optimization framework. This effectively solves the problem that the original algorithm is prone to getting trapped in local optima during parameter identification, significantly improving the accuracy of parameter identification. Based on EKF estimation, this application constructs an LSTM network to learn and compensate for errors in the SOC estimation residuals, significantly improving the accuracy and robustness of SOC estimation. Attached Figure Description
[0052] Figure 1 This is a flowchart illustrating an embodiment of the lithium battery SOC estimation method based on a hybrid algorithm and an error compensation network according to this application.
[0053] Figure 2 This is a second-order RC equivalent circuit model diagram of an embodiment of the lithium battery SOC estimation method based on hybrid algorithm and error compensation network of this application;
[0054] Figure 3 yes Figure 1 A flowchart illustrating step S4 in one embodiment;
[0055] Figure 4 This is the voltage fitting curve of the AE-DE hybrid algorithm under DST condition in one embodiment of the lithium battery SOC estimation method based on hybrid algorithm and error compensation network of this application;
[0056] Figure 5 This is a voltage error comparison curve of the AE-DE hybrid algorithm compared with a single algorithm under the DST condition in one embodiment of the lithium battery SOC estimation method based on hybrid algorithm and error compensation network of this application;
[0057] Figure 6 This is an example of the SOC estimation curve of a lithium battery based on a hybrid algorithm and error compensation network under the DST condition in this application, after integrating the LSTM error compensation network.
[0058] Figure 7 This is an embodiment of the lithium battery SOC estimation method based on hybrid algorithm and error compensation network in this application, under the DST condition, which integrates the LSTM error compensation network and the SOC error comparison curve without integration. Detailed Implementation
[0059] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to specific embodiments.
[0060] Numerous specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways than those described herein, and therefore the invention is not limited to the specific embodiments disclosed in the following specification.
[0061] This application uses the Panasonic NCR-18650B lithium-ion battery as the research object. The battery has a rated voltage of 3.7V and a capacity of 3400mAh, and conducts intermittent constant current discharge experiments and dynamic stress tests on it.
[0062] See Figure 1 , Figure 1 This is a flowchart illustrating an embodiment of the lithium battery SOC estimation method based on a hybrid algorithm and error compensation network according to this application. The method includes:
[0063] S1. Based on intermittent constant current discharge experiments, the SOC-OCV curve of the lithium battery was obtained.
[0064] S2. Perform dynamic stress testing (DST) on the lithium battery to obtain the terminal voltage and load current of the lithium battery.
[0065] S3. Based on battery characteristics, establish a second-order RC equivalent circuit model for lithium batteries.
[0066] For details, please refer to Figure 2 The formula derivation for the second-order RC equivalent circuit model is as follows:
[0067] (1);
[0068] in: This is the open-circuit voltage of a lithium-ion battery. This refers to the terminal voltage of the lithium battery. and for and The voltage at both ends, This is the ohmic internal resistance of the lithium battery. and The parallel connection represents the electrochemical polarization reaction of the lithium battery. and The parallel connection represents the concentration polarization reaction in lithium-ion batteries. For current;
[0069] Based on formula (2), the ratio of the remaining capacity to the nominal capacity of the lithium battery is obtained; where formula (2) is:
[0070] (2);
[0071] in, and t and SOC value at time t, This is the battery's rated capacity;
[0072] Based on formulas (3)-(4), the continuous state space expression is obtained; where formulas (3)-(4) are:
[0073] (3);
[0074] (4).
[0075] S4. Based on the Alpha Evolution (AE) algorithm and combined with the Differential Evolution (DE) algorithm, an AE-DE hybrid algorithm optimization framework is constructed, and parameter identification is performed on the second-order RC equivalent circuit model to obtain the model parameters.
[0076] For details, please refer to Figure 3 The method of step S4 includes:
[0077] S41. Obtain the initial solution based on the AE algorithm.
[0078] Specifically, the formula for generating the initial solution is as follows:
[0079] (5);
[0080] in: Let be the i-th candidate solution, with a range of i = 1, 2, 3, ..., D, where D represents the dimension, and ub and lb represent the upper and lower bounds, respectively. This indicates that the elements of the generated 1×D dimensional random matrix satisfy a uniform distribution within (0,1).
[0081] S42. Perform alpha evolution on the initial solution to obtain the evolution matrix.
[0082] Specifically, the initial solution undergoes N sampling and replacement operations to obtain the evolution matrix E to be evolved. The relationship between the two is as follows:
[0083] (6);
[0084] Unlike other algorithms, this algorithm relies on only one alpha operator for efficient search. Multiple steps of extracting and utilizing evolutionary information can occur simultaneously within a single operator, whose mathematical model is as follows:
[0085] (7);
[0086] in, Let P be the i-th evolutionary solution at the (t+1)-th iteration, and let P be the basic vector that determines the starting position of the evolution. It is the attenuation coefficient used in the exploration and development of control algorithms. Let i be the i-th random step size. To control the parameters of the difference vector, and All are sample solutions in X, where ;
[0087] For the adaptive basic vector P, which determines the starting point of evolution, it is calculated in two ways.
[0088] (11);
[0089] In the formula: and They are respectively and The learning factor, A, is a D-order square matrix, obtained by sampling from X, and is obtained by sampling from matrix X without substitution. The K×D matrix obtained this time The formula for calculating the weight is as follows:
[0090] (12);
[0091] in, Let f represent the Kth solution from the i-th sample, where f is the fitness function;
[0092] For random step size This component provides global exploration capabilities. Decay therefore... With perturbation matrix Closely related, its calculation formula is:
[0093] (13);
[0094] In the formula: FEs represents fitness assessment, and MaxFEs represents maximum fitness assessment;
[0095] Defined as in The perturbation gradually weakens under its influence, thus facilitating the transition of the algorithm from exploration to development. Its calculation formula is:
[0096] (14);
[0097] In the formula: and for The generated random real matrix is used to generate the perturbation, where S represents the perturbation. The generated random integer matrix containing only 0 or 1 is used for trade-off perturbations;
[0098] For adaptive step size It is used to achieve local exploration. and All are sample solutions in X, where , This is an uncertain control vector, whose uncertainty stems from the fact that each of its components can be the same or different. If the values of each dimension are the same, rand(0, 2) is used to determine them. If the values of each dimension are different, rand(0, 1) is used to determine them separately.
[0099] S43. Based on the distance halving method and the greedy selection algorithm, boundary constraints and policy selection are applied to the evolution matrix to obtain the evolution vector.
[0100] Specifically, the AE algorithm uses a method of halving the distance, and the boundary constraint formula is as follows:
[0101] (8);
[0102] in, Let i be the i-th element and j-th element of the evolutionary matrix E and the evolutionary solution.
[0103] In the AE algorithm, a greedy selection algorithm is used to evaluate and select the evolutionary solution, as shown in the following formula:
[0104] (9).
[0105] S44. Based on evolutionary vectors, incorporate the three strategies of mutation, crossover, and selection from the DE algorithm to construct an AE-DE hybrid algorithm optimization framework and obtain model parameters.
[0106] Specifically, based on the AE algorithm, three strategies from the DE algorithm—mutation, crossover, and selection—were added to construct the AE-DE hybrid algorithm framework. The AE algorithm focuses on global search, while the DE algorithm focuses on fine exploration of local regions, effectively avoiding the problem of single algorithms easily getting trapped in local optima.
[0107] a. Mutation strategy
[0108] This invention employs a DE / rand / 1 mutation strategy, randomly selecting three individuals from the population to generate new solutions. And i≠q1,q2,q3, the mutation methods are as follows:
[0109] (15);
[0110] In the formula: m represents the current iteration number, Let F be the base vector, and F be the mutation factor;
[0111] b. Cross strategy
[0112] Intermediate individuals obtained from crossover operations and target individuals Perform hybridization. The specific steps are as follows:
[0113] (16);
[0114] In the formula: Let represent the crossover factor, i = 1, 2, ..., N, j = 1, 2, ..., D, where N is the population size, D is the problem dimension, and rand(j) is a random value in the range (0, 1). It is a randomly selected dimension index;
[0115] c. Choosing a strategy
[0116] During the selection phase, the differential evolution algorithm, based on a greedy criterion, retains individuals with higher fitness for the next generation of the population.
[0117] (17);
[0118] Repeat the above steps until the maximum number of iterations is reached.
[0119] S5. Construct an extended Kalman filter (EKF) to make a preliminary estimate of the SOC of the lithium battery and obtain a preliminary estimate.
[0120] Specifically, based on the extended Kalman filter, in order to reduce the influence of old data points on the current state estimation and improve the algorithm's response speed to sudden changes in state or noise, a forgetting factor is introduced, thus constructing an extended Kalman filter algorithm with a forgetting factor:
[0121] The state equations and observation equations of the nonlinear system are as follows:
[0122] (10);
[0123] in, For state variables, For input variables, For observed variables, and The noise is Gaussian white noise with variances Q and R, respectively.
[0124] The steps of the extended Kalman filter algorithm are as follows:
[0125] Parameter initialization;
[0126] Give state variables Error covariance matrix Q and R are given initial values.
[0127] Status update;
[0128] a. State prediction
[0129] (18);
[0130] In the formula: , , .
[0131] b. Error covariance matrix prediction
[0132] (19);
[0133] c. Kalman gain
[0134] (20);
[0135] In the formula: .
[0136] d. Output formula
[0137] (twenty one);
[0138] e. State estimate update
[0139] (twenty two);
[0140] f. Error covariance matrix update
[0141] (twenty three);
[0142] S6. Construct a Long Short-Term Memory (LSTM) network to learn and compensate for errors in the residuals of the initial estimate, and obtain the final SOC estimate.
[0143] Specifically, the method in step S6 includes:
[0144] S61. Constructing an LSTM error compensation network
[0145] LSTM is a special type of recurrent neural network designed to overcome the vanishing and exploding gradient problems inherent in traditional recurrent neural networks when processing long-running sequences. The mathematical formula for the LSTM model is:
[0146] (twenty four);
[0147] (25);
[0148] (26);
[0149] (27);
[0150] (28);
[0151] (29);
[0152] In the formula: For the sigmoid function, Let be the state of the input gate at time t, and tanh be the hyperbolic tangent function. Input to the current structural cells, , , , All are bias terms. For input gate output, Candidate cell state, The current cell state, For output gate output, , , , Both are weight matrices. This is the output of the upper cell structure.
[0153] S62. SOC Error Compensation
[0154] First, the AE-DE hybrid algorithm is used to identify the parameters of the second-order RC model. Based on the obtained parameter identification results, the predicted value of the battery terminal voltage can be calculated and compared with the actual terminal voltage. Figure 4 As shown, the parameters were then identified and the terminal voltage fitted using the single AE algorithm and DE algorithm, respectively, and their fitting errors were compared with those of the AE-DE hybrid algorithm. Figure 5 As shown. Next, the parameters are input into the EKF to obtain a preliminary estimate of the SOC. Then, an LSTM network is used to learn and compensate for the estimation residuals. The network is trained using the current, voltage, voltage change rate, current change rate, and the EKF estimate as inputs, and finally, a high-precision and robust SOC estimate is obtained. Figure 6 The SOC estimation curve after integrating the LSTM error compensation network is shown. Figure 7 Comparison curves of SOC estimation errors with and without the integrated LSTM error compensation network.
[0155] In summary, under DST conditions, it can be seen that the AE-DE hybrid algorithm can provide higher accuracy for parameter identification of battery models, and the integrated LSTM error compensation network can also significantly improve the estimation accuracy and robustness of SOC, which has engineering value.
[0156] The above description is merely an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A lithium battery SOC estimation method based on a hybrid algorithm and error compensation network, characterized in that, include: S1. Based on intermittent constant current discharge experiments, the SOC-OCV curve of lithium batteries was obtained; S2. Perform dynamic stress test (DST) on the lithium battery to obtain the terminal voltage and load current of the lithium battery; S3. Based on battery characteristics, establish a second-order RC equivalent circuit model for lithium batteries; S4. Based on the Alpha Evolution (AE) algorithm and combined with the Differential Evolution (DE) algorithm, an AE-DE hybrid algorithm optimization framework is constructed, and the parameters of the second-order RC equivalent circuit model are identified to obtain the model parameters. S5. Construct an extended Kalman filter (EKF) to make a preliminary estimate of the SOC of the lithium battery and obtain a preliminary estimate; S6. Construct a Long Short-Term Memory (LSTM) network to learn and compensate for errors in the residuals of the preliminary estimate, and obtain the final SOC estimate.
2. The method according to claim 1, characterized in that, The method of step S3 includes: Based on formula (1), the second-order RC equivalent circuit model is obtained; wherein, formula (1) is: (1); in: This is the open-circuit voltage of the lithium battery. This refers to the terminal voltage of the lithium battery. and for and The voltage at both ends, This is the ohmic internal resistance of the lithium battery. and The parallel connection represents the electrochemical polarization reaction of the lithium battery. and The parallel connection represents the concentration polarization reaction in lithium-ion batteries. For current; Based on formula (2), the ratio of the remaining capacity to the nominal capacity of the lithium battery is obtained; wherein, formula (2) is: (2); in, and t and SOC value at time t, This is the battery's rated capacity; Based on formulas (3)-(4), the continuous state space expression is obtained; wherein, formulas (3)-(4) are: (3); (4)。 3. The method according to claim 1, characterized in that, The method of step S4 includes: S41. Obtain the initial solution based on the AE algorithm; S42. Perform alpha evolution on the initial solution to obtain the evolution matrix; S43. Based on the distance halving method and the greedy selection algorithm, perform boundary constraints and strategy selection on the evolution matrix to obtain the evolution vector; S44. Based on the evolution vector, incorporate the three strategies of mutation, crossover, and selection from the DE algorithm to construct the AE-DE hybrid algorithm optimization framework and obtain the model parameters.
4. The method according to claim 3, characterized in that, The method of step S41 includes: Based on formula (5), the continuous state space expression is obtained; wherein, formula (5) is: (5); in: Let be the i-th candidate solution, with a range of i = 1, 2, 3, ..., D, where D represents the dimension, and ub and lb represent the upper and lower bounds, respectively. Let represent the generated 1×D dimensional random matrix whose elements satisfy a uniform distribution within (0,1).
5. The method according to claim 4, characterized in that, The method of step S42 includes: Based on formula (6), N sampling and replacement operations are performed on the initial solution to obtain the evolution matrix E to be evolved. Wherein, formula (6) is: (6); Based on formula (7), the alpha operator is obtained; wherein, formula (7) is: (7); in, Let P be the i-th evolutionary solution at the (t+1)-th iteration, and let P be the basic vector that determines the starting position of the evolution. It is the attenuation coefficient used in the exploration and development of control algorithms. Let i be the i-th random step size. To control the parameters of the difference vector, and All are sample solutions in X.
6. The method according to claim 5, characterized in that, The method of step S43 includes: Based on formula (8), the boundary constraint formula is obtained; wherein, formula (8) is: (8); in, Let j be the j-th element of the i-th evolutionary solution in the evolutionary matrix E. Based on formula (9), a greedy selection algorithm is used to judge and select the evolutionary solution; wherein, formula (9) is: (9)。 7. The method according to claim 1, characterized in that, The method of step S5 includes: Based on formula (10), the state equation and observation equation of the nonlinear system are obtained; wherein, formula (10) is: (10); in, For state variables, For input variables, For observed variables, and The noise is Gaussian white noise with variances Q and R, respectively.
8. The method according to claim 1, characterized in that, The method of step S6 includes: Construct an LSTM error compensation network; Based on the model parameters and the preliminary estimate, the LSTM error compensation network is used to perform residual estimation and learning error compensation. The network is trained with current, voltage, voltage change rate, current change rate and the preliminary estimate as inputs to obtain the final SOC estimate.