A battery fault diagnosis method and system based on improved automatic encoder

Through the improved autoencoder, combined with TCN and MSA blocks, and using normal module battery data to train the model, it solves the problems of high complexity and insufficient accuracy of existing battery fault diagnosis methods, and achieves efficient and accurate fault detection and positioning. Suitable for various battery types.

CN118169562BActive Publication Date: 2024-10-22SHANDONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410394623.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-02
Publication Date
2024-10-22
Estimated Expiration
2044-04-02

AI Technical Summary

Technical Problem

Existing battery fault diagnosis methods have problems such as high complexity, insufficient accuracy, or high demand for high-quality fault data, making it difficult to effectively detect and control faults in electric vehicles and energy storage systems.

Method used

Using an improved autoencoder, combined with a temporal convolutional network (TCN) and an improved self-attention (MSA) block, to extract time series features and capture long-term series relationships, the model is trained through normal module battery data to achieve Fault diagnosis, reducing the need for high-quality fault data.

Benefits of technology

It improves the accuracy and efficiency of fault diagnosis, reduces investment costs, can effectively detect and locate faults in different types of batteries, has data-driven characteristics, and avoids complex battery electrochemical mechanism analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118169562B_ABST
    Figure CN118169562B_ABST
Patent Text Reader

Abstract

The present disclosure proposes a battery fault diagnosis method and system based on an improved autoencoder, the method comprising: obtaining battery data to be diagnosed and preprocessing; the battery data to be diagnosed includes the voltage data of each battery and the corresponding acquisition time; the preprocessed battery data to be diagnosed is input into the improved autoencoder, and the reconstructed data is output; the improved autoencoder includes an encoder composed of a multi-layer TCN network, an improved self-attention module, and a decoder symmetrical to the encoder structure; the improved self-attention module includes a plurality of SA blocks and residual structures with different numbers of attention heads, which are used to capture long time series relationships; by calculating the reconstruction error based on the reconstructed data, the faulty battery is located and the fault degree is graded according to the reconstruction error. An improved autoencoder is constructed using a time domain convolutional network and an improved self-attention module to improve the ability to capture detailed features.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of battery management, and relates to a battery fault diagnosis method and system based on an improved automatic encoder. Background Art

[0002] In the actual application of electric vehicles and energy storage systems, various internal and external faults may occur during battery operation, leading to performance problems and potentially serious consequences such as thermal runaway, fire or explosion. Therefore, fault diagnosis is an important function of the battery management system, which is responsible for early detection of faults and providing control measures to minimize the impact of faults, which is crucial to ensure the safe and reliable operation of batteries.

[0003] At present, there are mainly the following methods for battery fault diagnosis:

[0004] 1) Model-based method: First, a nonlinear model of the battery is constructed, and then the model parameters or estimated state anomalies are used for fault diagnosis. This method has problems such as high complexity, large amount of calculation, and susceptibility to external interference, making it difficult to apply in practice.

[0005] 2) Signal processing-based method: Using signal processing methods, such as correlation coefficient and sample entropy, the collected battery data is processed and analyzed for fault diagnosis. This method has the problem of low nonlinear fitting degree, resulting in insufficient fault diagnosis accuracy.

[0006] 3) Machine learning-based methods: This method uses machine learning techniques such as neural networks to learn battery failure modes and perform fault diagnosis with high accuracy. However, this method has the problem of insufficient high-quality failure data for training, resulting in poor model training results.

[0007] Based on the defects of the above methods, there is an urgent need for a battery fault diagnosis method with low complexity, high accuracy and little or no demand for high-quality fault data. Summary of the invention

