Hydrogen-sensitive lithium battery thermal runaway multistage early warning method based on BiLSTM mechanism

Through the BiLSTM mechanism combined with the PSO optimization algorithm, the multi-level early warning method of lithium batteries is solved, and the problems of insufficient correlation and misjudgment of timing characteristics in the prior art are achieved, and early warning and accurate prediction of thermal runaway of lithium batteries are realized.

CN120294575APending Publication Date: 2025-07-11JILIN UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510357157.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-25
Publication Date
2025-07-11

AI Technical Summary

Technical Problem

The existing thermal runaway warning methods of lithium batteries cannot fully explore the correlation between the front and back timing characteristics in the thermal runaway process, and it is difficult to capture the early coupling rules of gas-production-temperature rise-chemical reactions, and are susceptible to battery aging and working conditions fluctuations in energy storage scenarios, resulting in misjudgment.

Method used

The multi-stage early warning method based on the BiLSTM mechanism is adopted, and the LSTM and CNN+BiLSTM networks are trained through hydrogen concentration and temperature sensor data, combined with the PSO optimization algorithm, to realize abnormal detection and prediction of hydrogen concentration and temperature, dynamically adjust the early warning threshold, and trigger multi-stage early warning.

Benefits of technology

An early multi-level early warning of thermal runaway from lithium batteries is achieved, which improves the accuracy and reliability of early warnings and avoids fires.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120294575A_ABST
    Figure CN120294575A_ABST
Patent Text Reader

Abstract

The invention discloses a hydrogen-sensitive lithium battery thermal runaway multistage early warning method based on a BiLSTM mechanism. The method comprises the following steps: step 1, acquiring parameters of a hydrogen sensor and a temperature sensor; 2, acquiring hydrogen concentration and lithium battery surface temperature data in a set time period; thirdly, the hydrogen concentration and the surface temperature in the set time period are input into the LSTM network and the CNN + BiLSTM network respectively to obtain early warning information; and step 4, starting a thermal management system to perform automatic temperature control from the early warning condition, eliminating the early warning state, and completing lithium battery thermal runaway multi-stage early warning. The method has the beneficial effect that the prediction accuracy is improved. Simulation experiment results show that the method can carry out effective early warning on thermal runaway of the lithium battery in the charging process, secondary early warning information can be sent out in a period of time before the lithium battery is on fire, and fire disasters are avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a multi - level early warning method for lithium - battery thermal runaway, and particularly to a multi - level early warning method for lithium - battery thermal runaway sensitive to hydrogen based on the BiLSTM mechanism. Background Art

[0002] At present, the multi - level early warning method for lithium - battery thermal runaway sensitive to hydrogen aims to input the data collected in real - time by sensors into a established prediction model to predict hydrogen and temperature and compare them with the thermal - runaway boundary. At present, the thermal - runaway early warning methods are mainly divided into two categories: the method based on electrochemical mechanism and the method based on big data and deep learning.

[0003] The technology based on electrochemical mechanism constructs an early - warning boundary through gas - production detection (such as CO, CO2, HF, etc.), electrochemical impedance spectroscopy analysis or heat - generation model. Although it has physical interpretability, it is limited by the complexity of multi - reaction coupling inside the battery, with insufficient model accuracy. Moreover, the release of traditional gases (such as CO, HF) usually lags behind the initial stage of thermal runaway, making it difficult to give early warning in time. For example, hydrogen gas (H2) generated in the initial stage of electrolyte decomposition and diaphragm rupture often is released earlier than other gases, but the existing methods lack sufficient sensitive monitoring and characteristic correlation research on hydrogen, resulting in a limited early - warning window.

[0004] The big - data and deep - learning methods achieve anomaly detection by fusing multi - modal data such as voltage, current, and temperature and combining machine - learning algorithms (such as LSTM, CNN), significantly improving the adaptability of early warning. However, existing models mostly rely on unidirectional time - series analysis (such as unidirectional LSTM), unable to fully explore the correlation between front - and - back time - series features in the thermal - runaway process. At the same time, there is a lack of effective modeling for the dynamic response of gas signals (especially hydrogen), making it difficult to capture the early coupling law of "gas production - temperature rise - chemical reaction". In addition, factors such as battery aging and working - condition fluctuations in the energy - storage scenario further increase the misjudgment risk of single - modal data early warning.

