Method and device for predicting thermal runaway of battery pack

By constructing a dynamic weighted graph and improving the Transformer model, combined with graph neural networks and time features, the problems of data imbalance and multi-dimensional time-series collaborative modeling in battery pack thermal runaway prediction are solved. This enables accurate location of faulty batteries and accurate prediction of fault time, improving prediction accuracy and early warning capabilities.

CN121656845APending Publication Date: 2026-03-13DONGFENG MOTOR GRP
View PDF 0 Cites 2 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-19
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

Existing technologies for early warning of thermal runaway faults in battery packs suffer from several drawbacks. Data imbalance leads to model bias towards the majority class, resulting in poor generalization ability. Early warning requirements are difficult to meet, multi-dimensional time series and spatial topology collaborative modeling is challenging, prediction accuracy is insufficient, and it is difficult to accurately locate faulty battery cells and accurately predict the fault time point.

Method used

By constructing a dynamic weighted graph of the battery pack, extracting spatial features using a graph neural network, and combining it with an improved Transformer model to obtain long-term temporal features, and fusing spatiotemporal anomaly features, and adding fault-sensitive masks and temperature gradient information, the system can accurately locate and predict the time of faulty batteries.

Benefits of technology

It significantly improves the accuracy of battery pack thermal runaway prediction, reduces the probability of false alarms and missed alarms, reduces hardware complexity and cost, issues early warnings, and achieves precise location of faulty batteries and accurate prediction of fault time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121656845A_ABST
    Figure CN121656845A_ABST
Patent Text Reader

Abstract

The invention discloses a battery pack thermal runaway prediction method and device, and relates to the technical field of power battery thermal runaway fault early warning, and the method comprises the steps: generating a dynamic weighted graph of a battery pack based on the physical connection relation between single cells in the battery pack, so as to obtain the spatial characteristics of the battery pack; according to the improved Transform model and in combination with the spatial features, obtaining long-term features of the battery pack; fusing the spatial features and the long-term features to obtain space-time fusion abnormal features; inputting the time-space fusion abnormal features into a classifier to obtain the fault occurrence probability of each single battery cell so as to predict the fault battery and the fault time; wherein a fault sensitive mask matrix is added into the improved Transform model before standard self-attention calculation, and temperature gradient information used for representing battery state parameters is added into position codes. According to the method, the limitation of single dimension in the prediction process is overcome, and the overall accuracy of prediction is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of early warning technology for thermal runaway faults in power batteries, specifically to a method and device for predicting thermal runaway of battery packs. Background Technology

[0002] In the field of early warning technology for thermal runaway faults in power batteries, existing technologies typically monitor the concentration of specific gases using gas sensors and trigger alarms based on thresholds, or employ the Transformer architecture to process charging voltage and temperature curves. However, both of these methods suffer from the following problems: First, the problem of imbalanced data, where the scarcity of fault samples leads to a severe bias towards the majority class in the model, resulting in poor generalization ability; second, the need for early warning, requiring effective prediction using only multi-dimensional time-series data prior to the fault occurrence; third, the need for collaborative modeling of multi-dimensional time-series and spatial topology, requiring the simultaneous capture of the temporal evolution of battery parameters and the spatial structural dependence of individual battery cells; and fourth, insufficient prediction accuracy, as existing solutions struggle to accurately locate faulty battery cells and accurately predict the fault occurrence time. Therefore, an innovative technical solution that can comprehensively address these problems is urgently needed. Summary of the Invention

[0003] This application provides a method and apparatus for predicting thermal runaway of battery packs, which can solve the technical problem of poor accuracy in predicting thermal runaway of battery packs in the prior art.

[0004] In a first aspect, embodiments of this application provide a method for predicting thermal runaway of a battery pack, the method comprising: Based on the physical connection relationship between individual cells in the battery pack, a dynamic weighted map of the battery pack is generated to obtain the spatial characteristics of the battery pack. Based on the improved Transformer model and combined with the aforementioned spatial features, the long-term temporal characteristics of the battery pack are obtained. By fusing the aforementioned spatial features with long-term temporal features, spatiotemporal fusion anomaly features are obtained; The spatiotemporal fusion anomaly features are input into a classifier to obtain the failure probability of each individual cell, so as to predict the failure battery and failure time. The improved Transformer model incorporates a fault-sensitive mask matrix before standard self-attention calculation and includes temperature gradient information to characterize battery state parameters in the position encoding.

[0005] In conjunction with the first aspect, in one embodiment, in generating a dynamic weighted map of the battery pack based on the physical connection relationships between individual cells in the battery pack to obtain the spatial characteristics of the battery pack, generating the dynamic weighted map of the battery pack based on the physical connection relationships between individual cells in the battery pack includes: A single cell in the battery pack is used as a node in a dynamic weighted graph. Construct an edge between two nodes corresponding to two physically adjacent cells in the battery pack; Calculate the edge weights between two adjacent nodes, which characterize the thermal conductivity coefficient, specifically as follows:

[0006] in, For battery cells and battery cells The dynamic weight of the edge between the corresponding two nodes. For battery cells and battery cells The physical distance between them For battery cells and battery cells temperature correlation coefficient These are the weighting coefficients; A dynamic weighted graph of the battery pack is generated by forming a vertex set with all nodes and an edge set with all edges, and combining the edge weights of each edge.

[0007] In conjunction with the first aspect, in one embodiment, in generating a dynamic weighted map of the battery pack based on the physical connection relationships between individual cells in the battery pack to obtain the spatial characteristics of the battery pack, obtaining the spatial characteristics of the battery pack includes: Based on a graph neural network model, the node feature vectors of each cell in the battery pack are defined as follows:

[0008] in, For battery cells The node feature vectors, For battery cells voltage, For battery cells temperature, For battery cells The rate of change of voltage, For battery cells rate of temperature change For battery cells The state of charge; Perform a linear transformation on the feature vectors of each node, and then split the transformed node feature vectors into multiple attention heads; For each attention head, the transformed feature vector of the node is concatenated with the transformed feature vectors of its neighboring nodes, and the inner product of the concatenated feature vector and a learnable attention vector is calculated. Substituting the inner product into the nonlinear activation function yields the attention score of a node to its neighboring nodes. The attention score is masked according to the adjacency relationship in the dynamic weighted graph, and the attention score corresponding to the neighbor node with no edge is set to a very small negative value. The attention scores after masking are normalized to obtain the attention weights of each node to each of its neighboring nodes; Based on the attention weights, the transformed features of neighboring nodes are weighted and summed to obtain the new features of the nodes under the attention head. All the new features output by the attention heads are stitched together to obtain the spatial features of the battery pack.

