A multi-level early warning method for thermal runaway of lithium batteries based on attention mechanism

By using Attention+CNN+LSTM network in the thermal runaway warning of lithium-ion batteries, combined with the attention mechanism, the problem of untimely warning in the existing technology is solved, and a more accurate and timely thermal runaway warning of lithium-ion batteries is achieved.

CN118209873BActive Publication Date: 2025-03-21深圳市灰山石能源管理有限公司 +1
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202410240419.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-04
Publication Date
2025-03-21
Estimated Expiration
2044-03-04

AI Technical Summary

Technical Problem

In the prior art, early warning is based on the battery surface temperature. The early warning is not timely enough, making it difficult to effectively prevent the thermal runaway of lithium-ion batteries.

Method used

The Attention+CNN+LSTM network based on the attention mechanism is adopted to intercept battery parameters through the sliding window, combine LSTM and CNN to extract battery data changes, and use the attention mechanism to determine key parameters to achieve multi-level early warning of thermal runaway from lithium batteries.

Benefits of technology

It improves the accuracy and timeliness of thermal runaway warning of lithium batteries, and can issue a third-level warning message some time before the lithium battery fire to avoid the occurrence of fire.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118209873B_ABST
    Figure CN118209873B_ABST
Patent Text Reader

Abstract

The present invention provides a multi-level early warning method for thermal runaway of lithium batteries based on an attention mechanism, comprising: step 1: obtaining lithium-ion battery parameters; step 2: intercepting battery parameters within a first preset time through a sliding window; step 3: inputting the lithium-ion battery parameters of the preset time into the Attention+CNN+LSTM network and the LSTM network to obtain early warning information; step 4: taking corresponding measures for the early warning information, eliminating the early warning state, and completing the multi-level early warning of thermal runaway of lithium batteries. The present invention uses a deep learning method to predict the internal temperature of the battery. On the basis of LSTM, improvements are made, CNN is added to extract changes in battery data, and an attention mechanism is added to determine which parameters are more important for temperature prediction, thereby improving the accuracy of the prediction. Simulation experimental results show that this method can effectively warn of thermal runaway of lithium batteries during charging, and can issue three-level early warning information some time before the lithium battery catches fire to avoid the occurrence of fire.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of thermal runaway warning, and more specifically, relates to a multi-level thermal runaway warning method for lithium batteries based on an attention mechanism. Background Art

[0002] The thermal runaway early warning method for lithium-ion batteries mainly inputs the data collected by the sensor in real time into the established algorithm and compares it with the thermal runaway boundary. So far, the thermal runaway early warning methods for lithium-ion batteries can be divided into methods based on electrochemical mechanisms and methods based on big data and deep learning algorithms.

[0003] The methods based on electrochemical mechanism mainly include heat generation calculation, gas production detection, expansion force detection, electrochemical impedance spectroscopy test and other methods. The electrochemical-thermal coupling model can be used to calculate the heat generation of the battery, determine the boundary of battery thermal runaway according to the working conditions, and issue an early warning when the boundary value is exceeded; when the battery has thermal runaway, it will produce CO, CO2, HF and other gases, and thermal runaway early warning can be achieved by monitoring the concentration of these gases; according to the electrochemical impedance spectroscopy characteristics of lithium-ion batteries, the internal temperature of the battery can be estimated in real time through phase shift, ZIF (zero intercept frequency), non-ZIF and other methods to achieve thermal runaway early warning; the dynamic impedance slope changes from negative to positive within a specific frequency range to detect whether the battery is overcharged and prevent the battery from thermal runaway. These methods have high interpretability, but due to the complex internal mechanism of the battery and the occurrence of multiple chemical reactions inside the battery when the battery has thermal runaway, it is difficult to establish an accurate model.

[0004] The method based on battery big data and deep learning algorithm uses information such as battery voltage, current, correlation coefficient between voltage and temperature, sample entropy, etc. to analyze abnormal values ​​in real vehicle data, and uses machine learning algorithm to directly predict whether the battery is abnormal or thermal runaway. The method based on big data and deep learning has gone through the development process from threshold boundary determination, information statistics method, machine learning method to deep learning, and from the initial single-modal analysis to the current multi-modal data analysis. More and more machine learning algorithms are applied to the field of thermal runaway warning, and many progress has been made.

[0005] Due to environmental pollution, climate change and the depletion of non-renewable resources, fossil energy is gradually being replaced by clean electricity. As an important part of the energy system, battery energy storage systems are widely used due to the need to quickly respond to energy needs and improve battery performance. Lithium-ion batteries have the advantages of high energy density, long life, low self-discharge rate, and environmental protection, and are more widely used in energy storage systems than other types of batteries. During the charging and discharging process, lithium-ion batteries generate a lot of heat due to electrochemical reactions and internal resistance heating, and the heat generated will increase the temperature of the energy storage system. The accumulation of heat and the increase in temperature will accelerate the exothermic reaction; in severe cases, it may even lead to thermal runaway, which in turn causes a fire. At present, there have been many fires in energy storage power stations and electric vehicles, causing serious economic losses.

[0006] When a lithium-ion battery is overcharged, the internal temperature will increase rapidly, causing a series of complex chemical reactions inside the battery, such as diaphragm decomposition and electrolyte decomposition. These chemical reactions will release heat, further increasing the temperature inside the battery, thereby further triggering internal chemical reactions, forming a "heat-temperature-chemical reaction" closed loop, and causing battery thermal runaway. In response to the overcharge of lithium-ion batteries, the present invention designs a thermal runaway multi-level early warning method of Attention+CNN+LSTM, which issues different levels of early warning information as thermal runaway develops. Summary of the invention

[0007] The present invention aims to solve the technical problem that the warning is not timely enough in the prior art according to the surface temperature of the battery, and further proposes a multi-level warning method for thermal runaway of a lithium battery based on an attention mechanism.

[0008] The technical solution adopted by the present invention to solve the above problems is: the present invention proposes a multi-level early warning method for thermal runaway of lithium batteries based on an attention mechanism, comprising:

[0009] Step 1: Obtain lithium-ion battery parameters;