[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, the battery energy - storage system has been widely used due to the need for rapid response to energy demand and improvement of 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 charge - discharge process of lithium - ion batteries, a large amount of heat is generated due to electrochemical reactions and internal - resistance heating, and the generated heat 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 will even lead to thermal runaway, and then cause a fire. At present, there have been many incidents of energy - storage power stations and electric vehicles catching fire, causing serious economic losses.

[0006] In view of the above problems, there is an urgent need for a new method that can integrate multi-dimensional features and balance early sensitivity and hierarchical warning capabilities. As an important marker in the initial stage of thermal runaway, the change in hydrogen concentration is directly related to the intensity of side reactions inside the battery and can be used as the core index for early warning. At the same time, Bidirectional Long Short-Term Memory (BiLSTM) can capture both forward and backward dependencies of time series simultaneously and is more suitable for analyzing the dynamic evolution law of "gas production - temperature rise - electrochemical response" during thermal runaway. Based on this, this study proposes a hydrogen-sensitive driven BiLSTM multi-level warning method. By real-time monitoring of multi-source signals such as hydrogen concentration, temperature, and voltage, combined with bidirectional spatio-temporal feature extraction and hierarchical threshold determination, multi-stage warning from the "latent period" to the "critical runaway period" is realized, providing new ideas for improving the safety of lithium-ion batteries. Summary of the Invention

[0007] The main objective of the present invention is to solve the problem that existing models mostly rely on unidirectional time series analysis and cannot fully explore the correlation between front and back time series features during the thermal runaway process;

[0008] Another objective of the present invention is to solve the problem that there is a lack of effective modeling for the dynamic response of gas signals (especially hydrogen), making it difficult to capture the early coupling law of "gas production - temperature rise - chemical reaction";

[0009] Another objective of the present invention is to solve the problem that factors such as battery aging and operating condition fluctuations in the energy storage scenario further increase the risk of misjudgment in single-modal data warning.

[0010] The present invention provides a hydrogen-sensitive multi-level warning method for lithium battery thermal runaway based on the BiLSTM mechanism in order to achieve the above objectives and solve the above problems.

[0011] The hydrogen-sensitive multi-level warning method for lithium battery thermal runaway based on the BiLSTM mechanism provided by the present invention includes the following steps:

[0012] First step, obtain the parameters of hydrogen sensors and temperature sensors;

[0013] Second step, obtain the hydrogen concentration and the surface temperature data of the lithium battery within a set time period;

[0014] Third step, input the hydrogen concentration and surface temperature within the set time period into the LSTM network and the CNN+BiLSTM network respectively to obtain warning information;

[0015] Fourth step, start the thermal management system for automatic temperature control from the warning situation to eliminate the warning state and complete the multi-level warning of lithium battery thermal runaway.

[0016] The steps to complete the early warning of lithium batteries in the third step are as follows:

[0017] Step 1: Use the hydrogen concentration near the lithium battery and the surface temperature of the lithium battery as training data, and use the PSO optimization algorithm to train the LSTM network and the CNN+BiLSTM network;

[0018] Step 2: Input the hydrogen concentration data within the intercepted time period into the trained LSTM network to obtain the detection result of abnormal hydrogen concentration;

[0019] Step 3: Input the surface temperature data of the lithium battery within the intercepted time period into the trained CNN+BiLSTM network to obtain the prediction result of the surface temperature of the lithium battery;

[0020] Step 4: Based on the abnormal hydrogen concentration detection result and the lithium battery surface temperature prediction result in the above Step 3, give early warning information and complete the solution measures;

[0021] Step 5: Repeat the hydrogen concentration and lithium battery surface temperature data within the intercepted time period;

[0022] Step 6: Repeat the above Steps 2 to 5 to complete the continuous multi-level early warning of lithium batteries.

[0023] In Step 1 of the above third step, the particle swarm optimization (PSO) algorithm is used to optimize the hyperparameters of the LSTM and CNN+BiLSTM networks to improve the training effect of the model. The steps are as follows:

[0024] 1) Initialize various parameters required for the PSO algorithm, specifically as follows:

[0025] Upper and lower limits of the search space: u d and l d ;

[0026] Learning factors, i.e., inertia weights: c1, c2;

[0027] Maximum number of iterations: T or convergence accuracy ξ;

[0028] Upper and lower limits of velocity: V max ,V min

[0029] Initialize the position and velocity of the particles: Assume that the particle swarm contains M particles, each particle represents a candidate hyperparameter combination, and the position of each particle in the D-dimensional search space is x i ,t and velocity v i ,t;

[0030] 2) Calculate the fitness value fitness of each particle according to the fitness function, and set it as the loss function of the model, including mean square error (MSE) or accuracy:

[0031] fitness = f(x i,t ) (1)

[0032] Save the optimal position of each particle, i.e., the individual optimal position p i ;

[0033] Record the global optimal position, the swarm optimal position p g ;

[0034] 3), Calculate the velocities and positions of the next-generation particles according to the PSO velocity update formula and position update formula, specifically as follows:

[0035] V id,t+1 = V id,t + c1r1(p id,t - x id,t ) + c2r2(p gd,t - x id,t ) (2)

[0036] X id,t+1 = X id,t + V id,t+1 (3)

[0037] 4), Calculate the new fitness value fitness, and compare the fitness values of the new position and the historical optimal position. If it is better, update the individual optimal position;

[0038] 5), Compare the new individual optimal fitness value with the current swarm optimal fitness value. If it is better, update the swarm optimal position p g , and the more commonly used is the linearly decreasing weight LDW strategy, specifically as follows:

[0039] ω (t) = (ω ini - ω end )(G k - g) / G k + ω end (4)

[0040] 6), If the maximum number of iterations T is reached or the fitness function meets the accuracy requirement ξ, terminate the search and output the optimal hyperparameters; otherwise, continue the iteration;

[0041] Among them:

[0042] Particle: A candidate solution to the optimization problem;

[0043] Position: The location where the candidate solution is located;

[0044] Velocity: The speed at which the candidate solution moves;

[0045] Fitness: A value evaluating the quality of the particle, set as the objective function value;

[0046] Individual best position: The best position found by a single particle so far;

[0047] Global best position: The best position found by all particles so far;

[0048] The particle swarm expression is as follows:

[0049] In a D-dimensional target search space, there is a particle swarm composed of m particles. The attributes of the i-th particle at time t are composed of two vectors: (1) Velocity: v i t =(v i1 t , v i2 t , …, v id t ); v id t ∈[v min , v max , where v min and v max represent the minimum and maximum values of the velocity respectively; (2) Position: x i t =(x i1 t , x i2 t , …, x id t ); x id t {∈[l d , u d , where l d and u d are the lower and upper limits of the search space for each particle; Two optimal positions are recorded in each iteration: (1) Individual optimal position: p i t =(p i1 t , p i2 t , …, p id t ); (2) Population optimal position: p g t :=(p g1 t , p g2 t , …, p gd t ); where, 1 ≤ i ≤ M, 1 ≤ d ≤ D, then the velocity and position update formulas of the particle at time t + 1 according to the above theory are as follows:

[0050] Vid t+1 = v id t + c1r1(p id t - x id t ) + c2r2(p gd t - x id t ) (5)

[0051] X id t+1 = x id t + v id t+1 (6)

[0052] Wherein, r1 and r2 are random numbers between (0, 1), and c1 and c2 represent learning factors, and their values are generally taken as c1 = c2 = 2.

[0053] In the above-mentioned step 2 of the third step, the time series modeling module in the abnormal detection of hydrogen concentration consists of a forget gate structure, an input gate structure, and an output gate structure to form a dynamic memory unit, and realizes the dynamic modeling of the time series characteristics of hydrogen concentration through a multi-layer gating mechanism;

[0054] The forget gate structure includes a feature coupling layer and a Sigmoid probability activation layer, wherein the feature coupling layer performs feature fusion on the input real-time hydrogen concentration data x t and the hidden state h t-1 at the previous moment, and the Sigmoid probability activation layer generates a forgetting weight in the range of 0-1 through a non-linear mapping, which is used to quantify the retention ratio of historical memory;

[0055] The input gate structure passes through the cascaded operation of a Sigmoid feature selection layer and a Tanh state transformation layer. The Sigmoid layer generates an update intensity coefficient of the current input information, and the Tanh layer performs a non-linear transformation on the fused features to generate a candidate state quantity with amplitude constraints;

[0056] The output gate structure adopts a composite architecture of a Sigmoid gating layer and a Tanh normalization layer. The Sigmoid layer calculates the activation probability of the output features, and the Tanh layer normalizes the amplitude of the cell state to ensure the numerical stability of the output features;

[0057] The input of the time series modeling module includes the sampled value x t of the battery hydrogen concentration at the current moment, the hidden state h t-1 at the previous moment, and the cell state C t-1 , and dynamically captures the evolution law of hydrogen concentration through time series correlation feature modeling;

[0058] The output result is a binary decision signal. Defining 0 as an abnormal hydrogen concentration warning and 1 as a concentration safety indicator, the precise identification of abnormal states is achieved through a gating mechanism.

[0059] The implementation steps of the hydrogen concentration abnormal detection in step 2 of the above step 3 are as follows:

[0060] 1). Memory decay control:

[0061] The hydrogen concentration data x collected in real time t and the hidden state h at the previous moment t-1 are input into the forget gate. Through the feature coupling layer, spatial projection is performed on the time series features, and the forget coefficient ft is generated through the Sigmoid function operation. The calculation expression is:

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

[0063] The forget coefficient ft is related to the decay rate of the historical memory information. Multiply f t element-wise with the historical cell state C t-1 to obtain the memory retention amount f t *C t-1 to achieve dynamic screening of the historical memory state;

[0064] 2). Incremental information generation:

[0065] Synchronously input x t and h t-1 into the input gate, and extract the feature update weight and the state change amount respectively through the dual-channel processing mechanism;

[0066] In the Sigmoid feature selection channel, calculate the update coefficient i t of the input information. The expression is:

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

[0068] In the Tanh state transformation channel, perform a non-linear transformation on the fused features to generate a candidate state The expression is:

[0069]

[0070] Candidate state A new feature pattern including the change of hydrogen concentration at the current moment;

[0071] 3), Memory state iteration:

[0072] Perform a linear superposition of the memory retention and the candidate state to update the current cell state: C t

[0073]

[0074] The linear superposition operation realizes the adaptive fusion of historical memory features and current incremental features, forming a memory state expression with temporal continuity;

[0075] 4), Feature space mapping:

[0076] Input xt and ht-1 into the input and output gates, and calculate the output gate control system o through the Sigmoid function t , The expression is:

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

[0078] 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 hydrogen measurement value at the corresponding moment, tanh(C t ) is the updated value of the current cell state after being transformed by the tanh function, and tanh(C t )∈[-1,1];

[0079] h t =o t ×tanh(C t ) (12)

[0080] 5), Abnormal state decision:

[0081] Set the judgment threshold θ = 0.5, and perform feature energy analysis on the hidden state h t :

[0082] When the absolute value of the hidden state |h t |<θ, it is determined that there is an abnormal fluctuation in the current hydrogen concentration, output an alarm flag 0 and trigger a three-level highest warning;

[0083] When |h t |≥θ, it is confirmed that the concentration change conforms to the normal evolution law, and output a safety flag 1;

[0084] The threshold judgment mechanism realizes the reliable identification of abnormal states by quantifying the feature energy intensity.

[0085] In the third step, the LSTM network includes: a forward LSTM and a backward LSTM, specifically as follows:

[0086] Both the forward LSTM and the backward LSTM include an input gate, a forget gate, and an output gate;

[0087] The forget gate includes a linear transformation layer and a sigmoid function layer;

[0088] The input gate includes a linear transformation layer, a sigmoid function layer, and a tanh function layer;

[0089] The output gate includes a linear transformation layer, a sigmoid function layer, and a tanh function layer;

[0090] The input data of the forward LSTM network is the sensor data input at the current moment, the result output by the previous neuron, and the cell state at the previous moment;

[0091] The output data is the temperature prediction value.

[0092] In the third step, the steps to obtain the temperature anomaly detection result in step 3 are as follows:

[0093] 1), Bidirectional forget gate calculation, specifically as follows:

[0094] The first forward forget gate:

[0095] Input: The temperature sensor data x at the current moment t , The hidden state of the forward LSTM at the previous moment and the cell state The weight matrix of the forward forget gate and the bias term

[0096] Calculation:

[0097]

[0098] Function: Control the degree of forgetting of the forward LSTM for the temperature information at the previous moment;

[0099] The second backward forget gate:

[0100] Input: The temperature sensor data x at the current moment t , The hidden state of the backward LSTM at the next moment and the cell state The backward LSTM processes from the end to the beginning of the sequence, and the weight matrix of the backward forget gate and bias term

[0101] Calculate:

[0102]

[0103] Function: Control the degree of forgetting of the reverse LSTM for the temperature information at the next moment.

[0104] 1), Bidirectional input gate and state candidate vector:

[0105] The first forward input gate:

[0106] Input: x t , The weight matrix of the forward input gate and bias term The weight matrix of the forward state candidate vector and bias term

[0107] Calculate:

[0108]

[0109]

[0110] Output: Forward state candidate vector

[0111] The second reverse input gate:

[0112] Input: x t and The output value of the forward LSTM input gate

[0113] Calculate:

[0114]

[0115]

[0116] Output: Reverse state candidate vector

[0117] 3), Bidirectional cell state update:

[0118] The first forward cell state:

[0119]

[0120] The second reverse cell state:

[0121]

[0122] Third merged cell state:

[0123] Directly concatenate the forward and reverse cell states:

[0124]

[0125] 4), Bidirectional output gate and hydrogen concentration prediction:

[0126] First forward output gate:

[0127] Weight matrix of the forward input gate and bias term Output value of the forward output gate

[0128]

[0129] Second reverse output gate:

[0130]

[0131]

[0132] Third merged output:

[0133] Concatenate the forward and reverse hidden states:

[0134]

[0135] Output the temperature prediction value through the fully connected layer:

[0136] y t =σ(W y ·h t +b y ) (27)

[0137] 5), Temperature anomaly determination:

[0138] Determination logic:

[0139] First dynamic threshold setting:

[0140] Calculate the mean and standard deviation of the temperature prediction error based on historical data, and dynamically set the threshold τ:

[0141] τ=μ error +λ·σ error (28)

[0142] where λ is the sensitivity coefficient, taking μ error and σ error are the mean and standard deviation of the prediction error of the training set respectively;

[0143] Second anomaly trigger condition:

[0144] If A first-level warning is triggered, indicating abnormal temperature;

[0145] If the first-level warning is triggered for N consecutive moments, it is upgraded to a second-level warning, indicating a thermal runaway risk;

[0146] The third multi-modal fusion, that is, the improvement point:

[0147] Combined with the temperature sensor data Joint determination is carried out as follows:

[0148] Comprehensive risk value = α × hydrogen abnormal probability + (1 - α) · temperature abnormal probability

[0149] When the comprehensive risk value exceeds the threshold, a third-level warning is triggered and emergency shutdown is required.

[0150] Advantages of the present invention:

[0151] The multi-level early warning method for thermal runaway of hydrogen-sensitive lithium batteries based on the BiLSTM mechanism provided by the present invention uses a deep learning method to predict the temperature of the battery. It is improved on the basis of the bidirectional LSTM, and a CNN is added to extract the changes in battery data to determine which parameters are more important for temperature prediction, thereby improving the prediction accuracy. The simulation experimental results show that this method can effectively warn of the thermal runaway of lithium batteries during charging, and can send out second-level warning information for a period of time before the lithium battery catches fire, avoiding the occurrence of fires. Brief description of the drawings

[0152] Figure 1 It is a flowchart of the multi-level early warning method for thermal runaway of hydrogen-sensitive lithium batteries according to the present invention;

[0153] Figure 2 It is a schematic diagram of the long short-term memory network neuron structure according to the present invention.

[0154] Figure 3 It is a structure diagram of the LSTM neural network according to the present invention.

[0155] Figure 4 It is a structure diagram of the BiLSTM + CNN + LSTM network according to the present invention.

[0156] Figure 5 It is a flowchart of training the LSTM neural network and the BiLSTM + CNN + LSTM network using the PSO optimization algorithm according to the present invention. Specific embodiments

[0157] Please refer to Figures 1 to 5 as shown:

[0158] The hydrogen-sensitive multi-level early warning method for lithium battery thermal runaway based on the BiLSTM mechanism provided by the present invention includes the following steps:

[0159] First step: Obtain the parameters of the hydrogen sensor and the temperature sensor;

[0160] Second step: Obtain the hydrogen concentration and the lithium battery surface temperature data within a set time period;

[0161] Third step: Input the hydrogen concentration and the surface temperature within the set time period into the LSTM network and the CNN+BiLSTM network respectively to obtain early warning information;

[0162] Fourth step: Enable the thermal management system from the early warning situation to perform automatic temperature control, eliminate the early warning state, and complete the multi-level early warning of lithium battery thermal runaway.

[0163] The steps for completing the lithium battery early warning in the third step are as follows:

[0164] Step 1: Use the hydrogen concentration near the lithium battery and the lithium battery surface temperature as training data, and use the PSO optimization algorithm to train the LSTM network and the CNN+BiLSTM network;

[0165] Step 2: Input the hydrogen concentration data within the intercepted time period into the trained LSTM network to obtain the detection result of abnormal hydrogen concentration;

[0166] Step 3: Input the lithium battery surface temperature data within the intercepted time period into the trained CNN+BiLSTM network to obtain the prediction result of the lithium battery surface temperature;

[0167] Step 4: Based on the abnormal hydrogen concentration detection result and the lithium battery surface temperature prediction result in the above step 3, obtain early warning information and complete the solution measures;

[0168] Step 5: Repeat the hydrogen concentration and the lithium battery surface temperature data within the intercepted time period;

[0169] Step 6: Repeat the above steps 2 to 5 to complete the continuous multi-level early warning of the lithium battery.

[0170] In step 1 of the above third step, the particle swarm optimization PSO algorithm is used to optimize the hyperparameters of the LSTM and CNN+BiLSTM networks to improve the training effect of the model. The steps are as follows:

[0171] 1). Initialize various parameters required by the PSO algorithm, specifically as follows:

[0172] Upper and lower limits of the search space: u d and l d ;

[0173] Learning factors, i.e., inertia weights: c1, c2;

[0174] Maximum number of iterations: T or convergence accuracy ξ;

[0175] Upper and lower limits of velocity: V max ,V min

[0176] Initialize the positions and velocities of the particles: Suppose the particle swarm contains M particles, each particle represents a candidate hyperparameter combination, and the position x of each particle in the D-dimensional search space i ,t and velocity v i ,t;

[0177] 2) Calculate the fitness value fitness of each particle according to the fitness function, and set the loss function of the model to include mean squared error MSE or accuracy:

[0178] fitness = f(x i,t ) (1)

[0179] Save the optimal position of each particle, i.e., the individual optimal position p i ;

[0180] Record the global optimal position, the swarm optimal position p g ;

[0181] 3) Calculate the velocities and positions of the next-generation particles according to the PSO velocity update formula and position update formula, as follows:

[0182] V id,t+1 = V id,t + c1r1(p id,t - x id,t ) + c2r2(p gd,t - x id,t ) (2)

[0183] X id,t+1 = X id,t + V id,t+1 (3)

[0184] 4) Calculate the new fitness value fitness, and compare the fitness value of the new position with that of the historical optimal position. If it is better, update the individual optimal position;

[0185] 5) Compare the new individual optimal fitness value with the current swarm optimal fitness value. If it is better, update the swarm optimal position p g , and the linear decreasing weight LDW strategy is more commonly used, as follows:

[0186] ω (t) = (ω ini - ωend )(G k -g) / G k +ω end (4)

[0187] 6) If the maximum number of iterations T is reached or the fitness function meets the accuracy requirement ξ, terminate the search and output the optimal hyperparameters; otherwise, continue the iteration;

[0188] Where:

[0189] Particle: A candidate solution to the optimization problem;

[0190] Position: The location where the candidate solution is located;

[0191] Velocity: The speed at which the candidate solution moves;

[0192] Fitness: A value that evaluates the quality of a particle, set to the objective function value;

[0193] Individual best position: The best position found so far by a single particle;

[0194] Global best position: The best position found so far by all particles;

[0195] The particle swarm expression is as follows:

[0196] In a D-dimensional objective search space, there is a particle swarm composed of m particles. The attributes of the i-th particle at time t are composed of two vectors: (1) Velocity: v i t =(v i1 t ,v i2 t ,…,v id t ); v id t ∈[v min ,v max , v min and v max represent the minimum and maximum values of the velocity respectively; (2) Position: x i t =(x i1 t ,x i2 t ,…,x id t ); x id t {∈[l d ,u d , l d and u dare the lower and upper limits of the search space for each particle; two optimal positions are recorded in each iteration: (1) the individual optimal position: p i t =(p i1 t , p i2 t , …, p id t ); (2) the population optimal position: p g t :=(p g1 t , p g2 t , …, p gd t ); where 1 ≤ i ≤ M, 1 ≤ d ≤ D, then the velocity and position update formulas of the particle at time t + 1 according to the above theory are as follows:

[0197] V id t+1 = v id t + c1r1(p id t - x id t ) + c2r2(p gd t - x id t ) (5)

[0198] X id t+1 = x id t + v id t+1 (6)

[0199] Among them, r1 and r2 are random numbers between (0, 1), and c1 and c2 represent learning factors, and their values are generally taken as c1 = c2 = 2.

[0200] In the above step 2 of the third step, the time series modeling module in the abnormal detection of hydrogen concentration consists of a forget gate structure, an input gate structure, and an output gate structure to form a dynamic memory unit, and realizes the dynamic modeling of the time series characteristics of hydrogen concentration through a multi-layer gating mechanism;

[0201] The forget gate structure includes a feature coupling layer and a Sigmoid probability activation layer, where the feature coupling layer performs feature fusion on the input real-time hydrogen concentration data x t and the hidden state h t-1 at the previous moment, and the Sigmoid probability activation layer generates a forget weight in the 0-1 interval through a non-linear mapping to quantify the retention ratio of historical memory;

[0202] The input gate structure performs a cascaded operation through a Sigmoid feature selection layer and a Tanh state transformation layer. The Sigmoid layer generates an update intensity coefficient for the current input information, and the Tanh layer performs a non-linear transformation on the fused features to generate candidate state quantities with amplitude constraints.

[0203] The output gate structure adopts a composite architecture of a Sigmoid gating layer and a Tanh normalization layer. The Sigmoid layer calculates the activation probability of the output features, and the Tanh layer normalizes the amplitude of the cell state to ensure the numerical stability of the output features.

[0204] The input of the time series modeling module includes the sampled value x of the battery hydrogen concentration at the current moment t , the hidden state h at the previous moment t-1 and the cell state C t-1 , and dynamically captures the evolution law of the hydrogen concentration through time series correlation feature modeling.

[0205] The output result is a binary decision signal. Defining 0 as an abnormal alarm for hydrogen concentration and 1 as a concentration safety label, the accurate identification of abnormal states is achieved through a gating mechanism.

[0206] The implementation steps of hydrogen concentration anomaly detection in step 2 of the above step 3 are as follows:

[0207] 1). Memory decay control:

[0208] Input the real-time collected hydrogen concentration data x t and the hidden state h at the previous moment t-1 into the forget gate. Through the feature coupling layer, perform a spatial projection on the time series features, and generate a forgetting coefficient f through the Sigmoid function operation t , and the calculation expression is:

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

[0210] The forgetting coefficient ft represents the decay rate of historical memory information. Multiply f t and the historical cell state C t-1 element-wise to obtain the memory retention amount f t *C t-1 to achieve dynamic screening of historical memory states;

[0211] 2). Incremental information generation:

[0212] Input x t and h t-1Synchronous input enters the input gate, and the feature update weight and the state change amount are respectively extracted through a dual-channel processing mechanism;

[0213] In the Sigmoid feature selection channel, the update coefficient i of the input information is calculated t , and the expression is:

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

[0215] In the Tanh state transformation channel, the fused feature is non-linearly transformed to generate a candidate state The expression is:

[0216]

[0217] Candidate state contains a new feature pattern of the hydrogen concentration change at the current moment;

[0218] 3) Memory state iteration:

[0219] The memory retention amount and the candidate state are linearly superimposed to update the current cell state: C t

[0220]

[0221] The linear superposition operation realizes the adaptive fusion of the historical memory feature and the current incremental feature, forming a memory state expression with temporal continuity;

