SOC estimation method based on TSCSO-TSCSO-GRU-Attention network
By combining the Sand Cat Group algorithm and attention mechanism improved by the triangular walking strategy, the TSCSO-GRU-Attention neural network is built, which solves the problems of insufficient accuracy and cumbersome parameter calculation in lithium battery SOC estimation, and achieves efficient Accurate SOC estimation.
Patent Information
- Application Number
- CN202411162149.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-23
- Publication Date
- 2024-11-15
AI Technical Summary
The existing SOC estimation methods of lithium batteries are insufficient in accuracy, especially when dealing with long-term dependency and nonlinear timing data, they are prone to fall into local optimal solutions, and require cumbersome parameter calculations and accurate considerations of electrochemical states.
The Sand Cat Group algorithm based on triangular walking strategy and the GRU network with attention mechanism are adopted to enhance the local search ability of the Sand Cat Group through triangular walking strategy, and combined with hyperparameter optimization and attention mechanism, TSCSO-GRU is built. -Attention neural network, used for estimation of SOC of lithium batteries.
It improves the accuracy of SOC estimation, reduces the demand for artificial resources, avoids local optimal solutions and hyperparameter omissions, enhances the model's attention to useful information, and achieves efficient SOC estimation.
Smart Images

Figure CN118962465A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of lithium battery prediction, and designs a SOC (State of Charge) estimation method based on a sand cat swarm algorithm improved by a triangle walk strategy and a GRU network with an attention mechanism. Background Art
[0002] The development of electrochemical energy storage technology has made it possible for new electric vehicles powered by electricity to replace traditional fuel vehicles. Lithium batteries provide energy for electric vehicles. Accurately estimating the state of charge (SOC) of lithium batteries is crucial to ensure the safe operation of the battery.
[0003] At present, the SOC estimation methods are mainly divided into three categories: traditional estimation method, model prediction method, and data-driven method. Traditional estimation methods include the ampere-hour integration method based on the formula and the open circuit voltage method based on the battery voltage. The ampere-hour integration method calculates the SOC by integrating the current; the open circuit voltage method indirectly measures the SOC based on the nonlinear functional relationship between the battery open circuit voltage and the lithium ion concentration inside the battery. Prediction methods include electrochemical models, mathematical models, and equivalent circuit model prediction methods. The electrochemical model is established based on the electrochemical principle and can reflect the complex electrochemical changes of the battery during the charge and discharge cycle; the mathematical model is established based on the empirical formula and can describe the relationship between different characteristics of the battery; the equivalent circuit model is to build a circuit to simulate the structure and characteristics of the battery. The data-driven method includes support vector machines, neural networks, fuzzy control and other methods, which mainly start from the external characteristics of the battery and obtain the battery voltage through a large amount of data training.
[0004] GRU (Gated Recurrent Unit) is an advanced RNN (Recurrent Neural Network) architecture, which was originally designed to overcome the difficulties encountered by traditional RNN in processing long-term dependent time series data. GRU effectively captures the long-distance dependencies in time series data by introducing the update gate and reset gate mechanism. GRU has a simple structure, which can reduce the number of model parameters while maintaining performance, thereby reducing computational costs.
[0005] The attention mechanism is an encoder-decoder model. The inspiration of the attention mechanism comes from the process of human information processing. When humans process external information, they generally do not pay attention to all global information, but focus on local important information according to the situation.
[0006] The SCSO (Sand Cat Swarm Optimization) algorithm is a metaheuristic algorithm based on the hunting behavior of sand cats in nature. The SCSO algorithm simulates the hunting behavior of sand cats in nature. It adjusts the search strategy and balances the exploration process by simulating the sand cat's search, tracking and hunting behaviors. The sand cat swarm optimization algorithm is particularly suitable for processing long-term dependent, nonlinear, and multi-dimensional time series prediction tasks. Sand cats have large ears that can capture low-frequency information. During the search process, the algorithm simulates the sensitivity of sand cats to low-frequency noise to find the possible optimal solution. Summary of the invention
[0007] The present invention provides a lithium battery SOC estimation method for improving the accuracy of lithium battery SOC estimation.
[0008] The above object has not been achieved, and the present invention improves the following technical solutions:
[0009] A SOC estimation method based on TSCSO-GRU-Attention neural network, the method comprising the following steps:
[0010] Step 1: Measure the lithium battery to obtain data on its voltage, current and SOC.
[0011] Step 2: Use the triangle walking strategy to improve the hunting stage of the sand cat group, enhance its local search ability, and reduce the possibility of falling into the local optimum.
[0012] Step 3: Use the Sand Cat Swarm Algorithm optimized with the triangle walk strategy to optimize the hyperparameters of the GRU-Attention network.
[0013] Step 4: Establish a TSCSO-GRU-Attention neural network and predict the SOC value of the lithium battery.
[0014] Further, the step 1 is specifically as follows:
[0015] The selected lithium battery is subjected to a charge and discharge cycle test with a sampling frequency of 0.1s. The voltage and current during the cycle are recorded and the capacity is calculated.
[0016] The current SOC value is calculated based on the rated capacity and current of the lithium battery.
[0017] The calculation formula of SOC is as follows:
[0018]
[0019] In the formula, is the SOC value of the battery at the initial moment, is the SOC value of the battery at time t, is the coulombic efficiency, i is the charge and discharge current, and C is the nominal capacity of the battery.
[0020] Further, the step 2 is specifically as follows:
[0021] The sand cat swarm optimization algorithm consists of two optimization stages: searching and hunting. The sand cat searching stage is responsible for global search, and the sand cat hunting stage is responsible for local search.
[0022] The position update formula in the search phase is:
[0023]
[0024]
[0025]
[0026]
[0027] R is the judgment condition, which is used to weigh the global search ability and local search ability of the sand cat swarm algorithm. When |R|>1, the sand cat enters the search stage. is the sensitivity range of the sand cat's hearing, which is a dynamic value that decreases with the increase of the number of iterations. is the auditory feature from the sand cat, with a value of 2, is the current iteration number, is the maximum number of iterations, and rand(0,1) is a random number between 0 and 1. The sand cat individuals will be based on the best candidate position , Current Location , sensitivity range and other information to find the best hunting position.
[0028] The position update formula in the hunting phase is:
[0029]
[0030]
[0031] When |R|<1, the sand cat will enter the hunting state, and will hunt according to the distance difference between the best position and the current position. If the sensitivity range of the sand cat is regarded as a circle, the sand cat will move in the direction of a random angle θ. The random angle method can avoid the problem of the algorithm encountering a local optimal solution during the hunting stage. It indicates the best hunting position for sand cats. Indicates the current sand cat position, Indicates a random position.
[0032] The triangular wandering strategy is used to improve the hunting phase of the sand cat swarm algorithm, so that when searching for prey, it updates its position in a triangular manner and wanders towards the prey.
[0033] The improved position update formula is:
[0034]
[0035]
[0036]
[0037]
[0038]
[0039] in is the distance between the sand cat and the prey, through the optimal solution position and current sand cat location It is calculated that is the distance between the sand cat and its prey, The direction in which the sand cats roam. is the circumference of a circle, is the distance between the sand cat and the prey calculated by the wandering strategy, Indicates the final wandering position of the sand cat.
[0040] Further, the step three is specifically as follows:
[0041] The sand cat swarm algorithm optimized by the triangle walk strategy is used to optimize the hyperparameters of the ATGRU network. The number of hidden neurons in the first layer of the neural network, the number of hidden neurons in the second layer of the neural network, the learning rate and the batch are selected as the location information of the sand cat. MAE and RMSE are selected as the fitness function of the TSCSO algorithm. The calculation formula of the fitness function is:
[0042]
[0043]
[0044] in is the true value of SOC, is the SOC prediction value. The smaller the RMSE and MAE values are, the higher the accuracy of the model is and the better the fit is.
[0045] Further, the step 4 is specifically as follows:
[0046] According to the optimal hyperparameter structure found in step three, the TSCSO-ATGRU neural network is constructed. The ATGRU network consists of two layers of GRU networks, one layer of attention mechanism, and one layer of fully connected layer. The voltage and current data of the characteristic lithium battery are input, and the output data is the estimated SOC value.
[0047] The input array is a three-dimensional array: the format is (number of samples, sequence length, number of eigenvalues).
[0048] The benefits of the present invention are as follows: the present invention proposes a SOC estimation model based on a neural network, which can estimate the SOC without tedious parameter calculation process and accurate consideration of the electrochemical state inside the battery; the use of a triangular walk strategy can improve the local search capability of SCSO; the use of TSCSO to find the hyperparameters of the neural network can reduce manual resources and avoid the phenomenon of optimal hyperparameter omission caused by manual search; the Attention mechanism can make the GRU network pay more attention to more useful information; the algorithm proposed in this article improves the accuracy of SOC estimation. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 It is a flow chart of the lithium battery SOC estimation method provided by the present invention;
[0050] Figure 2 It is the data of a single lithium battery under different working conditions;
[0051] Figure 3 This is the structure diagram of the GRU-Attention neural network;
[0052] Figure 4 Schematic diagram of the change of RMSE fitness of two sand cat swarm algorithms in the process of finding the optimal hyperparameters;
[0053] Figure 5 Schematic diagram of the change of MAE fitness of two sand cat swarm algorithms in the process of finding the optimal hyperparameters;
[0054] Figure 6 , 7 is a comparison diagram of the estimation results of the GRU network and the GRU-Attention network in the lithium battery SOC estimation method provided by the present invention;
[0055] Figure 8 , 9 is a comparison diagram of the estimation results of the TSCSO-GRU-Attention network and the SCSO-GRU-Attention network in the lithium battery SOC estimation method provided by the present invention. Specific implementation methods
[0057] In order to make the purpose, technical effect and technical solution of the present invention clearer, the technical solution in the embodiment of the present invention is described clearly and in detail in combination with the drawings in the embodiment of the present invention. Based on the embodiments disclosed in the present invention, other embodiments obtained by ordinary technicians in this field without making creative work should all fall within the scope of protection of the present invention.
[0058] The present invention combines the improved sand cat swarm optimization algorithm of the triangle walking strategy and the two-layer GRU model with the attention mechanism to realize the charge state estimation of the lithium battery according to the voltage and current data during the operation of the lithium battery.
[0059] Combine the following Figure 1 The present invention provides a lithium battery SOC estimation method, comprising:
[0060] Step 1: Measure the lithium battery to obtain the data between its voltage, current and SOC. Use Panasonic 18650pf battery to perform charge and discharge experiments under different working conditions with a sampling frequency of 0.1s, record its voltage and current in the cycle, and calculate its capacity SOC.
[0061]
[0062] In the formula, is the SOC value of the battery at the initial moment, is the SOC value of the battery at time t, is the coulombic efficiency, i is the charge and discharge current, and C is the nominal capacity of the battery.
[0063] Select voltage and current as characteristic values, calibrate their data as input sets, and record SOC values, such as Figure 2 As shown, it is labeled as the output set.
[0064] Step 2: Use the triangle walking strategy to improve the hunting stage of the sand cat group, enhance its local search ability, and reduce the possibility of falling into the local optimum.
[0065] The sand cat swarm optimization algorithm is divided into two stages: sand cat search and sand cat hunting. Sand cat search is responsible for global search, and sand cat hunting is responsible for local search. The triangle optimization strategy is used to optimize the sand cat hunting stage, so that it changes its position according to the center of gravity of the triangle when hunting, enhancing its local search ability.
[0066] Step 3: Use the Sand Cat Swarm algorithm optimized by the triangle walk strategy to optimize the hyperparameters of the GRU-Attention network. The network structure is as follows: Figure 3 .
[0067] The number of hidden neurons in the first layer of the neural network, the number of hidden neurons in the second layer of the neural network, the learning rate and the batch are selected as the location information of the sand cat. The search range of the number of hidden neurons in the first layer of the neural network is [1, 100]; the search range of the number of hidden neurons in the second layer of the neural network is [1, 100]; the search range of the learning rate is [0.1, 0.0001]; the search range of the batch is [1, 128].
[0068] The fitness function's MAE and RMSE are calculated as follows:
[0069]
[0070]
[0071] in is the true value of SOC, is the SOC prediction value. The smaller the RMSE and MAE values are, the higher the accuracy of the model is and the better the fit is.
[0072] The number of sand cat populations is set to 50, the number of iterations of the TSCSO algorithm is set to 50, and the sand cat population algorithm optimized by the triangle walk strategy is used to optimize the hyperparameters of the GRU-Attention network. The optimization results are shown in Table 1.
[0073] Table 1 Model Number of hidden neurons in the first layer The number of hidden neurons in the second layer Batch size Learning Rate TSCSO-GRU-Attention 24 34 15 0.0057350195351984976 SCSO-GRU-Attention 41 51 27 0.012117568009555912
[0074] Step 4: Establish a TSCSO-GRU-Attention neural network and predict the SOC value of the lithium battery.
[0075] According to the optimal hyperparameter structure found in step 3, the ATGRU neural network is constructed. The GRU-Attention network consists of two layers of GRU networks, one layer of attention mechanism, and one layer of fully connected layer. The voltage and current data of the characteristic lithium battery are input. The input data is a three-dimensional array in the form of (number of samples, sequence length, number of eigenvalues).
[0076] The output is the SOC value estimated by the neural network. The data set is divided into a training set and a test set. The number of training times is set. Finally, the model is established to achieve the estimation of the battery health charge state. Figure 5 , 6, 7, 8, and 9 are comparison charts of the estimation results.
[0077] The SCSO algorithm after triangle walking strategy optimization has MAE and RMSE of 0.011920311 and 0.017026005449273057 respectively under UDDS condition, and MAE and RMSE of 0.012582521 and 0.016343834379274207 respectively under HWFT condition.
[0078] Finally, it should be noted that the above embodiments are for explaining the present invention. For those skilled in the art, any changes made thereto without departing from the principle of the present invention shall fall within the protection scope of the claims of the present invention.
Claims
1. A lithium battery SOC estimation method based on TSCSO-GRU-Attention network, characterized by: The method comprises the following steps: Step 1: Measure the lithium battery to obtain data on its voltage, current and SOC; Step 2: Use the triangle walking strategy to improve the hunting stage of the sand cat group, enhance its local search ability, and reduce the possibility of falling into the local optimum; Step 3: Use the Sand Cat Swarm Algorithm optimized with the triangle walk strategy to optimize the hyperparameters of the ATGRU network.
2. According to claim 1, a lithium battery SOC estimation method based on TSCSO-GRU-Attention network is characterized in that: The step 1 is specifically as follows: Carry out charge and discharge cycle test on the selected lithium battery with a sampling frequency of 0.1s, record its voltage and current during the cycle, and calculate its capacity; Calculate the current SOC value based on the rated capacity and current of the lithium battery; The calculation formula of SOC is as follows: In the formula, is the SOC value of the battery at the initial moment, is the SOC value of the battery at time t, is the coulombic efficiency, i is the charge and discharge current, and C is the nominal capacity of the battery.
3. The lithium battery SOC estimation method based on TSCSO-GRU-Attention network according to claim 1 is characterized in that: The step 2 is specifically as follows: The triangular roaming strategy is used to improve the hunting phase of the sand cat swarm algorithm, so that when searching for prey, it updates its position in a triangular manner and roams towards the prey; The improved position update formula is: , , , , , is the distance between the sand cat and the prey, through the optimal solution position and current sand cat location It is calculated that is the distance between the sand cat and its prey, The direction in which the sand cats roam. is the circumference of a circle, is the distance between the sand cat and the prey calculated by the wandering strategy, Indicates the final wandering position of the sand cat.
4. The lithium battery SOC estimation method based on TSCSO-GRU-Attention network according to claim 1 is characterized in that: The step three is specifically as follows: The sand cat swarm algorithm optimized by the triangle walk strategy is used to optimize the hyperparameters of the GRU-Attention network. The number of hidden neurons in the first layer of the neural network, the number of hidden neurons in the second layer of the neural network, the learning rate and the batch are selected as the location information of the sand cats. MAE and RMSE are selected as the fitness function of the TSCSO algorithm. The calculation formula of the fitness function is: , , in is the true value of SOC, is the SOC prediction value. The smaller the RMSE and MAE values are, the higher the accuracy of the model is and the better the fit is.
5. The lithium battery SOC estimation method based on TSCSO-GRU-Attention network according to claim 1 is characterized in that: The step four is specifically as follows: according to the optimal hyperparameter structure found in step three, a TSCSO-GRU-Attention neural network is constructed. The GRU-Attention network consists of two layers of GRU networks, one layer of attention mechanism, and one layer of fully connected layer. The voltage and current data of the characteristic lithium battery are input, and the output data is the estimated SOC value.
6. The lithium battery SOC estimation method based on TSCSO-GRU-Attention network according to claim 3 is characterized in that: The sand cat swarm optimization algorithm consists of two optimization stages: searching and hunting; the sand cat searching stage is responsible for global search, and the sand cat hunting stage is responsible for local search; The position update formula in the search phase is: , , , , Where R is the judgment condition, which is used to weigh the global search ability and local search ability of the sand cat swarm algorithm. When |R|>1, the sand cat enters the search stage; is the sensitivity range of the sand cat's hearing, which is a dynamic value that decreases with the increase of the number of iterations. is the auditory feature from the sand cat, with a value of 2, is the current iteration number, is the maximum number of iterations, rand(0,1) is a random number between 0 and 1; the sand cat individual will be based on the best candidate position , Current Location , sensitivity range and other information to update its own position to find the best hunting position; The position update formula in the hunting phase is: , , When |R|<1, the sand cat will enter the hunting state, and will hunt according to the distance difference between the optimal position and the current position; if the sensitivity range of the sand cat is regarded as a circle, the sand cat will move in the direction of a random angle θ. The random angle method can avoid the problem of the algorithm encountering a local optimal solution during the hunting stage. It indicates the best hunting position for sand cats. Indicates the current sand cat position, Indicates a random position.
7. The lithium battery SOC estimation method based on TSCSO-GRU-Attention network according to claim 4 is characterized in that: Limiting the optimization range of the hyperparameters; The search range for the number of hidden neurons in the first layer of the neural network is [1, 100]; the search range for the number of hidden neurons in the second layer of the neural network is [1, 100]; the search range for the learning rate is [0.1, 0.0001]; and the search range for the batch is [1, 128].
8. The lithium battery SOC estimation method based on TSCSO-GRU-Attention network according to claim 4 is characterized in that: When searching for hyperparameters using the improved sand cat swarm algorithm, the maximum population size is set to 40 and the maximum number of iterations is set to 40.
9. The lithium battery SOC estimation method based on TSCSO-GRU-Attention network according to claim 5, characterized in that: The input array is a three-dimensional array; The format of the input array is (number of samples, sequence length, number of eigenvalues).
Citation Information
Cited By
Tread calender rotating speed PID control method and system, storage medium and equipment
CN119247748A
