Lithium ion battery SOC estimation method based on GRU neural network

By using GRU neural network and immunogenetic algorithms to optimize hyperparameters in lithium-ion battery SOC prediction, and introducing multi-head attention mechanism and residual structure, the problems of hyperparameter optimization and gradient disappearance in the existing technology are solved, achieving higher prediction accuracy and stability.

CN119514652APending Publication Date: 2025-02-25YANCHENG INST OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411548462.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-01
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

The existing neural network-based SOC prediction method for lithium-ion batteries has difficulties in hyperparameter optimization and gradient vanishing problems, resulting in training failure and inaccurate prediction.

Method used

GRU neural network is used to optimize hyperparameters in combination with immunogenetic algorithms, and the neural network model is optimized through multi-head attention mechanism and residual structure to solve the problems of hyperparameter optimization and gradient vanishing.

Benefits of technology

It improves the accuracy and stability of SOC estimation of lithium-ion batteries, avoids the problem of gradient vanishing, and enhances the real-time and prediction accuracy of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119514652A_ABST
    Figure CN119514652A_ABST
Patent Text Reader

Abstract

The invention discloses a lithium ion battery SOC estimation method based on a GRU neural network. The method comprises the following specific steps: S1, establishing a GRU neural network model; s2, optimizing hyper-parameters of the GRU neural network by using an immune genetic algorithm; s3, optimizing the neural network model by using a multi-head attention mechanism and a residual structure; and S4, estimating the SOC based on the optimized neural network model. According to the method, a multi-head attention mechanism is introduced to fully mine input data features, the multi-head attention mechanism overcomes the defects of single-head attention in processing a complex model, feature information can be better extracted from multiple aspects, model over-fitting is prevented, the immune genetic algorithm is adopted to optimize GRU recurrent neural network hyper-parameters, and the accuracy of the model is improved. And the GRU can be used for well storing time sequence characteristics of important data and mining time sequence information, so that the time sequence information becomes a good candidate for SOC prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of battery management systems, and in particular to a method for estimating the SOC of a lithium-ion power battery of an electric vehicle based on a GRU neural network. Background Art

[0002] The SOC (State of Charge) estimation method of lithium-ion batteries based on GRU neural network is a method that uses the gated recurrent unit (GRU) in the recurrent neural network to predict the charge and discharge state of lithium-ion batteries. At present, there are three main categories of SOC estimation: the first category is the traditional estimation method, which estimates the battery SOC based on the relevant physical and chemical properties of the battery. The more common ones are the ampere-hour integration method, the open circuit voltage method, and the internal resistance measurement method. However, the ampere-hour integration method will cause cumulative errors in the estimation of battery power for continuous use due to the error in the accuracy of the current sensor. Due to the characteristics of lithium-ion batteries, the open circuit voltage method is only suitable for accurate estimation of battery SOC in the laboratory, and is inaccurate for the estimation of power in the actual operation of the car. Although the internal resistance measurement method can accurately estimate the battery SOC, there is currently no sensor that directly measures the internal resistance of the battery, so it cannot be used in a moving car. The second category is the model-based estimation method. Before using this type of method, the battery must be modeled first, and then the Kalman filter adaptive filter algorithm is used to estimate the battery SOC. Although the Kalman filter has high accuracy, the algorithm is complex and cannot calculate the SOC in real time.

[0003] The third type is the estimation method based on data. This type of method does not require battery modeling. Compared with traditional open circuit voltage method and equivalent circuit model method, it does not need to pay too much attention to the static and dynamic characteristics of lithium batteries. It only needs to train the machine learning model with a large amount of lithium battery discharge data to provide an accurate SOC prediction model. There are many SOC estimation algorithms based on neural networks, but they only use the timing characteristics of LSTM or GRU for SOC prediction, and training neural networks requires a large amount of data. During the training process, the gradient may disappear, resulting in training failure.

[0004] In view of the above problems, the present invention proposes a lithium-ion battery SOC estimation method based on a GRU neural network. Summary of the invention

[0005] 1. Technical issues to be resolved

[0006] In view of the shortcomings of the prior art, the present invention provides a lithium-ion battery SOC estimation method based on a GRU neural network, which solves: the hyperparameter optimization problem of the current SOC prediction based on a neural network, and at the same time solves the problem of gradient disappearance that easily leads to training failure during the training process.

[0007] (II) Technical solution

[0008] To achieve the above objectives, the present invention is implemented through the following technical solutions:

[0009] The technical solution of the present invention is: a lithium-ion battery SOC estimation method based on a neural network, comprising the following steps:

[0010] S1. Establish a GRU neural network model;

[0011] S2. Use immune genetic algorithm to optimize the hyperparameters of GRU neural network;

[0012] S3, optimize the neural network model using multi-head attention mechanism and residual structure;

[0013] S4, estimating SOC based on the optimized neural network model;

[0014] As a preferred technical solution of the present invention, the optimization step in step S2 is as follows:

[0015] S2.1. Set the multiple hyperparameters to be optimized as a solution in the solution set, and randomly generate multiple groups of solution sets (individuals) to form a population;

[0016] S2.2, use the training data to train the model and calculate the fitness of individuals in the current population;

[0017] S2.3, if the individual reaches the set stop threshold or reaches the optimized generation number, end the loop and jump to step S2.6; otherwise, execute step S2.4;

[0018] S2.4, performing selection, crossover, and mutation operations according to the affinity of the antibodies in the current population to generate a progeny population;

[0019] S2.5, taking the offspring population as the current population, generating memory unit antibodies, and jumping to step S2.2 to continue the operation;

[0020] S2.6. Record the optimal parameters, use the optimal parameters to build a model, and use the model to train and predict experimental data;

[0021] As a preferred technical solution of the present invention, the fitness calculation formula of step S2.2 is as follows:

[0022]

[0023] In the above formula, y t is the true value of SOC, y p is the predicted value of the network model;

[0024] As a preferred technical solution of the present invention, the selection probability of antibody k based on affinity and concentration in step S2.4 is defined as follows:

[0025]

[0026] Where β is the reaction affinity f k and concentration c k The adjustment parameter; m represents the number of antibodies in the population; s(x, y) represents the similarity between antibody x and antibody y. The smaller the value, the greater the concentration c, and the more similar antibody x and antibody y are; n is the length of the antibody;

[0027] As a preferred technical solution of the present invention, the calculation process of the multi-head attention mechanism in step S3 includes three stages:

[0028] S3.1, by introducing the cosine similarity function, to calculate the correlation value si between Query and Key;

[0029] S3.2, use the SoftMax function to normalize the correlation values ​​calculated in the first stage, and convert the results of s1, s2..., sn into weight coefficients ai whose sum is 1;

[0030] S3.3, multiply the weight coefficient ai corresponding to Value by Valuei and add them together to calculate the value of Attention;

[0031] As a preferred technical solution of the present invention, the similarity function Softmax function formula in step S3.2 is as follows:

[0032] MultiHead(Q,K,V)=Concat(head1...,head k ,…,head h )W o

[0033]

[0034] Among them, i represents the i-th node, the output X and different weight matrices W Q , W K , W V Multiply to get Q, K and V, and then transform Q, K and V into h matrices, namely: Q1, Q2, ... Q h ,K1,K2,…,Kh 、V1,V2,…,V h , and their corresponding dimensions are d k ,d q and d v ; In each group Q i , K i and V i Each of them corresponds to an attention layer. The results after the attention mechanism processing are spliced ​​together, and then the output of the multi-head attention mechanism is obtained through linear transformation; Concat(·) is the vertical splicing operation of the matrix, and the weight matrix

[0035] Among them, X is the input, the weight matrix

[0036] is the scaling factor, d k =d model / h.

[0037] (III) Beneficial effects

[0038] The present invention provides a lithium-ion battery SOC estimation method based on a GRU neural network. It has the following beneficial effects:

[0039] (1) In the present invention, a multi-head attention mechanism is introduced to fully exploit the features of the input data. The multi-head attention mechanism overcomes the shortcomings of single-head attention in processing complex models, can better extract feature information from multiple aspects, and prevent model overfitting. The immune genetic algorithm is used to optimize the hyperparameters of the GRU recurrent neural network to seek a better network structure and improve training efficiency. The GRU can well preserve the time series characteristics of important data and mine time series information, making it a good candidate for SOC prediction.

[0040] (2) In the present invention, the application of the multi-head attention mechanism increases the diversity of feature extraction, and the mutual collaboration between the multiple heads helps the network learn deeper data features; when the residual module is added to the model, the residual connection with the weight matrix can make the network more stable and avoid the gradient disappearance. Combined with the convolutional neural network, the accuracy of SOC estimation is improved. After improving the prediction accuracy, it can avoid overcharging or over-discharging of the battery and increase the battery life; at the same time, multi-head parallel processing can improve the training speed of the network, so that the network can meet higher real-time requirements. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 It is a schematic diagram of the IGA-GRU-MHA structure of the present invention;