[0010] Step 2: intercepting battery parameters within a first preset time through a sliding window;

[0011] Step 3: Input the lithium-ion battery parameters at the preset time into the Attention+CNN+LSTM network and the LSTM network to obtain warning information;

[0012] Step 4: Take corresponding measures for the warning information, eliminate the warning status, and complete the multi-level warning of lithium battery thermal runaway.

[0013] Optionally, the lithium-ion battery parameters in step 1 include lithium-ion battery voltage, current, lithium-ion charge state, battery surface temperature and ambient temperature data.

[0014] Optionally, the steps of completing the lithium-ion battery thermal runaway warning in step 3 include:

[0015] Step 3.1: Use lithium-ion battery parameters as training data and use the zebra optimization algorithm to train the LSTM network and Attention+CNN+LSTM;

[0016] Step 3.2: Input the intercepted lithium-ion battery voltage data within the preset time into the trained LSTM network to obtain the voltage anomaly detection result;

[0017] Step 3.3: Input the captured lithium-ion battery voltage, current, lithium-ion charge state, battery surface temperature and ambient temperature data within the preset time into the trained Attention+CNN+LSTM network to obtain the prediction result of the internal temperature of the lithium-ion battery;

[0018] Step 3.4: issuing corresponding warning information based on the voltage anomaly detection result and the lithium-ion battery internal temperature prediction result;

[0019] Step 3.5: Repeatedly capture the battery parameters within a preset time by sliding the window, with a second preset time interval between the last capture of the battery parameters;

[0020] Step 3.6: Repeat steps 3.2 to 3.5 to complete the continuous lithium-ion battery thermal runaway warning.

[0021] Optionally, the steps of using the zebra optimization algorithm to train the LSTM network and Attention+CNN+LSTM in step 3.1 include:

[0022] Step 3.1.1: Set the maximum number of iterations and the number of decision variables;

[0023] Step 3.1.2: Initialize the zebra population and calculate the objective function of the initialized zebra population;

[0024] Step 3.1.3: Obtain the pioneer horse based on the objective function of the zebra population initialized by Hu;

[0025] Step 3.1.4: Perform the first-stage iterative update according to the foraging strategy to obtain the updated objective function value of the first stage;

[0026] Step 3.1.5: If the objective function value after the first phase update is less than the objective function value before the update, then select the defense strategy for the second phase iterative update to obtain the corresponding objective function value. If the objective function value after the second phase iterative update is less than the objective function value before the update, then continue to iterate and update. If it is greater than the objective function value before the update, then keep the current objective function value.

[0027] Step 3.1.6: Repeat steps 3.1.3 to 3.1.5 until the maximum number of iterations is reached, and output the objective function value after the last update;

[0028] Step 3.1.7: Get the updated network weights and biases based on the last updated objective function value;

[0029] Step 3.1.8. Train the LSTM network and Attention+CNN+LSTM based on the updated network weights, biases, and training data, and calculate the model accuracy of the trained LSTM network and Attention+CNN+LSTM;

[0030] Step 3.1.9: Repeat steps 3.1.1 to 3.1.8 until the model accuracy of the trained LSTM network and Attention+CNN+LSTM reaches the preset accuracy;

[0031] The expression for the zebra population is:

[0032]

[0033] In formula (1), X is the matrix of the zebra population, X i is the i-th zebra, x i,j is the solution of the i-th zebra with respect to the j-th decision variable, N is the number of zebras, and m is the number of decision variables;

[0034] The expression of the objective function value is:

[0035]

[0036] In formula (2), F is the numerical vector of the objective function, F i is the objective function value obtained by the i-th zebra, F(X i ) is the objective function value of the i-th zebra with respect to the j-th decision variable;

[0037] The expression of the foraging strategy is:

[0038]

[0039]

[0040] In formulas (3) and (4), is the updated position of the i-th zebra in the first stage, is the value of the j-th decision variable, PZ is the pioneer horse, PZ j is the value of the jth dimension, r is a random constant in the interval [0,1], I is a random constant in the interval {1,2}, is the current objective function value, F i is the objective function value before updating;

[0041] The defense strategy is expressed as:

[0042]

[0043]

[0044] In formulas (5) and (6), is the updated position of the i-th zebra in the second phase, is the value of the jth decision variable, t is the number of iterations, T is the maximum number of iterations, R is a constant, P s is the probability of choosing the first strategy, AZ is the state of the attacked zebra, AZ j is the value of its j-th dimension, F i new,P1 is the current objective function value.

[0045] Optionally, the LSTM network in step 3.1 includes:

[0046] The LSTM network includes a forget gate, an input gate, and an output gate;

[0047] The forget gate includes a data reading layer and a sigmoid function layer;

[0048] The input gate includes a sigmoid function layer and a tanh function layer;

[0049] The output gate includes a sigmoid function layer and a tanh function layer;

[0050] The input data of the LSTM network is the lithium-ion battery voltage data input at the current moment, the result of the previous neuron output, and the cell state at the previous moment;

[0051] The output data is 0 or 1, 0 means the voltage is abnormal, 1 means the voltage is normal.

[0052] Optionally, the step of obtaining the voltage anomaly detection result in step 3.1 includes:

[0053] Step 3.1.1: Input the lithium-ion battery voltage data at the current moment and the result of the previous neuron output into the forget gate, and after passing through the sigmoid layer, output a value f in the interval [0,1] t , f t Multiply the cell state at the previous moment point by point to determine the retained value from the cell state at the previous moment to the cell state at the current moment;

[0054] Step 3.1.2: Input the lithium-ion battery voltage data at the current moment and the result of the previous neuron output into the sigmoid function layer and tanh function layer in the input gate to obtain the state candidate vector;

[0055] Step 3.1.3: Update the current cell state based on the retained value and state candidate vector from the cell state at the previous moment to the cell state at the current moment;

[0056] Step 3.1.4: Input the lithium-ion battery voltage data at the current moment and the result of the previous neuron output into the sigmoid function layer in the output gate to obtain the value o in the [0,1] interval t , the updated current cell state is converted into an output value in the interval [-1,1] through the tanh function layer, and the output value and o t Multiply to get the voltage output value at the corresponding moment;

