Lithium ion battery SOH estimation method based on HHO optimization and fusing attention mechanism and TCN-GRU
Through HHO optimization of the fusion attention mechanism and the TCN-GRU model, the problem of difficulty in adjusting model parameters and overfitting in SOH estimation of lithium batteries is solved, and efficient and accurate health status prediction is achieved.
Patent Information
- Application Number
- CN202510078944.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-17
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2045-01-17
AI Technical Summary
The existing SOH estimation methods of lithium batteries have problems such as difficulty in adjusting model parameters, easily falling into local optimization, and overfitting and difficulty in taking into account both precision and efficiency.
The HHO optimization fusion attention mechanism and the TCN-GRU model are adopted to dynamically adjust the model parameters and structure, combined with uniform random initialization and HHO algorithm optimization, reduce overfitting and improve generalization ability.
It realizes more efficient and accurate prediction of the health status of lithium batteries, avoiding local optimization and overfitting problems, while taking into account estimation accuracy and efficiency.
Smart Images

Figure CN119881716A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of deep learning and lithium-ion battery state prediction, and specifically is a lithium battery SOH estimation method based on HHO optimization fusion attention mechanism and TCN-GRU. Background Art
[0002] As the global energy crisis and environmental pollution become increasingly serious, promoting the development of new energy has become an important measure to alleviate energy and environmental pressures. Lithium-ion batteries have been widely used in the field of energy storage and supply due to their long life, fast charge and discharge capabilities, high energy density, and good stability during use, especially in the field of four-wheel new energy vehicles driven by electric motors. The battery's state of health (SOH) is one of the key parameters in the battery state management system of new energy vehicles. It is a key indicator of battery performance, service life and aging status. In order to ensure the smooth operation of the vehicle, it is crucial to accurately estimate the lithium battery SOH.
[0003] Existing lithium battery SOH estimation methods are mainly divided into model-based methods and data-driven methods. The model-based method comprehensively 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 it is necessary to weigh the accuracy of the model and the computational efficiency. The data-driven method does not need to actively establish an accurate battery model. By extracting features related to battery aging from lithium battery charging and discharging data, and using deep learning algorithms to mine the mapping relationship between input features and SOH, the estimation of lithium battery SOH is achieved, and the development and application efficiency is higher.
[0004] However, the existing data-driven method has certain defects: First, the internal structure of the traditional data-driven model and parameters such as 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 of the model; Second, when introducing an optimization algorithm to optimize the parameters of the traditional data-driven model, a set of solutions is usually randomly generated within the definition domain of the parameters as the initial population, which can easily cause the model to fall into a local optimum due to uneven population distribution; Third, the traditional TCN model is usually in a small data set or complex task, it is easy to perform well on the training data, but perform poorly on the test data or new data, and overfitting occurs. Fourth, the traditional data-driven model is always contradictory in terms of estimation accuracy and efficiency, and there is a lack of estimation methods for lithium battery SOH that take both accuracy and efficiency into account. Summary of the invention
[0005] The technical problem to be solved by the present invention is to provide a lithium battery SOH estimation method based on HHO optimization fusion attention mechanism and TCN-GRU in response to the deficiencies of the above-mentioned prior art. The lithium battery SOH estimation method based on HHO optimization fusion attention mechanism and TCN-GRU solves the problem that the internal structure of the existing data-driven model and parameters such as the number of hidden layer neurons and the learning rate cannot be flexibly adjusted according to the characteristics of the current lithium battery, resulting in poor generalization ability of the model; and when introducing an optimization algorithm to optimize the parameters of the traditional data-driven model, a set of solutions are usually randomly generated within the definition domain of the parameters and set as the initial population, which easily causes the model to fall into a local optimum due to uneven population distribution; and the existing TCN model is prone to perform well on training data in small data sets or complex tasks, but performs poorly on test data or new data, resulting in overfitting; and the existing data-driven model cannot take into account both estimation accuracy and efficiency.
[0006] In order to achieve the above technical objectives, the technical solution adopted by the present invention is:
[0007] A lithium-ion battery SOH estimation method based on HHO optimization 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 in each charge and discharge cycle, and calculate the SOH value based on the current capacity;
[0009] Step 2: Process the data under each charge and discharge cycle to obtain multiple battery degradation feature sequences; use the Pearson correlation coefficient to calculate the correlation coefficient between different degradation features and SOH values, select the degradation feature sequence whose correlation coefficient meets the expected threshold, and obtain a new degradation feature sequence.
[0010] Step 3: Combine the new decay 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 appropriate proportions.
[0011] Step 4: Input the decay feature sequence and the corresponding SOH value sequence in the training set into the model integrating the attention mechanism and TCN-GRU to obtain the model 1 that has been preliminarily trained.
[0012] Step 5: Use the decay feature sequence in the test set as input and input the model 1 preliminarily trained in step 4 to obtain a predicted SOH value sequence with the same length as the decay feature sequence in the test set.
[0013] 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 scaled error (MASE) as the loss function.
[0014] Step 7: Set the range of the number of neurons 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 evolutionary generations, and use the uniform random initialization technique to generate the initial population.
[0015] 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 used as the search starting point of the HHO algorithm, and the loss function obtained in step 6 is used as the objective function of the HHO algorithm for iterative optimization. The neurons, key values of the attention mechanism, regularization parameters and learning rates corresponding to the minimum loss value are obtained as the optimal solution, and the fusion attention mechanism and TCN-GRU model corresponding to the optimal solution are used as the trained model 2. Model 2 is used as the 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 tested.
[0017] As a further improved technical solution of the present invention, the SOH value of the lithium battery in step 1 is expressed as:
[0018]
[0019] In the formula, Q t Q is the maximum available capacity of the battery. n This is the factory rated capacity of the battery.
[0020] As a further improved technical solution of the present invention, the multiple degradation characteristics of the lithium battery in step 2 include constant current charging time, constant current charging capacity, constant voltage charging time, constant voltage charging capacity, maximum temperature during the charging process, voltage change in the same time, peak value of the IC curve and voltage corresponding to the peak value of the IC curve.
[0021] As a further improved technical solution of the present invention, the step of collecting multiple degradation characteristics of lithium batteries specifically includes the following sub-steps:
[0022] Step 2.1, collecting the total time of the lithium battery in each charge and discharge cycle at a constant current of 1.5A during the charging stage, and all the total time constitutes a decay characteristic sequence 1;
[0023] Step 2.2, collecting the charging capacity of the lithium battery at the charging stage of 1.5A constant current in each charge and discharge cycle, and all charging capacities constitute the decay characteristic sequence 2;
[0024] Step 2.3, collecting the total time of the lithium battery in the charging stage at a constant voltage of 4.2V in each charge and discharge cycle, and all the total time constitutes the decay characteristic sequence 3;
[0025] Step 2.4, collecting the charging capacity of the lithium battery at the 4.2V constant voltage charging stage in each charge and discharge cycle, and all charging capacities constitute a decay characteristic sequence 4;
[0026] Step 2.5, collecting the maximum temperature of the battery surface during each charge and discharge cycle of the lithium battery, and all the maximum temperatures constitute the decay characteristic sequence 5;
[0027] Step 2.6, collecting the time intervals when the voltage changes from 3.8V to 3.2V during the constant current discharge stage of each charge and discharge cycle of the lithium battery, and all the time intervals constitute characteristic sequence 6;
[0028] Step 2.7, collecting the peak values of the IC curve during the constant current discharge stage of each charge and discharge cycle of the lithium battery, and all the peak values constitute 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 each charge and discharge cycle of the lithium battery, and all voltage values constitute characteristic sequence eight.
[0030] As a further improved technical solution of the present invention, the charging capacity Q in step 2.2 and step 2.4 is expressed as:
[0031]
[0032] Where 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 present invention, the IC curve calculation formula in step 2.7 is:
[0034]
[0035] Where ΔQ is the cumulative capacity obtained by integrating the current over a certain period of time, and ΔV is the change in voltage over that period of time.
[0036] The Pearson correlation coefficient r in step 2 is expressed as:
[0037]
[0038] Among them, x i and i denote the i-th value of the decay feature sequence and the SOH value sequence, respectively; x and y denote the average values of the decay feature sequence and the SOH value sequence, respectively;
[0039] The expected threshold in step 2 is that the absolute value of the correlation coefficient ranges from 0.8 to 1.0.
[0040] As a further improved technical solution of the present invention, the model integrating the attention mechanism and TCN-GRU in step 4 includes an input layer, a TCN layer, a GRU layer, a multi-head attention layer and an output layer from top to bottom.
[0041] The TCN layer contains two convolutional residual modules, each of which contains two convolutional 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 gradient vanishing problem, improves training efficiency, and strengthens regularization to avoid overfitting;
[0042] GRU layer, used to capture the correlation between different decay features;
[0043] Multi-head attention layer, which is 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 calculation;
[0044] The output layer, which includes the fully connected layer and the regression output layer, is used to map the extracted features to the dimensions of the output target and generate the final predicted value.
[0045] As a further improved technical solution of the present invention, the mean absolute scaled error (MASE) in step 6 is expressed as:
[0046]
[0047] Among them, 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 invention, in step 7, the range of the number of neurons is set to 18-72, the key value range of the attention mechanism is 30-60, the range of the regularization parameter is set to 0.001-0.01, and the range of the learning rate is set to 0.0001-0.001.
[0049] In step 7, the initial population size is set to 100 and the maximum number of evolution generations is set to 10.
[0050] After uniform random initialization within the predefined range, an initial population of 100 is obtained. The solution of each individual has a vector of 4 dimensions. The initial population X is:
[0051] X=[x1 x2…x 99 x 100 ].
[0052] For the first solution x1:
[0053] The number of neurons is randomly selected in the range of [18,72];
[0054] The key value of the attention mechanism is randomly selected to be generated in the range of [30,60];
[0055] The regularization parameter is randomly selected and generated in the range of [0.001, 0.01];
[0056] The learning rate is randomly selected and generated in the range [0.0001, 0.001].
[0057] These solutions are distributed within the preset legal range, ensuring the diversity of the population and the extensiveness of the search.
[0058] As a further improved technical solution of the present invention, step 9 is specifically: using one or more corresponding decay features in the new decay feature sequence (decay feature sequence that satisfies the Pearson correlation coefficient) obtained in step 2 as associated features, collecting and processing data under the charge and discharge cycle of the lithium battery to be tested to obtain data of associated features, and inputting the data of associated 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 present invention can achieve the following beneficial effects:
[0060] First, the present invention adopts the HHO algorithm to optimize the parameters of the fusion attention mechanism and the TCN-GRU model. The internal structure can be dynamically adjusted according to the input data, which solves the problem that the internal structure of the traditional data-driven model and parameters such as the number of hidden layer neurons and the learning rate are difficult to dynamically adjust according to the characteristics of the current lithium battery, resulting in poor generalization ability of the model.
[0061] Second, the present invention adopts uniform distribution initialization technology to evenly distribute the search space within the parameter definition domain, and generates the initial population according to the distribution rules, which effectively reduces the risk of the initial population being concentrated in a certain area, and solves the problem that the initial population randomly generated by the traditional data-driven model is unevenly distributed, causing the model to easily fall into local optimality.
[0062] Third, the present invention adopts a convolutional residual module with a Dropout layer to ensure that the model effectively captures the long-term dependencies in the time series, alleviates the gradient vanishing problem, improves training efficiency, and strengthens regularization to avoid overfitting. This solves the problem that the TCN model performs well on training data in small data sets or complex tasks, but performs poorly on test data or new data, resulting in overfitting.
[0063] Fourth, the present invention combines multiple attention mechanism layers, utilizes their feature capture capabilities for long sequences and parallel computing capabilities, and enhances the network's sensitivity to important features by weighting input features, while significantly reducing the time and space resources required for calculations, thereby solving the problem that existing data-driven models cannot balance estimation accuracy and efficiency.
[0064] Therefore, the present invention achieves more efficient and accurate prediction of battery health status, and has outstanding social value and broad market application prospects. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] Figure 1 Schematic diagram of the training process of the lithium-ion battery SOH estimation model based on HHO optimization fusion attention mechanism and TCN-GRU.
[0066] Figure 2 Schematic diagram of the structure of the HHO optimized fusion attention mechanism and TCN-GRU neural network model.
[0067] Figure 3 Comparison curve of SOH prediction and true value for B0005 battery based on HHO optimized fusion attention mechanism and TCN-GRU model.
[0068] Figure 4 Comparison curve of SOH prediction and true value for B0006 battery based on HHO optimized fusion attention mechanism and TCN-GRU model.
[0069] Figure 5 Comparison curve of SOH prediction and true value for B0007 battery based on HHO optimized fusion attention mechanism and TCN-GRU model. DETAILED DESCRIPTION
[0070] In order to more intuitively illustrate the technical solution of the present invention, it is now described in more detail in conjunction with the accompanying drawings and specific embodiments. It should be pointed out that the specific embodiments are only used to illustrate the content of the present invention, rather than to limit the scope of its implementation. Other implementation schemes obtained by those skilled in the art without creative work all belong to the protection scope of the present invention.
[0071] Combination Figure 1 The present invention provides a lithium-ion battery SOH estimation method that optimizes the HHO algorithm and integrates the 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 in each charge and discharge cycle, and calculate the SOH value based on the current capacity;
[0073] Specifically, the lithium battery charge and discharge cycle data collected in step 1 are from NASA (NASA), and three groups of data, B0005, B0006 and B0007, are selected for verification. All three groups of data are derived from the same 18650 battery with a rated capacity of 2Ah. According to official data, the three groups of batteries are charged at 1.5A constant current at 24°C. When the operating voltage rises to the maximum cut-off voltage of 4.2V, they are switched to constant voltage charging until the current drops to 20mA and stops charging. After standing, they are discharged at 2A constant current. When the voltages of the three groups of batteries are respectively reduced to 2.7V, 2.5V and 2.2V, the experiment is completed. Compared with other data, the three groups of experimental data selected by the embodiment cover more battery charge and discharge cycles, a total of 168 groups of data.
[0074] SOH is the health status of the battery. When SOH is defined from the perspective of capacity, the calculation formula is:
[0075]
[0076] In the formula, Q t Q is the maximum available capacity of the battery. n is the factory rated capacity of the battery. Both indicate the actual amount of charge discharged by the battery when the battery's state of charge (SOC) changes from 100% to 0 under standard discharge conditions.
[0077] Step 2: Process the data under each charge and discharge cycle to obtain multiple battery degradation feature sequences; use the Pearson correlation coefficient to calculate the correlation coefficient between different degradation features and SOH values, select the degradation feature sequence whose correlation coefficient meets the expected threshold, and obtain a new degradation feature sequence.
[0078] Specifically, in this step, the various degradation characteristics of the lithium battery include constant current charging time, constant current charging capacity, constant voltage charging time, constant voltage charging capacity, maximum temperature during charging, voltage change during the same time, peak value of the IC curve, and voltage corresponding to the peak value of the IC curve. It includes the following sub-steps:
[0079] Step 2.1, collecting the total time of the lithium battery in each charge and discharge cycle at a constant current of 1.5A during the charging stage, and all the total time constitutes a decay characteristic sequence 1;
[0080] In the constant current charging stage, as the number of charge and discharge cycles increases, the active substances in the electrode material gradually decrease while the internal resistance of the battery increases, resulting in a rapid rise in the battery voltage in the constant current charging stage and a gradual shortening of the constant current charging time. Therefore, the present invention forms a decay characteristic sequence 1 with the total time of the constant current charging stage in all cyclic charging processes.
[0081] Step 2.2, collecting the charging capacity of the lithium battery at the 1.5A constant current charging stage in each charge and discharge cycle, and all charging capacities constitute a decay characteristic sequence 2;
[0082] Similar to the above sub-step 2.1, in the constant current charging stage, as the number of charging times increases, the active substances in the electrode material gradually decrease while the internal resistance of the battery increases. By changing the charging capacity in the constant current stage, it is possible to clearly analyze whether the decay rate has a sudden change or abnormality. Therefore, the present invention forms a decay characteristic sequence 2 with the charging capacity in the constant current charging stage during all cyclic charging processes.
[0083] Step 2.3, collecting the total time of the lithium battery in the charging stage at a constant voltage of 4.2V in each charge and discharge cycle, and all the total time constitutes a decay characteristic sequence 3;
[0084] In the constant voltage charging stage, as the number of charge and discharge cycles increases, the polarization effect causes the electrochemical reaction rate of the battery to decrease, and the electrolyte interface (SEI) film is formed and gradually thickens. The charging 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 extended. Therefore, the present invention combines the total time of the constant voltage charging stage in all cyclic charging processes into a decay characteristic sequence 3.
[0085] Step 2.4, collecting the charging capacity of the lithium battery at the 4.2V constant voltage charging stage during each charge and discharge cycle, and all charging capacities form a decay characteristic sequence 4;
[0086] Similar to the above sub-step 2.3, in the constant voltage charging stage, as the number of charge and discharge cycles increases, the polarization effect causes the electrochemical reaction rate of the battery to decrease, the electrolyte interface (SEI) film is formed and gradually thickens, and the charging capacity in the constant voltage stage will also decrease accordingly. Therefore, the present invention combines the charging capacity of the constant voltage charging stage in all cyclic charging processes into a decay characteristic sequence 4.
[0087] Compared with the constant current charging stage, the constant voltage charging stage is less affected by external factors such as temperature and current. The combination of the two can more comprehensively describe the battery degradation mechanism and improve the comprehensiveness of health status assessment.
[0088] Specifically, the charge capacity Q in step 2.2 and step 2.4 is expressed as:
[0089]
[0090] Where 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, collecting the maximum temperature of the battery surface during each charge and discharge cycle of the lithium battery, and all the maximum temperatures constitute a decay characteristic sequence 5;
[0092] As the number of charge and discharge cycles increases, the internal resistance of the battery gradually increases. The increase in internal resistance causes the battery to generate more heat during the charge and discharge process, thereby increasing the surface temperature. The maximum surface temperature can reflect the change trend of the internal resistance of the battery, and then reflect the battery degradation. Therefore, the present invention combines the maximum surface temperature of the lithium battery during all cyclic charging processes into a degradation characteristic sequence 5.
[0093] Step 2.6, collecting the time intervals when the voltage changes from 3.8V to 3.2V during the constant current discharge stage of each charge and discharge cycle of the lithium battery, and all the time intervals constitute a characteristic sequence 6;
[0094] The time of the constant current discharge stage is closely related to the actual available capacity of the battery. As the number of charge and discharge cycles increases, the battery capacity gradually decays, resulting in a shortened discharge time. Since the electrode surface reacts more violently in the early stage of discharge, the concentration of the electrode active substance decreases rapidly, and the voltage drops rapidly. As the battery discharges to the outside, the active substance has been consumed in large quantities in the later stage of discharge, the reaction rate decreases again, and the voltage also drops rapidly. In this case, a period of time in which the discharge voltage drops relatively slowly (from 3.8V to 3.2V) is selected as a feature of the discharge stage to help evaluate the health of the battery. Therefore, the present invention forms a decay feature sequence 6 with the time interval of the voltage changing from 3.8V to 3.2V during the constant current discharge stage of all cyclic charging processes.
[0095] Step 2.7, collecting the peak values of the IC curve during the constant current discharge stage of each charge and discharge cycle of the lithium battery, and all the peak values constitute a characteristic sequence 7;
[0096] The peak position and height of the IC curve are closely related to the reversibility of the electrochemical reaction inside the battery and the utilization rate of the active materials. As the number of battery charge and discharge cycles increases, the peak of the IC curve shifts or decreases in height. The change in the peak value can reflect the migration resistance of lithium ions in the electrode material. When the resistance increases, the peak of the IC curve becomes wider and lower, indicating that the dynamic performance of the battery decreases and shows an aging trend. Therefore, the present invention forms a decay characteristic sequence 7 of the peak values of the IC curve during all cyclic charging processes.
[0097] 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 and discharge cycle of the lithium battery, and all voltage values compose a characteristic sequence 8.
[0098] The number of complete data points of the IC curve is huge. Directly using all the data will increase the computational complexity. The peak voltage, as a key feature, can more sensitively capture tiny electrochemical changes while effectively reducing redundant information. This sensitivity is very important for predicting the remaining life (RUL) of the battery or detecting faults at an early stage. Therefore, the present invention forms a decay feature sequence 8 by combining the discharge voltage values corresponding to the peak values of the IC curve during all cyclic charging processes.
[0099] Specifically, the present invention adopts the incremental capacity method, and calculates the IC curve according to the following formula based on the battery voltage and current parameters during constant current discharge:
[0100]
[0101] Where ΔQ is the cumulative capacity obtained by integrating the current over a certain period of time, and ΔV is the change in voltage over that period of time.
[0102] The Pearson correlation coefficient is a statistical indicator that measures the degree of linear correlation between two variables. Its value range is -1 to 1. The specific explanation is as follows: when the coefficient tends to 1, it means that the two variables are positively correlated. When one variable increases, the other variable also increases proportionally; when the coefficient tends to -1, it means that the two variables are negatively correlated. When one variable increases, the other variable decreases proportionally; when the coefficient tends to 0, it means that the two variables are not linearly correlated, indicating that there is no linear relationship between the variables. The Pearson correlation coefficient r is expressed as:
[0103]
[0104] Among them, x i and i They represent the i-th value of the decay feature sequence and the SOH value sequence respectively, and x and y represent the average values of the decay feature sequence and the SOH value sequence respectively.
[0105] In this project, the absolute value of the expected threshold correlation coefficient is set between 0.8 and 1.0. Features within this range can make a greater contribution to the model prediction results and improve the accuracy and generalization ability of the model.
[0106] Step 3: Combine the new decay 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 ratio of 7:3.
[0107] Specifically, the 7:3 ratio has been proven to be effective in a variety of scenarios and tasks and has a certain degree of universality. 70% of the data is used for training, which can provide enough data samples for the model to learn and improve the model's fitting ability; 30% of the data is used for testing, which can 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 in the training set into the model that integrates the attention mechanism and TCN-GRU to train the model, and obtain 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 integrating the attention mechanism and TCN-GRU in step 4 includes an input layer, a TCN layer, a GRU layer, a multi-head attention layer, and an output layer from top to bottom.
[0110] like Figure 2 As shown in the figure, the TCN layer contains two convolutional residual modules, each of which contains two convolutional layers, two Dropout layers, two normalization layers, an activation layer, and a residual connection layer. The two convolutional layers include a causal convolutional layer and an expansion convolutional layer. It is used to ensure that the model effectively captures the long-term dependencies in the time series, alleviates the gradient vanishing problem, improves training efficiency, and strengthens regularization to avoid overfitting;
[0111] GRU layer, used to capture the correlation between different decay features;
[0112] Multi-head attention layer, which is 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 calculation;
[0113] The output layer, which includes the fully connected layer and the regression output layer, is used to map the extracted features to the dimensions of the output target and generate the final predicted value.
[0114] More specifically, the composition of the convolutional residual module is further defined:
[0115] Causal convolutional layers to ensure that the output does not depend on future information;
[0116] The dilated convolution layer is used to expand the receptive field and capture long-term dependencies or large-scale features. The convolution output calculation formula at time step t is:
[0117]
[0118] Where: K is the size of the convolution kernel, that is, the number of convolution kernel weights, w[k] is the weight of the convolution kernel at the kth position, and d is the expansion 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 randomly discards 10% of the neuron outputs to make the model independent of certain specific neurons during training, thereby increasing the robustness of the model.
[0120] Two normalization layers use layer normalization to stabilize each training process and avoid gradient disappearance or explosion. Compared with batch normalization, layer normalization is more suitable for small batch data or even single sample training. The calculation formula for the normalized value of the i-th neuron after layer normalization is:
[0121]
[0122] Where: x i is the activation value of the i-th neuron, μ is the mean of the input features, σ 2 is the variance of the input feature, is a small constant used to prevent the denominator from being zero and ensure numerical stability, and γ is a trainable scaling parameter.
[0123] More specifically, the calculation formula for the mean μ of the input feature is:
[0124]
[0125] Where: H is the total number of neurons.
[0126] Variance σ of input features 2 The calculation formula is:
[0127]
[0128] The activation layer is used to introduce nonlinear characteristics so that the model can learn complex mapping relationships. The ReLU type activation layer is selected, and the calculation formula is:
[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:
[0131] y=F(x)+x;
[0132] Where: F(x) is the output of the convolution module.
[0133] Step 5: Use the decay feature sequence in the test set as input and input it into the model 1 preliminarily trained in step 4 to obtain a predicted SOH value sequence with the same length as the decay feature sequence in the test set.
[0134] 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 scaled error (MASE) as the loss function.
[0135] Specifically, the mean absolute scaled error (MASE) in step 6 is expressed as:
[0136]
[0137] Among them, 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.
[0138] Step 7: Set the range of the number of neurons 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 evolutionary generations, and use the uniform random initialization technique to generate the initial population.
[0139] Specifically, the number of neurons in the fusion attention mechanism and TCN-GRU model is set to range from 18 to 72, the key value of the attention mechanism ranges from 30 to 60, the regularization parameter range is set to 0.001 to 0.01, and the learning rate range is set to 0.0001 to 0.001.
[0140] In the internal parameters of the HHO algorithm, the initial population size is set to 100 and the maximum number of evolution generations is set to 10.
[0141] After uniform random initialization within the predefined range, an initial population of 100 is obtained. The solution of each individual has a vector of 4 dimensions. The initial population X is:
[0142] X=[x1 x2…x 99 x 100 ];
[0143] For the first solution x1:
[0144] The number of neurons is randomly selected in the range of [18,72];
[0145] The key value of the attention mechanism is randomly selected to be generated in the range of [30,60];
[0146] The regularization parameter is randomly selected and generated in the range of [0.001, 0.01];
[0147] The learning rate is randomly selected and generated 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 extensiveness of the 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 used as the search starting point of the HHO algorithm, and the loss function obtained in step 6 is used as the objective function of the HHO algorithm for iterative optimization. The neurons, key values of the attention mechanism, regularization parameters and learning rates corresponding to the minimum loss value are obtained as the optimal solution, and the fusion attention mechanism and TCN-GRU model corresponding to the optimal solution are used as the trained model 2. Model 2 is used as the trained lithium-ion battery SOH estimation model.
[0150] Specifically, the HHO algorithm simulates the behavior patterns of hawks during hunting, guides the search direction through different search behavior patterns (such as chasing, encircling, and attacking), updates the initial population position for iterative optimization, and after each update, HHO will evaluate the pros and cons of the new position based on the loss function, gradually approaching the global optimal solution.
[0151] Step 9: Use the trained lithium-ion battery SOH estimation model to predict the SOH of the lithium battery to be tested.
[0152] The specific steps of step 9 are as follows: one or more corresponding decay features in the new decay feature sequence (decay feature sequence satisfying the Pearson correlation coefficient) obtained in step 2 are used as associated features, data under the charge and discharge cycle of the lithium battery to be tested are collected and processed to obtain data of associated features, and the data of associated features are input into the trained lithium-ion battery SOH estimation model to obtain the predicted SOH value of the lithium battery to be tested.
[0153] Figure 3 Comparison curve of SOH prediction and true value for B0005 battery based on HHO optimized fusion attention mechanism and TCN-GRU model. Figure 4 Comparison curve of SOH prediction and true value for B0006 battery based on HHO optimized fusion attention mechanism and TCN-GRU model. Figure 5 Comparison curve of SOH prediction and true value for B0007 battery based on HHO optimized fusion attention mechanism and TCN-GRU model. Figure 3-5 In the above example, the predicted value is the SOH value predicted by model 2, given by Figure 3-5 It can be seen that the predicted value and the true value are highly similar. The present invention achieves more efficient and accurate prediction of battery health status, and has outstanding social value and broad market application prospects.
[0154] The embodiments provided by the present invention are only examples of specific implementations, and the above description should not be understood as limiting the present invention. Many variations and modifications can be made within the scope of the model and principle of the present invention. Therefore, the protection scope of the present invention should be defined by the attached claims rather than the specific implementation methods given in this specification.
Claims
1. A lithium-ion battery SOH estimation method based on HHO optimization fusion attention mechanism and TCN-GRU, characterized in that: The following steps are involved: Step 1: Collect the voltage data, current data, battery surface temperature and current capacity of the lithium battery in each charge and discharge cycle, and calculate the SOH value based on the current capacity; Step 2: Process the data of each charge and discharge cycle to obtain multiple battery degradation characteristic sequences; The Pearson correlation coefficient is used to calculate the correlation coefficient between different decay characteristics and SOH values, and the decay characteristic sequence whose correlation coefficient meets the expected threshold is selected to obtain a new decay characteristic sequence; Step 3: Combine the new decay feature sequence obtained 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 according to a certain ratio; Step 4: Input the decay feature sequence and the corresponding SOH value sequence in the training set into the fusion attention mechanism and TCN-GRU model to obtain the model 1 that has been preliminarily trained; Step 5: Input the decay feature sequence in the test set into the model 1 preliminarily trained in step 4 to obtain a predicted SOH value sequence with the same length as the decay feature sequence in 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 scaled error MASE as the loss function; Step 7: Set the range of the number of neurons 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 evolutionary generations, and use the uniform random initialization technique to generate the initial population; 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 used as the search starting point of the HHO algorithm, and the loss function obtained in step 6 is used as the objective function of the HHO algorithm for iterative optimization, and the neurons, key values of the attention mechanism, regularization parameters and learning rates corresponding to the minimum loss value are obtained as the optimal solution, and the fusion attention mechanism and TCN-GRU model corresponding to the 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 to be tested.
2. According to claim 1, the lithium-ion battery SOH estimation method based on HHO optimization fusion attention mechanism and TCN-GRU is characterized in that: In step 1, the SOH value of the lithium battery is expressed as: In the formula, Q t Q is the maximum capacity of the battery currently available, n This is the factory rated capacity of the battery.
3. The lithium-ion battery SOH estimation method based on HHO optimization fusion attention mechanism and TCN-GRU according to claim 1 is characterized in that: In step 2, the various degradation characteristics of the lithium battery include constant current charging time, constant current charging capacity, constant voltage charging time, constant voltage charging capacity, maximum temperature during the charging process, voltage change in the same time, peak value of the IC curve and voltage corresponding to the peak value of the IC curve.
4. The lithium-ion battery SOH estimation method based on HHO optimization fusion attention mechanism and TCN-GRU according to claim 3 is characterized in that: The specific method for collecting the various degradation characteristics of the lithium battery is: Step 2.1, collecting the total time of the lithium battery in each charge and discharge cycle at a constant current of 1.5A during the charging stage, and all the total time constitutes a decay characteristic sequence 1; Step 2.2, collecting the charging capacity of the lithium battery at the charging stage of 1.5A constant current in each charge and discharge cycle, and all charging capacities constitute the decay characteristic sequence 2; Step 2.3, collecting the total time of the lithium battery in the charging stage at a constant voltage of 4.2V in each charge and discharge cycle, and all the total time constitutes the decay characteristic sequence 3; Step 2.4, collecting the charging capacity of the lithium battery at the 4.2V constant voltage charging stage in each charge and discharge cycle, and all charging capacities constitute a decay characteristic sequence 4; Step 2.5, collecting the maximum temperature of the battery surface during each charge and discharge cycle of the lithium battery, and all the maximum temperatures constitute the decay characteristic sequence 5; Step 2.6, collecting the time intervals when the voltage changes from 3.8V to 3.2V during the constant current discharge stage of each charge and discharge cycle of the lithium battery, and all the time intervals constitute characteristic sequence six; Step 2.7, collecting the peak values of the IC curve at the constant current discharge stage of each charge and discharge cycle of the lithium battery, and all the peak values constitute characteristic sequence seven; 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 and discharge cycle of the lithium battery, and all voltage values constitute characteristic sequence eight.
5. The lithium-ion battery SOH estimation method based on HHO optimization fusion attention mechanism and TCN-GRU according to claim 4 is characterized in that: The charging capacity Q in step 2.2 and step 2.4 is expressed as: Where 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 optimization fusion attention mechanism and TCN-GRU according to claim 4 is characterized in that: In step 2.7, the calculation formula of the IC curve is: Where ΔQ is the cumulative capacity obtained by integrating the current over a certain period of time, and ΔV is the change in voltage over that period of time.
7. The lithium-ion battery SOH estimation method based on HHO optimization fusion attention mechanism and TCN-GRU according to claim 1 is characterized in that: The Pearson correlation coefficient r in step 2 is expressed as: Among them, x i and i Represent the i-th value of the decay feature sequence and SOH value sequence respectively, and They represent the average values of the decay characteristic series and the SOH value series respectively; The expected threshold in step 2 is that the absolute value of the correlation coefficient ranges from 0.8 to 1.
0.
8. The lithium-ion battery SOH estimation method based on HHO optimization fusion attention mechanism and TCN-GRU according to claim 1 is characterized in that: The fusion attention mechanism and TCN-GRU model in step 4 include input layer, TCN layer, GRU layer, multi-head attention layer and output layer from top to bottom; Among them, the TCN layer,contains two convolutional residual modules, each of which contains two convolutional layers, two Dropout layers, two normalization layers, an activation layer, and a residual connection layer; Among them, the output layer includes a fully connected layer and a regression output layer.
9. The lithium-ion battery SOH estimation method based on HHO optimization fusion attention mechanism and TCN-GRU according to claim 1 is characterized in that: In step 6, the mean absolute scale error MASE is expressed as: Among them, y i is the true value of the i-th SOH value sequence in the test set, y i,sim To predict the i-th predicted value of the SOH value sequence, N is the number of samples.
10. The lithium-ion battery SOH estimation method based on HHO optimization fusion attention mechanism and TCN-GRU according to claim 1 is 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 evolutionary generation is set to 10.
Citation Information
Patent Citations
Lithium battery health state prediction method based on HHO-SVR
CN116774045A
Lithium battery health state prediction method based on TWP-SVR
CN117388742A
Lithium battery discharge capacity estimation method without temperature sensor
CN118393361A
Lithium battery health state assessment method based on improved Harlisia eagle optimization and SVR algorithm
CN118535876A
Lithium battery SOH estimation method fusing attention mechanism and deep convolution
CN118731751A
Cited By
Lead-carbon battery rapid recession diagnosis method based on feature fusion
CN120142986A
Rapid degradation diagnosis method for lead-carbon batteries based on feature fusion
CN120142986B
Lithium battery SOH estimation method and system based on improved TCN-GRU
CN120891396A