[0042] Figure 2It is a schematic diagram of the GRU network structure of the present invention;

[0043] Figure 3 It is a schematic diagram of the structure of the multi-head attention mechanism of the present invention;

[0044] Figure 4 Schematic diagram of SOC prediction results of the comparison model of the present invention;

[0045] Figure 5 Schematic diagram of prediction error of the comparison model of the present invention. DETAILED DESCRIPTION

[0046] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0047] See also Figure 1-5 The embodiment of the present invention provides a technical solution: a lithium-ion battery SOC estimation method based on a GRU neural network, comprising the following steps:

[0048] S1. Establish a GRU neural network model, such as Figure 2 As shown;

[0049] S2. Use immune genetic algorithm to optimize the hyperparameters of GRU neural network;

[0050] S2.1. Set the multiple hyperparameters to be optimized as a solution in the solution set, and randomly generate multiple groups of solution sets (individuals) to form a population;

[0051] S2.2. Use the training data to train the model and calculate the fitness of individuals in the current population. The fitness calculation formula is as follows:

[0052]

[0053] In the above formula, y t is the true value of SOC, y p is the predicted value of the network model;

[0054] S2.3, if the individual reaches the set stop threshold or reaches the optimized generation number, end the loop and jump to step S2.6; otherwise, execute step S2.4;

[0055] S2.4. Perform selection, crossover, and mutation operations based on the affinity of the antibodies in the current population to generate a progeny population. The selection probability of antibody k based on affinity and concentration is defined as follows:

[0056]

[0057] Where β is the reaction affinity f k and concentration c k The adjustment parameter; m represents the number of antibodies in the population; s(x, y) represents the similarity between antibody x and antibody y. The smaller the value, the greater the concentration c, and the more similar antibody x and antibody y are; n is the length of the antibody;

[0058] S2.5, taking the offspring population as the current population, generating memory unit antibodies, and jumping to step S2.2 to continue the operation;

[0059] S2.6. Record the optimal parameters, use the optimal parameters to build a model, and use the model to train and predict experimental data;

[0060] S3, using multi-head attention mechanism and residual structure to optimize the neural network model, such as Figure 3 As shown, the calculation process of the multi-head attention mechanism includes three stages:

[0061] S3.1, by introducing the cosine similarity function, to calculate the correlation value si between Query and Key;

[0062] S3.2, use the SoftMax function to normalize the correlation values ​​calculated in the first stage, and convert the results of s1, s2..., sn into weight coefficients ai whose sum is 1. The formula of the similarity function Softmax function is as follows:

[0063] MultiHead(Q,K,V)=Concat(head1...,head k ,…,head h )W o

[0064]

[0065] Among them, i represents the i-th node, the output X and different weight matrices W Q , W K , W V Multiply to get Q, K and V, and then transform Q, K and V into h matrices, namely: Q1, Q2, ... Q h ,K1,K2,…,K h 、V1,V2,…,V h , and their corresponding dimensions are d k ,d q and d v ; In each group Q i , K i and V iEach of them corresponds to an attention layer. The results after the attention mechanism processing are spliced ​​together, and then the output of the multi-head attention mechanism is obtained through linear transformation; Concat(·) is the vertical splicing operation of the matrix, and the weight matrix

[0066] Among them, X is the input, the weight matrix

[0067]

[0068] is the scaling factor, d k =d model / h.

[0069] S3.3, multiply the weight coefficient ai corresponding to Value by Valuei and add them together to calculate the value of Attention;

[0070] S4, based on the optimized neural network model, the SOC is estimated. The structure is as follows Figure 1 As shown;

[0071] Figure 4 To predict the results, Figure 4 It can be seen that the prediction model proposed in this paper has the smallest overall error fluctuation and has a better SOC prediction effect. The MAE and RMSE of the IGA-GRU-MHA prediction model are both smaller than those of the other three models, indicating that the proposed IGA-GRU-MHA prediction model has better SOC prediction performance. Figure 5 is the error between the predicted SOC value and the actual value. The prediction curve of the IGA-GRU-MHA fusion model is closer to the true value curve, and the prediction curve is more stable.

[0072] The above shows and describes the basic principles and main features of the present invention and the advantages of the present invention. It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and the present invention can be implemented in other specific forms without departing from the spirit or basic features of the present invention. Therefore, no matter from which point of view, the embodiments should be regarded as exemplary and non-restrictive. The scope of the present invention is defined by the attached claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any figure mark in the claims should not be regarded as limiting the claims involved.

[0073] In addition, it should be understood that although the present specification is described according to implementation modes, not every implementation mode contains only one independent technical solution. This description of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment may also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.