[0057] Step 3.1.5: If the voltage output value at the corresponding moment is 0, it means that the voltage is abnormal and a first-level warning message is issued; if the voltage output value at the corresponding moment is 1, it means that the voltage is normal and no warning message is issued;

[0058] The expression of the forget gate is:

[0059] f t =σ(W f ·[h t-1 ,x t ]+b f ) (7)

[0060] In formula (7), f t is a constant in [0,1], W t is the weight of the forget gate, σ represents the sigmoid function, h t-1 is the output of the previous neuron, x t is the lithium-ion battery voltage data input at the current moment, b f Bias for the forget gate;

[0061] The expression of the input gate is:

[0062] i t =σ(W i ·[h t-1 ,x t ]+b i ) (8)

[0063]

[0064] In formulas (8) and (9), W i is the weight of the updated value, W c is the input gate weight, bi is the bias of the updated value, b c is the bias of the input gate, is the state candidate vector, i t The updated value of the lithium-ion battery voltage data input at the current moment;

[0065] The expression for the current cell state update is:

[0066]

[0067] In formula (10), C t Update the value for the current cell state, C t-1 is the cell state at the previous moment;

[0068] The expression of the output gate is:

[0069] o t =σ(W o ·[h t-1 ,x t ]+b o ) (11)

[0070] h t =o t ×tan(C t ) (12)

[0071] In formulas (11) and (12), o t is the output value in the interval [0,1], W o is the weight of the output gate, b o is the bias of the output gate, h t is the voltage output value at the corresponding moment, tan(C t ) is the updated value of the current cell state after conversion by the tanh function, and tan(C t )∈[-1,1].

[0072] Optionally, the Attention+CNN+LSTM network in step 3.2 includes an input layer, a one-dimensional convolutional neural network layer, an LSTM neural network layer, an attention mechanism layer, a fully connected layer, and an output layer;

[0073] The one-dimensional convolutional neural network layer includes convolutional layer, pooling layer and fully connected layer.

[0074] Optionally, the step of obtaining the prediction result of the internal temperature of the lithium-ion battery in step 3.2 includes:

[0075] Step 3.2.1: Input the captured lithium-ion battery voltage, current, lithium-ion state of charge, battery surface temperature and ambient temperature data within the preset time into the convolution layer of the one-dimensional convolutional neural network layer for linear weighted summation, input the lithium-ion battery voltage, current, lithium-ion state of charge, battery surface temperature and ambient temperature data after the linear weighted summation into the pooling layer for pooling operation, and input the lithium-ion battery voltage, current, lithium-ion state of charge, battery surface temperature and ambient temperature data after the pooling operation into the fully connected layer for nonlinear combination;

[0076] Step 3.2.2: Input the nonlinearly combined lithium-ion battery voltage, current, lithium-ion state of charge, battery surface temperature and ambient temperature data into the LSTM neural network layer to obtain the predicted values ​​of the lithium-ion battery voltage, current, lithium-ion state of charge, battery surface temperature and ambient temperature data at the corresponding moment;

[0077] Step 3.2.3: Input the predicted values ​​of lithium-ion battery voltage, current, lithium-ion state of charge, battery surface temperature and ambient temperature data at the corresponding time into the attention mechanism layer for attention weight allocation and attention weighted summation;

[0078] Step 3.2.4: Input the weighted sum of the lithium-ion battery voltage, current, lithium-ion charge state, battery surface temperature and ambient temperature data at the corresponding time into the fully connected layer for nonlinear combination to obtain the battery internal temperature prediction result at the corresponding time;

[0079] Step 3.2.5: When the predicted result of the internal temperature of the battery at the corresponding moment exceeds 50°C, a second-level warning message is issued; when it exceeds 80°C, a third-level warning message is issued; if it is less than 50°C, it is the normal temperature of the battery and no warning message is issued;

[0080] The expression of attention weight distribution is:

[0081] score(y,x i )=V T tanh(W a [y,x i ]) (13)

[0082]

[0083] In formulas (13) and (14), V T and W a are weight matrices, is the attention weight assigned to the output lithium battery parameters, score(y,x i ) is the dependency relationship between input data and output elements;

[0084] The expression of the weighted sum of attention is:

[0085]

[0086] In formula (15), c t The output after the lithium battery parameters and the weighted sum of attention, x i Input lithium battery parameters.

[0087] The beneficial effect of the present invention is that the present invention adopts a deep learning method to predict the internal temperature of the battery. Improvements are made on the basis of LSTM, CNN is added to extract changes in battery data, and an attention mechanism is added to determine which parameters are more important for temperature prediction, thereby improving the accuracy of the prediction. Simulation experimental results show that this method can effectively warn of thermal runaway of lithium batteries during charging, and can issue a three-level warning message some time before a lithium battery catches fire to avoid the occurrence of fire. BRIEF DESCRIPTION OF THE DRAWINGS

[0088] Figure 1 It is a flow chart of a multi-level early warning method for thermal runaway of a lithium battery based on an attention mechanism provided by an embodiment of the present invention;

[0089] Figure 2 A diagram of the battery thermal runaway-fire development process provided by an embodiment of the present invention;

[0090] Figure 3 A diagram of a long short-term memory network neuron structure provided by an embodiment of the present invention;

[0091] Figure 4 LSTM neural network structure diagram provided for an embodiment of the present invention;

[0092] Figure 5 Attention+CNN+LSTM network structure diagram provided for the embodiment of the present invention;

[0093] Figure 6 A flowchart of using the zebra optimization algorithm to train an LSTM neural network and an Attention+CNN+LSTM network according to an embodiment of the present invention;

[0094] In the figure, 1D-CNN is a one-dimensional convolution, Attention is an attention mechanism, and X V is the input lithium battery voltage data, X I is the input lithium battery current data, X T is the input lithium battery surface temperature data, X t is the input lithium battery ambient temperature data, X soc is the input state of charge data of the lithium battery, Softmax is the fully connected layer, Outout is the output, h t-1is the output of the previous neuron, x t is the lithium-ion battery voltage data input at the current moment, c t is the output of the weighted sum of lithium battery parameters and attention, x i is the input lithium battery parameter, h t is the voltage output value at the corresponding moment. Example