[0009] In conjunction with the first aspect, in one implementation, both the graph neural network model and the improved Transformer model are models trained using a data-augmented training set, wherein the data augmentation of the training set specifically includes: A spatiotemporal generative adversarial network (GAN) is used to generate virtual fault samples. The GAN comprises a generator and a discriminator. The generator uses a graph neural network encoder and a Transformer decoder structure. Its inputs are a random noise vector, topology type encoding, and fault stage encoding. The output is a spatiotemporal fault sample containing node features and edge weights. The discriminator uses a Transformer encoder and a graph neural network classifier structure, and incorporates a physical constraint loss function. The physical constraint loss function is as follows:

[0010] in, The physical constraint loss function, Generate adversarial loss for the standard. , , All are weighting coefficients. For temperature physical constraint loss, For voltage physical constraint loss, For thermal propagation constraint loss; The generated virtual fault samples are screened to retain effective virtual fault samples that conform to the laws of thermal propagation in space and the laws of fault evolution in time. Valid virtual fault samples and real samples are added to the original training set to form a data-enhanced training set.

[0011] In conjunction with the first aspect, in one implementation, both the graph neural network model and the improved Transformer model are models trained using a meta-learning framework, wherein the training process of the meta-learning framework specifically includes: The original training set is divided into multiple meta-tasks, each of which contains a support set and a query set. During the meta-training phase, the following operations are performed for each meta-task: fine-tuning each model in the inner loop on the support set to update the topology adaptation layer parameters in each model; calculating the meta-loss of each model after fine-tuning on the query set; and updating the global initial parameters of each model through the outer loop based on the meta-loss.

[0012] In conjunction with the first aspect, in one implementation, obtaining the long-term temporal characteristics of the battery pack based on the improved Transformer model and incorporating the spatial characteristics includes: The spatial features are stacked according to time steps to form a temporal tensor; Position encoding is added to the temporal tensor, and the temporal tensor with added position encoding is input into a multi-head self-attention layer embedded with a fault-sensitive mask for feature transformation. Long-term time features are extracted by nonlinearly mapping the output of the multi-head self-attention layer using a feedforward neural network.

[0013] In conjunction with the first aspect, in one implementation, when adding position encoding to the time-series tensor, temperature gradient information for characterizing battery state parameters is incorporated into the position encoding. The specific incorporation process is as follows: By combining standard time location coding with temperature gradient information, a hybrid location coding is constructed, specifically as follows:

[0014] in, For mixed positional encoding, Standard time location encoding, This is the scaling factor. For the battery pack in the first The average temperature gradient over the time step, This is a feature map related to temperature.

[0015] In conjunction with the first aspect, in one implementation, when the temporal tensor with added position encoding is input into a multi-head self-attention layer embedded with a fault-sensitive mask for feature transformation, the specific embedding process of the fault-sensitive mask is as follows: Construct a time-step-related fault-sensitive mask matrix, which assigns higher attention weights to time steps closer to the fault termination point compared to other time steps, specifically:

[0016] in, For time step time step The visibility weight, i.e., the fault-sensitive mask matrix, The attenuation coefficient is... This is the end time step of the timing window. Given the total length of the input sequence, Normalized distance; The mask weight matrix is ​​weighted and fused with the attention score in the standard self-attention calculation.

[0017] In conjunction with the first aspect, in one implementation, the step of inputting the spatiotemporal fusion anomaly features into a classifier to obtain the failure probability of each individual cell, so as to predict the failure battery and failure time, includes: The spatiotemporal fusion anomaly features are input into a fully connected layer for nonlinear transformation; The spatiotemporal fusion anomaly features after nonlinear transformation are input into a classifier to obtain the probability distribution of each single cell in the two categories of fault and normal. The probability value of the fault category is used as the probability of fault occurrence for each individual cell. Determine whether the failure probability of each individual cell exceeds a preset threshold. If so, the individual cell that exceeds the preset threshold is identified as the predicted fault cell, and the time when the individual cell first exceeds the preset threshold is identified as the predicted fault time. If not, output the normal state signal of the battery pack.

[0018] Secondly, embodiments of this application provide a battery pack thermal runaway prediction device, the battery pack thermal runaway prediction device comprising: The first acquisition module is used to generate a dynamic weighted map of the battery pack based on the physical connection relationship between the individual cells in the battery pack to obtain the spatial characteristics of the battery pack. The second acquisition module is used to acquire the long-term temporal characteristics of the battery pack based on the improved Transformer model and the spatial characteristics. A fusion module is used to fuse the spatial features with long-term temporal features to obtain spatiotemporal fusion anomaly features; The prediction module is used to input the spatiotemporal fusion anomaly features into the classifier to obtain the failure probability of each individual cell, so as to predict the failure battery and failure time. The improved Transformer model incorporates a fault-sensitive mask matrix before standard self-attention calculation and includes temperature gradient information to characterize battery state parameters in the position encoding.

[0019] The beneficial effects of the technical solutions provided in this application include: This application embodiment constructs a dynamically weighted graph and utilizes a graph neural network to extract spatial features. Based on the physical correlation between individual cells within the battery pack and the spatial propagation effect of the fault, it achieves precise location of the faulty cell. By improving the Transformer model, it can effectively acquire key timing signals and subtle changes before the fault occurs, significantly advancing the warning time. This application embodiment fuses spatial features with long-term temporal features. Based on the spatial features, it locates the position of the faulty battery in the battery pack, and based on the long-term temporal features, it obtains the fault time, forming a spatiotemporal fusion anomaly feature. This overcomes the limitations of existing fault prediction processes that rely on a single dimension of time or space, significantly reducing the probability of false alarms and missed alarms, and improving the overall accuracy of prediction. Furthermore, this application embodiment does not rely on any additional hardware such as gas sensors, significantly reducing system complexity and hardware costs while achieving high-performance early warning. Attached Figure Description

[0020] Figure 1 This is a flowchart illustrating the battery pack thermal runaway prediction method of this application; Figure 2 A schematic diagram illustrating the extraction process of spatial features and long-term temporal features provided for this application; Figure 3 A flowchart illustrating the prediction of faulty cells and fault time provided in this application; Figure 4 This is a schematic diagram of the functional modules of the battery pack thermal runaway prediction device of this application; Figure 5 This is a schematic diagram of the hardware structure of the battery pack thermal runaway prediction device involved in the embodiments of this application. Detailed Implementation

[0021] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.

[0022] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0023] This application provides a method and apparatus for predicting thermal runaway of battery packs, which can solve the technical problem of poor accuracy in predicting thermal runaway of battery packs in the prior art.

[0024] In a first aspect, embodiments of this application provide a method for predicting thermal runaway in battery packs.

[0025] In one embodiment, reference is made to Figure 1 , Figure 1 This is a flowchart illustrating the battery pack thermal runaway prediction method of this application. Figure 1 As shown, the battery pack thermal runaway prediction method includes the following steps: Step S1: Based on the physical connection relationship between individual cells in the battery pack, generate a dynamic weighted map of the battery pack to obtain the spatial characteristics of the battery pack.

[0026] In this embodiment of the application, step S1, generating a dynamic weighted graph of the battery pack based on the physical connection relationship between the individual cells in the battery pack, specifically includes the following steps: Step S111: Treat a single cell in the battery pack as a node in the dynamic weighted graph.

