Lithium-ion battery soh estimation method based on hho optimization fusion attention mechanism and tcn-gru
By optimizing the fusion attention mechanism and the TCN-GRU model through HHO optimization, the problems of poor model generalization ability, easy getting trapped in local optima and overfitting in the SOH estimation of lithium batteries are solved, and efficient and accurate prediction of battery health status is achieved.
Patent Information
- Application Number
- CN202510078944.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-17
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2045-01-17
AI Technical Summary
Existing methods for estimating the state of harm (SOH) of lithium batteries suffer from poor model generalization ability, susceptibility to local optima, overfitting, and difficulty in balancing accuracy and efficiency.
The HHO optimization fusion attention mechanism and TCN-GRU model are adopted. By collecting lithium battery charging and discharging data, Pearson correlation coefficient is used to screen features. Combined with uniform random initialization and Dropout layer, the model parameters are optimized to enhance the network's sensitivity to important features and avoid overfitting.
It achieves more efficient and accurate prediction of lithium battery health status, improves the model's generalization ability and prediction accuracy, and reduces the demand for computing resources.
Smart Images

Figure CN119881716B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the field of deep learning and lithium-ion battery state prediction, and particularly relates to a lithium battery SOH estimation method based on HHO optimization fusion attention mechanism and TCN-GRU. BACKGROUND
[0002] With the increasingly serious global energy crisis and environmental pollution problems, promoting the development of new energy has become an important measure to alleviate energy and environmental pressure. Lithium-ion batteries have been widely used in energy storage and supply fields, especially in four-wheel new energy vehicles driven by electric motors, due to their long life, fast charging and discharging capacity, and high energy density, and good stability in use. The state of health (SOH) of the battery is one of the key parameters in the battery state management system of new energy vehicles, and is a key indicator reflecting the performance, service life and aging state of the battery. It is crucial to accurately estimate the SOH of the lithium battery to ensure the good operation of the vehicle.
[0003] Existing lithium battery SOH estimation methods are mainly divided into model-based methods and data-driven methods. The model-based method considers the physical and chemical processes of the battery to establish a mathematical model, but its accuracy depends on accurate internal parameters and complex calculations, and the accuracy and computational efficiency of the model need to be balanced. The data-driven method does not need to actively establish an accurate battery model, extracts features related to battery aging from lithium battery charging and discharging data, uses deep learning algorithms to mine the mapping relationship between input features and SOH, and realizes the estimation of lithium battery SOH, which is more efficient in development and application.
[0004] However, the existing data-driven method has some defects: first, the internal structure of the traditional data-driven model and the number of hidden layer neurons and learning rate are difficult to dynamically adjust according to the characteristics of the current lithium battery, resulting in poor generalization ability of the model; second, when an optimization algorithm is introduced to optimize the parameters of the traditional data-driven model, a set of solutions is randomly generated in the definition domain of the parameters and set as the initial population, which can easily lead the model to fall into local optimum due to uneven population distribution; third, the traditional TCN model usually performs well on training data in small data sets or complex tasks, but performs poorly on test data or new data, resulting in overfitting phenomenon. Fourth, the traditional data-driven model is always contradictory in estimation accuracy and efficiency, and there is a lack of lithium battery SOH estimation method that takes into account both accuracy and efficiency. SUMMARY
[0005] The technical problems to be solved by the present application are to provide a lithium battery SOH estimation method based on HHO optimized fusion attention mechanism and TCN-GRU to solve the problems of the prior art, i.e., the internal structure and the number of hidden layer neurons and learning rate of the existing data-driven model cannot be flexibly adjusted according to the characteristics of the current lithium battery, resulting in poor generalization ability of the model; when an optimization algorithm is introduced to optimize the parameters of the traditional data-driven model, a set of solutions is randomly generated in the definition domain of the parameters and set as the initial population, which easily causes the model to fall into local optimization due to uneven population distribution; the existing TCN model is prone to good performance on training data but poor performance on test data or new data, resulting in overfitting; and the existing data-driven model cannot balance estimation accuracy and efficiency.
[0006] To achieve the above technical purposes, the technical scheme adopted by the present application is as follows:
[0007] A lithium ion battery SOH estimation method based on HHO optimized fusion attention mechanism and TCN-GRU, comprising the following steps:
[0008] Step 1: Collect the voltage data, current data, battery surface temperature and current capacity of the lithium battery under each charge and discharge cycle, and calculate the SOH value according to the current capacity;
[0009] Step 2: Process the data under each charge and discharge cycle to obtain a plurality of battery degradation feature sequences; calculate the correlation coefficients of different degradation features and SOH values using the Pearson correlation coefficient, select the degradation feature sequences with correlation coefficients meeting the expected threshold, and obtain new degradation feature sequences.
[0010] Step 3: Combine the new degradation feature sequences in step 2 and the SOH value sequences in step 1 into a new data set, and divide it into a training set and a test set according to an appropriate proportion.
[0011] Step 4: Input the degradation feature sequences and the corresponding SOH value sequences in the training set into the model of the fusion attention mechanism and TCN-GRU to obtain a preliminarily trained model 1.
[0012] Step 5: Input the degradation feature sequences in the test set as input into the preliminarily trained model 1 in step 4 to obtain a predicted SOH value sequence equal in length to the degradation feature sequences in the test set.
[0013] Step 6: Calculate the mean absolute scaled error (MASE) as the loss function according to the predicted SOH value sequence obtained in step 5 and the SOH value sequence in the test set in step 3.
[0014] Step 7: Set the neuron number range of the fusion attention mechanism and TCN-GRU model, the key value range of the attention mechanism, the regularization parameter range and the learning rate range, set the internal parameters of the HHO algorithm, set the initial population size and the maximum evolution generation, and use the uniform random initialization technique to generate the initial population.
[0015] Step 8: Take the neuron number, key value of the attention mechanism, regularization parameter and learning rate in the initial population obtained in step 7 as the search starting point of the HHO algorithm, take the loss function obtained in step 6 as the objective function of the HHO algorithm for iterative optimization, obtain the neuron, key value of the attention mechanism, regularization parameter and learning rate corresponding to the minimum loss value as the optimal solution, and take the fusion attention mechanism and TCN-GRU model corresponding to the optimal solution as the trained model two. Model two is a trained lithium ion battery SOH estimation model.
[0016] Step 9: Use the trained lithium ion battery SOH estimation model to predict the SOH of the lithium battery to be measured.
[0017] As a further improved technical solution of the application, the lithium battery SOH value in step 1 is represented as:
[0018]
[0019] In the formula, Q t is the current maximum available capacity of the battery, Q n is the rated capacity of the battery.
[0020] As a further improved technical solution of the application, the lithium battery SOH value in step 1 is represented as:
[0021] As a further improved technical solution of the application, the lithium battery SOH value in step 1 is represented as:
[0022] Step 2.1, collect the total time of the lithium battery at the 1.5A constant current charging stage of each charge and discharge cycle, and all total times form a degradation feature sequence one;
[0023] Step 2.2, collect the charging capacity of the lithium battery at the 1.5A constant current charging stage of each charge and discharge cycle, and all charging capacities form a degradation feature sequence two;
[0024] Step 2.3, collect the total time of the lithium battery at the 4.2V constant voltage charging stage of each charge and discharge cycle, and all total times form a degradation feature sequence three;
[0025] Step 2.4, collect the charging capacity of the lithium battery at the constant voltage of 4.2V in each charge-discharge cycle, and all the charging capacities form a degradation characteristic sequence four;
[0026] Step 2.5, collect the maximum temperature of the lithium battery surface in each charge-discharge cycle, and all the maximum temperatures form a degradation characteristic sequence five;
[0027] Step 2.6, collect the time interval of the voltage change from 3.8V to 3.2V during the constant current discharge stage of the lithium battery in each charge-discharge cycle, and all the time intervals form a characteristic sequence six;
[0028] Step 2.7, collect the peak value of the IC curve during the constant current discharge stage of the lithium battery in each charge-discharge cycle, and all the peak values form a characteristic sequence seven;
[0029] Step 2.8, collect the discharge voltage corresponding to the peak value of the IC curve during the constant current discharge stage of the lithium battery in each charge-discharge cycle, and all the voltage values form a characteristic sequence eight.
[0030] As a further improved technical solution of the application, the charging capacity Q in step 2.2 and step 2.4 is represented as:
[0031]
[0032] In the formula, Q is the battery charging capacity, t1 is the charging start time, t2 is the charging end time, and I is the current.
[0033] As a further improved technical solution of the application, the IC curve calculation formula in step 2.7 is:
[0034]
[0035] In the formula, ΔQ is the cumulative capacity obtained by integrating the current in a certain time period, and ΔV is the voltage change in the time period.
[0036] In step 2, the Pearson correlation coefficient r is represented as:
[0037]
[0038] In the formula, x i and y i represent the i-th value of the degradation characteristic sequence and the SOH value sequence respectively, and x and y represent the average value of the degradation characteristic sequence and the SOH value sequence respectively.
[0039] In step 2, the expected threshold value is the absolute value of the correlation coefficient, which is in the range of 0.8 to 1.0.
[0040] As a further improved technical solution of the present application, the model of step 4 fuses attention mechanism and TCN-GRU from top to bottom, including input layer, TCN layer, GRU layer, multi-head attention layer and output layer.
[0041] The TCN layer contains two convolution residual modules, each module containing two convolution layers, two Dropout layers, two normalization layers, an activation layer and a residual connection layer. It is used to ensure that the model effectively captures long-term dependencies in time series, alleviates the problem of gradient disappearance and improves training efficiency while strengthening regularization to avoid overfitting;
[0042] The GRU layer is used to capture the correlation between different recession characteristics;
[0043] The multi-head attention layer is used to enhance the sensitivity of the network to important features by weighting the input features, while significantly reducing the time and space resources required for calculation;
[0044] The output layer contains a fully connected layer and a regression output layer. It is used to map the extracted features to the dimension of the output target, generating the final prediction value.
[0045] As a further improved technical solution of the present application, the mean absolute scaled error (MASE) in step 6 is represented as:
[0046]
[0047] Where y i is the i-th true value of the SOH sequence, y i,sim is the i-th predicted value of the SOH sequence, and N is the number of samples.
[0048] As a further improved technical solution of the present application, the number of neurons in step 7 is set to 18-72, the key value range of attention mechanism is 30-60, the regularization parameter range is set to 0.001-0.01, and the learning rate range is set to 0.0001-0.001.
[0049] In step 7, the initial population size is set to 100, and the maximum evolution generation is set to 10.
[0050] After uniform random initialization within the above predefined range, an initial population of size 100 is obtained, and each individual solution has a 4-dimensional vector. The initial population X is:
[0051] X = [x1 x2…x 99 x 100 ].
[0052] For the first solution x1:
[0053] Randomly select the number of neurons in the range of [18, 72] to generate;
[0054] Randomly select the key value of the attention mechanism in the range of [30, 60] to generate;
[0055] Randomly select the regularization parameter in the range of [0.001, 0.01] to generate;
[0056] Randomly select the learning rate in the range of [0.0001, 0.001] to generate.
[0057] These solutions are distributed within the preset legal range, ensuring the diversity of the population and the comprehensiveness of the search.
[0058] As a further improved technical solution of the application, the step 9 is specifically: taking one or more corresponding degradation features in the new degradation feature sequence (the degradation feature sequence satisfying the Pearson correlation coefficient) obtained in step 2 as the correlation features, collecting and processing the data under the charge and discharge cycle of the lithium battery to be tested to obtain the data of the correlation features, inputting the data of the correlation features into the trained lithium ion battery SOH estimation model to obtain the SOH value of the lithium battery to be tested.
[0059] Through the above scheme design, the application can achieve the following beneficial effects:
[0060] Firstly, the application adopts the HHO algorithm to optimize the parameters of the fusion attention mechanism and the TCN-GRU model, and the internal structure can be dynamically adjusted according to the input data, solving the problem that the internal structure and the number of hidden layer neurons and the learning rate of the traditional data-driven model are difficult to dynamically adjust according to the characteristics of the current lithium battery, thereby causing poor generalization ability of the model.
[0061] Secondly, the application adopts the uniform distribution initialization technology to uniformly distribute the search space within the parameter definition domain, and generates the initial population according to the distribution rule, effectively reducing the risk of the initial population concentrating in a certain area, solving the problem that the initial population generated by the traditional data-driven model is not uniformly distributed, causing the model to easily fall into local optimum.
[0062] Thirdly, the application adopts the convolution residual module with the Dropout layer, which ensures that the model effectively captures the long-term dependence in the time series, alleviates the gradient vanishing problem, improves the training efficiency, and strengthens the regularization to avoid overfitting, solving the problem that the TCN model performs well on the training data, but performs poorly on the test data or new data, and overfitting phenomenon occurs.
[0063] Fourthly, the application combines the multi-head attention mechanism layer, uses the feature capturing ability and parallel computing ability of the multi-head attention mechanism layer for long sequences, enhances the sensitivity of the network to important features by weighting the input features, and greatly reduces the time and space resources required for calculation, thereby solving the problem that the existing data-driven model cannot balance the estimation accuracy and efficiency.
[0064] Therefore, the application realizes more efficient and accurate battery state of health prediction, has outstanding social value and broad market application prospect. BRIEF DESCRIPTION OF DRAWINGS
[0065] Figure 1 A training process diagram of a lithium ion battery SOH estimation model based on HHO optimization fusion of attention mechanism and TCN-GRU.
[0066] Figure 2 A neural network model structure diagram of HHO optimization fusion of attention mechanism and TCN-GRU.
[0067] Figure 3 A comparison curve diagram of SOH predicted values and true values of a B0005 battery based on HHO optimization fusion of attention mechanism and TCN-GRU model.
[0068] Figure 4 A comparison curve diagram of SOH predicted values and true values of a B0006 battery based on HHO optimization fusion of attention mechanism and TCN-GRU model.
[0069] Figure 5 A comparison curve diagram of SOH predicted values and true values of a B0007 battery based on HHO optimization fusion of attention mechanism and TCN-GRU model. DETAILED DESCRIPTION
[0070] In order to more directly illustrate the technical solutions of the application, the application will be described in more detail in combination with the drawings and specific embodiments. It should be pointed out that the specific embodiments are only used to illustrate the content of the application, and are not limited to the scope of its implementation. Other embodiments obtained by those skilled in the art without creative labor are all within the protection scope of the application.
[0071] In combination Figure 1 The application provides a lithium ion battery SOH estimation method based on HHO algorithm optimization fusion of attention mechanism and TCN-GRU, comprising the following steps:
[0072] Step 1: Collect the voltage data, current data, battery surface temperature and current capacity of the lithium battery under each charge and discharge cycle, and calculate the SOH value according to the current capacity;
[0073] Specifically, the lithium battery charge-discharge cycle data collected in step 1 is from the United States National Aeronautics and Space Administration (NASA), and three groups of data B0005, B0006 and B0007 are selected for verification. The three groups of data are all from the same 18650 battery with a rated capacity of 2 Ah. According to the official data, the three groups of batteries are charged at a constant current of 1.5 A at 24°C, and when the working voltage rises to the maximum cut-off voltage of 4.2 V, the charging is converted to constant voltage charging until the current drops to 20 mA. After standing, discharge at a constant current of 2 A, when the voltage of the three groups of batteries drops to 2.7 V, 2.5 V and 2.2 V respectively, the experiment is completed. Compared with other data, the three groups of experimental data selected in the embodiment cover more battery charge-discharge cycles, a total of 168 groups of data.
[0074] SOH is the state of health of the battery. When SOH is defined from the capacity angle, the calculation formula is:
[0075]
[0076] In the formula, Q t is the current maximum capacity of the battery, Q n is the rated capacity of the battery out of the factory, both of which represent the actual charge amount discharged by the battery when the state of charge (SOC) of the battery under standard discharge conditions changes from 100% to 0.
[0077] Step 2: Process the data under each charge-discharge cycle to obtain a plurality of battery degradation characteristic sequences; calculate the correlation coefficient of different degradation characteristics and SOH values using the Pearson correlation coefficient, select the degradation characteristic sequence that meets the expected threshold, and obtain a new degradation characteristic sequence.
[0078] Specifically, the plurality of degradation characteristics of the lithium battery in this step include constant current charging time, constant current charging capacity, constant voltage charging time, constant voltage charging capacity, maximum temperature during charging process, voltage change amount at the same time, peak value of IC curve and voltage corresponding to the peak value of IC curve. The following sub-steps are included:
[0079] Step 2.1, collect the total time of the lithium battery at the constant current charging stage of each charge-discharge cycle, and all the total times form a degradation characteristic sequence 1;
[0080] During the constant current charging stage, as the number of charge-discharge cycles increases, the active material in the electrode material gradually decreases while the internal resistance of the battery increases, resulting in a rapid rise in the voltage of the battery during the constant current charging stage and a gradual shortening of the constant current charging time. Therefore, the total time of the constant current charging stage in all cycle charging processes is formed into a degradation characteristic sequence 1.
[0081] Step 2.2, collect the charging capacity of the lithium battery at the constant current charging stage of each charge-discharge cycle, and all the charging capacities constitute a degradation characteristic sequence 2;
[0082] As described in the above sub-step 2.1, in the constant current charging stage, as the number of charging increases, the active material in the electrode material gradually decreases, and the internal resistance of the battery increases. The change in the charging capacity in the constant current stage can clearly analyze whether the degradation rate changes abruptly or abnormally. Therefore, the present application constitutes a degradation characteristic sequence 2 by all the charging capacities in the constant current charging stage in the process of each cycle charging.
[0083] Step 2.3, collect the total time of the lithium battery at the constant voltage charging stage of each charge-discharge cycle, and all the total times constitute a degradation characteristic sequence 3;
[0084] In the constant voltage charging stage, as the number of charge-discharge cycles increases, the polarization effect leads to the decrease of the electrochemical reaction rate of the battery, and the formation and gradual thickening of the electrolyte interface (SEI) film. The current gradually decreases at the end of the constant voltage charging stage, and the time required to reach the constant voltage charging end current threshold is prolonged. Therefore, the present application constitutes a degradation characteristic sequence 3 by all the total times in the constant voltage charging stage in the process of each cycle charging.
[0085] Step 2.4, collect the charging capacity of the lithium battery at the constant voltage charging stage of each charge-discharge cycle, and all the charging capacities constitute a degradation characteristic sequence 4;
[0086] As described in the above sub-step 2.3, in the constant voltage charging stage, as the number of charge-discharge cycles increases, the polarization effect leads to the decrease of the electrochemical reaction rate of the battery, and the formation and gradual thickening of the electrolyte interface (SEI) film, and the charging capacity in the constant voltage stage also decreases accordingly. Therefore, the present application constitutes a degradation characteristic sequence 4 by all the charging capacities in the constant voltage charging stage in the process of each cycle charging.
[0087] Compared with the constant current charging stage, the constant voltage charging stage is less affected by external temperature and current and other factors, and the combination of the two can more comprehensively describe the battery degradation mechanism and improve the comprehensiveness of the state of health evaluation.
[0088] Specifically, the charging capacity Q in steps 2.2 and 2.4 is represented as:
[0089]
[0090] In the formula, Q is the battery charging capacity, t1 is the charging start time, t2 is the charging end time, and I is the current value.
[0091] Step 2.5, collect the maximum temperature of the lithium battery surface in each charge-discharge cycle, and all the maximum temperatures constitute a degradation characteristic sequence 5;
[0092] As the number of charge-discharge cycles increases, the internal resistance of the battery gradually increases, and the increase in internal resistance causes the battery to generate more heat during charging and discharging, thereby causing the surface temperature to rise. The maximum surface temperature of the lithium battery can reflect the trend of the internal resistance of the battery, and thus reflect the degradation of the battery. Therefore, the present application comprises a degradation feature sequence 5 of the maximum surface temperature of the lithium battery during all cycle charging processes.
[0093] Step 2.6, collect the time interval of the voltage change from 3.8V to 3.2V during the constant current discharge phase of each charge-discharge cycle of the lithium battery, and all time intervals form a feature sequence 6;
[0094] The time of the constant current discharge phase is closely related to the actual available capacity of the battery. As the number of charge-discharge cycles increases, the capacity of the battery gradually decreases, resulting in a shorter discharge time. Because the electrode surface reacts more vigorously at the beginning of the discharge, the concentration of the electrode active material rapidly decreases, and the voltage rapidly decreases. As the battery discharges, the active material is consumed in large quantities in the later stage of discharge, and the reaction rate again decreases, and the voltage also rapidly decreases. In this case, the time of a relatively flat voltage drop region (from 3.8V to 3.2V) is selected as a feature of the discharge phase, which helps to evaluate the health status of the battery. Therefore, the present application comprises a degradation feature sequence 6 of the time interval of the voltage change from 3.8V to 3.2V during the constant current discharge phase during all cycle charging processes.
[0095] Step 2.7, collect the peak value of the IC curve during the constant current discharge phase of each charge-discharge cycle of the lithium battery, and all peak values form a feature sequence 7;
[0096] The position and height of the peak value of the IC curve are closely related to the reversibility of the internal electrochemical reaction of the battery and the utilization rate of the active material. As the number of charge-discharge cycles of the battery increases, the peak value of the IC curve shifts or decreases in height, and the change in the peak value can reflect the migration resistance of lithium ions in the electrode material. When the resistance increases, the peak value of the IC curve becomes wider and lower, indicating that the dynamic performance of the battery decreases, showing an aging trend. Therefore, the present application comprises a degradation feature sequence 7 of the peak value of the IC curve during all cycle charging processes.
[0097] Step 2.8, collect the discharge voltage corresponding to the peak value of the IC curve during the constant current discharge phase of each charge-discharge cycle of the lithium battery, and all voltage values form a feature sequence 8.
[0098] The number of complete data points of the IC curve is large, and directly using all the data will increase the computational complexity. The peak voltage, as a key feature, can more sensitively capture the slight electrochemical changes while effectively reducing redundant information. This sensitivity is very important for predicting the remaining useful life (RUL) of the battery or early detection of faults. Therefore, the present application groups the discharge voltage values corresponding to the peak of the IC curve during the entire cycle charging process to form a degradation feature sequence 8.
[0099] Specifically, the present application uses the incremental capacity method to calculate the IC curve according to the battery voltage and current parameters during the constant current discharge process according to the following formula:
[0100]
[0101] In the formula, ΔQ is the cumulative capacity obtained by integrating the current in a certain time period, and ΔV is the voltage change in the time period.
[0102] The Pearson correlation coefficient is a statistical indicator that measures the degree of linear correlation between two variables, with a value range of -1 to 1. Specifically, when the coefficient tends to 1, it indicates that the two variables are positively correlated, and when one variable increases, the other variable also increases proportionally. When the coefficient tends to -1, it indicates that the two variables are negatively correlated, and when one variable increases, the other variable decreases proportionally. When the coefficient tends to 0, it indicates that the two variables are not linearly correlated, indicating that there is no linear relationship between the variables. The Pearson correlation coefficient r is represented as:
[0103]
[0104] In the formula, x i and y i represent the i-th value of the degradation feature sequence and the SOH value sequence, respectively, and x and y represent the average value of the degradation feature sequence and the SOH value sequence, respectively.
[0105] In this project, the expected threshold is set to have an absolute value of the correlation coefficient within 0.8 to 1.0. Features within this range can contribute significantly to the model prediction results, improving the accuracy and generalization ability of the model.
[0106] Step 3: Combine the new degradation feature sequence in step 2 and the SOH value sequence in step 1 into a new data set, and divide it into a training set and a test set in a 7:3 ratio.
[0107] Specifically, the 7:3 ratio has been proven effective in various scenarios and tasks, and has a certain universality. 70% of the data is used for training, which can provide sufficient data samples for model learning and improve the fitting ability of the model. 30% of the data is used for testing, which can more comprehensively evaluate the performance of the model without introducing too much variance.
[0108] Step 4: Input the decay feature sequence and the corresponding SOH value sequence from the training set into the model that integrates the attention mechanism and TCN-GRU to train the model, obtaining the preliminarily trained Model 1. The decay feature sequence is the input data of the model that integrates the attention mechanism and TCN-GRU, and the SOH value sequence is the output data of the model that integrates the attention mechanism and TCN-GRU.
[0109] Specifically, the model that integrates the attention mechanism and TCN-GRU in step 4 includes, from top to bottom, an input layer, a TCN layer, a GRU layer, a multi-head attention layer, and an output layer.
[0110] like Figure 2 As shown, the TCN layer contains two convolutional residual modules. Each convolutional residual module contains two convolutional layers, two dropout layers, two normalization layers, one activation layer, and one residual connection layer. The two convolutional layers contain causal convolutional layers and dilated convolutional layers. This is used to ensure that the model effectively captures long-term dependencies in time series, alleviates the gradient vanishing problem, and improves training efficiency while strengthening regularization to avoid overfitting.
[0111] GRU layer, used to capture the correlation between different decay characteristics;
[0112] Multi-head attention layers are used to enhance the network's sensitivity to important features by weighting the input features, while significantly reducing the time and space resources required for computation.
[0113] The output layer, consisting of fully connected layers and regression output layers, maps the extracted features to the dimensions of the output target, generating the final predicted value.
[0114] More specifically, the composition of the convolutional residual module is further defined:
[0115] Causal convolutional layers are used to ensure that the output does not depend on future information;
[0116] Dilated convolutional layers are used to expand the receptive field and capture long-term dependent or large-scale features. The formula for calculating the convolution output at time step t is as follows:
[0117]
[0118] Where: K is the size of the convolution kernel, i.e. the number of weights in the convolution kernel, w[k] is the weight of the convolution kernel at the k-th position, and d is the dilation factor, which controls the step size of each jump of the convolution kernel.
[0119] Two Dropout layers are used to prevent the model from overfitting. This project increases the robustness of the model by randomly dropping 10% of the neuron outputs, so that the model does not depend on certain specific neurons during training.
[0120] Two normalization layers use layer normalization to avoid gradient vanishing or explosion for each stable training process. Compared with batch normalization, layer normalization is more suitable for small batch data or even single sample training. The normalization value of the i-th neuron after layer normalization is calculated as follows:
[0121]
[0122] where x i is the activation value of the i-th neuron, μ is the mean of the input feature, σ 2 is the variance of the input feature, is a very small constant to prevent the denominator from being zero and ensure numerical stability, and γ is a trainable scaling parameter.
[0123] Specifically, the mean μ of the input feature is calculated as follows:
[0124]
[0125] where H is the total number of neurons.
[0126] The variance σ 2 of the input feature is calculated as follows:
[0127]
[0128] The activation layer is used to introduce non-linear characteristics to enable the model to learn complex mapping relationships. The ReLU type activation layer is selected, and the calculation formula is as follows:
[0129] f(x) = max(0, x);
[0130] The residual connection layer is used to introduce a residual path to add the input directly to the output, alleviate the gradient vanishing problem, and promote the training of deep networks. The residual connection calculation formula is as follows:
[0131] y = F(x) + x;
[0132] where F(x) is the output of the convolution module.
[0133] Step 5: Input the degradation feature sequence in the test set into the model 1 preliminarily trained in step 4 to obtain a predicted SOH value sequence equal in length to the degradation feature sequence in the test set.
[0134] Step 6: Calculate the mean absolute scaled error (MASE) as the loss function according to the predicted SOH value sequence obtained in step 5 and the SOH value sequence in the test set in step 3.
[0135] Specifically, the mean absolute scaled error (MASE) in step 6 is expressed as:
[0136]
[0137] where y i is the i-th real value of the SOH sequence, y i,sim is the i-th predicted value of the SOH sequence, and N is the number of samples.
[0138] Step 7: Set the neuron number range of the fusion attention mechanism and TCN-GRU model, the key value range of the attention mechanism, the regularization parameter range, and the learning rate range, set the internal parameters of the HHO algorithm, set the initial population size and the maximum evolution generation, and use the uniform random initialization technique to generate the initial population.
[0139] Specifically, the neuron number range of the fusion attention mechanism and TCN-GRU model is set to 18-72, the key value range of the attention mechanism is set to 30-60, the regularization parameter range is set to 0.001-0.01, and the learning rate range is set to 0.0001-0.001.
[0140] In the internal parameters of the HHO algorithm, the initial population size is set to 100, and the maximum evolution generation is set to 10.
[0141] After uniform random initialization within the above predefined range, an initial population of size 100 is obtained, and each individual solution has a 4-dimensional vector. The initial population X is:
[0142] X = [x1 x2…x 99 x 100 ];
[0143] For the first solution x1:
[0144] Randomly select the neuron number in the range [18, 72];
[0145] Randomly select the key value of the attention mechanism in the range [30, 60];
[0146] Randomly select the regularization parameter in the range [0.001, 0.01];
[0147] Randomly select the learning rate in the range [0.0001, 0.001].
[0148] These solutions are distributed within the preset legal range, ensuring the diversity of the population and the extensive search.
[0149] Step 8: The number of neurons in the initial population obtained in step 7, the key value of the attention mechanism, the regularization parameter and the learning rate are taken as the search starting point of the HHO algorithm, and the loss function obtained in step 6 is taken as the objective function of the HHO algorithm for iterative optimization to obtain the minimum loss value corresponding to the neuron, the key value of the attention mechanism, the regularization parameter and the learning rate as the optimal solution, and the fusion attention mechanism and the TCN-GRU model corresponding to the optimal solution are taken as the trained model 2. Model 2 is taken as the trained lithium ion battery SOH estimation model.
[0150] Specifically, the HHO algorithm simulates the behavior pattern of the eagle group in the hunting process, guides the search direction through different search behavior patterns (such as pursuit, surround, attack), updates the initial population position for iterative optimization, and after each update, the HHO will evaluate the pros and cons of the new position according to the loss function, and gradually approach the global optimal solution.
[0151] Step 9: Using the trained lithium ion battery SOH estimation model to predict the SOH of the lithium battery to be measured.
[0152] The step 9 is specifically: taking one or more corresponding degradation features in the new degradation feature sequence (the degradation feature sequence satisfying the Pearson correlation coefficient) obtained in step 2 as the correlation features, collecting and processing the data under the charge and discharge cycle of the lithium battery to be measured to obtain the data of the correlation features, and inputting the data of the correlation features into the trained lithium ion battery SOH estimation model to obtain the SOH value of the lithium battery to be measured after prediction.
[0153] Figure 3 The comparison curve graph of the SOH prediction value and the true value of the B0005 battery based on the HHO optimized fusion attention mechanism and TCN-GRU model. Figure 4 The comparison curve graph of the SOH prediction value and the true value of the B0006 battery based on the HHO optimized fusion attention mechanism and TCN-GRU model. Figure 5 The comparison curve graph of the SOH prediction value and the true value of the B0007 battery based on the HHO optimized fusion attention mechanism and TCN-GRU model. Figures 3-5 In the comparison curve graph, the prediction value is the SOH value predicted by the model 2, and the true value is the SOH value of the battery. Figures 3-5 It can be seen that the prediction value and the true value have high similarity, and the present application realizes more efficient and accurate battery health state prediction, has outstanding social value and broad market application prospect.
[0154] The embodiments of the present application are only used to illustrate the present application, and the above description should not be understood as a limitation to the present application. Many variations and modifications can be made to the present application within the scope of the present application's model and principles. Therefore, the scope of the present application should be defined by the appended claims, rather than the specific embodiments described in the specification.
Claims
1. A method for estimating the state of matter (SOH) of a lithium-ion battery based on HHO-optimized fusion attention mechanism and TCN-GRU, characterized in that, Includes the following steps: Step 1: Collect voltage data, current data, battery surface temperature, and current capacity of the lithium battery during each charge-discharge cycle, and calculate the SOH value based on the current capacity; Step 2: Process the data from each charge-discharge cycle to obtain various battery degradation characteristic sequences; The correlation coefficient between different decay characteristics and SOH values is calculated using the Pearson correlation coefficient. Decay characteristic sequences with correlation coefficients that meet the expected threshold are selected to obtain new decay characteristic sequences. Step 3: Combine the new decay feature sequence obtained in Step 2 with the SOH value sequence in Step 1 to form a new dataset, and divide it into training set and test set according to a certain ratio; Step 4: Input the decay feature sequence and the corresponding SOH value sequence from the training set into the fusion attention mechanism and TCN-GRU model to obtain the preliminarily trained Model 1; Step 5: Input the decay feature sequence from the test set into Model 1, which has been initially trained in Step 4, to obtain a predicted SOH value sequence with the same length as the decay feature sequence from the test set. Step 6: Based on the predicted SOH value sequence obtained in Step 5 and the SOH value sequence in the test set in Step 3, calculate the mean absolute scaling error MASE as the loss function; Step 7: Set the range of the number of neurons, the range of key values, the range of regularization parameters, and the range of learning rate for the fusion attention mechanism and TCN-GRU model; set the internal parameters of the HHO algorithm; set the initial population size and the maximum number of generations; and use uniform random initialization technique to generate the initial population. Step 8: Using the number of neurons, attention mechanism key value, regularization parameter, and learning rate in the initial population obtained in Step 7 as the search starting point for the HHO algorithm, and using the loss function obtained in Step 6 as the objective function of the HHO algorithm for iterative optimization, the neurons, attention mechanism key value, regularization parameter, and learning rate corresponding to the minimum loss value are obtained as the optimal solution, and the fusion attention mechanism and TCN-GRU model corresponding to this optimal solution are used as the trained Model 2; Model 2 is used as the trained lithium-ion battery SOH estimation model; Step 9: Use the trained lithium-ion battery SOH estimation model to predict the SOH of the lithium battery under test.
2. The lithium-ion battery SOH estimation method based on HHO optimized fusion attention mechanism and TCN-GRU according to claim 1, characterized in that, In step 1, the SOH value of the lithium battery is expressed as: In the formula, Q t Q represents the battery's current maximum available capacity. n This refers to the battery's factory rated capacity.
3. The lithium-ion battery SOH estimation method based on HHO optimized fusion attention mechanism and TCN-GRU according to claim 1, characterized in that, In step 2, various degradation characteristics of lithium batteries include constant current charging time, constant current charging capacity, constant voltage charging time, constant voltage charging capacity, maximum temperature during charging, voltage change over the same time period, peak value of IC curve, and voltage corresponding to the peak value of IC curve.
4. The lithium-ion battery SOH estimation method based on HHO optimized fusion attention mechanism and TCN-GRU according to claim 3, characterized in that, The specific method for collecting the various degradation characteristics of the lithium battery is as follows: Step 2.1: Collect the total time of the lithium battery during the charging phase at a constant current of 1.5A in each charge-discharge cycle. All total times constitute the first degradation characteristic sequence. Step 2.2: Collect the charging capacity of the lithium battery during the charging phase at a constant current of 1.5A in each charge-discharge cycle. All charging capacities are used to form the second degradation characteristic sequence. Step 2.3: Collect the total time of the lithium battery during the charging phase at a constant voltage of 4.2V in each charge-discharge cycle. All total times constitute the three degradation characteristic sequences. Step 2.4: Collect the charging capacity of the lithium battery during the charging stage at a constant voltage of 4.2V in each charge-discharge cycle. All charging capacities are used to form the degradation characteristic sequence four. Step 2.5: Collect the maximum surface temperature of the lithium battery during each charge-discharge cycle. All maximum temperatures form the five-part degradation characteristic sequence. Step 2.6: Collect the time intervals during the constant current discharge phase of each charge-discharge cycle of the lithium battery, when the voltage changes from 3.8V to 3.2V. All time intervals form characteristic sequence six. Step 2.7: Collect the peak values of the IC curve during the constant current discharge stage of each charge-discharge cycle of the lithium battery, and form a characteristic sequence seven from all the peak values; Step 2.8: Collect the discharge voltage corresponding to the peak value of the IC curve during the constant current discharge stage of each charge-discharge cycle of the lithium battery, and form a feature sequence eight with all voltage values.
5. The lithium-ion battery SOH estimation method based on HHO optimized fusion attention mechanism and TCN-GRU according to claim 4, characterized in that, The charging capacity Q in steps 2.2 and 2.4 is expressed as follows: In the formula, Q is the battery charging capacity, t1 is the charging start time, t2 is the charging end time, and I is the current.
6. The lithium-ion battery SOH estimation method based on HHO optimized fusion attention mechanism and TCN-GRU according to claim 4, characterized in that, In step 2.7, the formula for calculating the IC curve is: In the formula, ΔQ is the cumulative capacity obtained by integrating the current over a certain time period, and ΔV is the change in voltage over that time period.
7. The lithium-ion battery SOH estimation method based on HHO optimized fusion attention mechanism and TCN-GRU according to claim 1, characterized in that, In step 2, the Pearson correlation coefficient r is expressed as: Where, x i and y i These represent the i-th values of the decay characteristic sequence and the SOH value sequence, respectively. and These represent the average values of the decay characteristic sequence and the SOH value sequence, respectively. In step 2, the expected threshold is that the absolute value of the correlation coefficient is within the range of 0.8 to 1.
0.
8. The lithium-ion battery SOH estimation method based on HHO optimized fusion attention mechanism and TCN-GRU according to claim 1, characterized in that, Step 4, which integrates the attention mechanism and the TCN-GRU model, includes, from top to bottom, an input layer, a TCN layer, a GRU layer, a multi-head attention layer, and an output layer. The TCN layer contains two convolutional residual modules, each of which contains two convolutional layers, two dropout layers, two normalization layers, one activation layer, and one residual connection layer. The output layer includes a fully connected layer and a regression output layer.
9. The lithium-ion battery SOH estimation method based on HHO optimized fusion attention mechanism and TCN-GRU according to claim 1, characterized in that, In step 6, the mean absolute scaling error (MASE) is expressed as: Among them, y i Let y be the i-th true value in the SOH value sequence of the test set. i,sim To predict the i-th predicted value in the SOH value sequence, N is the number of samples.
10. The lithium-ion battery SOH estimation method based on HHO optimized fusion attention mechanism and TCN-GRU according to claim 1, characterized in that, In step 7, the number of neurons is set to 18-72, the key value of the attention mechanism is set to 30-60, the regularization parameter is set to 0.001-0.01, and the learning rate is set to 0.0001-0.
001. In step 7, the initial population size is set to 100, and the maximum number of generations is set to 10.
Citation Information
Patent Citations
Lithium battery SOH estimation method fusing attention mechanism and deep convolution
CN118731751A
Lithium battery SOH estimation model training method and system based on improved CPO optimized Bi-LSTM
CN118731752A