[0095] Combination Figure 1-6 In this embodiment, the thermal runaway of the battery occurs because the internal heat generation rate is much higher than the heat dissipation rate, and a large amount of heat is accumulated inside the battery, which triggers a chain reaction and causes the battery to catch fire. The root causes of battery thermal runaway can be divided into three categories: mechanical abuse, electrical abuse, and thermal abuse.

[0096] Mechanical abuse: Mechanical deformation or even partial rupture of the diaphragm may cause internal short circuit due to extrusion or puncture.

[0097] Electrical abuse: Overcharging and over-discharging can lead to the formation of lithium dendrites inside the battery cell, which can penetrate the diaphragm and cause a short circuit between the positive and negative electrodes.

[0098] Thermal abuse: Excessively high temperature causes decomposition of the diaphragm and positive electrode materials, and large-scale collapse of the diaphragm leads to a short circuit between the positive and negative electrodes.

[0099] like Figure 2 As shown in the figure, in the case of overheating, overcharging, overdischarging, impact, extrusion, puncture, short circuit, etc., the battery will become hot, which will lead to thermal runaway reaction of the battery. Thermal runaway reaction includes SEI decomposition, diaphragm melting, electrolyte decomposition, positive electrode material decomposition, reaction between negative electrode active material and electrolyte, reaction between positive electrode active material and electrolyte, reaction between negative electrode active material and binder, etc. There is no order in which these reactions occur. As long as the temperature reaches the conditions for the reaction to start, these reactions will proceed simultaneously.

[0100] This series of reactions will produce a large amount of high-temperature flammable gas. When these gases accumulate to a certain level, they will break the safety valve of the battery, and the ejected electrolyte inside the battery and the generated flammable gas will produce a jet fire. The heat of the thermal runaway battery module will first spread to the surrounding battery modules. In addition, the combustion materials ejected by the battery fall on other battery modules, which will cause the temperature of adjacent batteries to rise rapidly, causing the fire to spread.

[0101] The occurrence of battery thermal runaway is not the change of a single parameter, but the result of the interaction of multiple internal and external components. The process of battery thermal runaway will cause temperature rise, voltage drop, gas release, smoke release, combustion and explosion, etc.

[0102] As a series of complex chemical reactions occur inside the battery and release heat, the battery temperature will continue to rise. Since it takes a certain amount of time for heat to spread from the inside of the battery to the surface of the battery, there will be a certain delay in the change of the battery surface temperature.

[0103] Due to different causes of battery thermal runaway, the voltage change trend will also be different. In thermal runaway caused by mechanical abuse, the voltage will drop directly to 0V; in thermal runaway caused by overcharging, the voltage will first increase and then drop to 0V; in overdischarge, the voltage will gradually decrease to 0V; in overheating, the voltage will gradually drop to 0V with thermal runaway.

[0104] The chemical reaction inside the battery generates heat and gas, causing the pressure inside the battery to increase. When the pressure reaches the safety valve threshold, the safety valve will open and discharge the gas. A sound signal will also be generated at the moment the safety valve opens.

[0105] When a lithium-ion battery experiences thermal runaway, multiple parameters change, and these parameters are also the basis for thermal runaway warning.

[0106] like Figure 1 As shown, a multi-level early warning method for thermal runaway of lithium batteries based on an attention mechanism includes:

[0107] Step 1: Obtain lithium-ion battery parameters;

[0108] Furthermore, the lithium-ion battery parameters in step 1 include lithium-ion battery voltage, current, lithium-ion charge state, battery surface temperature and ambient temperature data.

[0109] Step 2: intercepting the battery parameters within a first preset time through a sliding window, where the first preset time is 30 seconds;

[0110] Step 3: Input the lithium-ion battery parameters at the preset time into the Attention+CNN+LSTM network and the LSTM network to obtain warning information;

[0111] Furthermore, the steps of completing the thermal runaway warning of the lithium-ion battery in step 3 include:

[0112] Step 3.1: Use lithium-ion battery parameters as training data and use the zebra optimization algorithm to train the LSTM network and Attention+CNN+LSTM;

[0113] like Figure 6 As shown, the zebra optimization algorithm is a meta-heuristic optimization algorithm that simulates the foraging and defense behavior of zebras, and shows excellent performance in a variety of optimization problems. The present invention uses the zebra optimization algorithm to optimize the parameters of the neural network, aiming to improve the accuracy of the model and perform voltage anomaly detection and temperature estimation more effectively.

[0114] The zebra optimization algorithm is a population-based optimization algorithm. Zebras are members of the population. From a mathematical point of view, each zebra is a candidate solution to the problem. The plane where the zebras are located is the search space of the problem. The position of each zebra in the space determines the value of the decision variable. Each zebra is represented by a vector, and the elements of the vector represent the value of the decision variable. A matrix is ​​used to represent the zebra population.

[0115] Furthermore, step 3.1 includes:

[0116] Step 3.1.1: Set the maximum number of iterations and the number of decision variables;

[0117] Step 3.1.2: Initialize the zebra population and calculate the objective function of the initialized zebra population;

[0118] Step 3.1.3: Obtain the pioneer horse based on the objective function of the zebra population initialized by Hu;

[0119] Step 3.1.4: Perform the first-stage iterative update according to the foraging strategy to obtain the updated objective function value of the first stage;

[0120] Step 3.1.5: If the objective function value after the first phase update is less than the objective function value before the update, then select the defense strategy for the second phase iterative update to obtain the corresponding objective function value. If the objective function value after the second phase iterative update is less than the objective function value before the update, then continue to iterate and update. If it is greater than the objective function value before the update, then keep the current objective function value.

[0121] Step 3.1.6: Repeat steps 3.1.3 to 3.1.5 until the maximum number of iterations is reached, and output the objective function value after the last update;

[0122] Step 3.1.7: Get the updated network weights and biases based on the last updated objective function value;

[0123] Step 3.1.8. Train the LSTM network and Attention+CNN+LSTM based on the updated network weights, biases, and training data, and calculate the model accuracy of the trained LSTM network and Attention+CNN+LSTM;

