Battery thermal runaway prediction method and device based on attention feature fusion and medium
The battery thermal runaway prediction method, which uses multi-dimensional data extraction and dynamic weight adjustment, solves the problems of insufficient feature coverage and neglect of stage differences in existing technologies. It achieves high-precision prediction and early warning throughout the entire battery life cycle and is adaptable to different battery scenarios.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-18
- Publication Date
- 2026-03-31
AI Technical Summary
Existing thermal runaway prediction technologies suffer from insufficient feature dimensions, failing to cover correlation, clustering, and dimensionality reduction features, and ignoring differences in battery stages. This results in large fluctuations in prediction accuracy between new and old battery scenarios, weak early warning capabilities, and difficulty in meeting engineering requirements.
By acquiring multi-dimensional data, extracting anomaly, time series, correlation, clustering, and dimensionality reduction features, and combining multi-head attention calculation and stage label weight adjustment, a dynamic feature vector is generated to predict the probability of battery thermal runaway.
It achieves high-precision thermal runaway prediction throughout the entire life cycle, with strong early warning capabilities, good adaptability, and can accurately capture the precursors of thermal runaway, reduce the amount of computation, output quantitative risk results, and facilitate the measures taken by operation and maintenance personnel.
Smart Images

Figure CN121142343B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of battery safety control technology, and in particular to a method, device and medium for predicting battery thermal runaway based on attention feature fusion. Background Technology
[0002] Existing thermal runaway prediction technologies mostly collect data such as temperature and voltage from the Battery Management System (BMS), extract anomalous or time-series single features, and combine them with models to predict risks. However, they have obvious shortcomings: First, the feature dimensions are insufficient, focusing only on anomalous and time-series features, without covering correlation, clustering, and dimensionality reduction features, making it difficult to capture multi-parameter coupled anomalies that are precursors to thermal runaway. Second, they ignore the differences in battery stages, failing to incorporate stage labels such as mileage, usage time, and aging degree for adjustment strategies, resulting in large fluctuations in prediction accuracy between new and old battery scenarios. Third, the feature weights are fixed or rely solely on general attention, failing to dynamically adapt to battery stages, and the weight allocation is out of sync with the actual risk patterns.
[0003] The aforementioned problems result in weak early warning capabilities and poor adaptability throughout the entire life cycle of existing technologies, making it difficult to meet engineering requirements. There is an urgent need for a thermal runaway prediction method that integrates multiple features and battery stages. Summary of the Invention
[0004] The main objective of this invention is to provide a battery thermal runaway prediction method, device, and medium based on attention feature fusion, aiming to solve the technical problems of weak early warning capability and poor adaptability throughout the entire battery life cycle in the prior art.
[0005] To achieve the aforementioned objectives, the first aspect of this invention proposes a battery thermal runaway prediction method based on attention feature fusion, the method comprising:
[0006] Obtain specified data related to the battery;
[0007] Extract the abnormal features, time series features, correlation features, clustering features, and dimensionality reduction features from the specified data to generate a feature matrix of multi-dimensional features;
[0008] Identify the current stage label of the battery, wherein the stage label includes one or more of the following: mileage stage label, usage time length label, and battery aging degree label;
[0009] The first weight of each feature in the feature matrix is calculated based on multi-head attention, and the first weight is adjusted according to the stage label to obtain the second weight;
[0010] Based on the second weight, each feature in the feature matrix is weighted and fused to obtain the fused dynamic feature vector;
[0011] Based on the dynamic feature vector, the probability of thermal runaway of the battery is predicted.
[0012] Further, the specified data includes:
[0013] Multi-dimensional operating data including temperature, voltage, current, resistance, SOC, mileage, and operating conditions.
[0014] Furthermore, the method for extracting the abnormal features includes:
[0015] The abnormal features are extracted from the specified data using thresholding, statistical methods, or machine learning.
[0016] Furthermore, the time-series features include sliding window statistical features, time-domain features, and frequency-domain features;
[0017] The sliding window statistical features include features calculated within a specified sliding window;
[0018] The time-domain feature includes the voltage change rate;
[0019] The frequency domain features include the main frequency and harmonic components extracted by performing Fourier transform on voltage and current data.
[0020] Furthermore, the association features include related features and segmentation features;
[0021] The relevant features include the Pearson correlation coefficient between temperature and voltage, and the Spearman correlation coefficient between SOC and internal resistance.
[0022] The segmented features include features obtained by statistically analyzing specified data within a time slice.
[0023] Furthermore, the clustering features include a first clustering feature obtained based on K-Means clustering and a second clustering feature obtained based on DBSCAN clustering.
[0024] Furthermore, the dimensionality reduction features include principal component features extracted based on principal component analysis and distribution features obtained based on t-distribution random neighborhood embedding.
[0025] Further, the calculation of the first weight of each feature in the feature matrix based on multi-head attention includes:
[0026] Based on the current stage of the battery, the feature matrix is weighted according to the stage, and the physical correlation coefficient of the battery is introduced to jointly modulate the "query Q" and "key K" matrices.
[0027] Modifications for stages and physical constraints are added inside the attention head to enable a single attention head to focus on the correlation of key features of thermal runaway;
[0028] After multi-head fusion, the first weight adapted to the battery scenario is obtained through secondary modulation in the battery stage.
[0029] Further, the step of adjusting the first weight according to the stage label to obtain the second weight includes:
[0030] Let the stage label be s, where s=1 represents the mileage stage, s=2 represents the usage time stage, and s=3 represents the aging stage. Adjustment coefficient... satisfy:
[0031]
[0032] Second weight By first weight Multiplying the result element by element by the adjustment coefficient yields:
[0033] Where λ is the characteristic difference attenuation coefficient, with a value range of [0.1, 0.5]. This represents the normalized value of the i-th feature. This represents the normalized value of the j-th feature.
[0034] Further, predicting the thermal runaway probability of the battery based on the dynamic feature vector includes:
[0035] The dynamic feature vector is input into the algorithm model, and the probability value of thermal runaway risk is output.
[0036] The dynamic feature vector is judged based on a preset rule engine to generate rule matching results;
[0037] Based on the dynamic feature vector, query the knowledge base to obtain the historical case matching degree;
[0038] By integrating the aforementioned risk probability values, rule matching results, and case matching degrees, the final thermal runaway risk level and early warning signal are determined. Among these:
[0039] A second aspect of the present invention provides a computer device including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the battery thermal runaway prediction method based on attention feature fusion as described in any of the preceding claims.
[0040] A third aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, characterized in that, when the computer program is executed by a processor, it implements the steps of the battery thermal runaway prediction method based on attention feature fusion as described in any of the preceding claims.
[0041] Beneficial effects:
[0042] This invention presents a battery thermal runaway prediction method, device, and medium based on attention feature fusion. Through a comprehensive design encompassing "data acquisition - parallel extraction of multiple features - stage identification - dynamic weight fusion - probability prediction," it specifically addresses the core shortcomings of existing technologies in feature coverage, stage adaptation, and weight allocation. Specific benefits include: parallel extraction of five types of features—anomaly, time series, correlation, clustering, and dimensionality reduction—to generate a feature matrix, unlike existing technologies that focus on only 1-2 types of features. These five types of features comprehensively characterize the battery state from the dimensions of "parameter abrupt changes," "dynamic time series evolution," "multi-parameter coupling correlation," "operating condition / state clustering pattern," and "high-dimensional information compression." This multi-dimensional coverage enables the method to accurately capture the coupled precursors of "gradual temperature rise + gradual voltage drop + sudden increase in internal resistance" before thermal runaway, avoiding missed detection by a single feature. The early warning window is extended compared to existing technologies, allowing sufficient time for emergency response. Furthermore, the introduction of stage labels—mileage, usage time, and aging degree—overcomes the shortcomings of existing technologies that rely on a "unified model for the entire lifecycle." To address the sudden failure risk of new batteries (low mileage, short usage time), the method can focus on abnormal and time-series characteristics such as sudden voltage / current changes; for the progressive failure risk of aged batteries (high mileage, high degradation), it can focus on features such as internal resistance correlation and temperature clustering. By anchoring the current risk mode of the battery through stage labels, the model avoids misjudging aging characteristics in new battery scenarios and missing key precursors in aged battery scenarios, resulting in smaller fluctuations in prediction accuracy throughout the entire life cycle. The method uses multi-head attention to calculate the first weight (capturing statistical correlations of features), and then combines it with stage labels to obtain the second weight (adapting to the stage risk mode), overcoming the static defects of existing technologies' "fixed weights" or "general attention weights." Dynamic weights enable the fused feature vector to accurately focus on the key risk information of the current stage. Compared with the static fusion of existing technologies, feature discrimination is improved, directly leading to improved subsequent prediction accuracy. The dynamic feature vector generated by weighted fusion using the second weight compresses high-dimensional feature redundancy (reducing subsequent computation) while retaining key risk information (ensuring prediction accuracy), meeting the needs of real-time monitoring. Based on dynamic vector-based thermal runaway probability prediction, it can output quantitative risk results (0-1 interval), which makes it easier for operation and maintenance personnel to take measures according to probability levels (such as triggering emergency warning when the probability is ≥0.8, and strengthening monitoring when the probability is 0.5-0.8). This solves the problem that the existing technology's "qualitative alarm" is difficult to implement, promotes the method from laboratory research to engineering application, and provides a feasible technical solution for the safety management of power batteries in new energy vehicles. Attached Figure Description
[0043] Figure 1 A flowchart illustrating an embodiment of the battery thermal runaway prediction method based on attention feature fusion. Figure 2 This is a schematic diagram of the structure of a computer device according to an embodiment of the invention.
[0044] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0045] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0046] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in this specification means the presence of features, integers, steps, operations, elements, modules, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, modules, components, and / or groups thereof. It should be understood that when we say an element is “connected” or “coupled” to another element, it can be directly connected or coupled to the other element, or there may be intermediate elements. Furthermore, “connected” or “coupled” as used herein can include wireless connections or wireless coupling. The term “and / or” as used herein includes all or any modules and all combinations of one or more associated listed items.
[0047] It will be understood by those skilled in the art that, unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. It should also be understood that terms such as those defined in general dictionaries should be understood to have the same meaning as in the context of the prior art, and should not be interpreted in an idealized or overly formal sense unless specifically defined as herein.
[0048] Reference Figure 1 This invention provides a battery thermal runaway prediction method based on attention feature fusion. The execution entity is a cloud server or an in-vehicle computer, etc. Taking the cloud as an example, the method includes:
[0049] S1. Obtain specified data related to the battery.
[0050] In this step, the specified data refers to a multi-dimensional set of parameters reflecting the battery's operating state, encompassing temperature, voltage, current, resistance, SOC, mileage, and operating conditions. Temperature refers to the surface and internal temperature of the battery cells and battery pack; voltage includes total voltage and individual cell voltage; current refers to charging and discharging current; resistance refers to the battery's internal resistance (including charging and discharging resistance); SOC (State of Charge) is the battery's state of charge; mileage refers to the vehicle's cumulative mileage; and operating conditions refer to charging, discharging, and resting conditions. These data are collected through dedicated sensors in the BMS (such as NTC temperature sensors and voltage sampling chips) and the vehicle's OBD interface, and are core parameters reflecting the battery's electrochemical, thermal, and mechanical states. This data set covers the battery's full-dimensional state across "electrical-thermal-lifetime-operating conditions," providing sufficient physical information for subsequent feature extraction and serving as the fundamental data guarantee for accurate thermal runaway prediction. The comprehensiveness of this data directly supports the subsequent extraction of multiple features, such as "abnormal features (e.g., temperature anomalies), time-series features (e.g., voltage change rate), and correlation features (e.g., the correlation coefficient between temperature and SOC)," ensuring that the features can reflect the true precursory patterns of thermal runaway in the battery.
[0051] For example, it collects parameters such as temperature (including the surface and interior of the battery pack), total voltage, charging and discharging current, cumulative mileage, fast charging cycles, and SOC of 12 cells of a certain ternary lithium battery pack. This comprehensively covers the multi-physics information of battery operation, providing complete data for subsequent feature extraction and avoiding biased predictions due to missing data. Furthermore, data cleaning is performed when acquiring specified data to remove outliers (such as jump values caused by sensor malfunctions). Normalization maps raw data with different dimensions to a unified interval (such as [0,1]), eliminating dimensional differences. This embodiment uses the 3σ criterion (if a data point deviates from the mean by more than 3 times the standard deviation, it is considered an anomaly) to identify and remove outliers; data normalization is performed using the min-max standardization formula. For example, the original temperature range is -40℃ to 85℃. After cleaning, abnormal temperatures of "99℃" (exceeding the 3σ range) at a certain moment are removed, and normal temperature values are mapped to standardized values of 0 to 1. Voltage (300V~420V) and current (-200A~200A) are also normalized simultaneously. This reduces noise interference, makes different types of features numerically comparable, and lays the foundation for subsequent multi-feature fusion.
[0052] S2. Extract the abnormal features, time series features, correlation features, clustering features and dimensionality reduction features from the specified data to generate a feature matrix of multidimensional features.
[0053] In this step, the feature matrix is a high-dimensional matrix (64×128 dimensions in this application) that organizes the features of each dimension by rows and columns. The above-mentioned anomalous features can be extracted using thresholding methods (such as the duration of temperature exceeding 42℃), time-series features can be calculated using sliding windows (such as the 5-minute voltage change rate), correlation features can be analyzed using statistical correlation coefficients (such as the Pearson coefficient between temperature and SOC), clustering features can be generated using K-Means and DBSCAN, and dimensionality reduction features can be compressed using PCA or t-SNE. Furthermore, the above-mentioned anomalous features, time-series features, correlation features, clustering features, and dimensionality reduction features are extracted in parallel. For example, 64-dimensional features such as "duration of temperature exceeding 42℃ for more than 5 minutes" (annomous feature), "mean voltage change rate within 10 minutes" (time-series feature), and "Pearson correlation coefficient between temperature and SOC" (correlation feature) are extracted in parallel to form a (64×128) feature matrix (128 being the length of a single sample time window). It significantly improves feature extraction efficiency while retaining multi-dimensional information, avoiding the limitations of a single feature in describing battery state.
[0054] S3. Identify the current stage label of the battery, wherein the stage label includes one or more of the following: mileage stage label, usage time length label, and battery aging degree label.
[0055] In this step, the aforementioned stage labels are quantitative identifiers of the battery's lifecycle state, divided according to dimensions such as mileage, usage time, and / or aging degree. Each dimension corresponds to a stage range with different risk levels. For example, mileage is divided into stages of 10,000 kilometers (e.g., Stage 1: 0-10,000 km, Stage 2: 10,001-20,000 km, etc.); usage time is divided into stages of 6 months; and aging degree is divided according to capacity decay rate (80%, 70%, and 60% of initial capacity correspond to stages 1, 2, and 3, respectively). In one embodiment, a vehicle has accumulated 35,000 kilometers of driving (corresponding to mileage stage 3), used for 2 years (corresponding to usage time stage 4), and its capacity has decayed to 75% (corresponding to aging degree stage 2), so the stage label set is {3,4,2}. This step achieves a refined division of the battery's lifecycle state, providing a basis for subsequent "dynamic weight adjustment" and solving the drawbacks of traditional methods that apply a "one-size-fits-all" approach to different lifecycle stages.
[0056] S4. Calculate the first weight of each feature in the feature matrix based on multi-head attention, and adjust the first weight according to the stage label to obtain the second weight.
[0057] In this step, the first weight is an initial feature importance coefficient calculated using a customized multi-head attention mechanism (integrating battery stage and physical correlation); the second weight is the final feature weight optimized by combining the stage label with the first weight. In this embodiment, the first weight is first generated by a multi-head attention algorithm that integrates battery physical characteristics, and then the second weight is obtained by adjusting it according to the adjustment coefficient corresponding to the stage label (e.g., multiplying the weight of the internal resistance feature by 1.2 for the aging stage). For example, when the aging stage is 2, the first weight of the "internal resistance change rate" feature is 0.3. After being amplified by the stage adjustment coefficient of 1.2, the second weight is 0.36, increasing the contribution of this key feature in the fusion. This allows the model to automatically focus on key features of different life cycle stages, enhancing its adaptability to the risk of thermal runaway throughout the battery's entire life cycle.
[0058] S5. Based on the second weight, the features in the feature matrix are weighted and fused to obtain the fused dynamic feature vector.
[0059] In this step, the aforementioned dynamic feature vector is a low-dimensional (64-dimensional in this application) feature representation focused on key information, obtained by weighted summation of the feature matrix using the second weight, and is updated in real time according to the battery state. Feature fusion is achieved through matrix multiplication (multiplication of the feature matrix and the second weight matrix), compressing the dimension to 64 dimensions and highlighting key risk features. For example, in the fused 64-dimensional dynamic feature vector, the cumulative contribution of "temperature anomaly features + aging-related features" reaches 45%, accurately capturing the core information of precursors to thermal runaway. Reducing the feature dimension reduces redundant information while highlighting key risk features, improving the efficiency and accuracy of subsequent prediction stages.
[0060] S6. Based on the dynamic feature vector, predict the probability of thermal runaway of the battery.
[0061] In this step, the aforementioned thermal runaway probability refers to the likelihood of the battery experiencing thermal runaway within a specified timeframe (e.g., within 24 hours), with a value range of [0,1]. It can be predicted through multimodal fusion using an algorithm model (cFSMN), a rule engine, and a knowledge base. The dynamic feature vector is input into a deep feedforward sequence memory network (cFSMN) to obtain an initial probability, which is then corrected using a rule engine (e.g., "temperature > 42℃ and rate of change p-value < 0.01") and a knowledge base (historical thermal runaway case matching) to finally output the probability.
[0062] For example, after the dynamic feature vector is input into cFSMN, the initial output probability is 0.72. The rule engine detects that "the rate of temperature change exceeds the threshold," and the knowledge base matches a similar case of "sudden increase in internal resistance of aging battery accompanied by thermal runaway" (matching degree 85%), ultimately correcting the output risk probability to 0.75. This achieves quantitative risk assessment, improves prediction reliability by combining multimodal evidence, and provides clear and interpretable basis for cloud-based early warning decisions.
[0063] This embodiment constructs a complete workflow method encompassing "data acquisition → preprocessing → parallel extraction of multiple features → stage identification → dynamic weighted fusion → multimodal prediction". Based on a multidimensional feature system covering "anomaly, time series, correlation, clustering, and dimensionality reduction", it comprehensively characterizes the battery state; it introduces stage labels such as "mileage, usage time, and aging degree" to achieve dynamic weight adaptation; and it employs a multimodal prediction approach combining "prediction model + rule engine + knowledge base" to improve accuracy and interpretability. Specifically, the battery thermal runaway prediction method based on attention feature fusion in this embodiment covers multiple physical fields and the entire lifecycle information of the battery through multidimensional feature extraction, avoiding the limitations of single parameters / stages; the combination of stage labels and dynamic weights ensures the model maintains high prediction accuracy throughout the battery's entire lifecycle; parallel computing and feature fusion technology shorten single-sample processing time, meeting the real-time warning requirements of vehicle systems; and the multimodal prediction fusion algorithm model, rules, and cases enhance the robustness and interpretability of the prediction.
[0064] In one embodiment, the method for extracting the above-mentioned abnormal features includes:
[0065] The abnormal features are extracted from the specified data using thresholding, statistical methods, and / or machine learning methods.
[0066] The thresholding method described above identifies anomalies by setting a fixed threshold (e.g., temperature > 42℃); the statistical method identifies anomalies through statistical distributions (e.g., the 3σ criterion); and the machine learning method automatically detects anomalies by training a model (e.g., Isolation Forest). The method is selected based on the data type and scenario: thresholding methods are used for parameters with easily defined thresholds, such as temperature and voltage; statistical methods are used for complex time-series data; and machine learning methods are used for multi-parameter coupled scenarios. For example, "temperature exceeding 42℃ for 5 minutes" is extracted using the thresholding method (corresponding to the temperature anomaly preceding thermal runaway); "current jump (deviation from the historical 3σ range exceeding 3 times)" is extracted using the statistical method; and "multi-parameter coupled anomalies (temperature, voltage, and current simultaneously deviating from the normal pattern)" is extracted using the Isolation Forest algorithm. Combining multiple methods ensures extraction efficiency for simple scenarios while improving anomaly identification capabilities for complex scenarios, making anomaly features more comprehensively cover the precursors of thermal runaway. Of course, depending on the actual situation, a single extraction method or any two extraction methods can be used to extract anomaly features.
[0067] The "abnormal feature extraction method" in this embodiment supports the aforementioned "parallel extraction of abnormal features" method. By combining the "threshold method (simple scenarios) + statistical method (time-series scenarios) + machine learning method (complex coupled scenarios)," key abnormal features such as "slow temperature rise before thermal runaway" and "irregular current fluctuations" are successfully extracted, providing core "risk signals" for subsequent prediction. Furthermore, the extraction method in this embodiment is adaptable to the anomaly identification needs of different types of data and scenarios; it covers various anomaly patterns from simple to complex, reducing the omission of precursors to thermal runaway; the introduction of machine learning improves the identification accuracy of complex anomalies, and the true positive rate of abnormal features is higher than that of the single threshold method.
[0068] In one embodiment, the aforementioned time-series features include sliding window statistical features, time-domain features, and frequency-domain features;
[0069] The sliding window statistical features include features calculated within a specified sliding window;
[0070] The time-domain feature includes the voltage change rate;
[0071] The frequency domain features include the main frequency and harmonic components extracted by performing Fourier transform on voltage and current data.
[0072] The aforementioned sliding window statistical features are statistics (mean, variance, etc.) calculated within a sliding time window (e.g., 5 minutes, 10 minutes); time-domain features are features directly extracted from the time dimension (e.g., rate of change); frequency-domain features are extracted by converting time-domain data to the frequency domain using Fourier transform, and then extracting the dominant frequency (the frequency with the highest energy) and harmonic components (frequency components that are integer multiples of the dominant frequency). The sliding window size is set according to the scenario (e.g., a 5-minute window for short-period features, and a 30-minute window for long-period features); the Fourier transform is implemented using Fast Fourier Transform (FFT). In one embodiment, the "voltage mean and variance within a 5-minute sliding window" (sliding window statistical features) are used to capture short-term voltage fluctuations; the "voltage rate of change (ΔV / Δt)" (time-domain feature) is used to identify voltage abrupt changes; performing an FFT on the current data extracts the amplitude of the dominant frequency (e.g., 50Hz) and the third harmonic component (150Hz), revealing that the proportion of the third harmonic component increased from 10% to 25% before thermal runaway (frequency-domain feature). This application characterizes the dynamic changes of battery parameters from multiple dimensions such as time and frequency, and captures the temporal patterns such as "gradual voltage change and abnormal current harmonics" before thermal runaway, making up for the shortcomings of a single dimension.
[0073] This embodiment refines the classification and extraction of "time-series features," which collectively reveal patterns such as "increased short-term voltage fluctuations, abnormal rate of change, and current harmonic distortion" before thermal runaway, providing a basis for the attention mechanism to focus on "time-series risk features." Furthermore, covering both the time and frequency domains allows for a comprehensive capture of the dynamic evolution of battery parameters; frequency domain features can identify latent anomalies in current and voltage (such as harmonic distortion), improving the early detection capability of thermal runaway; and the sliding window, time domain, and frequency domain features complement each other, making fuller use of time-series information.
[0074] In one implementation, the aforementioned association features include related features and segmentation features;
[0075] The relevant features include the Pearson correlation coefficient between temperature and voltage, and the Spearman correlation coefficient between SOC and internal resistance.
[0076] The segmented features include features obtained by statistically analyzing specified data within a time slice.
[0077] The aforementioned correlation features are statistics that measure the degree of linear (Pearson) or monotonic (Spearman) correlation between two variables; segmented features are characteristics (such as the rate of change of mean temperature between segments) after dividing time into slices (e.g., 1 hour, 2 hours). Pearson correlation coefficient is used for linear correlation scenarios, and Spearman correlation coefficient is used for monotonic correlation scenarios; the length of the time slice is set according to the time scale of battery state changes. In a specific embodiment, the "Pearson correlation coefficient between temperature and voltage" is calculated (before thermal runaway, the two change from a weak positive correlation (0.3) to a strong negative correlation (-0.8)); the "Spearman correlation coefficient between SOC and internal resistance" is calculated (in aged batteries, the two show a strong positive correlation, and the correlation coefficient increases from 0.2 to 0.7); the time is divided into 1-hour slices, and the "rate of change of mean temperature within each slice" is statistically analyzed (segmented feature, the rate of change increases from 0.5℃ / h to 2℃ / h before thermal runaway). Correlation features reveal the correlation patterns among multiple battery parameters (such as the reversal of the correlation between temperature and voltage before thermal runaway), providing a basis for attention mechanisms to identify "parameter correlation anomalies." Specifically, correlation features and segmented features can quantify the degree of correlation among multiple parameters, revealing the precursors of "multi-parameter coupling" in thermal runaway; correlation coefficients are sensitive to subtle changes in parameter correlations, enabling early warning of thermal runaway; segmented features, combined with the time dimension, make the temporal evolution of correlation anomalies clearer, improving the interpretability of predictions.
[0078] In one embodiment, the clustering features include a first clustering feature obtained based on K-Means clustering and a second clustering feature obtained based on DBSCAN clustering.
[0079] The K-Means clustering algorithm described above is a hard clustering algorithm that specifies the number of clusters, dividing the data into K clusters. DBSCAN (Density-Based Noise Spatial Clustering) is a density-based clustering algorithm that does not require specifying the number of clusters and can identify clusters and noise points of arbitrary shapes. The number of clusters K in K-Means is set based on experience or the elbow rule; the neighborhood radius (eps) and minimum number of points (minPts) in DBSCAN are determined through data density analysis. For example, using K-Means (K=3) to cluster three-dimensional data of "temperature, voltage, and current" yields "normal clusters, slightly anomalous clusters, and severely anomalous clusters," and the distance from the sample to the center of each cluster is extracted as the first clustering feature. Using DBSCAN (eps=0.5, minPts=5) to cluster the same data, "precursor clusters of thermal runaway" (high density and separated from normal clusters) are identified, and the cluster labels and densities of the samples are extracted as the second clustering feature. In the first clustering feature of samples before thermal runaway, the distance to the center of severely anomalous clusters decreased from 0.8 to 0.3, while in the second clustering feature, the proportion of labels "belonging to the precursor cluster of thermal runaway" increased from 5% to 35%. This embodiment uses K-Means to provide global cluster partitioning and DBSCAN to capture local density anomalies. The combination of these two methods comprehensively extracts cluster structure anomalies from the data, providing a "population anomaly" perspective for thermal runaway prediction. Through the complementarity of K-Means and DBSCAN, both global cluster distribution anomalies and local density anomalous clusters (corresponding to "small-scale parameter aggregation anomalies" in precursors of thermal runaway) are identified, providing a "population anomaly" feature dimension for the attention mechanism. Specifically, the global partitioning of K-Means and the local density clustering of DBSCAN complement each other, covering different types of cluster anomalies; DBSCAN's adaptability to noise and anomalous shape clusters improves the ability to identify precursor clusters of thermal runaway; the clustering features can effectively distinguish between "normal populations" and "precursor populations of thermal runaway," providing a population-level judgment basis for prediction.
[0080] In one embodiment, the aforementioned dimensionality reduction features include principal component features extracted based on principal component analysis and distribution features obtained based on t-distribution random neighborhood embedding.
[0081] Principal Component Analysis (PCA) is a linear dimensionality reduction method that projects high-dimensional data into a low-dimensional principal component space through orthogonal transformation, preserving the maximum variance. t-Distributed Random Neighborhood Embedding (t-SNE) is a non-linear dimensionality reduction method that preserves the local structure of the data by minimizing the KL divergence between the high-dimensional and low-dimensional spaces. For example, PCA retains principal components with a cumulative variance contribution rate ≥ 95%; t-SNE sets the perplexity to 30 (balancing local and global structure). In a specific embodiment, PCA is performed on the original 64-dimensional features, retaining the top 20 principal components (cumulative variance contribution rate 96%), and the scores of these principal components are extracted as principal component features. t-SNE is then performed on the same 64-dimensional features to reduce the dimensionality to 2 dimensions. Visualization reveals that the samples before thermal runaway changed from being "dispersed" to "clustered in a specific region" in the low-dimensional space, and this 2-dimensional coordinate is extracted as the distribution feature. In the principal component features of the samples before thermal runaway, the "first principal component score" increases from 0.2 to 0.8, and in the t-SNE distribution features, the "x-coordinate" changes from -5 to 2. This application preserves key global information through PCA and retains local structural anomalies through t-SNE, providing the attention mechanism with features that remain discriminative even after dimensionality reduction. Furthermore, the feature dimensionality is significantly reduced after dimensionality reduction (e.g., from 64 dimensions to 20 / 2 dimensions), improving subsequent computational efficiency; the preservation of local structure by t-SNE makes the features of thermal runaway precursors more discriminative; the global information from PCA and the local structure from t-SNE complement each other, providing a more comprehensive dimensionality reduction perspective for feature fusion.
[0082] In one embodiment, the above-mentioned calculation of the first weight of each feature in the feature matrix based on multi-head attention includes:
[0083] Based on the current stage of the battery, the feature matrix is weighted according to the stage, and the physical correlation coefficient of the battery is introduced to jointly modulate the "query Q" and "key K" matrices.
[0084] Modifications for stages and physical constraints are added inside the attention head to enable a single attention head to focus on the correlation of key features of thermal runaway;
[0085] After multi-head fusion, the first weight adapted to the battery scenario is obtained through secondary modulation in the battery stage.
[0086] Specifically, let the feature matrix be... (m is the number of features, k is the dimension of a single feature), the stage modulation vector is The physical correlation coefficient matrix is (e.g., the Pearson correlation coefficient matrix between temperature and voltage):
[0087]
[0088]
[0089]
[0090]
[0091]
[0092]
[0093] in, For learnable weight matrix, Let t be the physical correlation weight matrix, where t is a single feature dimension. h represents the number of multi-head attention heads.
[0094] The above Multiply the feature matrix F element by the "stage modulation vector" The "transformed diagonal matrix" achieves the "initial weighting of features by stage labels". and When generating the query matrix Q and the key matrix K, not only are "stage-weighted features" incorporated... It also integrates the "physical correlation coefficient matrix C" (through a learnable matrix). , This reflects the physical prior relationships between battery parameters. In the calculation of a single attention head i, in addition to the usual... Also added "Stage-Physics Modifier" "Strengthen the weight of feature pairs with strong physical correlations at the current stage; It is a scaling factor to prevent the inner product from becoming too large. After concatenating the results of multi-head attention, a learnable matrix is used. Fusion, then element-wise multiplication by the "stage-secondary modulation vector" The diagonal matrix is used to achieve secondary optimization of weights at each stage. Existing multi-head attention techniques are general feature association tools that only calculate weights based on data-driven computation; this application integrates battery stage labels into the entire process of Q / K generation, attention head computation, and multi-head fusion. , The physical correlation coefficient matrix C represents the attention mechanism for "battery scenario customization." For example, if the battery is in "aging stage 2," the stage modulation vector... The element corresponding to the "rate of change of internal resistance" feature is 1.5, and the element corresponding to the "temperature" feature is 1.2; the correlation coefficient between "temperature and voltage" in the physical correlation coefficient matrix C is -0.83. In the calculation... When calculating Q / K, internal resistance and temperature characteristics are given priority weighting; negative correlations of physical correlation coefficients are incorporated; in attention head calculations, features with strong physical correlations, such as "temperature-voltage" and "internal resistance-capacitance," have their weights amplified by correction terms; ultimately, the first weight... In this embodiment, the weight of aging-related features is increased by 30% compared to general multi-head attention. The attention weight is upgraded from "general data association" to "customized association for battery thermal runaway scenarios", which improves the sensitivity of identifying thermal runaway precursor features compared to traditional Transformer multi-head attention, and maintains stable performance at different battery aging stages.
[0095] This embodiment refines the step of "calculating the first weight based on multi-head attention". By integrating battery "stage labels" and "physical correlation priors" into the entire multi-head attention process, it solves the problem of insufficient adaptability of general attention mechanisms to battery scenarios. Customized multi-head attention provides more accurate weight allocation for "battery thermal runaway characteristics during the aging stage", directly improving the accuracy of subsequent fusion and prediction stages. Specifically, the integration of stage labels solves the problem of weight inaccuracies caused by feature distribution drift during the battery life cycle; the introduction of the physical correlation coefficient matrix makes the attention weights consistent with the battery's "electro-thermal coupling" mechanism, improving the interpretability of the method; customized corrections increase the weights of key features; the algorithm complexity increases only slightly, but it can be seamlessly integrated into existing cloud computing environments.
[0096] In one embodiment, adjusting the first weight according to the stage label to obtain the second weight includes:
[0097] Let the stage label be s, where s=1 represents the mileage stage, s=2 represents the usage time stage, and s=3 represents the aging stage. Adjustment coefficient... satisfy:
[0098]
[0099] Second weight By first weight Multiplying the result element by element by the adjustment coefficient yields:
[0100] Where λ is the characteristic difference attenuation coefficient, with a value range of [0.1, 0.5]. This represents the normalized value of the i-th feature. This represents the normalized value of the j-th feature.
[0101] The above adjustment coefficients Based on the stage type (mileage, usage time, aging), different formulas are used to calculate that the adjustment intensity is positively correlated with the stage progress (e.g., the longer the mileage and the higher the degree of aging, the larger αs is). First weight First multiply by the stage adjustment factor Then, multiplying by the "exponential decay term of feature difference" λ controls the decay rate. The smaller the feature difference, the closer the decay term is to 1, retaining the weight; the larger the difference, the smaller the decay term, weakening the weight. Existing weight adjustments are mostly "single coefficient scaling" or "without stage distinction." This embodiment combines "stage type customized adjustment coefficient" and "feature difference decay" to achieve more refined weight optimization. For example, if a battery has a driving range of 50,000 kilometers (s=1), then... =1.2 + 0.05 × log(50000 / 1000) = 1.2 + 0.05 × 3.912 = 1.4; Feature i is "internal resistance change rate" (normalized value 0.8), and feature j is "temperature" (normalized value 0.7), then If λ = 0.2, then the exponential term is exp(-0.1 / 0.2) = 0.6065. First weight Then the second weight =0.3×1.4×0.6065=0.255, which reflects both the weight amplification of the mileage stage and the attenuation correction based on feature differences. The stage adjustment coefficient makes the weights adapt to the battery life cycle, and the feature difference attenuation term makes the weights more focused on "similar and critical" feature pairs.
[0102] By employing a dual mechanism of "stage-specific adjustment coefficients + feature difference attenuation," the attention weights are further optimized to better align with the stage characteristics and feature correlation patterns of battery thermal runaway. Specifically, customized adjustment coefficients for different stages ensure the effectiveness of the weights throughout the battery's entire lifespan; the feature difference attenuation term filters out "irrelevant and highly disparate" feature pairs, making the weights more focused on key correlations; the combination of these two mechanisms upgrades weight adjustment from "coarse-grained scaling" to "fine-grained customization," significantly improving the prediction accuracy after feature fusion.
[0103] In one embodiment, predicting the thermal runaway probability of the battery based on the dynamic feature vector includes:
[0104] The dynamic feature vector is input into the algorithm model, and the probability value of thermal runaway risk is output.
[0105] The dynamic feature vector is judged based on a preset rule engine to generate rule matching results;
[0106] Based on the dynamic feature vector, query the knowledge base to obtain the historical case matching degree;
[0107] By combining the risk probability value, rule matching results, and case matching degree, the final thermal runaway risk level and early warning signal are determined.
[0108] The aforementioned algorithm model can be a CNN-LSTM hybrid network; the rule engine can be a module storing "if-then" thermal runaway judgment rules; the knowledge base can be a database storing historical thermal runaway cases and features; and the case matching degree refers to the similarity between the current dynamic features and the features of historical cases. The algorithm model provides quantitative probabilities, the rule engine provides qualitative rule matching, and the knowledge base provides case references. The integration of these three components achieves multimodal prediction based on "quantitative + qualitative + experience". For example, the dynamic feature vector input to the CNN-LSTM outputs a risk probability of 0.72; the rule engine checks for "temperature > 42℃ (rule 1 triggered) and internal resistance change rate > 5% / day (rule 2 triggered)" and generates a "level 2 warning" rule matching result; the knowledge base queries a historical case with 85% similarity to the current features (this case experienced thermal runaway 24 hours later), with a case matching degree of 0.85. During the fusion process, the algorithm model weight is set to 0.5, the rule engine weight to 0.3, and the knowledge base weight to 0.2. The final comprehensive risk value is 0.72×0.5+0.8×0.3+0.85×0.2=0.75, corresponding to a "Level 2 warning". In this embodiment, multimodal fusion compensates for the limitations of a single algorithm, the rule engine improves interpretability, and the knowledge base incorporates historical experience, making the prediction more reliable and interpretable. Specifically, multimodal evidence fusion reduces the misjudgment rate of a single method; rules and cases provide "human-understandable" evidence for warnings, facilitating operational decisions; and it covers three types of logic: "data-driven, rule-driven, and experience-driven," addressing the thermal runaway prediction needs of different scenarios.
[0109] Furthermore, the above algorithm model can be a CNN-LSTM hybrid network, which outputs the risk probability value P as follows:
[0110]
[0111] Where z is the dynamic feature vector, and sig() is the sigmoid function. This is the bias term. By utilizing a CNN-LSTM hybrid network, the "local correlation" and "long-term temporal sequence" information in dynamic feature vectors are fully leveraged to achieve accurate prediction of thermal runaway probability. This network is the core of the "multimodal prediction" algorithm, providing a quantitative basis for the final risk level determination. Specifically, the CNN+LSTM hybrid architecture adapts to the dual characteristics of battery thermal runaway: "local mutation + long-term evolution"; LSTM's capture of long-term temporal sequence dependencies enhances the early warning capability of thermal runaway; and the hybrid network combines local and global features, significantly improving prediction accuracy compared to a single network.
[0112] The rule engine mentioned above includes threshold rules, such as generating a level one warning trigger signal when the charging temperature T > 42 degrees Celsius and the p-value of the temperature change rate < 0.01.
[0113] The aforementioned knowledge base stores typical thermal runaway cases. The matching degree is obtained by calculating the cosine similarity between the dynamic feature vector and the case features. When the matching degree is greater than 80%, a case matching warning signal is generated.
[0114] The specific implementations of the algorithm model, rule engine, and knowledge base are clearly defined. The algorithm model ensures accuracy, the rule engine improves interpretability, and the knowledge base empowers current predictions with experience from historical hot runaway cases. Covering both "known patterns (algorithm / rule coverage)" and "unknown patterns (knowledge base coverage)" enhances robustness.
[0115] Reference Figure 2 The present invention also provides a computer device, the internal structure of which can be as follows: Figure 2 As shown. The computer device includes a processor, memory, network interface, and database connected via a system bus. The processor is designed to provide computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores operating devices, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database stores specified data, a knowledge base, a rule base, etc. The network interface is used to communicate with external terminals via a network connection. Furthermore, the computer device may also include an input device and a display screen. When the computer program is executed by the processor, it implements the battery thermal runaway prediction method based on attention feature fusion according to any of the above embodiments. Those skilled in the art will understand that... Figure 2 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied.
[0116] An embodiment of this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the battery thermal runaway prediction method based on attention feature fusion of any of the above embodiments.
[0117] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in this application and in the embodiments can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual-speed SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0118] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, apparatus, article, or method. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, apparatus, article, or method that includes that element.
[0119] The above description is merely a preferred embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. A battery thermal runaway prediction method based on attention feature fusion, characterized in that, The method comprises: acquiring specified data related to the battery; extracting abnormal features, timing features, correlation features, clustering features and dimension reduction features in the specified data to generate a feature matrix of multi-dimensional features; identifying a stage label in which the battery currently stays, wherein the stage label comprises one or more of a driving mileage stage label, a usage time length label and a battery aging degree label; calculating first weights of each feature in the feature matrix based on multi-head attention, and adjusting the first weights according to the stage label to obtain second weights; weighting and fusing each feature in the feature matrix based on the second weights to obtain a fused dynamic feature vector; predicting a thermal runaway probability of the battery based on the dynamic feature vector; the adjustment of the first weights to obtain the second weights according to the stage label comprises: Let the phase label be s, where s = 1 represents the travel mileage phase, s = 2 represents the use time length phase, and s = 3 represents the aging phase. The adjustment coefficient satisfies: Second weight By the first weight Element-wise multiplication with the adjustment coefficient is obtained: Wherein, λ is the characteristic difference attenuation coefficient, the value range is [0.1, 0.5], Indicates the normalized value of the ith dimension feature, Indicates the normalized value of the jth dimension feature.
2. The battery thermal runaway prediction method based on attention feature fusion according to claim 1, characterized in that, the specified data comprises: multi-dimensional operation data of temperature, voltage, current, resistance, SOC, mileage and working conditions.
3. The battery thermal runaway prediction method based on attention feature fusion according to claim 1, characterized in that, The extraction method of the abnormal features comprises: extracting the abnormal features from the specified data by threshold method, statistical method or machine learning method.
4. The battery thermal runaway prediction method based on attention feature fusion according to claim 1, characterized in that, The timing features comprise sliding window statistical features, time domain features and frequency domain features; the sliding window statistical features comprise features calculated in a specified sliding window; the time domain features comprise a voltage change rate; the frequency domain features comprise main frequencies and harmonic components extracted by Fourier transform on voltage and current data.
5. The battery thermal runaway prediction method based on attention feature fusion according to claim 1, characterized in that, The correlation features comprise correlation features and segmented features; the correlation features comprise a Pearson correlation coefficient of temperature and voltage, and a Spearman correlation coefficient of SOC and internal resistance; the segmented features comprise features statistically obtained in a time slice.
6. The battery thermal runaway prediction method based on attention feature fusion according to claim 1, characterized in that, The clustering features comprise first clustering features based on K-Means clustering, and second clustering features based on DBSCAN clustering.
7. The battery thermal runaway prediction method based on attention feature fusion according to claim 1, characterized in that, The dimension reduction features comprise principal component features extracted based on principal component analysis method, and distribution features based on t-distributed stochastic neighbor embedding method.
8. The battery thermal runaway prediction method based on attention feature fusion according to claim 1, characterized in that, The calculation of the first weights of each feature in the feature matrix based on multi-head attention comprises: performing stage weighting on the feature matrix based on the current stage of the battery, and introducing physical correlation coefficients of the battery to jointly modulate a "query Q" and a "key K" matrix; adding a correction term of stage and physical constraint in the attention head to enable a single attention head to focus on the correlation of key features of thermal runaway; after multi-head fusion, the first weights adapted to the battery scene are obtained through secondary modulation of the battery stage.
9. The battery thermal runaway prediction method based on attention feature fusion according to claim 1, characterized in that, The prediction of the thermal runaway probability of the battery based on the dynamic feature vector comprises: inputting the dynamic feature vector into an algorithm model to output a thermal runaway risk probability value; judging the dynamic feature vector based on a preset rule engine to generate a rule matching result; querying a knowledge base based on the dynamic feature vector to obtain a historical case matching degree; fusing the risk probability value, the rule matching result and the case matching degree to determine a final thermal runaway risk level and a warning signal.
10. A computer device comprising a memory and a processor, the memory having stored therein a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the battery thermal runaway prediction method based on attention feature fusion as claimed in any one of claims 1 to 9.
11. A computer readable storage medium having stored thereon a computer program, characterized in that The computer program is executed by the processor to implement the steps of the battery thermal runaway prediction method based on attention feature fusion as claimed in any one of claims 1 to 9.
Citation Information
Patent Citations
Battery thermal runaway detection method and device, battery management system and vehicle
CN111890988A
New energy group vehicle thermal runaway risk assessment method based on digital twinning
CN114240260A