Claims

1. A lithium-ion battery SOC estimation method based on GRU neural network, characterized in that: The specific steps include the following: S1. Establish a GRU neural network model; S2. Use immune genetic algorithm to optimize the hyperparameters of GRU neural network; S3, optimize the neural network model using multi-head attention mechanism and residual structure; S4. Estimate SOC based on the optimized neural network model.

2. The method for estimating SOC of a lithium-ion battery based on a GRU neural network according to claim 1, characterized in that: In step S1, the GRU network structure formula is as follows: z(k)=s{W z ×[h(k-1),x(k)]} r(k)=σ{W r ·[h(k-1),x(k)]} In the above formula, z(k) and r(k) are the states of the reset gate and update gate respectively; H(k) is the output; Wz, Wr and They are reset gate, update gate and output weight respectively. The function of reset gate is to detect whether past data has value for predicting future information. If it has no value, the value of r(k) is close to 0, the model will forget the past information and save the current input information. If the model believes that the past information is related to the future information, then the value of r(k) is close to 1 and it is added to the current information.

3. The method for estimating SOC of a lithium-ion battery based on a GRU neural network according to claim 1, characterized in that: The optimization steps in step S2 are as follows: S2.1, set the multiple hyperparameters to be optimized as a solution in the solution set, and randomly generate multiple groups of solution sets to form a population; S2.2, use the training data to train the model and calculate the fitness of individuals in the current population; S2.3, if the individual reaches the set stop threshold or reaches the optimized generation number, end the loop and jump to step S2.6; Otherwise, execute step S2.4; S2.4, performing selection, crossover, and mutation operations according to the affinity of the antibodies in the current population to generate a progeny population; S2.5, taking the offspring population as the current population, generating memory unit antibodies, and jumping to step S2.2 to continue the operation; S2.

6. Record the optimal parameters, use the optimal parameters to build a model, and use the model to train and predict experimental data.

4. The method for estimating SOC of a lithium-ion battery based on a GRU neural network according to claim 3, characterized in that: The fitness formula of step S2.2 is as follows: In the above formula, y t is the true value of SOC, y p is the predicted value of the network model.

5. The method for estimating SOC of a lithium-ion battery based on a GRU neural network according to claim 3, characterized in that: The selection probability of antibody k based on affinity and concentration in step S2.4 is defined as follows: Where β is the reaction affinity f k and concentration c k The adjustment parameters; m represents the number of antibodies in the population, and the concentration of antibodies c k The function calculation formula is as follows: In the formula, s(x, y) represents the similarity between antibody x and antibody y. The smaller the value, the greater the concentration c, and the more similar antibody x and antibody y are; n is the length of the antibody.

6. The method for estimating SOC of a lithium-ion battery based on a GRU neural network according to claim 1, characterized in that: The calculation process of the multi-head attention mechanism in step S3 includes three stages: S3.1, by introducing the cosine similarity function, to calculate the correlation value si between Query and Key; S3.2, use the SoftMax function to normalize the correlation values ​​calculated in the first stage, and convert the results of s1, s2..., sn into weight coefficients ai whose sum is 1; S3.3, multiply the weight coefficient ai corresponding to Value by Valuei and add them together to calculate the value of Attention.

7. The method for estimating SOC of a lithium-ion battery based on a GRU neural network according to claim 6, characterized in that: The similarity function Softmax function formula in step S3.2 is as follows: MultiHead(Q,K,V)=Concat(head1…,head k ,…,head h )W o Among them, i represents the i-th node, the output X and different weight matrices W Q , W K , W V Multiply to get Q, K and V, and then transform Q, K and V into h matrices, namely: Q1, Q2, ... Q h ,K1,K2,…,K h 、V1,V2,…,V h , and their corresponding dimensions are d k d q and d v ; In each group Q i , K i and V i Each of them corresponds to an attention layer. The results after being processed by the attention mechanism are spliced ​​together, and then linearly transformed to obtain the output of the multi-head attention mechanism.

8. A lithium-ion battery SOC estimation method based on a GRU neural network according to claim 7, characterized in that :Concat(·) is a matrix concatenation operation, weight matrix Among them, X is the input, the weight matrix is the scaling factor, d k =d model / h.

9. The method for estimating SOC of a lithium-ion battery based on a GRU neural network according to claim 1, characterized in that: In step S3, a residual structure is added between the input and the fully connected layer, as follows: H(x)=x+F(x) Among them, x is the input feature of the current residual module; F(x) is the layer convolution and activation operation.