[0124] Step 3.1.9: Repeat steps 3.1.1 to 3.1.8 until the model accuracy of the trained LSTM network and Attention+CNN+LSTM reaches more than 85%;

[0125] The expression for the zebra population is:

[0126]

[0127] In formula (1), X is the matrix of the zebra population, X i is the i-th zebra, x i,j is the solution of the i-th zebra with respect to the j-th decision variable, N is the number of zebras, and m is the number of decision variables;

[0128] The expression of the objective function value is:

[0129]

[0130] In formula (2), F is the numerical vector of the objective function, F i is the objective function value obtained by the i-th zebra, F(X i ) is the objective function value of the i-th zebra with respect to the j-th decision variable;

[0131] The expression of the foraging strategy is:

[0132]

[0133]

[0134] In formulas (3) and (4), is the updated position of the i-th zebra in the first stage, is the value of the j-th decision variable, PZ is the pioneer horse, PZ j is the value of the jth dimension, r is a random constant in the interval [0,1], I is a random constant in the interval {1,2}, F i new,P1 is the current objective function value, F i is the objective function value before updating;

[0135] The defense strategy is expressed as:

[0136]

[0137]

[0138] In formulas (5) and (6), is the updated position of the i-th zebra in the second phase, is the value of the jth decision variable, t is the number of iterations, T is the maximum number of iterations, R is a constant, P s is the probability of choosing the first strategy, AZ is the state of the attacked zebra, AZ j is the value of its j-th dimension, F i new,P1 is the current objective function value.

[0139] After using the zebra algorithm to optimize the training of the LSTM network and Attention+CNN+LSTM network, the optimal solution for the network parameters is found through continuous iteration.

[0140] When using the zebra optimization algorithm for model optimization, it is necessary to determine the decision variables and objective functions to be optimized. The weight W and bias b are the main factors affecting the accuracy of the neural network model, so [W, b] is used as the decision variables to be optimized. If the accuracy of the entire model is used as the objective function of the zebra optimization algorithm, all data needs to be learned once for one iteration, which will take a lot of time. Here, the idea of ​​stochastic gradient descent is adopted, and the loss function is used as the objective function, that is, the difference between the temperature estimated by the model and the actual temperature is optimized. In order to reduce the generalization error of the model and improve the convergence speed of the algorithm, the idea of ​​mini-batch is borrowed to randomly extract a part of the data to calculate the loss function as the optimization objective function.

[0141]

[0142] In formula (7), n is the number of samples drawn, is the estimated internal temperature of the battery, and T is the actual internal temperature of the battery.

[0143] Step 3.2: Input the intercepted lithium-ion battery voltage data within the preset time into the trained LSTM network to obtain the voltage anomaly detection result;

[0144] Furthermore, the LSTM network in step 3.1 includes:

[0145] The LSTM network includes a forget gate, an input gate, and an output gate;

[0146] The forget gate includes a data reading layer and a sigmoid function layer;

[0147] The input gate includes a sigmoid function layer and a tanh function layer;

[0148] The output gate includes a sigmoid function layer and a tanh function layer;

[0149] The input data of the LSTM network is the lithium-ion battery voltage data input at the current moment, the result of the previous neuron output, and the cell state at the previous moment;

[0150] The output data is 0 or 1, 0 means the voltage is abnormal, 1 means the voltage is normal.

[0151] like Figure 3 and Figure 4As shown, the LSTM neural network in the present invention is further described below. LSTM (Long Short Term Memory) is a neural network structure commonly used to process sequence data. It is improved on the basis of recurrent neural network and can effectively predict time series. Compared with recurrent neural network, LSTM adds memory units to record and store historical information, and controls the flow of information through a gating mechanism.

[0152] The input of LSTM consists of x t ,h t-1 and C t-1 , the output is h t and C t . Where x t is the data input at the current moment, h t-1 is the output of the previous neuron, C t-1 is the cell state at the previous moment, h t and C t They represent the output and cell state at the current moment respectively. Several LSTM neural networks combined together can realize the prediction of time series.

[0153] Furthermore, the step of obtaining the voltage anomaly detection result in step 3.1 includes:

[0154] Step 3.1.1: Input the lithium-ion battery voltage data at the current moment and the result of the previous neuron output into the forget gate, and after passing through the sigmoid layer, output a value f in the interval [0,1] t , f t Multiply the cell state at the previous moment point by point to determine the retained value from the cell state at the previous moment to the cell state at the current moment;

[0155] The forget gate determines how much of the cell state from the previous moment is retained in the cell state at the current moment, that is, it determines what information is discarded from the cell state. t and h t-1 , and then after passing through the sigmoid layer, it outputs a value f between 0 and 1 t , and cell state C t-1 The values ​​in are multiplied point by point to determine the retained information.

[0156] The expression of the forget gate is:

[0157] f t =σ(W f ·[h t-1 ,x t ]+b f ) (8)

[0158] In formula (8), ft is a constant in [0,1], W t is the weight of the forget gate, σ represents the sigmoid function, h t-1 is the output of the previous neuron, x t is the lithium-ion battery voltage data input at the current moment, b f Bias for the forget gate;

[0159] Step 3.1.2: Input the lithium-ion battery voltage data at the current moment and the result of the previous neuron output into the sigmoid function layer and tanh function layer in the input gate to obtain the state candidate vector;

[0160] The input gate determines how much of the current input to keep in the current cell state. It consists of two parts. The first part is the sigmoid layer, which converts x t and h t-1 Input to the sigmoid function, output a value between 0 and 1, and decide which values ​​to update. The second part is the tanh layer, which converts x t and h t-1 Get a state candidate vector through the tanh function Its value is between -1 and 1.

[0161] The expression of the input gate is:

[0162] i t =σ(W i ·[h t-1 ,x t ]+b i ) (9)

[0163]

[0164] In formulas (9) and (10), W i is the weight of the updated value, W c is the input gate weight, b i is the bias of the updated value, b c is the bias of the input gate, is the state candidate vector, i t The updated value of the lithium-ion battery voltage data input at the current moment;