[0027] Specifically, for a single cell that does not have a temperature probe directly installed, the weighted average of three adjacent probe cells is used as its temperature characteristic value.

[0028] Step S112: Construct an edge between the two nodes corresponding to two physically adjacent single cells in the battery pack.

[0029] Specifically, adjacent single cells in the horizontal or vertical direction can be determined based on the battery pack design drawings, or a connection edge can be established when the Pearson correlation coefficient of the temperature sequences of two single cells is greater than 0.7, according to the thermal correlation rule.

[0030] Step S113: Calculate the edge weights between two adjacent nodes to characterize the thermal conductivity coefficient, specifically:

[0031] in, For battery cells and battery cells The dynamic weight of the edge between the corresponding two nodes. For battery cells and battery cells The physical distance between them For battery cells and battery cells temperature correlation coefficient These are the weighting coefficients.

[0032] Specifically, the thermal correlation strength between two cells is quantified by normalizing the weights to the [0,1] interval.

[0033] Step S114: Construct a vertex set with all nodes, construct an edge set with all edges, and combine the edge weights corresponding to each edge to generate a dynamic weighted graph of the battery pack.

[0034] Specifically, in practical applications, to address the topological differences between 95-cell and 96-cell battery packs, a virtual node completion method is employed. One virtual node is added to the 95-cell battery pack, with its features calculated as the average of all real nodes and its edge weights set to 0, ensuring that the number of nodes in all graphs is uniformly 96. During model training, an attention masking mechanism is used to shield the virtual node from the influence of the real node features, guaranteeing the effectiveness of model training.

[0035] In this embodiment of the application, obtaining the spatial features of the battery pack in step S1 specifically includes the following steps: Step S121: Based on the graph neural network model, define the node feature vector for each individual cell in the battery pack, specifically as follows:

[0036] in, For battery cells The node feature vectors, For battery cells voltage, For battery cells temperature, For battery cells The rate of change of voltage, For battery cells rate of temperature change For battery cells The state of charge; Step S122: Perform a linear transformation on the feature vectors of each node, and split the transformed node feature vectors into multiple attention heads; Step S123: For each attention head, the transformed feature vector of the node is concatenated with the transformed feature vectors of the neighboring nodes, and the inner product of the concatenated feature vector and a learnable attention vector is calculated. Step S124: Substitute the inner product into the nonlinear activation function to obtain the attention score of the node to its neighboring nodes; Step S125: Mask the attention score according to the adjacency relationship in the dynamic weighted graph, and set the attention score corresponding to the neighbor node with no edge to a very small negative value. Step S126: Normalize the masked attention scores to obtain the attention weights of each node to each of its neighboring nodes; Step S127: Based on the attention weights, perform a weighted summation of the transformed features of the neighboring nodes to obtain the new features of the nodes under this attention head; Step S128: Concatenate the new features output by all attention heads to obtain the spatial features of the battery pack.

[0037] Specifically, the spatial characteristics of the battery pack can be obtained using the following pseudocode: class BatteryGAT(nn.Module): def init(self, in_dim, out_dim, num_heads=4): super().init() self.num_heads = num_heads # Linear transformation matrix (shared by multiple heads) self.W = nn.Linear(in_dim, out_dim * num_heads, bias=False) # Attention vectors (one for each head) self.a = nn.Parameter(torch.randn(out_dim * num_heads, 1)) self.leaky_relu = nn.LeakyReLU(0.2) def forward(self, x, adj): # x: [N, in_dim] (N is the number of battery cells), adj: [N, N] (adjacency matrix) N = x.shape[0] # Linear transformation: [N, in_dim] → [N, out_dimnum_heads] h = self.W(x) # Multi-head split: [N, num_heads, out_dim] h = h.view(N, self.num_heads, -1) # Calculate the attention score: [N, N, num_heads] a_input = torch.cat([h.unsqueeze(1).repeat(1, N, 1, 1),h.unsqueeze(0).repeat(N, 1, 1, 1)], dim=-1) e = self.leaky_relu(torch.matmul(a_input, self.a).squeeze(-1)) # Adjacency matrix mask: Set the score of non-adjacent nodes to -1e9 mask = (1 - adj) * -1e9 e = e + mask.unsqueeze(-1) # Attention weight normalization alpha = torch.softmax(e, dim=1) # Feature aggregation: [N, num_heads, out_dim] out = torch.matmul(alpha.transpose(1,2), h) # Multi-head concatenation: [N, num_headsout_dim] out = out.view(N, -1) return out, alpha.

[0038] Figure 2 A schematic diagram illustrating the extraction process of spatial and long-term temporal features provided for this application. See also... Figure 2 In practical applications, multiple battery packs can be processed simultaneously. Different battery packs generate their corresponding dynamic weighted graphs, which are then input into a graph neural network model for spatial feature extraction. Figure 2 In this context, GNN stands for Graph Neural Network Model; Original network is the original graph, i.e., the initial dynamically weighted graph; Pooled network is used to gradually aggregate node information and reduce the graph size; at level 1, at level 2, and at level 3 are the structural or feature representations of the graph network or pooling network at different levels, typically used for multi-scale feature extraction or hierarchical graph modeling; Graph classification is responsible for extracting spatial features from the graph at the current level and then classifying it.

[0039] This application's embodiments utilize a multi-head attention mechanism to acquire complex spatial relationships within the battery pack from different perspectives, effectively modeling heat conduction and fault propagation paths. Simultaneously, the use of learnable attention vectors enables the graph neural network model to adaptively adjust the importance weights between nodes. This application's embodiments ensure the rationality of spatial features through adjacency masking, avoiding interference from invalid connections. The resulting spatial features incorporate global topological structure while retaining local neighborhood information, providing more accurate input features for subsequent temporal feature extraction and fault prediction.

[0040] Step S2: Obtain the long-term temporal characteristics of the battery pack based on the improved Transformer model and combined with spatial features.

[0041] In the embodiments of this application, the improved Transformer model adds a fault-sensitive mask matrix before the standard self-attention calculation, and adds temperature gradient information to the position encoding to characterize the battery state parameters.

[0042] In this embodiment of the application, a training set needs to be constructed and imbalanced samples need to be adjusted before training the model.

[0043] Specifically, a sliding window method was used to construct the samples. The window length was set to 10 minutes, corresponding to 120 time steps, with a time step size of 5 seconds. The window sliding step size was 5 minutes, corresponding to 60 time steps. Each window corresponds to a time series segment and the graph structure of each time step within that time series segment. The sample labels were marked according to the following rules: positive samples (fault windows) were selected from the fault vehicle data, with a time series window no more than 3 hours away from the fault cutoff point, and were labeled as 1; negative samples (normal windows) included all time series windows of normal vehicles, as well as time series windows of fault vehicles that were more than 3 hours away from the fault cutoff point, and were labeled as 0.