[0008] In order to solve the above problems, the present invention aims to provide a battery fault diagnosis method and system based on an improved autoencoder, and integrate a time domain convolutional network (TCN) and an improved self-attention (MSA) block to construct an improved autoencoder, wherein TCN is used to extract important features of time series, and has higher performance than traditional recurrent neural networks that are good at processing time series, without gradient explosion or gradient vanishing problems, and can be calculated in parallel to improve the stability and efficiency of large-scale data processing; MSA is composed of a plurality of self-attention (SA) blocks and residual structures with different numbers of heads, which is conducive to enhancing the ability to capture detailed features, thereby improving the data reconstruction accuracy of the autoencoder, and finally achieving the purpose of improving the accuracy of fault diagnosis; and, the model is trained using normal module battery data without the need to collect high-quality fault data, thereby reducing investment costs.

[0009] In order to achieve the above object, the present invention adopts the following technical solution:

[0010] In a first aspect, the present invention provides a battery fault diagnosis method based on an improved automatic encoder, comprising:

[0011] Obtaining the battery data to be diagnosed and preprocessing it; the battery data to be diagnosed includes the voltage data of each battery and the corresponding acquisition time;

[0012] The preprocessed battery data to be diagnosed is input into an improved autoencoder to output reconstructed data; the improved autoencoder includes an encoder composed of a multi-layer TCN network, an improved self-attention module, and a decoder symmetrical to the encoder structure; the improved self-attention module includes a plurality of SA blocks and residual structures with different numbers of attention heads, which are used to capture long time series relationships;

[0013] The reconstruction error is calculated based on the reconstruction data, and the faulty battery is located and the fault degree is classified according to the reconstruction error.

[0014] Preferably, the preprocessing is to use the median absolute deviation denoising method to remove gross errors in the data.

[0015] Preferably, each layer of the TCN network is composed of multiple residual blocks, and each residual block is composed of a one-dimensional dilated causal convolution layer, a weight normalization layer, a ReLU activation function and a dropout layer.

[0016] Preferably, the improved self-attention module includes a plurality of SA blocks and residual structures with different numbers of attention heads, which are used to capture long time series relationships, specifically including:

[0017] O=I+β 1 *SA 1 (I)+…+β i *SAi (I)+…+β d *SA d (I)

[0018] Among them, O is the output of MSA, I is the input of MSA; SA i is the ith SA block, each SA i All have different numbers of heads; β i , i∈[1:d] corresponds to SA i The learnable weights.

[0019] Preferably, the training process of the improved autoencoder is:

[0020] Select multiple normal batteries in series to form a module, perform charge and discharge cycle experiments under selected working conditions, and collect battery test data as normal battery training data;

[0021] The normal battery training data is used as training samples and labels at the same time and input into the improved autoencoder for training. When the loss function reaches the minimum value, the trained improved autoencoder is obtained.

[0022] Preferably, calculating the reconstruction error based on the reconstructed data specifically includes:

[0023]

[0024] Among them, MSE nk represents the mean square error of the nth battery when the sliding window length is k, U ni represents the voltage of the nth normal battery at time i, It represents the i-th reconstruction voltage of the n-th battery to be diagnosed.

[0025] Preferably, locating the faulty battery and grading the fault degree according to the reconstruction error specifically includes:

[0026] An initial threshold is set based on the reconstruction accuracy of the improved autoencoder;

[0027] If the reconstruction error exceeds the initial threshold, it is determined that the battery is faulty;

[0028] Multiple threshold intervals are set based on the initial threshold, and the fault degree of the battery is graded according to the reconstruction error and the threshold interval.

[0029] In a second aspect, the present invention provides a battery fault diagnosis system based on an improved automatic encoder, comprising:

[0030] Data acquisition module: used to acquire and pre-process the battery data to be diagnosed; the battery data to be diagnosed includes the voltage data of each battery and the corresponding acquisition time;

[0031] An autoencoder module: used to input the preprocessed battery data to be diagnosed into an improved autoencoder and output reconstructed data; the improved autoencoder includes an encoder composed of a multi-layer TCN network, an improved self-attention module and a decoder symmetrical to the encoder structure; the improved self-attention module includes a plurality of SA blocks with different numbers of attention heads, which are used to capture long time series relationships;