[0222] 4) Feature space mapping:

[0223] x t and h t-1 are input to the input and output gates, and the output gate control coefficient o is calculated through the Sigmoid function t , and the expression is:

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

[0225] o t is the output value in the range of [0, 1], W o is the weight of the output gate, b o is the bias of the output gate, h t is the hydrogen measurement value at the corresponding moment, tanh(C t) is the updated value of the current cell state after being transformed by the tanh function, and tanh(C t ) ∈ [-1, 1];

[0226] h t = o t ×tanh(C t ) (12)

[0227] 5), Abnormal state decision:

[0228] Set the decision threshold θ = 0.5, and conduct feature energy analysis on the hidden state h t :

[0229] When the absolute value of the hidden state |h t | < θ, it is determined that there is an abnormal fluctuation in the current hydrogen concentration, output an alarm flag 0 and trigger a level-three highest warning;

[0230] When |h t | ≥ θ, it is confirmed that the concentration change conforms to the normal evolution law, and output a safety flag 1;

[0231] The threshold decision mechanism realizes reliable identification of abnormal states by quantifying the feature energy intensity.

[0232] In the third step, the LSTM network includes: a forward LSTM and a backward LSTM, specifically as follows:

[0233] Both the forward LSTM and the backward LSTM include an input gate, a forget gate, and an output gate;

[0234] The forget gate includes a linear transformation layer and a sigmoid function layer;

[0235] The input gate includes a linear transformation layer, a sigmoid function layer, and a tanh function layer;

[0236] The output gate includes a linear transformation layer, a sigmoid function layer, and a tanh function layer;

[0237] The input data of the forward LSTM network is the sensor data input at the current moment, the result output by the previous neuron, and the cell state at the previous moment;

[0238] The output data is the temperature prediction value.

[0239] In the third step, the steps to obtain the temperature anomaly detection result in step 3 are as follows:

[0240] 1), Bidirectional forget gate calculation, specifically as follows:

[0241] The first forward forget gate:

[0242] Input: The temperature sensor data x at the current momentt The hidden state of the forward LSTM at the previous moment and the cell state The weight matrix of the forward forget gate and the bias term

[0243] Calculate:

[0244]

[0245] Function: Control the degree of forgetting of the forward LSTM about the temperature information at the previous moment;

[0246] The second backward forget gate:

[0247] Input: The temperature sensor data x at the current moment t The hidden state of the backward LSTM at the next moment and the cell state The backward LSTM processes from the end to the beginning of the sequence, the weight matrix of the backward forget gate and the bias term

[0248] Calculate:

[0249]

[0250] Function: Control the degree of forgetting of the backward LSTM about the temperature information at the next moment.

[0251] 1) The bidirectional input gate and the state candidate vector:

[0252] The first forward input gate:

[0253] Input: x t , The weight matrix of the forward input gate and the bias term The weight matrix of the forward state candidate vector and the bias term

[0254] Calculate:

[0255]

[0256]

[0257] Output: The forward state candidate vector

[0258] The second backward input gate:

[0259] Input: x t and Forward LSTM input gate output value

[0260] Calculation:

[0261]

[0262]

[0263] Output: Reverse state candidate vector

[0264] 3), Bidirectional cell state update:

[0265] First forward cell state:

[0266]

[0267] Second reverse cell state:

[0268]

[0269] Third combined cell state:

[0270] Directly concatenate the forward and reverse cell states:

[0271]

[0272] 4), Bidirectional output gate and hydrogen concentration prediction:

[0273] First forward output gate:

[0274] Weight matrix of the forward input gate and bias term Forward output gate output value

[0275]

[0276] Second reverse output gate:

[0277]

[0278]

[0279] Third combined output:

[0280] Concatenate the forward and reverse hidden states:

[0281]

[0282] Output the temperature prediction value through the fully connected layer:

[0283] y t= σ(W y ·h t + b y ) (27)

[0284] 5) Temperature anomaly determination:

[0285] Determination logic:

[0286] First dynamic threshold setting:

[0287] Calculate the mean and standard deviation of the temperature prediction error based on historical data, and dynamically set the threshold τ:

[0288] τ = μ error + λ·σ error (28)

[0289] where λ is the sensitivity coefficient, taking μ error and σ error as the mean and standard deviation of the prediction error of the training set respectively;

[0290] Second abnormal trigger condition:

[0291] If triggers a first-level warning, indicating a temperature anomaly;

[0292] If a first-level warning is triggered for N consecutive moments, it is upgraded to a second-level warning, indicating a risk of thermal runaway;

[0293] Third multi-modal fusion, i.e., the improvement point:

[0294] Combine the temperature sensor data for joint determination, as follows:

[0295] Comprehensive risk value = α□Hydrogen anomaly probability + (1 - α)·Temperature anomaly probability

[0296] When the comprehensive risk value exceeds the threshold, a third-level warning is triggered and an emergency shutdown is required.

Claims

1. A multi-level early warning method for hydrogen-sensitive lithium battery thermal runaway based on the BiLSTM mechanism, characterized in that: The method includes the following steps: First step: Obtain the parameters of the hydrogen sensor and the temperature sensor; Second step: Obtain the hydrogen concentration and the lithium battery surface temperature data within a set time period; Third step: Input the hydrogen concentration and the surface temperature within the set time period into the LSTM network and the CNN+BiLSTM network respectively to obtain early warning information; Fourth step: Enable the thermal management system from the early warning situation for automatic temperature control, eliminate the early warning state, and complete the multi-level early warning of lithium battery thermal runaway.