[0044] A combination of stratified downsampling and oversampling was used to adjust the imbalance ratio of samples. Specifically, stratified downsampling was implemented for negative samples, which were stratified according to vehicle type (e.g., faulty vehicle, normal vehicle) and operating condition (e.g., charging, discharging, stationary). Within each stratum, 10% of the normal window samples were randomly retained, significantly reducing the number of negative samples. Temporal oversampling was implemented for positive samples. New positive samples were generated by interpolating the temporal characteristics (e.g., voltage and temperature change sequences) of the original fault windows, ensuring that the new samples maintained the original temporal evolution trend (e.g., continuous temperature increase, increased voltage fluctuations, etc.).

[0045] After the above adjustments, the imbalance of the samples was significantly improved, providing the original training set for subsequent data augmentation using spatiotemporal generative adversarial networks.

[0046] In this embodiment, before using a spatiotemporal generative adversarial network for data augmentation, a dynamic hard example sampling strategy is first employed to optimize the training process. Dynamic hard example sampling can be implemented using the following pseudocode: class DynamicHardSampleSampler: def init(self, pos_ratio=0.1): self.pos_ratio = pos_ratio # Target positive and negative sample ratio def calculate_difficulty(self, samples, model): """ Calculating sample difficulty: based on the gap between the model's predicted probability and the true label. """ with torch.no_grad(): pred = model(samples["feat"]) # Difficulty level: The absolute difference between the predicted probability and the label (the smaller the difference, the higher the difficulty). difficulty = 1 - torch.abs(pred - samples["label"].unsqueeze(1)) return difficulty.squeeze(1).numpy() def sample(self, samples, model): # Separate positive and negative samples pos_mask = samples["label"] == 1 pos_samples = {k: v[pos_mask] for k, v in samples.items()} neg_samples = {k: v[~pos_mask] for k, v in samples.items()} # Difficulty in calculating negative samples neg_diff = self.calculate_difficulty(neg_samples, model) # Sort by difficulty in descending order and take the top K difficult examples (K = number of positive samples * (1 - pos_ratio) / pos_ratio) k = int(len(pos_samples["label"]) * (1 - self.pos_ratio) / self.pos_ratio) hard_neg_idx = np.argsort(neg_diff)[::-1][:k] hard_neg_samples = {k: v[hard_neg_idx] for k, v in neg_samples.items()} # Merge sampling results sampled_pos = pos_samples sampled_neg = hard_neg_samples return { "feat": torch.cat([sampled_pos["feat"], sampled_neg["feat"]]), "label": torch.cat([sampled_pos["label"], sampled_neg["label"]]) }

[0047] By focusing on difficult examples near the decision boundary through dynamic hard example sampling, the model's ability to discriminate boundary situations is effectively improved, thus enhancing the model's generalization performance.

[0048] In this embodiment, both the graph neural network model and the improved Transformer model are trained using a data-augmented training set. The data augmentation of the training set specifically includes the following steps: Step A1: A spatiotemporal generative adversarial network (GAN) is used to generate virtual fault samples. The GAN comprises a generator and a discriminator. The generator uses a graph neural network encoder and a Transformer decoder structure. The input consists of a random noise vector, topology type encoding, and fault stage encoding. The output is a spatiotemporal fault sample containing node features and edge weights. The discriminator uses a Transformer encoder and a graph neural network classifier structure, and introduces a physical constraint loss function. The physical constraint loss function is:

[0049] in, The physical constraint loss function, Generate adversarial loss for the standard. , , All are weighting coefficients. For temperature physical constraint loss, For voltage physical constraint loss, This is to account for the loss due to thermal spread.

[0050] Specifically, the generator first learns the spatial topological relationships of the battery pack through a graph neural network encoder, and then generates a graph sequence containing 10-minute time windows through a Transformer decoder. Each time step corresponds to a complete graph structure, including node features and edge weights. The discriminator takes the original samples and their labels as input and outputs binary classification probabilities of the samples as real or virtual. The discriminator introduces a physical constraint loss function to ensure that the generated voltage and temperature data conform to the physical change trends before the fault, such as a temperature gradient greater than 0.2℃ / min and a voltage fluctuation greater than 0.05V. This embodiment of the application ensures the rationality of the samples by introducing a physical constraint loss function, avoiding interference from invalid samples to model training.

[0051] Step A2: Filter the generated virtual fault samples to retain valid virtual fault samples that conform to the laws of thermal propagation in space and the laws of fault evolution in time.

[0052] Specifically, spatial conformity to the heat propagation law means that the temperature of adjacent nodes of the abnormal node rises synchronously, and temporal conformity to the fault evolution law means that the temperature gradient gradually increases.

[0053] Step A3: Add the valid virtual fault samples and real samples to the original training set to form a data-enhanced training set.

[0054] Specifically, the selected effective virtual fault samples are merged with the original training samples to reduce the ratio of positive to negative samples, so that the generated samples can cover a variety of fault scenarios and enhance the model's adaptability under different working conditions.

[0055] Furthermore, in this embodiment of the application, to adapt to pre-training and meta-learning, the publicly available dataset and self-collected data are aligned in multiple dimensions. Specifically: First, align the indicators and formats. Retain core monitoring fields consistent with the target dataset, including key parameters such as voltage, current, and temperature. Additional fields present in the public dataset (such as fault causes and cell internal resistance) are retained as auxiliary features. All time-series data are resampled at 5-second time steps to ensure consistent time-series resolution. The same graph modeling method as in the previous embodiment is used to construct the topology. Virtual node completion unifies the number of nodes in all graphs, ensuring complete consistency in graph structure format between the supplementary data and the target data.

[0056] Then, label calibration and operating condition annotation were performed. To address label differences from different data sources, the annotations were recalibrated according to a unified fault window definition rule (i.e., 3 hours before the fault). For publicly available data that did not conform to this rule, the annotations were re-annotated. For self-collected data, the fault window was calculated backwards from the heating or overcharge trigger time. Simultaneously, a new operating condition feature field C=[Mode, C-rate] was added, where Mode represents the charging / discharging / resting operating condition mode, and C-rate represents the charging / discharging rate, providing a basis for subsequent meta-learning to divide tasks according to operating conditions.

[0057] Finally, sample integration is performed. The aligned public dataset and self-collected dataset are merged with the enhanced target dataset to form a comprehensive dataset. The comprehensive dataset fully covers the topology of Section 95 / 96, multiple operating conditions, and different fault causes, forming a complete data foundation for model pre-training and meta-learning.

[0058] In this embodiment, both the graph neural network model and the improved Transformer model are trained using a meta-learning framework. The training process of the meta-learning framework specifically includes the following steps: Step B1: Divide the original training set into multiple meta-tasks, each of which contains a support set and a query set; Step B2: During the meta-training phase, perform the following operations for each meta-task: fine-tune each model in the inner loop on the support set to update the topology adaptation layer parameters in each model; calculate the meta-loss of each model after fine-tuning on the query set; and update the global initial parameters of each model through the outer loop based on the meta-loss.