[0032] Diagnostic module: used to calculate the reconstruction error based on the reconstruction data, locate the faulty battery and classify the fault degree according to the reconstruction error.

[0033] In a third aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the battery fault diagnosis method based on an improved automatic encoder described in the first aspect.

[0034] In a fourth aspect, the present invention provides a computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the battery fault diagnosis method based on the improved autoencoder described in the first aspect are implemented.

[0035] Compared with the prior art, the present invention has the following beneficial effects:

[0036] Based on the basic principle of the autoencoder, the present invention uses a time-domain convolutional network and an improved self-attention module to construct an improved autoencoder. On this basis, it is trained using normal module battery data. When performing fault diagnosis, the data to be diagnosed is input into the trained model to obtain the reconstruction data of each battery cell in the module, and then the fault detection and location can be achieved by evaluating the reconstruction loss of each battery cell in the module. The specific advantages are:

[0037] (1) The improved autoencoder proposed in the present application comprises an encoder and a decoder with a symmetrical structure composed of TCN, and an improved self-attention module added between the two. Among them, TCN can effectively capture the local dependencies in sequence data; the improved self-attention module has multiple self-attention blocks with different numbers of heads. Since each self-attention block has a different number of heads, it can focus on different aspects or patterns and learn richer and more detailed feature representations from the input data, thereby jointly constructing a more comprehensive feature set. Combining the advantages of TCN and self-attention modules improves the autoencoder's ability to understand input data at different levels and scales, thereby improving the performance and generalization ability of the autoencoder.

[0038] (2) The method for fault diagnosis using an improved autoencoder proposed in the present invention can complete the training of the model using only normal module battery data, thus getting rid of the problem that the traditional machine learning method cannot effectively train the model due to the lack of high-quality fault data.

[0039] (3) When the present invention utilizes the fault module data to be input into a trained autoencoder, the amplification principle of the autoencoder amplifies the data deviation caused by the fault, thereby achieving effective fault detection, thereby having a faster diagnosis speed and higher diagnosis accuracy.

[0040] (4) The method developed in the present invention has data-driven characteristics and does not involve complex battery electrochemical mechanisms. It can be conveniently used for fault diagnosis of various types of batteries without the need to construct different battery models under different circumstances like model-based methods.

[0041] Advantages of additional aspects of the present invention will be given in part in the following description, and in part will become obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] The accompanying drawings constituting a part of the present disclosure are used to provide a further understanding of the present disclosure. The exemplary embodiments of the present disclosure and the description thereof are used to explain the present disclosure but do not constitute a limitation of the present disclosure.

[0043] Figure 1 A flow chart of a battery fault diagnosis method based on an improved automatic encoder provided by the present invention;

[0044] Figure 2 A simplified diagram of the improved automatic encoder provided by the present invention;

[0045] Figure 3 Schematic diagram of the improved self-attention module provided by the present invention. DETAILED DESCRIPTION

[0046] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.

[0047] Embodiment 1

[0048] like Figure 1 As shown, this embodiment discloses a battery fault diagnosis method based on an improved automatic encoder, comprising the following steps:

[0049] S1: Acquire and pre-process the battery data to be diagnosed; the battery data to be diagnosed includes the voltage data of each battery and the corresponding acquisition time;

[0050] S2: inputting the preprocessed battery data to be diagnosed into an improved autoencoder and outputting reconstructed data; the improved autoencoder includes an encoder composed of a multi-layer TCN network, an improved self-attention module and a decoder symmetrical to the encoder structure; the improved self-attention module includes a plurality of SA blocks and residual structures with different numbers of attention heads, which are used to capture long time series relationships;

[0051] S3: Calculate a reconstruction error based on the reconstruction data by including but not limited to a mean square error, and locate the faulty battery and classify the fault degree according to the reconstruction error.