[0165] Step 3.1.3: Update the current cell state based on the retained value and state candidate vector from the cell state at the previous moment to the cell state at the current moment;

[0166] The expression for the current cell state update is:

[0167]

[0168] In formula (11), C t Update the value for the current cell state, C t-1 is the cell state at the previous moment;

[0169] Step 3.1.4: Input the lithium-ion battery voltage data at the current moment and the result of the previous neuron output into the sigmoid function layer in the output gate to obtain the value o in the [0,1] interval t , the updated current cell state is converted into an output value in the interval [-1,1] through the tanh function layer, and the output value and o t Multiply to get the voltage output value at the corresponding moment;

[0170] The output gate determines the output at the current moment. First, x t and h t-1 Input to the sigmoid layer and get an output value between 0 and 1. t , and then convert the cell state to between -1 and 1 through the tanh function, and compare the output value with o t Multiply to get the output at that moment.

[0171] The expression of the output gate is:

[0172] o t =σ(W o ·[h t-1 ,x t ]+b o ) (12)

[0173] h t =o t ×tan(C t ) (13)

[0174] In formulas (12) and (13), o t is the output value in the interval [0,1], W o is the weight of the output gate, b o is the bias of the output gate, h t is the voltage output value at the corresponding moment, tan(C t ) is the updated value of the current cell state after conversion by the tanh function, and tan(C t )∈[-1,1].

[0175] Step 3.1.5: If the voltage output value at the corresponding moment is 0, it means that the voltage is abnormal and a first-level warning message is issued; if the voltage output value at the corresponding moment is 1, it means that the voltage is normal and no warning message is issued;

[0176] like Figure 5As shown, step 3.2: input the lithium-ion battery voltage, current, lithium-ion charge state, battery surface temperature and ambient temperature data within the preset time into the Attention+CNN+LSTM network to obtain the prediction result of the internal temperature of the lithium-ion battery;

[0177] Furthermore, the Attention+CNN+LSTM network in step 3.2 includes an input layer, a one-dimensional convolutional neural network layer, an LSTM neural network layer, an attention mechanism layer, a fully connected layer, and an output layer;

[0178] The one-dimensional convolutional neural network layer includes convolutional layer, pooling layer and fully connected layer.

[0179] Furthermore, the step of obtaining the prediction result of the internal temperature of the lithium-ion battery in step 3.2 includes:

[0180] Step 3.2.1: Input the captured lithium-ion battery voltage, current, lithium-ion state of charge, battery surface temperature and ambient temperature data within the preset time into the convolution layer of the one-dimensional convolutional neural network layer for linear weighted summation, input the lithium-ion battery voltage, current, lithium-ion state of charge, battery surface temperature and ambient temperature data after the linear weighted summation into the pooling layer for pooling operation, and input the lithium-ion battery voltage, current, lithium-ion state of charge, battery surface temperature and ambient temperature data after the pooling operation into the fully connected layer for nonlinear combination;

[0181] The following is a further description of the one-dimensional convolutional neural network layer in the present invention. Convolutional neural network (CNN) is a powerful neural network designed for processing image data. The network structure of CNN mainly includes convolutional layer, pooling layer and fully connected layer.

[0182] The function of the convolution layer is to extract features from the input data. It contains multiple convolution kernels. Each element of the convolution kernel corresponds to a weight coefficient and a bias, similar to a neuron in a feedforward neural network. Each neuron in the convolution layer is connected to multiple neurons in the previous layer in a similar area. The size of the area depends on the size of the convolution kernel.

[0183] After the convolutional layer performs feature extraction, the output feature map is passed to the pooling layer for feature selection and information filtering. The pooling layer contains a pre-set pooling function, which replaces the result of a single point in the feature map with the feature map statistics of its adjacent area.

[0184] The convolutional layer and pooling layer in the convolutional neural network can extract features from the input data, and the role of the fully connected layer is to perform nonlinear combination of the extracted features to obtain the output. That is, the fully connected layer itself is not expected to have feature extraction capabilities, but attempts to use existing high-order features to achieve learning goals.

[0185] 1D-CNN refers to a one-dimensional convolutional neural network, which is a variant of a convolutional neural network. 1D-CNN is mainly used to process one-dimensional sequence data, and can better process local relationships in sequence data. When the data sequence is short and the sequence fragments are not highly correlated, it is very effective to use 1D-CNN for processing. In the present invention, 1D-CNN is used to process the sequence data of the battery.

[0186] The 1D convolution layer consists of a set of learnable convolution kernels, each of which slides over the input data and calculates the linear weighted sum of the local area. The feature map output by each convolution kernel reflects the local pattern in the input data.

[0187] The 1D pooling layer is used to reduce the dimension of the feature map, reduce network parameters and computation. Commonly used pooling operations include maximum pooling and average pooling. Maximum pooling extracts the most significant features from the feature map, and average pooling calculates the average value of the feature map.

[0188] Finally, the output of the pooling layer is connected to the fully connected layer, and the extracted features are nonlinearly combined and output to achieve the learning goal.

[0189] Step 3.2.2: Input the nonlinearly combined lithium-ion battery voltage, current, lithium-ion state of charge, battery surface temperature and ambient temperature data into the LSTM neural network layer to obtain the predicted values ​​of the lithium-ion battery voltage, current, lithium-ion state of charge, battery surface temperature and ambient temperature data at the corresponding moment;

[0190] Step 3.2.3: Input the predicted values ​​of lithium-ion battery voltage, current, lithium-ion state of charge, battery surface temperature and ambient temperature data at the corresponding time into the attention mechanism layer for attention weight allocation and attention weighted summation;

[0191] The following is a further explanation of the attention mechanism layer in the present invention. The attention mechanism is a method that imitates the "attention" process in human vision and cognitive systems, which enables the neural network to focus on the more relevant parts when processing input data. By introducing the attention mechanism, the neural network can automatically learn and selectively focus on important information in the input, thereby improving the performance and generalization ability of the model.