[0059] The training process of the meta-learning framework can be implemented using the following pseudocode: def taml_meta_train(meta_model, meta_optimizer, task_distribution,num_meta_epochs=50, num_tasks_per_epoch=4, inner_lr=1e-4): for meta_epoch in range(num_meta_epochs): meta_loss = 0.0 # Sampling Multiple Topologies - Working Condition Metatask tasks = [task_distribution.sample_task() for _ in range(num_tasks_per_epoch)] For task in tasks: # Task Data: Support set (small number of samples) + Query set (validation samples) support_data, support_label = task["support"] query_data, query_label = task["query"] # Inner Loop: Fine-tuning within the task (updating only the topology adaptation layer) fast_weights = copy.deepcopy(meta_model.state_dict()) for _ in range (3): # Inner loop iteration in 3 steps pred = meta_model(support_data, weights=fast_weights) inner_loss = F.binary_cross_entropy_with_logits(pred, support_label) # Only calculate gradients of the topology adaptation layer grads = torch.autograd.grad( inner_loss, [fast_weights[k] for k in fast_weights if "topo_adapter" in k] ) # Update adapter layer parameters adapter_keys = [k for k in fast_weights if "topo_adapter" in k] for k, g in zip(adapter_keys, grads): fast_weights[k] -= inner_lr * g # Outer loop: Calculate the meta-loss (query set performance) pred_query = meta_model(query_data, weights=fast_weights) meta_loss += F.binary_cross_entropy_with_logits(pred_query, query_label) # Meta-optimizer updates global initial parameters meta_optimizer.zero_grad() meta_loss / = num_tasks_per_epoch meta_loss.backward() meta_optimizer.step() print(f"Meta Epoch {meta_epoch+1}, Loss: {meta_loss.item():.4f}") return meta_model.

[0060] Furthermore, based on the cross-topology generalization capability obtained through meta-learning, a working condition feature gating mechanism is introduced. The specific introduction of the working condition feature gating mechanism is as follows: Step C1: Construct the working condition feature vector, specifically:

[0061] in, For the working condition feature vector, The symbol is for average current, and +1 indicates charging ( >0), Indicates discharge ( <0), 0 indicates static ( ≈ 0), This represents the absolute value of the average current of the battery pack within the current window. This is the rated current of the battery pack. This is the normalized current amplitude. This is the average temperature of all individual cells within the current window.

[0062] Step C2: Perform a linear transformation on the working condition feature vector using a learnable parameter matrix and bias terms, then process it through a sigmoid activation function to generate gated weights, specifically:

[0063] in, For gating weights, It is the sigmoid activation function. For a learnable parameter matrix, This is a learnable bias term. This allows the gating weights to adaptively reflect the degree of emphasis on spatiotemporal features under different operating conditions.

[0064] Step C3: Dynamically fuse temporal attention weights and spatial attention weights using gating weights. Specifically:

[0065] in, This is the final attention weight matrix after fusion. For temporal attention weights, For spatial branch self-attention scoring. When → 1 (e.g., charging condition) The model mainly references temporal attention, when → 0 (e.g., discharge condition) model mainly references spatial attention to achieve condition-adaptive attention fusion.

[0066] By introducing a condition-feature gating mechanism, the model can dynamically adjust the feature fusion strategy according to the real-time operating status, forming a dual adaptive capability of topology and operating conditions, which significantly improves performance in real-world complex application environments.

[0067] In this embodiment of the application, step S2 specifically includes the following steps: Step S21: Stack the spatial features according to time steps to form a temporal tensor.

[0068] Specifically, the temporal tensor has a dimension of L×N×d, where L represents the length of the time window (e.g., 120 time steps corresponding to 10 minutes), N represents the number of cells in the battery pack, and d represents the spatial feature dimension of each cell, thereby realizing the conversion from spatial features to temporal input.

[0069] Step S22: Add positional encoding to the temporal tensor, and input the temporal tensor with added positional encoding into a multi-head self-attention layer with a fault-sensitive mask for feature transformation.

[0070] Specifically, temperature gradient information, used to characterize battery state parameters, is incorporated into the position encoding. By fusing the hybrid position encoding with temperature gradients, physical prior knowledge is injected into the Transformer model, enhancing its sensitivity to precursory signals of thermal runaway. The embedding of a fault-sensitive mask allows for the allocation of higher attention weights to time steps closer to the fault, enabling the Transformer model to focus more on key changes at the end of the fault evolution.

[0071] Step S23: Nonlinearly map the output of the multi-head self-attention layer using a feedforward neural network to extract long-term time features.

[0072] Specifically, a deep feature representation containing long-term time patterns is extracted through a feedforward neural network, which represents the long-term time features of the battery pack.

[0073] In this embodiment of the application, in step S22, when adding position encoding to the time-series tensor, temperature gradient information for characterizing battery state parameters is added to the position encoding. The specific addition process is as follows: By combining standard time location coding with temperature gradient information, a hybrid location coding is constructed, specifically as follows:

[0074] in, For mixed positional encoding, Standard time location encoding, This is the scaling factor. For the battery pack in the first The average temperature gradient over the time step, This is a feature map related to temperature.

[0075] See also Figure 2 In the extraction of long-term temporal features based on the Transformer model: Thinking is the computation process in multi-head attention; Machines is the feedforward network; X1 is the feature obtained after the first thinking; X2 is the feature obtained after the second model processing; POSITIONAL ENCODING is positional encoding; Multi-HeadAttention is multi-head attention that computes multiple sets of attention in parallel to capture long-range dependencies between different subspaces within the sequence; Add&Normalize is residual connection and layer normalization, used to add the module input and output before layer normalization to prevent gradient vanishing and stabilize training; Feed Forward is the feedforward network, used to perform linear transformation and activation independently for each position, increasing non-linear expressive power; DECODER #1 is the first layer of the decoder; DECODER #2 is the second layer of the decoder, and after passing through two decoder layers, deeper long-term temporal features are extracted; Linear is linear transformation; Softmax is the normalization exponential function.

[0076] The embodiments of this application directly embed physical prior knowledge into the underlying model, enabling the model to perceive the physical signs of thermal runaway in the initial stage of feature extraction, significantly enhancing the sensitivity to weak signals before the failure.

[0077] In this embodiment of the application, when the temporal tensor with added position encoding is input into a multi-head self-attention layer embedded with a fault-sensitive mask for feature transformation, the specific embedding process of the fault-sensitive mask is as follows: Step D1: Construct a fault-sensitive mask matrix associated with each time step. This fault-sensitive mask matrix assigns higher attention weights to time steps closer to the fault's end compared to other time steps. Specifically:

[0078] in, For time step time step The visibility weight, i.e., the fault-sensitive mask matrix, The attenuation coefficient is... This is the end time step of the timing window. Given the total length of the input sequence, Normalized distance; Step D2: Weight the mask weight matrix and the attention score in the standard self-attention calculation.