[0052] In S1, preprocessing includes:

[0053] S101: Use a denoising method including but not limited to the median absolute deviation (MAD) denoising method to remove gross errors in the data. The MAD denoising method is to define MAD as a threshold. If any data exceeds 3 times the MAD, the data is considered outlier and removed.

[0054] S102: Normalize each battery voltage sequence:

[0055]

[0056] Where X is the original data, X′ is the normalized data, max(X) is the maximum value in the original data, and min(X) is the minimum value in the original data.

[0057] S103: Use the sliding window to process the data to obtain U:

[0058]

[0059] Where: U is the standard voltage matrix of the battery cell voltage sequence, k is the length of the sequence extracted by the sliding window, n is the number of battery cells, U nk Represents the voltage of the nth battery at time k. U is selected as both the input and label of the model to obtain the samples used to train the model.

[0060] In S2, the specific structure of the improved autoencoder TCN-MSA-AE composed of the temporal convolutional network (TCN) and the improved self-attention (MSA) block is:

[0061] S2101: The autoencoder consists of two parts: the encoder and the decoder. First, the encoder, which consists of m layers of TCN, is responsible for extracting important features from the data. Then, the decoder, which is symmetrical to the encoder structure, consists of m layers of TCN, is responsible for remapping the data back to the reconstruction space with the same number of input dimensions. Each layer of TCN consists of multiple residual blocks. Each residual block consists of four basic structures, including a one-dimensional dilated causal convolution layer, a weight normalization layer, a ReLU activation function, and a dropout layer. Subsequently, a 1×1 convolution is used to directly guide the input to the output to form a residual structure.

[0062] S2102: Add the MSA block between the encoder and decoder composed of TCN to improve the ability of the autoencoder to capture long time series relationships and improve the reconstruction accuracy. The specific improvement of the self-attention (SA) block is: use d (adjusted according to the actual application) SA blocks with different numbers of attention heads (selected according to the length of the processed data) to jointly process the input data, and set a learnable weight for each of them. On this basis, a residual structure is added in the form of 1×1 convolution, and the output obtained from multiple SA blocks and the output obtained after the input 1×1 convolution are added to obtain the final output. The specific expression is:

[0063] Ⅰ+β**SA(I)

[0064] Where O is the output of MSA, I is the input of MSA; i is the ith SA block, each SA i All have different numbers of heads; β i , i∈[1:d] corresponds to SA i The learnable weights.

[0065] A self-attention block with more heads can capture more fine-grained features, and multiple self-attention blocks with different heads can jointly extract features, which helps to understand the input data at different levels and improve the diversity of feature extraction. At the same time, multiple self-attention blocks with different heads can also help alleviate the overfitting problem and improve the generalization ability of the autoencoder.

[0066] In this embodiment, the training process of the improved automatic encoder is:

[0067] S2201: Select multiple normal batteries to be connected in series into a module, perform a charge and discharge cycle experiment under the selected working conditions, and collect battery test data as normal battery training data;

[0068] S2202: The normal battery training data is used as training samples and labels at the same time, and input into the improved autoencoder for training. When the loss function reaches a minimum value, a trained improved autoencoder is obtained.

[0069] In S2201, the number of batteries n and the cycle conditions are selected according to the actual application. The cycle conditions of the conditions include the current rate of battery charging and discharging, discharge depth, temperature and cut-off voltage; the collected battery test data includes but is not limited to the voltage data of each battery in the module and the corresponding data collection time.

[0070] The module to be diagnosed has the same structure as the module used to train the model, and contains the same battery model. The method for processing the data to be diagnosed is the same as step S2. When training the model, all samples are divided into a training set and a test set according to a certain ratio. The training set is responsible for training the model, and the test set is responsible for evaluating the training effect of the model.

[0071] In S3, the reconstruction error is calculated based on the reconstructed data by including but not limited to the mean square error, specifically comprising the following steps:

[0072] S3101: Obtain reconstructed data through the trained model. The specific expression is as follows:

[0073] Ure=TCN-MSA-AE(U)

[0074] In the formula, U re To reconstruct the data, the form is consistent with U, which is:

[0075]

[0076] in, represents the kth reconstruction voltage of the nth battery.

[0077] S3102: Calculate the reconstruction error corresponding to the reconstruction data of each cell by including but not limited to mean square error (MSE), and the specific expression is as follows:

[0078]

[0079] Among them, MSE nk It represents the mean square error of the nth battery when the sliding window length is k.

[0080] In S3, the faulty battery is located and the fault degree is graded according to the reconstruction error, which specifically includes the following steps:

[0081] S3201: An initial threshold α is set based on the reconstruction accuracy of the model. If the reconstruction loss of a battery among the batteries exceeds α, it is determined that the battery is faulty.

[0082] S3202: Based on the initial threshold α, multiple thresholds are set to evaluate and grade the degree of battery failure by taking into account the actual situation.

[0083] This specific embodiment is based on the basic principle of the autoencoder, uses a time domain convolutional network and an improved self-attention module to construct an improved autoencoder, and on this basis, uses normal module battery data to train it. When performing fault diagnosis, the data to be diagnosed is input into the trained model to obtain the reconstruction data of each battery cell in the module, and then the fault detection and positioning can be achieved by evaluating the reconstruction loss of each battery cell in the module.

[0084] Embodiment 2

[0085] This embodiment provides a battery fault diagnosis system based on an improved automatic encoder, comprising:

[0086] Data acquisition module: used to acquire and pre-process the battery data to be diagnosed; the battery data to be diagnosed includes the voltage data of each battery and the corresponding acquisition time;

[0087] An autoencoder module: used to input the preprocessed battery data to be diagnosed into an improved autoencoder and output reconstructed data; the improved autoencoder includes an encoder composed of a multi-layer TCN network, an improved self-attention module and a decoder symmetrical to the encoder structure; the improved self-attention module includes a plurality of SA blocks with different numbers of attention heads, which are used to capture long time series relationships;

[0088] Diagnostic module: used to calculate the reconstruction error based on the reconstruction data, locate the faulty battery and classify the fault degree according to the reconstruction error.

[0089] Embodiment 3

[0090] This embodiment provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the battery fault diagnosis method based on the improved automatic encoder as described in the first embodiment above are implemented.

[0091] This specific embodiment is based on the battery fault diagnosis method based on the improved autoencoder described in Example 1. According to the basic principle of the autoencoder, an improved autoencoder is constructed using a time domain convolutional network and an improved self-attention module. On this basis, it is trained using normal module battery data. When performing fault diagnosis, the data to be diagnosed is input into the trained model to obtain the reconstruction data of each battery cell in the module, and then the fault detection and positioning can be achieved by evaluating the reconstruction loss of each battery cell in the module.

[0092] Embodiment 4

[0093] This embodiment provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the steps of the battery fault diagnosis method based on the improved automatic encoder as described in the first embodiment above are implemented.

[0094] This specific embodiment is based on the battery fault diagnosis method based on the improved autoencoder described in Example 1. According to the basic principle of the autoencoder, an improved autoencoder is constructed using a time domain convolutional network and an improved self-attention module. On this basis, it is trained using normal module battery data. When performing fault diagnosis, the data to be diagnosed is input into the trained model to obtain the reconstruction data of each battery cell in the module, and then the fault detection and positioning can be achieved by evaluating the reconstruction loss of each battery cell in the module.

[0095] The steps or modules involved in the above embodiments 2 to 4 correspond to those in embodiment 1. For the specific implementation, please refer to the relevant description of embodiment 1. The term "computer-readable storage medium" should be understood as a single medium or multiple media including one or more instruction sets; it should also be understood to include any medium that can store, encode or carry an instruction set for execution by a processor and enable the processor to execute any method in the present invention.