[0192] The basic idea of ​​the attention mechanism is that when processing sequence data, the output Y pays different attention to different parts of the input X. This step can adaptively capture the dependency between the output and input elements by calculating the relative importance between the elements. Specifically, the attention mechanism calculates the importance of the input elements to the output and allocates different attention according to the importance. By calculating the importance between the output and input elements, normalizing the importance to the attention weight, and weighted summing each element with the corresponding attention weight, the output of the self-attention mechanism can be obtained.

[0193] The expression of attention weight distribution is:

[0194] score(y,x i )=V T tanh(W a [y,x i ]) (14)

[0195]

[0196] In formulas (14) and (15), V T and W a are weight matrices, is the attention weight assigned to the output lithium battery parameters, score(y,x i ) is the dependency relationship between input data and output elements;

[0197] The expression of the weighted sum of attention is:

[0198]

[0199] In formula (16), c t The output after the lithium battery parameters and the weighted sum of attention, x i Input lithium battery parameters.

[0200] Step 3.2.4: Input the weighted sum of the lithium-ion battery voltage, current, lithium-ion charge state, battery surface temperature and ambient temperature data at the corresponding time into the fully connected layer for nonlinear combination to obtain the battery internal temperature prediction result at the corresponding time;

[0201] Step 3.2.5: When the predicted result of the internal temperature of the battery at the corresponding moment exceeds 50°C, a second-level warning message is issued; when it exceeds 80°C, a third-level warning message is issued; if it is less than 50°C, it is the normal temperature of the battery and no warning message is issued;

[0202] Step 3.3: issuing corresponding warning information based on the voltage anomaly detection result and the lithium-ion battery internal temperature prediction result;

[0203] Step 3.4: Repeatedly capture the battery parameters within a preset time through a sliding window, with a second preset time interval between the last capture of the battery parameters, and the second preset time is 10 seconds;

[0204] Step 3.5: Repeat steps 3.1-3.2 to complete the continuous lithium-ion battery thermal runaway warning.

[0205] Step 4: Take corresponding measures for the warning information, eliminate the warning status, and complete the multi-level warning of lithium battery thermal runaway.

[0206] The above is only a preferred embodiment of the present invention and does not limit the present invention in any form. Although the present invention has been disclosed as a preferred embodiment as above, it is not used to limit the present invention. Any technician familiar with this profession can make some changes or modify the technical contents disclosed above into equivalent embodiments without departing from the scope of the technical solution of the present invention. However, any simple modification, equivalent replacement and improvement made to the above embodiments without departing from the content of the technical solution of the present invention, based on the technical essence of the present invention, within the spirit and principles of the present invention, still fall within the protection scope of the technical solution of the present invention.

Claims

1. A multi-level early warning method for thermal runaway of lithium batteries based on an attention mechanism, characterized in that: The steps of the multi-level early warning method for thermal runaway of a lithium battery based on an attention mechanism include: Step 1: Obtain lithium-ion battery parameters; Step 2: intercepting battery parameters within a first preset time through a sliding window; Step 3: Input the lithium-ion battery parameters at the preset time into the Attention+CNN+LSTM network and the LSTM network to obtain warning information; The steps for completing the lithium-ion battery thermal runaway warning in step 3 include: Step 3.1: Use lithium-ion battery parameters as training data and use the zebra optimization algorithm to train the LSTM network and Attention+CNN+LSTM; Step 3.2: Input the intercepted lithium-ion battery voltage data within the preset time into the trained LSTM network to obtain the voltage anomaly detection result; Step 3.3: Input the captured lithium-ion battery voltage, current, lithium-ion battery state of charge, battery surface temperature and ambient temperature data within the preset time into the trained Attention+CNN+LSTM network to obtain the prediction result of the internal temperature of the lithium-ion battery; The Attention+CNN+LSTM network in step 3.3 includes an input layer, a one-dimensional convolutional neural network layer, an LSTM neural network layer, an attention mechanism layer, a fully connected layer, and an output layer; The one-dimensional convolutional neural network neural network layer includes a convolutional layer, a pooling layer and a fully connected layer; The steps of obtaining the prediction result of the internal temperature of the lithium-ion battery in step 3.3 include: Step 3.3.1: inputting the intercepted lithium-ion battery voltage, current, lithium-ion battery state of charge, battery surface temperature and ambient temperature data within the preset time into the convolution layer of the one-dimensional convolutional neural network layer for linear weighted summation, inputting the lithium-ion battery voltage, current, lithium-ion battery state of charge, battery surface temperature and ambient temperature data after the linear weighted summation into the pooling layer for pooling operation, and inputting the lithium-ion battery voltage, current, lithium-ion battery state of charge, battery surface temperature and ambient temperature data after the pooling operation into the fully connected layer for nonlinear combination; Step 3.3.2: Input the nonlinearly combined lithium-ion battery voltage, current, lithium-ion battery state of charge, battery surface temperature and ambient temperature data into the LSTM neural network layer to obtain the predicted values ​​of the lithium-ion battery voltage, current, lithium-ion battery state of charge, battery surface temperature and ambient temperature data at the corresponding moment; Step 3.3.3: Input the predicted values ​​of lithium-ion battery voltage, current, lithium-ion battery state of charge, battery surface temperature and ambient temperature data at the corresponding time into the attention mechanism layer for attention weight allocation and attention weighted summation; Step 3.3.4: Input the weighted sum of the lithium-ion battery voltage, current, lithium-ion battery state of charge, battery surface temperature and ambient temperature data at the corresponding time into the fully connected layer for nonlinear combination to obtain the battery internal temperature prediction result at the corresponding time; Step 3.3.5: When the predicted result of the internal temperature of the battery at the corresponding moment exceeds 50°C, a second-level warning message is issued; when it exceeds 80°C, a third-level warning message is issued; if it is less than 50°C, it is the normal temperature of the battery and no warning message is issued; Step 3.4: issuing corresponding warning information based on the voltage anomaly detection result and the lithium-ion battery internal temperature prediction result; Step 3.5: Repeatedly capture the battery parameters within a preset time by sliding the window, with a second preset time interval between the last capture of the battery parameters; Step 3.6: Repeat steps 3.2 to 3.5 to complete the continuous lithium-ion battery thermal runaway warning; Step 4: Take corresponding measures for the warning information, eliminate the warning state, and complete the multi-level warning of thermal runaway of lithium batteries.