[0079] The embodiments of this application enhance the attention weight of key time steps at the end of the fault evolution, enabling the model to automatically focus on the most discriminative time period before the fault occurs, thus significantly improving the accuracy of early warning.

[0080] Step S3: Fuse spatial features with long-term temporal features to obtain spatiotemporal fusion anomaly features.

[0081] In this embodiment of the application, step S3 specifically includes the following steps: Step S31: Perform tensor-level concatenation of the spatial features extracted by the graph neural network and the long-term temporal features extracted by the improved Transformer.

[0082] Specifically, through specific dimensional transformation operations, the spatial feature matrix and the long-term time feature matrix are aligned to the same feature space.

[0083] Step S32: Employ a cross-attention mechanism to achieve deep interaction of spatiotemporal features.

[0084] Specifically, spatial features are used as queries, and temporal features are used as keys and values. Multi-head attention is used to calculate the dependencies of spatial nodes on the time series.

[0085] Step S33: Perform residual connection and layer normalization between the cross-attention output and the original features to form the final spatiotemporal fusion anomaly features.

[0086] The spatiotemporal fusion anomaly features not only retain the structural information of spatial topology, but also incorporate the dynamic laws of temporal evolution, and include the synergistic effects generated by spatiotemporal interaction.

[0087] Step S4: Input the spatiotemporal fusion anomaly features into the classifier to obtain the failure probability of each individual cell, so as to predict the failure battery and failure time.

[0088] Figure 3 A flowchart illustrating the prediction of faulty cells and failure times provided in this application. See also... Figure 3 In this embodiment of the application, step S4 specifically includes the following steps: Step S41: Input the spatiotemporal fusion anomaly features into the fully connected layer for nonlinear transformation.

[0089] Specifically, the spatiotemporal fusion anomaly features are input into a multi-layer fully connected neural network for deep nonlinear transformation, and the network contains multiple hidden layers. Figure 3 In this model, the input layer is used to receive spatiotemporal fusion anomaly features; hidden layer 1, hidden layer 2, and hidden layer 3 are all hidden layers that extract higher-order features layer by layer; and the output layer is used to input the spatiotemporal fusion anomaly features that have undergone nonlinear transformation into the Softmax classifier.

[0090] Step S42: Input the spatiotemporal fusion anomaly features after nonlinear transformation into the classifier to obtain the probability distribution of each single cell in the two categories of fault and normal.

[0091] Specifically, the spatiotemporal fusion anomaly features, after nonlinear transformation, are input into a Softmax classifier to calculate the probability distribution of each single cell in the fault and normal categories. The specific calculation is as follows:

[0092] in, , which is a logical value, is the feature vector output by the fully connected layer, representing the original prediction confidence of the Softmax classifier for each category; For the first Logical values ​​for each category, For the first Logical values ​​for each category, Sum the exponents of all category logical values. For the first The predicted probability of each category. Figure 3In the Softmax classifier step, the three values ​​2.0, 1.0, and 0.1 on the left are the feature vectors output by the fully connected layer for the three battery cells. After being transformed by the Softmax function, the logical value [2.0, 1.0, 0.1] is converted into a set of probability values ​​[0.7, 0.2, 0.1] that sum to 1. The failure probabilities of the three battery cells are 0.7 (high probability), 0.2 (low probability), and 0.1 (extremely low probability), respectively.

[0093] Step S43: Use the probability value of the fault category as the probability of fault occurrence for each individual cell.

[0094] Specifically, the failure probability of each individual cell reflects the degree of anomaly of the individual cell in the spatiotemporal dimension, and the higher the value, the greater the risk of thermal runaway failure.

[0095] Step S44: Determine whether the failure probability of each individual cell exceeds a preset threshold. If so, the individual cell that exceeds the preset threshold is taken as the predicted fault cell, and the time point when the individual cell first exceeds the preset threshold is taken as the predicted fault time. If not, output the battery pack normal status signal.

[0096] Specifically, the setting of preset thresholds should take into account the health status of the battery pack and its current operating conditions. The time of failure is determined based on the first time the threshold is exceeded, thereby capturing the initial signs of the fault, advancing the warning time, and effectively preventing thermal runaway accidents.

[0097] This application embodiment constructs a dynamically weighted graph and utilizes a graph neural network to extract spatial features. Based on the physical correlation between individual cells within the battery pack and the spatial propagation effect of faults, it achieves precise location of faulty cells. By improving the Transformer model, it can effectively acquire key timing signals and subtle changes before the fault occurs, significantly advancing the warning time. This application embodiment fuses spatial features with long-term temporal features to form spatiotemporal fusion anomaly features, thereby overcoming the limitations of existing fault prediction processes that rely on a single dimension of time or space, significantly reducing the probability of false alarms and missed alarms, and improving the overall accuracy of prediction. Furthermore, this application embodiment does not rely on any additional hardware such as gas sensors, significantly reducing system complexity and hardware costs while achieving high-performance early warning.

[0098] In practical applications, the following systematic optimization strategies are also included. Specifically: I. Based on spatiotemporal fusion anomaly features, a feature system encompassing both microscopic and macroscopic levels is further constructed. Microscopic features focus on the single-cell level, including the five-minute temperature change rate and voltage fluctuation amplitude, while macroscopic features focus on the battery pack level, including the number of high-temperature cell clusters and the voltage consistency coefficient. Through a feature selection method combining mutual information analysis and L1 regularization, an eight-dimensional subset of core features is selected from the original features, retaining over 95% of the fault information while reducing model complexity.

[0099] Second, a three-level training strategy of pre-training, fine-tuning, and distillation is adopted for the data-augmented training set and meta-learning framework. First, the model is pre-trained on a public dataset containing multiple fault causes to establish basic fault identification capabilities. Then, topology adaptive meta-learning is used to quickly fine-tune the model on the target dataset, focusing on optimizing the parameters of the topology adaptation layer. Finally, knowledge distillation is used to transfer the capabilities of the complex teacher model to the lightweight student model. While ensuring that the model accuracy loss is less than 2%, the model parameter size is compressed from 85 MB to 18 MB, and the inference latency is optimized from 200 milliseconds to 30 milliseconds, meeting the real-time requirements of in-vehicle edge devices.

[0100] Third, to adapt to the computing power constraints of the in-vehicle environment, the deployment model is compressed using 16-bit fixed-point quantization, reducing the model size from 340 megabytes to 36 megabytes. During inference, a sliding window reuse mechanism is employed. By caching intermediate computation results, the overlap rate of feature calculations in adjacent windows is increased to 70%, significantly reducing redundant computation overhead and ensuring stable and smooth system operation under limited hardware resources. Specifically, the sliding window reuse inference can be implemented using the following pseudocode: class RealTimeInferencer: def init(self, model, window_len=120, step_len=36): self.model = model self.window_len = window_len # Window length (time steps) self.step_len = step_len # Slide step size (time steps) self.cache = None # Cache intermediate calculation results from the previous window def infer(self, new_data): # new_data: [step_len, N, d] (Newly received time step data) if self.cache is None: # Initial inference: No cache, full window calculation required if new_data.shape[0] <self.window_len: raise ValueError("At least one complete window of data is required for the first inference") window_data = new_data[:self.window_len] # Cache intermediate results for subsequent reuse (window_len - step_len steps after the window) self.cache = window_data[self.step_len:] else: # Further reasoning: Combine cached data with new data to form a new window window_data = torch.cat([self.cache, new_data], dim=0) # Update cache self.cache = window_data[self.step_len:] # Model Inference with torch.no_grad(): pred = self.model(window_data) is_fault = (torch.sigmoid(pred)>self.model.threshold).item() return is_fault, torch.sigmoid(pred).item().

