Battery SOC inversion method based on simulated annealing and least square support vector machine algorithm
Through the simulation annealing algorithm, the parameters of the LSSVM model are optimized, and the problem of parameter optimization and accuracy improvement in lithium-ion battery SOC inversion is solved, and high-precision SOC inversion is achieved.
Patent Information
- Application Number
- CN202510177609.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-18
- Publication Date
- 2025-05-16
AI Technical Summary
The prior art is difficult to automatically find the key parameters of the model in the SOC inversion of lithium-ion batteries, resulting in difficulty in improving accuracy.
The simulated annealing algorithm is used to globally optimize the Gaussian kernel function width σ and punishment factor γ of the least squares support vector machine (LSSVM) model, and the optimal parameters are automatically found.
The univariate regression prediction capability of LSSVM algorithm for multi-feature input is greatly improved, and the accuracy of SOC inversion and model training efficiency are improved.
Smart Images

Figure CN120012599A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of lithium batteries, and in particular relates to a battery SOC inversion method based on simulated annealing and least squares support vector machine algorithms. Background Art
[0002] As an advanced energy technology with high energy density, long cycle life and low operating cost, lithium-ion batteries are widely used in electric vehicles, military equipment, aerospace and other fields. However, incorrect battery status monitoring and control may lead to performance degradation or even dangerous situations such as fire or explosion. Therefore, accurately capturing the internal dynamics of the battery is crucial for early warning of accidents. Ensuring the actual operating status of lithium-ion batteries is of great significance to extending their service life, improving capacity utilization, slowing down aging and reducing potential accidents. However, since the state of charge (SOC) of the battery cannot be measured directly, it can only be obtained indirectly through other external characteristic parameters.
[0003] Traditional battery SOC estimation methods can be roughly divided into open-loop methods, state estimation methods, and data-driven methods. Open-loop methods such as the ampere-hour method and the open-circuit voltage method are simple and easy to implement, but are affected by uncertainties such as noise and temperature, making it difficult to obtain accurate initial values and prone to accumulated errors. The state estimation method is a closed-loop method that reveals the nonlinear dynamic relationship between SOC and load current and terminal voltage through an electrochemical model or an equivalent circuit model, and predicts the state of charge with the help of a state observer or filter. However, these methods are difficult to eliminate system errors. With the development of big data and machine learning technology, data-driven SOC estimation has become one of the research hotspots, but it depends on the selection of key parameters.
[0004] Therefore, there is an urgent need for a new method to automatically find the key parameters of the model and to perform high-precision inversion and quantitative characterization of the battery SOC using information from different physical sources. Summary of the invention
[0005] In order to solve the technical problems of parameter optimization and accuracy improvement in battery SOC inversion in the prior art, the present invention provides a battery SOC inversion method based on simulated annealing and least squares support vector machine algorithm, comprising the following steps:
[0006] S1. Dataset preparation: collect 20 cycles of commercial lithium cobalt oxide battery data, divide the first 15 cycles into training sets, and divide the last 5 cycles into test sets;
[0007] The cycle data includes: electrical characteristic parameters, acoustic characteristic parameters and temperature parameters. The output item y of the cycle data is i is the battery state of charge SOC;
[0008] S2. Parameter optimization: simulated annealing algorithm is used to globally optimize the width σ and penalty factor γ of the Gaussian kernel function of the LSSVM model to obtain the optimal σ and γ;
[0009] S3. Model training and testing: Substitute the optimal σ and γ into the LSSVM model, use the training set for prediction training, output the battery SOC estimation value, and verify the model accuracy through the test set.
[0010] Further, in S1, the electrical characteristic parameters include: voltage U, current I and resistance R; the acoustic characteristic parameters include: transit time ToF, sound intensity amplitude SA and power spectrum density PSD; and the temperature parameter is the battery surface temperature.
[0011] Furthermore, S2 specifically includes:
[0012] S21. Initialize the number of particles, maximum number of iterations, initial temperature, learning factor, pre-speed, annealing factor and effective range of parameters to be optimized in the simulated annealing algorithm;
[0013] S22. Randomly initialize the position and velocity of particles;
[0014] S23. Generate two random initial points within the valid range; wherein the two random initial points are determined by all the determined kernel function widths σ and penalty factors γ, and each σ and γ determines the coordinates in a one-dimensional space;
[0015] S24. Calculate the fitness of each particle i at the current temperature. The fitness function is the objective function f(x). Record the position P of each particle. id , the global optimal position P pd , fitness f(P id ) and the global optimal fitness f(P pd );
[0016] S25. Perform roulette strategy at the current temperature;
[0017] S26. After selecting particles through the roulette strategy, update the speed and position of each particle, as well as the optimal position of individuals and populations;
[0018] S27. Iteratively update the temperature using the cooling function to change the particle activity;
[0019] S28. Determine whether the number of iterations has reached the maximum number of iterations. If not, return to S23. If reached, the iteration is terminated and the optimal σ and γ are output.
[0020] Further, in S2, the Gaussian kernel function is:
[0021] K(x,xi )=exp(-||xx i || 2 / σ 2 )
[0022] Where x is an observation in the input data, and x i is an observation in the training set, σ is the kernel function width; the objective function in the LSSVM model is:
[0023]
[0024] Among them, w is the weight vector of the model, γ is the penalty factor, represents the slack variable.
[0025] Further, in S24, the fitness function is:
[0026]
[0027] Among them, κ exp is the measured SOC data used for key parameter inversion, κ cal is the predicted SOC data of the LSSVM model constructed by guessing key parameters, N is the number of data points, Π is the fitness function of the current guess, i.e., the objective function, and γ g is the penalty factor for the current guess, σ g is the width of the kernel function currently guessed.
[0028] Further, in S24, the roulette strategy specifically includes:
[0029] S241. Generate a random number a between 0 and 1;
[0030] S242. Calculate the fitness of the annealing algorithm. id The fitness of the annealing algorithm is:
[0031]
[0032] S243. According to the fitness of the annealing algorithm f SA (P id ) calculates the cumulative probability, which is:
[0033]
[0034] S244. According to the cumulative probability, select the individual optimal position P of the rth particle that meets the conditions rd Instead of the global optimal position P pd , the condition is: comfort(r-1) <a<comfit(r)。
[0035] Further, in S26, the speed and position of each particle are updated by:
[0036]
[0037] Implementation, where x is the position of the particle, v is the velocity of the particle, i is the ith particle, j+1 is the number of iterations, b1 and b2 are learning factors that affect the local and global convergence speed of each particle, respectively, and the random number r1 / r2∈[0,1], Xbest i is the historical optimal position of the current i-th particle, and Xbest g It is the particle corresponding to the current minimum matching degree.
[0038] Further, in S27, the cooling function is:
[0039] T j+1 =δT j
[0040] Where δ is the annealing factor and T is the temperature.
[0041] The beneficial effects of the present invention are as follows:
[0042] The present invention uses simulated annealing algorithm to optimize two important parameters of LSSVM, namely penalty factor and kernel function width, which greatly improves the ability of LSSVM algorithm for multi-feature input and single variable regression prediction. At the same time, the method can automatically optimize the parameters without manual definition, thus improving the efficiency of mathematical model training. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 It is a flow chart of a battery SOC inversion method based on simulated annealing and least squares support vector machine algorithm;
[0044] Figure 2 Schematic diagram of the method for taking acoustic characteristic parameters;
[0045] Figure 3 A flowchart for roulette strategy. DETAILED DESCRIPTION
[0046] Example 1: Reference Figure 1 This embodiment describes a battery SOC inversion method based on simulated annealing and least squares support vector machine algorithm, comprising the following steps:
[0047] S1. Dataset preparation: collect 20 cycles of commercial lithium cobalt oxide battery data, divide the first 15 cycles into training sets, and divide the last 5 cycles into test sets;
[0048] The cycle data includes: electrical characteristic parameters, acoustic characteristic parameters and temperature parameters. The output item y of the cycle data is i is the battery state of charge SOC;
[0049] S2. Parameter optimization: simulated annealing algorithm is used to globally optimize the width σ and penalty factor γ of the Gaussian kernel function of the LSSVM model to obtain the optimal σ and γ;
[0050] S3. Model training and testing: Substitute the optimal σ and γ into the LSSVM model, use the training set for prediction training, output the battery SOC estimation value, and verify the model accuracy through the test set.
[0051] Specifically, when judging the accuracy in S3, the relative error is calculated. The specific formula is as follows:
[0052]
[0053] Where x* is the inverted SOC result, and x is the true SOC value.
[0054] In S1, the electrical characteristic parameters include: voltage U, current I and resistance R; the acoustic characteristic parameters include: transit time ToF, sound intensity amplitude SA and power spectrum density PSD; the temperature parameter is the battery surface temperature.
[0055] Specifically, the electrical characteristic parameters U, I, R and SOC can be directly derived from the commercial battery management system; the acoustic characteristic parameters adopt the dual sensor transmission detection method, as shown in the attached Figure 2 The maximum sound intensity amplitude in the transmission signal and its corresponding transit time on the time axis are extracted as SA and ToF characteristic parameters respectively; and the power density PSD of the acoustic signal can be calculated by the following formula, where x(t) is the transmission time domain signal;
[0056]
[0057] The temperature characteristic parameters are obtained through thermocouples attached to the surface of the battery.
[0058] Furthermore, S2 specifically includes:
[0059] S21. Initialize the number of particles, maximum number of iterations, initial temperature, learning factor, pre-speed, annealing factor and effective range of parameters to be optimized in the simulated annealing algorithm;
[0060] S22. Randomly initialize the position and velocity of particles;
[0061] S23. Generate two random initial points within the valid range; wherein the two random initial points are determined by all the determined kernel function widths σ and penalty factors γ, and each σ and γ determines the coordinates in a one-dimensional space;
[0062] S24. Calculate the fitness of each particle i at the current temperature. The fitness function is the objective function f(x). Record the position P of each particle. id , the global optimal position P pd , fitness f(P id ) and the global optimal fitness f(P pd );
[0063] S25. Perform roulette strategy at the current temperature;
[0064] S26. After selecting particles through the roulette strategy, update the speed and position of each particle, as well as the optimal position of individuals and populations;
[0065] S27. Iteratively update the temperature using the cooling function to change the particle activity;
[0066] S28. Determine whether the number of iterations has reached the maximum number of iterations. If not, return to S23. If reached, the iteration is terminated and the optimal σ and γ are output.
[0067] Further, in S2, the Gaussian kernel function is:
[0068] K(x,x i )=exp(-||xx i || 2 / σ 2 )
[0069] Where x is an observation in the input data, and x i is an observation in the training set, σ is the width of the kernel function;
[0070] The objective function in the LSSVM model is:
[0071]
[0072] Among them, w is the weight vector of the model, γ is the penalty factor, represents the slack variable.
[0073] Further, in S24, the fitness function is:
[0074]
[0075] Among them, κ exp is the measured SOC data used for key parameter inversion, κ calis the predicted SOC data of the LSSVM model constructed by guessing key parameters, N is the number of data points, Π is the fitness function of the current guess, i.e., the objective function, and γ g is the penalty factor for the current guess, σ g is the width of the kernel function currently guessed.
[0076] Specifically, when Π reaches the minimum value, substituting it into the key parameters of the LSSVM model is the optimal combination solution.
[0077] Further, in S24, the roulette strategy specifically includes:
[0078] S241. Generate a random number a between 0 and 1;
[0079] S242. Calculate the fitness of the annealing algorithm. id The fitness of the annealing algorithm is:
[0080]
[0081] S243. According to the fitness of the annealing algorithm f SA (P id ) calculates the cumulative probability, which is:
[0082]
[0083] S244. According to the cumulative probability, select the individual optimal position P of the rth particle that meets the conditions rd Instead of the global optimal position P pd , the condition is: comfort(r-1) <a<comfit(r)。
[0084] Specifically, the process of the roulette strategy is as follows: Figure 3 This strategy aims to avoid the misleading caused by uneven distribution, which may cause the results to fall into the dilemma of local optimality.
[0085] Further, in S26, the speed and position of each particle are updated by:
[0086]
[0087] Implementation, where x is the position of the particle, v is the velocity of the particle, i is the ith particle, j+1 is the number of iterations, b1 and b2 are learning factors that affect the local and global convergence speed of each particle, respectively, and the random number r1 / r2∈[0,1], Xbest i is the historical optimal position of the current i-th particle, and Xbest g It is the particle corresponding to the current minimum matching degree.
[0088] Further, in S27, the cooling function is:
[0089] T j+1 =δT j
[0090] Where δ is the annealing factor and T is the temperature.
Claims
1. A battery SOC inversion method based on simulated annealing and least squares support vector machine algorithm, characterized in that: The steps include: S1. Dataset preparation: collect 20 cycles of commercial lithium cobalt oxide battery data, divide the first 15 cycles of data into training sets, and divide the last 5 cycles of data into test sets; The cycle data includes: electrical characteristic parameters, acoustic characteristic parameters and temperature parameters. The output item y of the cycle data is i is the battery state of charge SOC; S2. Parameter optimization: simulated annealing algorithm is used to globally optimize the width σ and penalty factor γ of the Gaussian kernel function of the LSSVM model to obtain the optimal σ and γ; S3. Model training and testing: Substitute the optimal σ and γ into the LSSVM model, use the training set for prediction training, output the battery SOC estimation value, and verify the model accuracy through the test set.
2. A battery SOC inversion method based on simulated annealing and least squares support vector machine algorithm according to claim 1, characterized in that: In S1, the electrical characteristic parameters include: voltage U, current I and resistance R; the acoustic characteristic parameters include: transit time ToF, sound intensity amplitude SA and power spectrum density PSD; the temperature parameter is the battery surface temperature.
3. The battery SOC inversion method based on simulated annealing and least squares support vector machine algorithm according to claim 1 is characterized in that: S2 specifically includes: S21. Initialize the number of particles, maximum number of iterations, initial temperature, learning factor, pre-speed, annealing factor and effective range of parameters to be optimized in the simulated annealing algorithm; S22. Randomly initialize the position and velocity of particles; S23. Generate two random initial points within the valid range; wherein the two random initial points are determined by all the determined kernel function widths σ and penalty factors γ, and each σ and γ determines the coordinates in a one-dimensional space; S24. Calculate the fitness of each particle i at the current temperature. The fitness function is the objective function f(x). Record the position P of each particle. id , the global optimal position P pd , fitness f(P id ) and the global optimal fitness f(P pd ); S25. Perform roulette strategy at the current temperature; S26. After selecting particles through the roulette strategy, update the speed and position of each particle, as well as the optimal position of individuals and populations; S27. Iteratively update the temperature using the cooling function to change the particle activity; S28. Determine whether the number of iterations has reached the maximum number of iterations. If not, return to S23. If reached, the iteration is terminated and the optimal σ and γ are output.
4. The battery SOC inversion method based on simulated annealing and least squares support vector machine algorithm according to claim 1 is characterized in that: In S2, the Gaussian kernel function is: K(x,x i )=exp(-||x-x i || 2 / σ 2 ) Where x is an observation in the input data, and x i is an observation in the training set, σ is the width of the kernel function; The objective function in the LSSVM model is: Among them, w is the weight vector of the model, γ is the penalty factor, ξ i 2 represents the slack variable.
5. The battery SOC inversion method based on simulated annealing and least squares support vector machine algorithm according to claim 3 is characterized in that: In S24, the fitness function is: Among them, κ exp is the measured SOC data used for key parameter inversion, κ cal is the predicted SOC data of the LSSVM model constructed by guessing key parameters, N is the number of data points, Π is the fitness function of the current guess, i.e., the objective function, and γ g is the penalty factor for the current guess, σ g is the width of the kernel function currently guessed.
6. The battery SOC inversion method based on simulated annealing and least squares support vector machine algorithm according to claim 3 is characterized in that: In S24, the roulette strategy specifically includes: S241. Generate a random number a between 0 and 1; S242. Calculate the fitness of the annealing algorithm. id The fitness of the annealing algorithm is: S243. According to the fitness of the annealing algorithm f SA (P id ) calculates the cumulative probability, which is: S244. According to the cumulative probability, select the individual optimal position P of the rth particle that meets the conditions rd Instead of the global optimal position P pd , the condition is: comfort(r-1) <a<comfit(r)。 7. The battery SOC inversion method based on simulated annealing and least squares support vector machine algorithm according to claim 3 is characterized in that: In S26, the speed and position of each particle are updated by: Implementation, where x is the position of the particle, v is the velocity of the particle, i is the ith particle, j+1 is the number of iterations, b1 and b2 are learning factors that affect the local and global convergence speed of each particle, respectively, and the random number r1 / r2∈[0,1], Xbest i is the historical optimal position of the current i-th particle, and Xbest g It is the particle corresponding to the current minimum matching degree.
8. The battery SOC inversion method based on simulated annealing and least squares support vector machine algorithm according to claim 3 is characterized in that: In S27, the cooling function is: T j+1 =δT j Where δ is the annealing factor and T is the temperature.