[0096] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A battery fault diagnosis method based on an improved automatic encoder, characterized in that: include: Obtain the battery data to be diagnosed and perform preprocessing; The battery data to be diagnosed includes the voltage data of each battery and the corresponding collection time; The preprocessed battery data to be diagnosed is input into an improved autoencoder, and reconstructed data is output; the improved autoencoder includes an encoder composed of a multi-layer TCN network, an improved self-attention module, and a decoder symmetrical to the encoder structure; each layer of the TCN network is composed of a plurality of residual blocks, and each residual block is composed of a one-dimensional dilated causal convolution layer, a weight normalization layer, a ReLU activation function, and a dropout layer; the improved self-attention module includes a plurality of SA blocks and residual structures with different numbers of attention heads, which are used to capture long time series relationships; the improved self-attention module includes a plurality of SA blocks and residual structures with different numbers of attention heads, which are used to capture long time series relationships, specifically including: O=I+β1*SA1(I)+...+β i *WITH i (I)+...+β d *WITH d (AND) Among them, O is the output of MSA, I is the input of MSA; SA i is the ith SA block, each SA i All have different numbers of heads; β i , i∈[1:d] corresponds to SA i The learnable weights of The training process of the improved autoencoder is as follows: multiple normal batteries are selected to be connected in series into a module, a charge-discharge cycle experiment is performed under selected working conditions, and battery test data is collected as normal battery training data; the normal battery training data is used as training samples and labels at the same time, and input into the improved autoencoder for training, and when the loss function reaches the minimum value, a trained improved autoencoder is obtained; The reconstruction error is calculated based on the reconstruction data, and the faulty battery is located and the fault degree is classified according to the reconstruction error.

2. The battery fault diagnosis method based on the improved automatic encoder as claimed in claim 1, characterized in that: The preprocessing is to use the median absolute deviation denoising method to remove gross errors in the data.

3. The battery fault diagnosis method based on the improved automatic encoder as claimed in claim 1, characterized in that: The calculating of the reconstruction error based on the reconstructed data specifically includes: Among them, MSE nk represents the mean square error of the nth battery when the sliding window length is k, U ni represents the voltage of the nth normal battery at time i, It represents the i-th reconstruction voltage of the n-th battery to be diagnosed.

4. The battery fault diagnosis method based on the improved automatic encoder as claimed in claim 1, characterized in that: The positioning of the faulty battery and classification of the fault severity according to the reconstruction error specifically includes: An initial threshold is set based on the reconstruction accuracy of the improved autoencoder; If the reconstruction error exceeds the initial threshold, it is determined that the battery is faulty; Multiple threshold intervals are set based on the initial threshold, and the fault degree of the battery is graded according to the reconstruction error and the threshold interval.

5. A battery fault diagnosis system based on an improved auto-encoder, executing a battery fault diagnosis method based on an improved auto-encoder as claimed in claim 1, characterized in that: include: Data acquisition module: used to acquire the battery data to be diagnosed and perform preprocessing; The battery data to be diagnosed includes the voltage data of each battery and the corresponding collection time; An autoencoder module: used to input the preprocessed battery data to be diagnosed into an improved autoencoder and output reconstructed data; the improved autoencoder includes an encoder composed of a multi-layer TCN network, an improved self-attention module and a decoder symmetrical to the encoder structure; the improved self-attention module includes a plurality of SA blocks with different numbers of attention heads, which are used to capture long time series relationships; Diagnostic module: used to calculate the reconstruction error based on the reconstruction data, locate the faulty battery and classify the fault degree according to the reconstruction error.

6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps in the battery fault diagnosis method based on an improved automatic encoder as described in any one of claims 1 to 4 are implemented.

7. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps in the battery fault diagnosis method based on the improved automatic encoder as described in any one of claims 1 to 4 are implemented.