[0101] IV. To achieve functional safety requirements in accordance with ISO 26262, a triple redundancy protection mechanism is constructed. At the model redundancy level, three independent and heterogeneous sub-models are established, and a majority voting mechanism is used to generate the final warning output. At the diagnostic redundancy level, three lines of defense are established: sensor data integrity verification and inference timeliness monitoring, and feature physical rationality verification. At the threshold redundancy level, a physical safety threshold independent of the model output is established, and the highest level alarm is immediately triggered when the core parameter exceeds the safety boundary.

[0102] Secondly, embodiments of this application provide a battery pack thermal runaway prediction device.

[0103] Figure 4 This is a functional module diagram of the battery pack thermal runaway prediction device of this application. (See attached diagram) Figure 4 The battery pack thermal runaway prediction device includes: The first acquisition module is used to generate a dynamic weighted map of the battery pack based on the physical connection relationship between the individual cells in the battery pack to obtain the spatial characteristics of the battery pack. The second acquisition module is used to acquire the long-term temporal characteristics of the battery pack based on the improved Transformer model and combined with spatial features. The fusion module is used to fuse spatial features with long-term temporal features to obtain spatiotemporal fusion anomaly features. The prediction module is used to input spatiotemporal fusion anomaly features into the classifier to obtain the failure probability of each individual cell, so as to predict the failure battery and failure time. Among them, the improved Transformer model adds a fault-sensitive mask matrix before the standard self-attention calculation, and adds temperature gradient information to the position encoding to characterize the battery state parameters.

[0104] The functions of each module in the above-mentioned battery pack thermal runaway prediction device correspond to the steps in the above-mentioned battery pack thermal runaway prediction method embodiment, and their functions and implementation processes will not be described in detail here.

[0105] Thirdly, embodiments of this application provide a battery pack thermal runaway prediction device, which can be a device with data processing capabilities such as a personal computer (PC), a laptop computer, or a server.

[0106] Reference Figure 5 , Figure 5 This is a schematic diagram of the hardware structure of the battery pack thermal runaway prediction device involved in the embodiments of this application. In the embodiments of this application, the battery pack thermal runaway prediction device may include a processor, a memory, a communication interface, and a communication bus.

[0107] The communication bus can be of any type and is used to interconnect the processor, memory, and communication interface.

[0108] The communication interface includes input / output (I / O) interfaces, physical interfaces, and logical interfaces used for interconnecting devices within the battery pack thermal runaway prediction device, as well as interfaces used for interconnecting the battery pack thermal runaway prediction device with other devices (such as other computing devices or user equipment). Physical interfaces can be Ethernet interfaces, fiber optic interfaces, ATM interfaces, etc.; user equipment can be displays, keyboards, etc.

[0109] Memory can be various types of storage media, such as random access memory (RAM), read-only memory (ROM), non-volatile RAM (NVRAM), flash memory, optical storage, hard disk, programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), etc.

[0110] The processor can be a general-purpose processor, which can call the battery pack thermal runaway prediction program stored in the memory and execute the battery pack thermal runaway prediction method provided in the embodiments of this application. For example, the general-purpose processor can be a central processing unit (CPU). The method executed when the battery pack thermal runaway prediction program is called can be referred to the various embodiments of the battery pack thermal runaway prediction method of this application, and will not be repeated here.

[0111] Those skilled in the art will understand that Figure 5 The hardware structure shown does not constitute a limitation of this application and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0112] Fourthly, embodiments of this application also provide a computer-readable storage medium.

[0113] The present application provides a computer-readable storage medium storing a battery pack thermal runaway prediction program, wherein when the battery pack thermal runaway prediction program is executed by a processor, it implements the steps of the battery pack thermal runaway prediction method described above.

[0114] The method implemented when the battery pack thermal runaway prediction program is executed can be referred to in the various embodiments of the battery pack thermal runaway prediction method of this application, and will not be repeated here.

[0115] It should be noted that the sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0116] The terms "comprising" and "having," and any variations thereof, in the specification, claims, and accompanying drawings of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to such process, method, product, or apparatus. The terms "first," "second," and "third," etc., are used to distinguish different objects, etc., and do not indicate a sequence, nor do they limit "first," "second," and "third" to different types.

[0117] In the description of the embodiments of this application, terms such as "exemplary," "for example," or "for instance" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplary," "for example," or "for instance" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of terms such as "exemplary," "for example," or "for instance" is intended to present the relevant concepts in a concrete manner.

[0118] In the description of the embodiments of this application, unless otherwise stated, " / " means "or". For example, A / B can mean A or B. The "and / or" in the text is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of this application, "multiple" means two or more.

[0119] In some processes described in the embodiments of this application, multiple operations or steps are included in a specific order. However, it should be understood that these operations or steps may not be executed in the order they appear in the embodiments of this application, or they may be executed in parallel. The sequence number of the operation is only used to distinguish different operations, and the sequence number itself does not represent any execution order. In addition, these processes may include more or fewer operations, and these operations or steps may be executed sequentially or in parallel, and these operations or steps may be combined.

[0120] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device to execute the methods described in the various embodiments of this application.

[0121] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.

Claims

1. A method for predicting thermal runaway in a battery pack, characterized in that, The battery pack thermal runaway prediction method includes: Based on the physical connection relationship between individual cells in the battery pack, a dynamic weighted map of the battery pack is generated to obtain the spatial characteristics of the battery pack. Based on the improved Transformer model and combined with the aforementioned spatial features, the long-term temporal characteristics of the battery pack are obtained. By fusing the aforementioned spatial features with long-term temporal features, spatiotemporal fusion anomaly features are obtained; The spatiotemporal fusion anomaly features are input into a classifier to obtain the failure probability of each individual cell, so as to predict the failure battery and failure time. The improved Transformer model incorporates a fault-sensitive mask matrix before standard self-attention calculation and includes temperature gradient information to characterize battery state parameters in the position encoding.