2. According to claim 1, a multi-level early warning method for thermal runaway of a lithium battery based on an attention mechanism is characterized in that: The lithium-ion battery parameters in step 1 include lithium-ion battery voltage, current, lithium-ion battery state of charge, battery surface temperature and ambient temperature data.

3. According to claim 1, a multi-level early warning method for thermal runaway of a lithium battery based on an attention mechanism is characterized in that: The steps for training the LSTM network and Attention+CNN+LSTM using the Zebra optimization algorithm in step 3.1 include: Step 3.1.1: Set the maximum number of iterations and the number of decision variables; Step 3.1.2: Initialize the zebra population and calculate the objective function of the initialized zebra population; Step 3.1.3: Obtain the pioneer horse based on the objective function of the initialized zebra population; Step 3.1.4: Perform the first-stage iterative update according to the foraging strategy to obtain the updated objective function value of the first stage; Step 3.1.5: If the objective function value after the first phase update is less than the objective function value before the update, then select the defense strategy for the second phase iterative update to obtain the corresponding objective function value. If the objective function value after the second phase iterative update is less than the objective function value before the update, then continue to iterate and update. If it is greater than the objective function value before the update, then keep the current objective function value. Step 3.1.6: Repeat steps 3.1.3 to 3.1.5 until the maximum number of iterations is reached, and output the objective function value after the last update; Step 3.1.7: Obtain updated network weights and biases based on the objective function value after the last update; Step 3.1.

8. Train the LSTM network and Attention+CNN+LSTM based on the updated network weights, biases and training data, and calculate the model accuracy of the trained LSTM network and Attention+CNN+LSTM; Step 3.1.9: Repeat steps 3.1.1 to 3.1.8 until the model accuracy of the trained LSTM network and Attention+CNN+LSTM reaches the preset accuracy; The expression for the zebra population is: (1) In formula (1), is the matrix of the zebra population, is the i-th zebra, is the solution of the i-th zebra for the j-th decision variable, is the number of zebras, is the number of decision variables; The expression of the objective function value is: (2) In formula (2), is the numerical vector of the objective function, is the objective function value obtained by the i-th zebra, is the objective function value of the i-th zebra with respect to the j-th decision variable; The expression of the foraging strategy is: (3) (4) In formulas (3) and (4), is the updated position of the i-th zebra in the first stage, is the value of the j-th decision variable, For the pioneer horse, is the value of the jth dimension, r is The random constant in the interval, I is A random random constant in the interval, is the current objective function value, is the objective function value before updating; The defense strategy is expressed as: (5) (6) In formulas (5) and (6), It is Only the position of the zebra is updated in the second phase. It is The value of the decision variable, is the number of iterations, is the maximum number of iterations, is a constant, is the probability of choosing the first strategy, It is the state of the zebra being attacked. For its The value of the dimension, is the current objective function value.

4. According to claim 1, a multi-level early warning method for thermal runaway of a lithium battery based on an attention mechanism is characterized in that: The LSTM network in step 3.2 includes: The LSTM network includes a forget gate, an input gate and an output gate; The forget gate includes a data reading layer and a sigmoid function layer; The input gate includes a sigmoid function layer and a tanh function layer; The output gate includes a sigmoid function layer and a tanh function layer; The input data of the LSTM network is the lithium-ion battery voltage data input at the current moment, the result of the previous neuron output, and the cell state at the previous moment; The output data is 0 or 1, 0 means the voltage is abnormal, 1 means the voltage is normal.

5. According to claim 1, a multi-level early warning method for thermal runaway of lithium batteries based on an attention mechanism is characterized in that: The steps of obtaining the voltage anomaly detection result in step 3.2 include: Step 3.2.1: Input the lithium-ion battery voltage data at the current moment and the result of the previous neuron output into the forget gate, and after passing through the sigmoid layer, output a The value of the interval ,Will Multiply the cell state at the previous moment point by point to determine the retained value from the cell state at the previous moment to the cell state at the current moment; Step 3.2.2: Input the lithium-ion battery voltage data input at the current moment and the result of the previous neuron output into the sigmoid function layer and the tanh function layer in the input gate to obtain a state candidate vector; Step 3.2.3: updating the current cell state based on the retained value and the state candidate vector from the cell state at the previous moment to the cell state at the current moment; Step 3.2.4: Input the lithium-ion battery voltage data input at the current moment and the result of the previous neuron output into the sigmoid function layer in the output gate to obtain The value of the interval , the updated current cell state is converted to The output value of the interval will be Multiply to get the voltage output value at the corresponding moment; Step 3.2.5: If the voltage output value at the corresponding moment is 0, it means that the voltage is abnormal and a first-level warning message is issued; if the voltage output value at the corresponding moment is 1, it means that the voltage is normal and no warning message is issued; The expression of the forget gate is: (7) In formula (7), for The constant, is the weight of the forget gate, represents the sigmoid function, is the output of the previous neuron, is the lithium-ion battery voltage data input at the current moment, Bias for the forget gate; The expression of the input gate is: (8) (9) In formulas (8) and (9), is the weight of the updated value, is the input gate weight, is the bias of the updated value, is the bias of the input gate, is the state candidate vector, The updated value of the lithium-ion battery voltage data input at the current moment; The expression for the current cell state update is: (10) In formula (10), Update the value for the current cell state, is the cell state at the previous moment; The expression of the output gate is: (11) (12) In formulas (11) and (12), for The output value of the interval, is the weight of the output gate, is the bias of the output gate, is the voltage output value at the corresponding moment, is the updated value of the current cell state after the tanh function conversion, and .

Citation Information

Patent Citations

  • Online calculation method for internal temperature of battery pack

    CN113919222A

  • Method and device for determining internal temperature of energy storage device

    CN114520389A

  • High-voltage cable partial discharge diagnosis method based on CNN-LSTM-Attention neural network

    CN114563671A

  • Vehicle-mounted lithium battery collision thermal runaway early warning method and system

    CN117601655A

  • Battery large model cloud platform early warning method and system

    CN117633522A