2. A multi-level early warning method for hydrogen-sensitive lithium battery thermal runaway based on the BiLSTM mechanism according to claim 1, characterized in that: The steps for completing the lithium battery early warning in the third step are as follows: Step 1: Use the lithium battery nearby hydrogen concentration and the lithium battery surface temperature as training data, and use the PSO optimization algorithm to train the LSTM network and the CNN+BiLSTM network; Step 2: Input the hydrogen concentration data within the intercepted time period into the trained LSTM network to obtain the detection result of abnormal hydrogen concentration; Step 3: Input the lithium battery surface temperature data within the intercepted time period into the trained CNN+BiLSTM network to obtain the prediction result of the lithium battery surface temperature; Step 4: Based on the above-mentioned hydrogen concentration abnormal detection result and lithium battery surface temperature prediction result in Step 3, obtain early warning information and complete the solution measures; Step 5: Repeat intercepting the hydrogen concentration and lithium battery surface temperature data within the time period; Step 6: Repeat the above Steps 2 to 5 to complete the continuous multi-level early warning of the lithium battery.

3. A hydrogen-sensitive multi-level early warning method for thermal runaway of lithium batteries based on the BiLSTM mechanism according to claim 2, characterized in that: In Step 1 of the third step, the particle swarm optimization (PSO) algorithm is used to optimize the hyperparameters of the LSTM and CNN+BiLSTM networks to improve the training effect of the model. The steps are as follows: 1). Initialize various parameters required for the PSO algorithm, specifically as follows: Search space upper and lower limits: u d and l d ; Learning factors, that is, inertia weights: c1, c2; Maximum number of iterations: T or convergence accuracy ξ; Upper and lower limits of speed: V max ,V min Initialize the positions and velocities of the particles: Assume that the particle swarm contains M particles, each particle represents a candidate hyperparameter combination, and the position x i ,t and velocity v i ,t; 2). Calculate the fitness value fitness of each particle according to the fitness function. The loss function set for the model includes the mean square error (MSE) or accuracy: fitness=f(x i,t ) (1) Save the optimal position of each particle, i.e., the personal best position p i ; Record the global optimal position, the swarm optimal position p g ; 3). Calculate the velocity and position of the next generation of particles according to the PSO velocity update formula and position update formula, specifically as follows: V id,t+1 = V id,t + c1r1(p id,t - x id,t ) + c2r2(p gd,t - x id,t ) (2) X id,t+1 = X id,t + V id,t+1 (3) 4). Calculate the new fitness value fitness, and compare the fitness value of the new position with the fitness value of the historical optimal position. If it is better, update the individual optimal position; 5) Compare the new individual optimal fitness value with the current global optimal fitness value. If it is better, update the global optimal position p g , and the linear decreasing weight (LDW) strategy is mostly adopted, which is as follows: ω (t) = (ω ini - ω end )(G k - h) / G k + ω end (4) 6). If the maximum number of iterations T is reached or the fitness function meets the accuracy requirement ξ, terminate the search and output the optimal hyperparameters; otherwise, continue to iterate; Where: Particle: A candidate solution to the optimization problem; Position: The position where the candidate solution is located; Velocity: The velocity at which the candidate solution moves; Fitness: The value for evaluating the quality of the particle, set as the objective function value; Individual best position: The best position found by a single particle so far; Group best position: The best position found by all particles so far; The particle swarm expression is as follows: In a D-dimensional target search space, there is a swarm of m particles. The attributes of the i-th particle at time t consist of two vectors: (1) Velocity: v i t =(v i1 t , v i2 t , …, v id t ); v id t ∈[v min , v max , where v min and v max represent the minimum and maximum values of the velocity respectively; (2) Position: x i t =(x i1 t , x i2 t , …, x id t ); x id t {∈[l d , u d , where l d and u d are the lower and upper bounds of the search space for each particle; Two optimal positions are recorded in each iteration: (1) Personal best position: p i t =(p i1 t , p i2 t , …, p id t ); (2) Global best position: p g t :=(p g1 t , p g2 t , …, p gd t ); where 1 ≤ i ≤ M, 1 ≤ d ≤ D, then the velocity and position update formulas of the particle at time t + 1 according to the above theory are as follows: V id t+1 = v id t + c1r1(p id t - x id t ) + c2r2(p gd t - x id t ) (5) X id t+1 = x id t + v id t+1 (6) Where, r1 and r2 are random numbers between (0,1), and c1 and c2 represent learning factors, and their values are generally taken as c1 = c2 = 2.

4. A method for multi - level early warning of thermal runaway of hydrogen - sensitive lithium batteries based on the BiLSTM mechanism according to claim 2, characterized in that: In Step 2 of the third step, the time series modeling module in the abnormal hydrogen concentration detection consists of a forget gate structure, an input gate structure, and an output gate structure to form a dynamic memory unit, and realizes the dynamic modeling of the hydrogen concentration time series characteristics through a multi-layer gating mechanism; The forgetting gate structure includes a feature coupling layer and a Sigmoid probability activation layer. The feature coupling layer processes the input real-time hydrogen concentration data x t and the hidden state h t-1 at the previous moment for feature fusion. The Sigmoid probability activation layer generates a forgetting weight in the range of 0-1 through a non-linear mapping to quantify the retention ratio of historical memory; The input gate structure performs a cascaded operation through a Sigmoid feature selection layer and a Tanh state transformation layer. The Sigmoid layer generates an update intensity coefficient for the current input information, and the Tanh layer performs a non-linear transformation on the fused features to generate candidate state quantities with amplitude constraints. The output gate structure adopts a composite architecture of a Sigmoid gating layer and a Tanh normalization layer. The Sigmoid layer calculates the activation probability of the output features, and the Tanh layer normalizes the amplitude of the cell state to ensure the numerical stability of the output features. The input of the time series modeling module includes the sampled value x of the battery hydrogen concentration at the current moment t , the hidden state h at the previous moment t-1 and the cell state C t-1 , and realizes the dynamic capture of the evolution law of hydrogen concentration through time series correlation feature modeling; The output result is a binary decision signal, where 0 is defined as an abnormal hydrogen concentration warning and 1 is defined as a concentration safety label. The accurate identification of abnormal states is achieved through a gating mechanism.

5. A hydrogen-sensitive multi-stage early warning method for lithium battery thermal runaway based on the BiLSTM mechanism according to claim 2, characterized in that: In the third step, the implementation steps of step 2 for hydrogen concentration anomaly detection are as follows: 1) Memory decay control: The hydrogen concentration data x collected in real time t and the hidden state h at the previous moment t-1 are input into the forget gate. The temporal features are projected spatially through the feature coupling layer, and the forgetting coefficient ft is generated through the Sigmoid function operation. The calculation expression is as follows: f t = σ(W f · [h t-1 , x t + b f ) (7) The forgetting coefficient ft represents the attenuation rate of historical memory information. Multiply f t element-wise with the historical cell state C t-1 to obtain the memory retention f t *C t-1 to achieve dynamic screening of the historical memory state; 2) Incremental information generation: Input X t synchronously with h t-1 into the input gate, and respectively extract features, update weights, and the amount of state change through a dual-channel processing mechanism; In the Sigmoid feature selection channel, calculate the update coefficient i of the input information t , and the expression is: i t = σ(W i · [h t-1 , x t + b i ) (8) In the Tanh state transformation channel, a non-linear transformation is performed on the fused features to generate candidate states The expression is as follows: Candidate status A new characteristic pattern including the change in hydrogen concentration at the current moment; 3) Memory state iteration: Linearly superimpose the memory retention and the candidate state to update the current cell state: C t The linear superposition operation realizes the adaptive fusion of historical memory features and current incremental features, forming a memory state expression with temporal continuity. 4) Feature space mapping: Take o t and the ht-1 input-output gate, and calculate the output gate coefficient o through the Sigmoid function t , and the expression is: o t = σ(W o * [h t-1 , x t + b o ) (11) o t is the output value in the range of [0, 1], W o is the weight of the output gate, b o is the bias of the output gate, h t is the hydrogen measurement value at the corresponding moment, tanh(C t ) is the updated value of the current cell state after being transformed by the tanh function, and tanh(C t ) ∈ [-1, 1]; h t = o t ×tanh(C t ) (12) 5) Abnormal state decision: Set the decision threshold θ = 0.5 and perform feature energy analysis on the hidden state h t as follows: When the absolute value of the hidden state |h t | < θ, it is determined that there is an abnormal fluctuation in the current hydrogen concentration, and an alarm flag 0 is output and a level-3 highest warning is triggered; When |h t | ≥ θ, confirm that the concentration change conforms to the normal evolution law and output the safety flag 1; The threshold decision mechanism realizes the reliable identification of abnormal states by quantifying the feature energy intensity.

6. A hydrogen-sensitive multi-stage early warning method for thermal runaway of lithium batteries based on the BiLSTM mechanism according to claim 1, characterized in that: In the third step, the LSTM network includes a forward LSTM and a backward LSTM, specifically as follows: Both the forward LSTM and the backward LSTM include an input gate, a forget gate, and an output gate. The forget gate includes a linear transformation layer and a sigmoid function layer. The input gate includes a linear transformation layer, a sigmoid function layer, and a tanh function layer. The output gate includes a linear transformation layer, a sigmoid function layer, and a tanh function layer. The input data of the forward LSTM network is the sensor data input at the current moment, the result output by the previous neuron, and the cell state at the previous moment. The output data is the temperature prediction value.

7. A method for multi-level early warning of thermal runaway of a hydrogen-sensitive lithium battery based on the BiLSTM mechanism according to claim 2, characterized in that: In the third step, the steps to obtain the temperature anomaly detection result in step 3 are as follows: 1) Bidirectional forget gate calculation, specifically as follows: The first forward forget gate: Input: Temperature sensor data x at the current moment t , the hidden state of the forward LSTM at the previous moment and the cell state The weight matrix of the forward forget gate and the bias term Calculation: Function: Controls the degree of forgetting of the forward LSTM for the temperature information at the previous moment. The second backward forget gate: Input: Temperature sensor data x at the current moment t , the hidden state of the reverse LSTM at the next moment and the cell state The reverse LSTM processes from the end to the beginning of the sequence, the weight matrix of the backward forget gate and the bias term Calculation: Function: Controls the degree of forgetting of the backward LSTM for the temperature information at the next moment. 2) Bidirectional input gate and state candidate vector: The first forward input gate: Input: x t , Weight matrix of the forward input gate and bias term Weight matrix of the forward state candidate vector and bias term Calculation: Output: Forward state candidate vector The second backward input gate: Input: x t and Output value of the forward LSTM input gate Calculation: Output: Reverse state candidate vector 3) Bidirectional cell state update: The first forward cell state: The second backward cell state: The third combined cell state: Directly concatenate the forward and backward cell states: 4) Bidirectional output gate and hydrogen concentration prediction: The first forward output gate: Weight matrix of the forward input gate and bias term Output value of the forward output gate The second backward output gate: The third combined output: Concatenate the forward and backward hidden states: Output the temperature prediction value through a fully connected layer: y t = σ(W y ·h t + b y ) (27) 5) Temperature anomaly determination: Determination logic: The first dynamic threshold setting: Calculate the mean and standard deviation of the temperature prediction error based on historical data, and dynamically set the threshold τ: τ = μ error + λ·σ error (28) where λ is the sensitivity coefficient, taking μ error and σ error are the mean and standard deviation of the prediction errors of the training set, respectively; The second abnormal trigger condition: If A first-level warning is triggered, indicating abnormal temperature; If a first-level warning is triggered for N consecutive moments, it is upgraded to a second-level warning, indicating a risk of thermal runaway. The third multi-modal fusion, that is, the improvement point: Combine temperature sensor data Perform joint determination as follows: Comprehensive risk value = α × hydrogen anomaly probability + (1 - α) · temperature anomaly probability When the comprehensive risk value exceeds the threshold, a level-three early warning is triggered and emergency shutdown is required.