2. The battery pack thermal runaway prediction method according to claim 1, characterized in that, In generating a dynamic weighted map of the battery pack to obtain its spatial characteristics based on the physical connections between individual cells within the battery pack, this process includes: A single cell in the battery pack is used as a node in a dynamic weighted graph. Construct an edge between two nodes corresponding to two physically adjacent cells in the battery pack; Calculate the edge weights between two adjacent nodes, which characterize the thermal conductivity coefficient, specifically as follows: in, For battery cells and battery cells The dynamic weight of the edge between the corresponding two nodes. For battery cells and battery cells The physical distance between them For battery cells and battery cells Temperature correlation coefficient, These are the weighting coefficients; A dynamic weighted graph of the battery pack is generated by forming a vertex set with all nodes and an edge set with all edges, and combining the edge weights of each edge.

3. The battery pack thermal runaway prediction method according to claim 2, characterized in that, In generating a dynamic weighted map of the battery pack based on the physical connection relationships between individual cells in the battery pack to obtain the spatial characteristics of the battery pack, obtaining the spatial characteristics of the battery pack includes: Based on a graph neural network model, the node feature vectors of each cell in the battery pack are defined as follows: in, For battery cells The node feature vectors, For battery cells voltage, For battery cells temperature, For battery cells The rate of change of voltage, For battery cells rate of temperature change For battery cells The state of charge; Perform a linear transformation on the feature vectors of each node, and then split the transformed node feature vectors into multiple attention heads; For each attention head, the transformed feature vector of the node is concatenated with the transformed feature vectors of its neighboring nodes, and the inner product of the concatenated feature vector and a learnable attention vector is calculated. Substituting the inner product into the nonlinear activation function yields the attention score of a node to its neighboring nodes. The attention score is masked according to the adjacency relationship in the dynamic weighted graph, and the attention score corresponding to the neighbor node with no edge is set to a very small negative value. The attention scores after masking are normalized to obtain the attention weights of each node to each of its neighboring nodes; Based on the attention weights, the transformed features of neighboring nodes are weighted and summed to obtain the new features of the nodes under the attention head. All the new features output by the attention heads are stitched together to obtain the spatial features of the battery pack.

4. The battery pack thermal runaway prediction method according to claim 3, characterized in that, Both the graph neural network model and the improved Transformer model are trained using a data-augmented training set. Specifically, the data augmentation of the training set involves: A spatiotemporal generative adversarial network (GAN) is used to generate virtual fault samples. The GAN comprises a generator and a discriminator. The generator uses a graph neural network encoder and a Transformer decoder structure. Its inputs are a random noise vector, topology type encoding, and fault stage encoding. The output is a spatiotemporal fault sample containing node features and edge weights. The discriminator uses a Transformer encoder and a graph neural network classifier structure, and incorporates a physical constraint loss function. The physical constraint loss function is as follows: in, The physical constraint loss function, Generate adversarial loss for the standard. , , All are weighting coefficients. For temperature physical constraint loss, For voltage physical constraint loss, For thermal propagation constraint loss; The generated virtual fault samples are screened to retain effective virtual fault samples that conform to the laws of thermal propagation in space and the laws of fault evolution in time. Valid virtual fault samples and real samples are added to the original training set to form a data-enhanced training set.

5. The battery pack thermal runaway prediction method according to claim 4, characterized in that, Both the graph neural network model and the improved Transformer model are trained using a meta-learning framework. The specific training process of the meta-learning framework is as follows: The original training set is divided into multiple meta-tasks, each of which contains a support set and a query set. During the meta-training phase, the following operations are performed for each meta-task: fine-tuning each model in the inner loop on the support set to update the topology adaptation layer parameters in each model; calculating the meta-loss of each model after fine-tuning on the query set; and updating the global initial parameters of each model through the outer loop based on the meta-loss.

6. The battery pack thermal runaway prediction method according to claim 1, characterized in that, The step of obtaining the long-term temporal characteristics of the battery pack based on the improved Transformer model and combined with the spatial features includes: The spatial features are stacked according to time steps to form a temporal tensor; Position encoding is added to the temporal tensor, and the temporal tensor with added position encoding is input into a multi-head self-attention layer embedded with a fault-sensitive mask for feature transformation. Long-term time features are extracted by nonlinearly mapping the output of the multi-head self-attention layer using a feedforward neural network.

7. The battery pack thermal runaway prediction method according to claim 6, characterized in that, In adding position encoding to the time-series tensor, temperature gradient information for characterizing battery state parameters is incorporated into the position encoding. The specific incorporation process is as follows: By combining standard time location coding with temperature gradient information, a hybrid location coding is constructed, specifically as follows: in, For mixed positional encoding, Standard time location encoding, This is the scaling factor. For the battery pack in the first The average temperature gradient over the time step, This is a feature map related to temperature.

8. The battery pack thermal runaway prediction method according to claim 6, characterized in that, In the process of inputting the temporal tensor with added position encoding into a multi-head self-attention layer embedded with a fault-sensitive mask for feature transformation, the specific embedding process of the fault-sensitive mask is as follows: Construct a time-step-related fault-sensitive mask matrix, which assigns higher attention weights to time steps closer to the fault termination point compared to other time steps, specifically: in, For time step time step The visibility weight, i.e., the fault-sensitive mask matrix, The attenuation coefficient is... This is the end time step of the timing window. Given the total length of the input sequence, Normalized distance; The mask weight matrix is ​​weighted and fused with the attention score in the standard self-attention calculation.

9. The battery pack thermal runaway prediction method according to claim 1, characterized in that, The step of inputting the spatiotemporal fusion anomaly features into a classifier to obtain the failure probability of each individual cell, in order to predict the failure battery and failure time, includes: The spatiotemporal fusion anomaly features are input into a fully connected layer for nonlinear transformation; The spatiotemporal fusion anomaly features after nonlinear transformation are input into a classifier to obtain the probability distribution of each single cell in the two categories of fault and normal. The probability value of the fault category is used as the probability of fault occurrence for each individual cell. Determine whether the probability of failure of each individual cell exceeds a preset threshold. If so, the individual cell that exceeds the preset threshold is identified as the predicted fault cell, and the time when the individual cell first exceeds the preset threshold is identified as the predicted fault time. If not, output the normal state signal of the battery pack.

10. A battery pack thermal runaway prediction device, characterized in that, The battery pack thermal runaway prediction device includes: The first acquisition module is used to generate a dynamic weighted map of the battery pack based on the physical connection relationship between the individual cells in the battery pack to obtain the spatial characteristics of the battery pack. The second acquisition module is used to acquire the long-term temporal characteristics of the battery pack based on the improved Transformer model and the spatial characteristics. A fusion module is used to fuse the spatial features with long-term temporal features to obtain spatiotemporal fusion anomaly features; The prediction module is used to input the spatiotemporal fusion anomaly features into the classifier to obtain the failure probability of each individual cell, so as to predict the failure battery and failure time. The improved Transformer model incorporates a fault-sensitive mask matrix before standard self-attention calculation and includes temperature gradient information to characterize battery state parameters in the position encoding.

Citation Information

Cited By

  • Electric vehicle battery thermal runaway early warning method and system and computer program product

    CN121871449A

  • Lithium ion battery life prediction method and system based on state space model

    CN122017609A