A method for constructing a battery failure early warning model
By constructing a high-quality fault database and using a Transformer encoder and MLP Head to generate battery aging feature images, the problem of insufficient early identification in existing battery fault warning models is solved, achieving accurate early warning of internal short-circuit faults and reducing the risk of thermal runaway.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TAIYUAN UNIVERSITY OF TECHNOLOGY
- Filing Date
- 2026-03-25
- Publication Date
- 2026-05-29
Smart Images

Figure CN121902641B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of battery monitoring technology, specifically a method for constructing a battery fault early warning model. Background Technology
[0002] With the rapid and large-scale development of the new energy vehicle industry, the battery, as a core component accounting for more than 40% of the total vehicle cost, directly determines the vehicle's operational value and user experience through its safety and lifespan.
[0003] In recent years, battery energy density, integration, and charging rate have been continuously improving. However, insufficient manufacturing consistency, internal physicochemical degradation, and complex operating conditions have led to diverse and randomized battery thermal runaway modes. Once a battery thermal runaway or other safety incident occurs, the temperature rise of a single battery cell often spreads rapidly to the battery module and even the entire vehicle, creating a serious chain reaction. Traditional monitoring methods based on a single battery threshold can usually only trigger alarms after an anomaly has occurred significantly, lacking early fault warning capabilities.
[0004] Traditional battery fault warning models rely on existing data of poor overall quality, with problems such as complex data conditions, long intervals, high sensor noise, and occasional missing data. Key fault samples are even scarcer, failing to meet the training accuracy requirements of large models and making it difficult to fully characterize complex nonlinear coupling processes. Purely data-driven models are also susceptible to distribution drift and insufficient samples, resulting in insufficient robustness and interpretability. Summary of the Invention
[0005] In order to solve the problems of delayed warning and scarce fault samples in existing battery fault early warning models, this invention provides a method for constructing a battery fault early warning model.
[0006] This invention is achieved using the following technical solution:
[0007] A method for constructing a battery fault early warning model includes the following steps:
[0008] S1. Collect the full life cycle operation data of lithium batteries for new energy vehicles, construct different operating condition judgment standards, and screen and purify the collected full life cycle operation data of lithium batteries to retain valid operation data segments that meet the operating condition characteristics.
[0009] S2. Extract N types of battery characteristic parameters corresponding to different operating conditions from the valid operating data segments that meet the operating condition characteristics retained in step S1 to form a lithium battery full life cycle characteristic sequence, and filter out the actual characteristic segments of internal short circuit fault precursors and the characteristic segments of normal batteries (the characteristic segments of normal batteries are the characteristic segments without internal short circuit fault precursors).
[0010] S3. Based on the failure mechanism of lithium batteries, the entire life cycle of lithium batteries is simulated, and simulation feature segments of internal short circuit fault precursors are selected from them.
[0011] S4. Combine the actual feature segments of the internal short-circuit fault precursors selected in step S2 with the simulated feature segments of the internal short-circuit fault precursors selected in step S3 to form diverse abnormal feature segments, and then fuse the formed diverse abnormal feature segments with the feature segments of normal batteries to finally complete the construction of a high-quality fault database.
[0012] S5. Use the N types of battery feature parameters in the high-quality fault database formed in step S4 as the feature channels for constructing the battery fault early warning model. Use the time series length T as the image length and H as the image width to generate an N×H×T battery aging feature image. Then, process the generated battery aging feature image to generate a composite input sequence.
[0013] S6. Input the composite input sequence generated in step S5 into the Transformer encoder for processing, and output the fault judgment result through MLPHead. After training and optimization, the final battery fault early warning model is obtained.
[0014] Furthermore, the specific steps of step S1 include:
[0015] S1.1 Collect operational data of lithium batteries for new energy vehicles throughout their entire life cycle, including battery voltage, charging and discharging current, temperature of individual cells, state of charge, and duration of vehicle shutdown.
[0016] S1.2 Establish different operating condition judgment criteria: when the current change amplitude is ≤0.03C within a continuous time period and the state of charge shows a monotonically increasing trend, it is judged as charging condition; when the current change amplitude is >0.03C within a continuous time period and the state of charge shows a slowly decreasing trend, it is judged as dynamic driving condition; when the absolute value of the current is continuously greater than or equal to 0 and less than 0.03C, it is judged as standby condition; when there is no current input, it is judged as shutdown condition, where C is the current multiplier.
[0017] S1.3. Screen and purify the operating data of the lithium battery throughout its entire life cycle, that is, remove the rapid acceleration / regenerative braking data with current fluctuations >0.5C, the extreme environmental data with operating temperatures exceeding the range of 10℃-40℃, and the signal jump data with a state of charge difference >0.5% / s between adjacent times, so as to retain the effective operating data segments that conform to the operating conditions.
[0018] Furthermore, the N-type battery characteristic parameters mentioned in step S2 include:
[0019] Relative deviation of cell resistance This is the real-time resistance of the battery cell. Average resistance of all cells in the same battery pack The difference is expressed as: ;
[0020] Relative deviation of cell voltage This is the real-time voltage of the battery cell. Average voltage of all cells in the same battery pack The difference is expressed as: ;
[0021] Relative deviation of cell capacity It should be the real-time capacity of the battery cell. Average capacity of all cells in the same battery pack The difference is expressed as: .
[0022] Furthermore, the method for fusing diverse abnormal feature fragments with normal battery feature fragments in step S4 is as follows: for sudden abnormal feature fragments, they are implanted at a specific moment during the charge and discharge cycle of the normal battery; for gradual abnormal feature fragments, they are gradually integrated as the normal battery ages.
[0023] Furthermore, the specific processing steps for the battery aging feature image generated in step S5 are as follows:
[0024] a. Segment the generated battery aging feature image. Each of the non-overlapping segments is flattened and then mapped to a multidimensional feature space via linear projection, as shown in the following expression: ,in, The temporal index of the segment and , For the first Image fragments, For the first Flattening operator for image segments, and These are the weights and biases of the linear projection, respectively. For the projected first Embedding vectors of fragments;
[0025] b. Introduce learnable position embeddings to reconstruct the temporal positional relationships of segments, as shown in the following expression: ,in, and These are the weights and biases for position embedding, respectively. For the first The position encoding vector of each segment;
[0026] c. Project the first Embedding vectors of fragments With the Location encoding vector of each segment Superposition generates a composite input sequence. The expression is: .
[0027] Furthermore, the specific steps of step S6 include:
[0028] S6.1, The composite input sequence generated in step S5 The input is processed by the Transformer encoder to obtain the output sequence of the Transformer encoder.
[0029] S6.2: Fault determination result output via MLP Head: The Transformer encoder randomly generates a [CLS] token classification label. The feature vector corresponding to the [CLS] token in the output sequence of the Transformer encoder is input into the fully connected layer, and a binary classification result of "existing internal short circuit warning / no internal short circuit warning" is output, i.e.
[0030]
[0031] in, The feature vector of [CLS] token. and These are all classification layer parameters. The function Output maps the output to the [0,1] interval to represent the fault probability. , and the set threshold The final classification result is obtained by comparison:
[0032] ,
[0033] To obtain an initial battery fault early warning model;
[0034] S6.3. The initial battery fault warning model is trained using the cross-entropy loss function. The parameters are updated iteratively through the Adam optimizer, and an early stopping mechanism is introduced to avoid overfitting, thereby obtaining the final battery fault warning model.
[0035] The beneficial effects of this invention are as follows: The battery fault early warning model constructed in this invention solves the problems of scarce fault samples and delayed early warning in existing technologies. Specifically, it integrates the feature fragments of actual and simulated internal short-circuit fault precursors with the feature fragments of normal batteries in a sudden and progressive manner to construct a high-quality fault database, effectively making up for the industry difficulty of scarce actual fault samples. At the same time, relying on the visual Transformer internal short-circuit identification model, it deeply mines the global correlation of multi-dimensional features of the cell, and uses the MLP Head to aggregate full-dimensional feature information and output fault probability. It can accurately capture weak abnormal signals and progressive fault precursors before the occurrence of internal short circuits in the battery, breaking through the limitation of traditional threshold methods that can only alarm after the anomaly has occurred significantly. It significantly improves the accuracy and generalization ability of internal short-circuit fault identification, effectively reduces the risk of thermal runaway, improves the economic efficiency of battery life cycle management, and provides reliable technical support for the high-quality development of the new energy industry. Attached Figure Description
[0036] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0037] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0038] Figure 1 This is a flowchart of the battery fault early warning model construction method described in this invention;
[0039] Figure 2 This is a schematic diagram showing the accuracy curves of the battery fault early warning model during training and during verification in this invention. Detailed Implementation
[0040] To better understand the above-mentioned objectives, features, and advantages of the present invention, the solutions of the present invention will be further described below. It should be noted that, unless otherwise specified, the embodiments of the present invention and the features thereof can be combined with each other.
[0041] Many specific details are set forth in the following description in order to provide a full understanding of the invention, but the invention may also be practiced in other ways different from those described herein; obviously, the embodiments in the specification are only some embodiments of the invention, and not all embodiments.
[0042] The specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0043] like Figure 1 As shown, a method for constructing a battery fault early warning model includes the following steps:
[0044] S1. Collect the full life cycle operation data of lithium batteries for new energy vehicles, construct different operating condition judgment standards, and screen and purify the collected full life cycle operation data of lithium batteries to retain valid operation data segments that meet the operating condition characteristics.
[0045] The specific steps include:
[0046] S1.1 Collect operational data of lithium batteries for new energy vehicles throughout their entire life cycle, including battery voltage, charging and discharging current, temperature of individual cells, state of charge, and duration of vehicle shutdown.
[0047] S1.2 Establish different operating condition judgment criteria: when the current change amplitude is ≤0.03C within a continuous time period and the state of charge shows a monotonically increasing trend, it is judged as charging condition; when the current change amplitude is >0.03C within a continuous time period and the state of charge shows a slowly decreasing trend, it is judged as dynamic driving condition; when the absolute value of the current is continuously greater than or equal to 0 and less than 0.03C, it is judged as standby condition; when there is no current input, it is judged as shutdown condition, where C is the current multiplier.
[0048] S1.3. Screen and purify the operating data of the lithium battery throughout its entire life cycle, that is, remove the rapid acceleration / regenerative braking data with current fluctuations >0.5C, the extreme environmental data with operating temperatures exceeding the range of 10℃-40℃, and the signal jump data with a state of charge difference >0.5% / s between adjacent moments, so as to retain the effective operating data segments that conform to the operating conditions.
[0049] S2. Extract N types of battery characteristic parameters corresponding to different operating conditions from the valid operating data segments that meet the operating condition characteristics retained in step S1 to form a lithium battery full life cycle characteristic sequence, and filter out the actual characteristic segments of internal short circuit fault precursors (the actual characteristic segments of internal short circuit fault precursors are the characteristic segments that can reflect the gradual changes before the fault occurs) and the characteristic segments of normal batteries (the characteristic segments of normal batteries are the characteristic segments without internal short circuit fault precursors).
[0050] In specific implementation, the N types of battery characteristic parameters mentioned in step S2 include:
[0051] Relative deviation of cell resistance This is the real-time resistance of the battery cell. Average resistance of all cells in the same battery pack The difference is expressed as: ;
[0052] Relative deviation of cell voltage This is the real-time voltage of the battery cell. Average voltage of all cells in the same battery pack The difference is expressed as: ;
[0053] Relative deviation of cell capacity It should be the real-time capacity of the battery cell. Average capacity of all cells in the same battery pack The difference is expressed as: ;
[0054] S3. Based on the failure mechanism of lithium batteries, the entire life cycle of lithium batteries is simulated, and simulation feature segments of internal short circuit fault precursors are selected from them.
[0055] S4. Combine the actual feature segments of the internal short-circuit fault precursors selected in step S2 with the simulated feature segments of the internal short-circuit fault precursors selected in step S3 to form diverse abnormal feature segments, and then fuse the formed diverse abnormal feature segments with the feature segments of normal batteries to finally complete the construction of a high-quality fault database.
[0056] In specific implementation, the method for fusing diverse abnormal feature fragments with normal battery feature fragments in step S4 is as follows: for sudden abnormal feature fragments, they are implanted at a specific moment during the charge and discharge cycle of the normal battery; for gradual abnormal feature fragments, they are gradually integrated as the normal battery ages.
[0057] S5. Use the N types of battery feature parameters in the high-quality fault database formed in step S4 as the feature channels for constructing the battery fault early warning model. Use the time series length T as the image length and H as the image width to generate an N×H×T battery aging feature image. Then, process the generated battery aging feature image to generate a composite input sequence.
[0058] In practice, the specific processing steps for the battery aging feature image generated in step S5 are as follows:
[0059] a. Segment the generated battery aging feature image. Each of the non-overlapping segments is flattened and then mapped to a multidimensional feature space via linear projection, as shown in the following expression: ,in, The temporal index of the segment and , For the first Image fragments, For the first A flattening operator for image segments is used to transform multidimensional image segments into one-dimensional feature vectors. and These are the weights and biases of the linear projection, respectively. For the projected first Embedding vectors of fragments;
[0060] b. Introduce learnable position embeddings to reconstruct the temporal positional relationships of segments, as shown in the following expression: ,in, and These are the weights and biases for position embedding, respectively. For the first The position encoding vector of each segment;
[0061] c. Project the first Embedding vectors of fragments With the Location encoding vector of each segment Superposition generates a composite input sequence. The expression is:
[0062] ;
[0063] S6. Input the composite input sequence generated in step S5 into the Transformer encoder for processing, and output the fault judgment result through MLPHead. After training and optimization, the final battery fault early warning model is obtained.
[0064] The specific steps include:
[0065] S6.1, The composite input sequence generated in step S5 The input is processed by the Transformer encoder to obtain the output sequence of the Transformer encoder.
[0066] The Transformer encoder consists of sub-modules with the same structure in layer L.
[0067] First, different feature dimensions are captured in parallel using a multi-head self-attention mechanism in each sub-module and a multilayer perceptron, as shown in the following expression:
[0068]
[0069] in, The overall output of the multi-head self-attention mechanism is represented by a globally correlated feature vector that integrates features from all attention heads. The set of query matrices is the set of query matrices obtained by linear transformation of the model input sequence. This is the set of key matrices, which is the set of key feature matrices obtained by linear transformation of the model input sequence. It is the set of value matrices, which is the set of value feature matrices obtained by linear transformation of the model input sequence. To splice the operators, it is about to The output feature vectors of each attention head are concatenated according to their dimensions to form a single overall feature vector. This is the output weight matrix of the multi-head self-attention mechanism, used to perform a linear transformation on the concatenated feature vectors to match the dimensions of subsequent networks. For the first The output feature vector of each attention head , For the first The query matrix of each attention head and ,in, , For the first The linear transformation matrix of the attention head query. For the first The key matrix of each attention head and ,in, For the first The key linear transformation matrix of each attention head, Let j be the value matrix of the attention head and ,in, For the first Linear transformation weight matrix for each attention head. For each attention head, the feature dimensions, It is a soft-maximization activation function;
[0070] Secondly, Standardization is performed through layer normalization to obtain a stable feature vector after standardization. The expression is:
[0071]
[0072] in, and For learnable parameters, To find the minimum value to avoid the denominator being zero, and Inputs The mean and variance;
[0073] Then, the stable feature vector after standardization... Perform a nonlinear transformation, the expression is:
[0074]
[0075] in, , All are weights of the MLP. , Both are biases of the MLP, and GELU is the activation function;
[0076] Finally, after completing the processing of the L-layer submodule, the output sequence of the Transformer encoder is obtained;
[0077] S6.2: Fault determination result output via MLP Head: The Transformer encoder randomly generates a [CLS] token classification label. The feature vector corresponding to the [CLS] token in the output sequence of the Transformer encoder is input into the fully connected layer, and a binary classification result of "existing internal short circuit warning / no internal short circuit warning" is output, i.e.
[0078]
[0079] in, The feature vector of [CLS] token. and These are all classification layer parameters. The function Output maps the output to the [0,1] interval to represent the fault probability. , and the set threshold The final classification result is obtained by comparison:
[0080] ,
[0081] To obtain an initial battery fault early warning model;
[0082] S6.6. The initial battery fault warning model is trained using the cross-entropy loss function. The parameters are updated iteratively through the Adam optimizer, and an early stopping mechanism is introduced to avoid overfitting, thereby obtaining the final battery fault warning model.
[0083] The accuracy curve during model training is as follows: Figure 2 As shown, and by Figure 2 It can be seen that the battery fault warning model obtained after multiple rounds of training has a fault warning accuracy of 98%. At the same time, the model was validated based on the measured data of multiple new energy vehicles. The validation dataset covers battery data of different models, different years of use, and different operating environments. The fault warning accuracy after validation reached 97.2%, proving that the battery fault warning model constructed by the above method can effectively warn of battery faults.
[0084] The above description is merely a specific embodiment of the present invention, enabling those skilled in the art to understand or implement the present invention. Although detailed descriptions have been provided with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments, and they should all be covered within the protection scope of the claims.
Claims
1. A method for constructing a battery fault early warning model, characterized in that, Includes the following steps: S1. Collect the full life cycle operation data of lithium batteries for new energy vehicles, construct different operating condition judgment standards, and screen and purify the collected full life cycle operation data of lithium batteries to retain valid operation data segments that meet the operating condition characteristics. S2. Extract N types of battery characteristic parameters corresponding to different operating conditions from the valid operating data segments that meet the operating condition characteristics retained in step S1, form a lithium battery full life cycle characteristic sequence, and screen out the actual characteristic segments of internal short circuit fault precursors and the characteristic segments of normal batteries. S3. Based on the failure mechanism of lithium batteries, the entire life cycle of lithium batteries is simulated, and simulation feature segments of internal short circuit fault precursors are selected from them. S4. Combine the actual feature segments of the internal short-circuit fault precursors selected in step S2 with the simulated feature segments of the internal short-circuit fault precursors selected in step S3 to form diverse abnormal feature segments, and then fuse the formed diverse abnormal feature segments with the feature segments of normal batteries to finally complete the construction of a high-quality fault database. S5. Use the N types of battery feature parameters in the high-quality fault database formed in step S4 as the feature channels for constructing the battery fault early warning model. Use the time series length T as the image length and H as the image width to generate an N×H×T battery aging feature image. Then, process the generated battery aging feature image to generate a composite input sequence. S6. Input the composite input sequence generated in step S5 into the Transformer encoder for processing, and output the fault judgment result through the MLP Head. After training and optimization, the final battery fault early warning model is obtained.
2. The method for constructing a battery fault early warning model according to claim 1, characterized in that, The specific steps of step S1 include: S1.1 Collect operational data of lithium batteries for new energy vehicles throughout their entire life cycle, including battery voltage, charging and discharging current, temperature of individual cells, state of charge, and duration of vehicle shutdown. S1.2 Establish different operating condition judgment criteria: when the current change amplitude is ≤0.03C within a continuous time period and the state of charge shows a monotonically increasing trend, it is judged as charging condition; when the current change amplitude is >0.03C within a continuous time period and the state of charge shows a slowly decreasing trend, it is judged as dynamic driving condition; when the absolute value of the current is continuously greater than or equal to 0 and less than 0.03C, it is judged as standby condition; when there is no current input, it is judged as shutdown condition, where C is the current multiplier. S1.
3. Screen and purify the operating data of the lithium battery throughout its entire life cycle, that is, remove the rapid acceleration / regenerative braking data with current fluctuations >0.5C, the extreme environmental data with operating temperatures exceeding the range of 10℃-40℃, and the signal jump data with a state of charge difference >0.5% / s between adjacent times, so as to retain the effective operating data segments that conform to the operating conditions.
3. The method for constructing a battery fault early warning model according to claim 2, characterized in that, The N-type battery characteristic parameters mentioned in step S2 include: Relative deviation of cell resistance This is the real-time resistance of the battery cell. Average resistance of all cells in the same battery pack The difference is expressed as: ; Relative deviation of cell voltage This is the real-time voltage of the battery cell. Average voltage of all cells in the same battery pack The difference is expressed as: ; Relative deviation of cell capacity It should be the real-time capacity of the battery cell. Average capacity of all cells in the same battery pack The difference is expressed as: .
4. The method for constructing a battery fault early warning model according to claim 3, characterized in that, The method for fusing diverse abnormal feature fragments with normal battery feature fragments in step S4 is as follows: for sudden abnormal feature fragments, they are implanted at a specific moment during the charge and discharge cycle of normal battery; for gradual abnormal feature fragments, they are gradually integrated as normal battery ages.
5. The method for constructing a battery fault early warning model according to claim 4, characterized in that, The specific processing steps for the battery aging feature image generated in step S5 are as follows: a. Segment the generated battery aging feature image. Each of the non-overlapping segments is flattened and then mapped to a multidimensional feature space via linear projection, as shown in the following expression: ,in, The temporal index of the segment and , For the first Image fragments, For the first Flattening operator for image segments, and These are the weights and biases of the linear projection, respectively. For the projected first Embedding vectors of fragments; b. Introduce learnable position embeddings to reconstruct the temporal positional relationships of segments, as shown in the following expression: ,in, and These are the weights and biases for position embedding, respectively. For the first The position encoding vector of each segment; c. Project the first Embedding vectors of fragments With the Location encoding vector of each segment Superposition generates a composite input sequence. The expression is: .
6. The method for constructing a battery fault early warning model according to claim 5, characterized in that, The specific steps of step S6 include: S6.1, The composite input sequence generated in step S5 The input is processed by the Transformer encoder to obtain the output sequence of the Transformer encoder. S6.2: Fault determination result output via MLP Head: The Transformer encoder randomly generates a [CLS] token classification label. The feature vector corresponding to the [CLS] token in the output sequence of the Transformer encoder is input into the fully connected layer, and a binary classification result of "existing internal short circuit warning / no internal short circuit warning" is output, i.e. in, The feature vector of [CLS] token. and These are all classification layer parameters. The function Output maps the output to the [0,1] interval to represent the fault probability. , and the set threshold The final classification result is obtained by comparison: , To obtain an initial battery fault early warning model; S6.
3. The initial battery fault warning model is trained using the cross-entropy loss function. The parameters are updated iteratively through the Adam optimizer, and an early stopping mechanism is introduced to avoid overfitting, thereby obtaining the final battery fault warning model.
Citation Information
Patent Citations
Battery system fault identification method and system based on time sequence contrast learning encoder
CN120892801A
Wire feeding processing intelligent operation and maintenance system based on cloud computing
CN120915824A