CN118169562A - A battery fault diagnosis method and system based on improved automatic encoder - Google Patents
A battery fault diagnosis method and system based on improved automatic encoder Download PDFInfo
- Publication number
- CN118169562A CN118169562A CN202410394623.5A CN202410394623A CN118169562A CN 118169562 A CN118169562 A CN 118169562A CN 202410394623 A CN202410394623 A CN 202410394623A CN 118169562 A CN118169562 A CN 118169562A
- Authority
- CN
- China
- Prior art keywords
- battery
- data
- automatic encoder
- improved automatic
- improved
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 55
- 238000003745 diagnosis Methods 0.000 title claims abstract description 42
- 206010040736 Sinoatrial block Diseases 0.000 claims abstract description 14
- 238000007781 pre-processing Methods 0.000 claims abstract description 7
- 238000012549 training Methods 0.000 claims description 25
- 230000008569 process Effects 0.000 claims description 8
- 230000006870 function Effects 0.000 claims description 7
- 208000037170 Delayed Emergence from Anesthesia Diseases 0.000 claims description 6
- 238000004590 computer program Methods 0.000 claims description 6
- 238000012360 testing method Methods 0.000 claims description 6
- 230000004913 activation Effects 0.000 claims description 3
- 230000001364 causal effect Effects 0.000 claims description 3
- 238000002474 experimental method Methods 0.000 claims description 3
- 238000010606 normalization Methods 0.000 claims description 3
- 230000010339 dilation Effects 0.000 claims 1
- 238000001514 detection method Methods 0.000 description 6
- 238000012545 processing Methods 0.000 description 4
- 238000010801 machine learning Methods 0.000 description 3
- 208000032953 Device battery issue Diseases 0.000 description 2
- 101001121408 Homo sapiens L-amino-acid oxidase Proteins 0.000 description 2
- 102100026388 L-amino-acid oxidase Human genes 0.000 description 2
- 238000013528 artificial neural network Methods 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 238000004880 explosion Methods 0.000 description 2
- 230000006872 improvement Effects 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 101100012902 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) FIG2 gene Proteins 0.000 description 1
- 101100233916 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) KAR5 gene Proteins 0.000 description 1
- 230000003321 amplification Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000013480 data collection Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000007599 discharging Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000004146 energy storage Methods 0.000 description 1
- 230000002708 enhancing effect Effects 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 239000011159 matrix material Substances 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000003199 nucleic acid amplification method Methods 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
- 230000000306 recurrent effect Effects 0.000 description 1
- 230000002123 temporal effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01R—MEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
- G01R31/00—Arrangements for testing electric properties; Arrangements for locating electric faults; Arrangements for electrical testing characterised by what is being tested not provided for elsewhere
- G01R31/36—Arrangements for testing, measuring or monitoring the electrical condition of accumulators or electric batteries, e.g. capacity or state of charge [SoC]
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01R—MEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
- G01R31/00—Arrangements for testing electric properties; Arrangements for locating electric faults; Arrangements for electrical testing characterised by what is being tested not provided for elsewhere
- G01R31/36—Arrangements for testing, measuring or monitoring the electrical condition of accumulators or electric batteries, e.g. capacity or state of charge [SoC]
- G01R31/367—Software therefor, e.g. for battery testing using modelling or look-up tables
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01R—MEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
- G01R31/00—Arrangements for testing electric properties; Arrangements for locating electric faults; Arrangements for electrical testing characterised by what is being tested not provided for elsewhere
- G01R31/36—Arrangements for testing, measuring or monitoring the electrical condition of accumulators or electric batteries, e.g. capacity or state of charge [SoC]
- G01R31/378—Arrangements for testing, measuring or monitoring the electrical condition of accumulators or electric batteries, e.g. capacity or state of charge [SoC] specially adapted for the type of battery or accumulator
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01R—MEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
- G01R31/00—Arrangements for testing electric properties; Arrangements for locating electric faults; Arrangements for electrical testing characterised by what is being tested not provided for elsewhere
- G01R31/36—Arrangements for testing, measuring or monitoring the electrical condition of accumulators or electric batteries, e.g. capacity or state of charge [SoC]
- G01R31/396—Acquisition or processing of data for testing or for monitoring individual cells or groups of cells within a battery
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Secondary Cells (AREA)
Abstract
Description
技术领域Technical Field
本发明属于电池管理技术领域,涉及一种基于改进的自动编码器的电池故障诊断方法及系统。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 technique
在电动汽车以及储能系统的实际应用中,电池运行过程中可能会出现各种内部和外部故障,导致性能问题,并且存在潜在的严重后果,例如热失控、火灾或爆炸。因此,故障诊断是电池管理系统的重要功能,负责及早发现故障并提供控制措施以尽量减少故障影响,对确保电池的安全可靠运行至关重要。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.
目前对电池进行故障诊断的方法主要有以下几类:At present, there are mainly the following methods for battery fault diagnosis:
1)基于模型的方法:首先构建电池的非线性模型,然后利用模型的参数或估计状态的异常进行故障诊断。该种方法存在复杂度高,计算量大和易受外界干扰等问题,难以实际应用。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.
2)基于信号处理的方法:利用信号处理的方法,例如相关系数、样本熵,对采集的电池数据进行处理分析进行故障诊断。该种方法存在非线性拟合度较低导致故障诊断精确度不足的问题。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.
3)基于机器学习的方法:利用机器学习技术如神经网络强大的非线性拟合能力学习电池故障模式从而进行故障诊断,精度较高。但该方法存在用于训练的高质量故障数据较少导致模型训练效果差的问题。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.
基于上述方法的缺陷,亟需一种复杂度低、精度高和对高质量故障数据需求少或无需求的电池故障诊断方法。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
本公开为了解决上述问题,本发明的目的在于提供一种基于改进的自动编码器的电池故障诊断方法及系统,融合时域卷积网络(TCN)和改进的自注意力(MSA)块构建改进的自动编码器,其中,TCN用于提取时间序列重要特征,相比于传统的擅于处理时间序列的循环神经网络具有更高的性能,无梯度爆炸或梯度消失问题,可并行计算,提高大规模数据处理的稳定性和效率;MSA由多个拥有不同头数的自注意力(SA)块和残差结构组成,有利于增强捕获细节特征的能力,从而提高自动编码器的数据重构精度,最后达到提高故障诊断准确性的目的;并且,使用正常模组电池数据训练模型,而无需采集高质量故障数据,降低投入成本。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.
为了实现上述目的,本发明采用如下技术方案:In order to achieve the above object, the present invention adopts the following technical solution:
第一方面,本发明提供一种基于改进的自动编码器的电池故障诊断方法,包括:In a first aspect, the present invention provides a battery fault diagnosis method based on an improved automatic encoder, comprising:
获取待诊断电池数据并进行预处理;待诊断电池数据包括各电池电压数据以及对应的采集时间;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;
将预处理后的待诊断电池数据输入至改进的自动编码器中,输出重构数据;所述改进的自动编码器包括由多层TCN网络构成的编码器、改进的自注意力模块以及与所述编码器结构对称的解码器;所述改进的自注意力模块包括多个具有不同注意力头数的SA块和残差结构,用于捕获长时间序列关系;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; 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 reconstruction error is calculated based on the reconstruction data, and the faulty battery is located and the fault degree is graded according to the reconstruction error.
优选地,所述预处理为采用中位数绝对偏差去噪法去除数据中的粗大误差。Preferably, the preprocessing is to use the median absolute deviation denoising method to remove gross errors in the data.
优选地,所述TCN网络每层均由多个残差块组成,每个残差块均由一维扩张因果卷积层、权重归一化层、ReLU激活函数和dropout层组成。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.
优选地,所述改进的自注意力模块包括多个具有不同注意力头数的SA块和残差结构,用于捕获长时间序列关系,具体包括: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:
O=I+β1*SA1(I)+…+βi*SAi(I)+…+βd*SAd(I)O=I+β 1 *SA 1 (I)+…+β i *SA i (I)+…+β d *SA d (I)
其中,其中,O为MSA的输出,I为MSA的输入;SAi是第i个SA块,每个SAi均具有不同的头数;βi,i∈[1:d]是对应SAi的可学习权重。Among them, O is the output of MSA, I is the input of MSA; SA i is the i-th SA block, and each SA i has a different number of heads; β i , i∈[1:d] is the learnable weight corresponding to SA i .
优选地,所述改进的自动编码器的训练过程为:Preferably, the training process of the improved autoencoder is:
选取多节正常电池串联成模组,在选定工况下进行充放电循环实验,采集电池测试数据,作为正常电池训练数据;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;
将正常电池训练数据同时作为训练样本和标签,输入到改进的自动编码器中进行训练,当损失函数达到最小值,得到训练好的改进的自动编码器。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.
优选地,所述基于重构数据计算重构误差具体包括:Preferably, calculating the reconstruction error based on the reconstructed data specifically includes:
其中,MSEnk表示第n个电池在滑动窗口长度为k时的均方误差,Uni表示第n个正常电池在i时刻的电压,表示第n个待诊断电池第i个重构电压。Where MSE nk represents the mean square error of the nth battery when the sliding window length is k, Uni 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.
优选地,所述根据重构误差对故障电池进行定位及故障程度分级,具体包括:Preferably, locating the faulty battery and grading the fault degree 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.
第二方面,本发明提供一种基于改进的自动编码器的电池故障诊断系统,包括:In a second aspect, the present invention provides a battery fault diagnosis system based on an improved automatic encoder, comprising:
数据获取模块:用于获取待诊断电池数据并进行预处理;待诊断电池数据包括各电池电压数据以及对应的采集时间;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;
自动编码器模块:用于将预处理后的待诊断电池数据输入至改进的自动编码器中,输出重构数据;所述改进的自动编码器包括由多层TCN网络构成的编码器、改进的自注意力模块以及与所述编码器结构对称的解码器;所述改进的自注意力模块包括多个具有不同注意力头数的SA块,用于捕获长时间序列关系;Autoencoder module: used to input the preprocessed battery data to be diagnosed into the improved autoencoder and output the 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.
第三方面,本发明提供一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现第一方面所述的基于改进的自动编码器的电池故障诊断方法中的步骤。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.
第四方面,本发明提供一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现第一方面所述的基于改进的自动编码器的电池故障诊断方法中的步骤。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.
与现有技术相比,本公开的有益效果为:Compared with the prior art, the beneficial effects of the present invention are:
本发明基于自动编码器的基本原理,使用时域卷积网络和改进的自注意力模块构建了改进的自动编码器,在此基础上,使用正常模组电池数据对其进行训练。在进行故障诊断时,将待诊断数据输入训练好的模型得到模组中各电芯重构数据,然后通过评估模组中各电芯重构损失可实现故障检测及定位。具体优点有: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:
(1)本申请提出的改进的自动编码器,包括由TCN组成的、呈对称结构的编码器和解码器,以及添加在两者中间的改进的自注意力模块组成。其中,TCN能够有效地捕捉序列数据中的局部依赖关系;改进的自注意力模块具有多个不同头数的自注意力块,每个自注意力块由于具有不同头数,因此可以专注于不同的方面或模式,能够从输入数据中学习到更加丰富和细致的特征表示,从而共同构建出更全面的特征集合。融合TCN和自注意力模块的优势,提高了自动编码器在不同层次和尺度上理解输入数据,从而提高自动编码器的性能和泛化能力。(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 the 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.
(2)本发明提出的使用改进的自动编码器进行故障诊断的方法仅使用正常的模组电池数据即可完成对模型的训练,摆脱了传统机器学习方法因高质量故障数据缺乏导致模型无法得到有效训练的问题。(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.
(3)本发明利用故障模组数据输入到训练好的自动编码器时,自动编码器的放大原理将故障引起的数据偏差放大,实现了故障的有效检测,从而具有较快的诊断速度与较高的诊断精度。(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.
(4)本发明所开发的方法具备数据驱动特性,没有涉及复杂的电池电化学机理,可以方便地用于各种不同种类电池的故障诊断,而无需像基于模型的方法一样在不同情况下构建不同的电池模型。(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 the model-based method.
本发明附加方面的优点将在下面的描述中部分给出,部分将从下面的描述中变得明显,或通过本发明的实践了解到。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
构成本公开的一部分的说明书附图用来提供对本公开的进一步理解,本公开的示意性实施例及其说明用于解释本公开,并不构成对本公开的限定。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.
图1为本发明提供的一种基于改进的自动编码器的电池故障诊断方法流程图;FIG1 is a flow chart of a battery fault diagnosis method based on an improved automatic encoder provided by the present invention;
图2为本发明提供的改进的自动编码器的简图;FIG2 is a schematic diagram of an improved automatic encoder provided by the present invention;
图3为本发明提供的改进的自注意力模块示意图。FIG3 is a schematic diagram of an improved self-attention module provided by the present invention.
具体实施方式Detailed ways
下面结合附图与实施例对本发明作进一步说明。The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
实施例一Embodiment 1
如图1所示,本实施例公开了一种基于改进的自动编码器的电池故障诊断方法,包括以下步骤:As shown in FIG1 , this embodiment discloses a battery fault diagnosis method based on an improved automatic encoder, comprising the following steps:
S1:获取待诊断电池数据并进行预处理;待诊断电池数据包括各电池电压数据以及对应的采集时间;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;
S2:将预处理后的待诊断电池数据输入至改进的自动编码器中,输出重构数据;所述改进的自动编码器包括由多层TCN网络构成的编码器、改进的自注意力模块以及与所述编码器结构对称的解码器;所述改进的自注意力模块包括多个具有不同注意力头数的SA块和残差结构,用于捕获长时间序列关系;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;
S3:通过包括但不限于均方误差基于重构数据计算重构误差,根据重构误差对故障电池进行定位及故障程度分级。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.
S1中,预处理包括:In S1, preprocessing includes:
S101:使用包括但不限于中位数绝对偏差(MAD)去噪法的降噪方法去除数据中的粗大误差。MAD去噪法即:定义MAD作为阈值。如果有数据超过了3倍的MAD,则认为该数据离群并去除。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.
S102:对各电池电压序列进行归一化处理:S102: Normalize each battery voltage sequence:
式中X是原始数据,X′是归一化后的数据,max(X)为原始数据中最大值,min(X)原始数据中最小值。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.
S103:使用滑动窗口对数据进行处理得到U:S103: Use the sliding window to process the data to obtain U:
其中:U是电池单元电压序列的标准电压矩阵,k是滑动窗口提取的序列长度,n是电芯单元的数量,Unk表示第n个电池在k时刻的电压。选取U同时作为模型的输入与标签得到用于训练模型的样本。Among them: 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, and Unk represents the voltage of the nth battery at time k. U is selected as both the input and label of the model to obtain samples for training the model.
S2中,采用的由时域卷积网络(TCN)和改进的自注意力(MSA)块组成的改进的自动编码器TCN-MSA-AE的具体结构为: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:
S2101:自动编码器由编码器和解码器两部分组成。首先由m层TCN组成的编码器,负责对数据中的重要特征进行提取。然后由m层TCN组成与编码器结构对称的解码器,负责将数据重新映射回与输入维度数相同的重建空间。TCN每层均由多个残差块组成。每个残差块均由四种基本结构组成,包含一维扩张因果卷积层,权重归一化层,ReLU激活函数和dropout层。随后采用1×1卷积将输入直接导向输出形成残差结构。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.
S2102:将MSA块添加到由TCN组成的编码器和解码器中间以提高自动编码器捕获长时间序列关系的能力,提高重构精度。对自注意力(SA)块的具体改进为:使用d(根据实际应用调整)个具有不同的注意力头数(根据处理数据的长度进行选择)的SA块共同处理输入数据,并分别为它们设置一个可学习的权重。在此基础上采用1×1卷积的形式增添残差结构,将从多个SA块获得的输出和从输入1×1卷积后获得的输出加和得到最终的输出,具体表达式为: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:
Ⅰ+β**SA(I)Ⅰ+β**SA(I)
式中,O为MSA的输出,I为MSA的输入;SAi是第i个SA块,每个SAi均具有不同的头数;βi,i∈[1:d]是对应于SAi的可学习的权重。Where O is the output of MSA, I is the input of MSA; SA i is the i-th SA block, and each SA i has a different number of heads; β i , i∈[1:d] is the learnable weight corresponding to SA i .
头数较多的自注意力块能够捕获更细粒度的特征,而多个具有不同头数的自注意力块共同进行特征提取,有助于在不同层次理解输入数据,提高特征提取的多样性。同时,多个不同头数的自注意力块也有助于缓解过拟合问题,提高自动编码器的泛化能力。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.
本实施例中,改进的自动编码器的训练过程为:In this embodiment, the training process of the improved automatic encoder is:
S2201:选取多节正常电池串联成模组,在选定工况下进行充放电循环实验,采集电池测试数据,作为正常电池训练数据;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;
S2202:将正常电池训练数据同时作为训练样本和标签,输入到改进的自动编码器中进行训练,当损失函数达到最小值,得到训练好的改进的自动编码器。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.
S2201中,电池个数n和循环工况根据实际应用选取,工况的循环条件包括电池充电与放电的电流倍率,放电深度,温度和截止电压;采集的电池测试数据包括但不限于模组中各电池电压数据以及对应的数据采集时间。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.
所述待诊断的模组与用于训练模型的模组结构相同,所含电池型号一致。处理待诊断数据的方法与步骤S2相同。对模型进行训练时,将所有样本按照一定的比例划分为训练集和测试集,训练集负责模型的训练,测试集负责评价模型的训练效果。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.
S3中,通过包括但不限于均方误差基于重构数据计算重构误差,具体包括以下步骤: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:
S3101:通过训练好的模型获取重构数据,具体表达式如下:S3101: Obtain reconstructed data through the trained model. The specific expression is as follows:
Ure=TCN-MSA-AE(U)Ure=TCN-MSA-AE(U)
式中,Ure为重构数据,形式与U一致,为:Where U re is the reconstructed data, which is in the same form as U:
其中,表示第n个电池第k个重构电压。in, represents the kth reconstruction voltage of the nth battery.
S3102:通过包括但不限于均方误差(MSE)计算出各电芯重构数据对应的重构误差,具体表达式如下: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:
其中,MSEnk表示第n个电池在滑动窗口长度为k时的均方误差。Wherein, MSE nk represents the mean square error of the nth battery when the sliding window length is k.
S3中,根据重构误差对故障电池进行定位及故障程度分级,具体包括以下步骤:In S3, the faulty battery is located and the fault degree is graded according to the reconstruction error, which specifically includes the following steps:
S3201:基于模型的重构精度设立一个初始阈值α,若各电池中有电池的重构损失超过α,则判断该电池存在故障。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.
S3202:在初始阈值α的基础上综合考虑实际情况设定多个阈值对电池的故障程度进行评估分级。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.
本具体实施例基于自动编码器的基本原理,使用时域卷积网络和改进的自注意力模块构建了改进的自动编码器,在此基础上,使用正常模组电池数据对其进行训练。在进行故障诊断时,将待诊断数据输入训练好的模型得到模组中各电芯重构数据,然后通过评估模组中各电芯重构损失可实现故障检测及定位。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.
实施例二Embodiment 2
本实施例提供一种基于改进的自动编码器的电池故障诊断系统,包括:This embodiment provides a battery fault diagnosis system based on an improved automatic encoder, comprising:
数据获取模块:用于获取待诊断电池数据并进行预处理;待诊断电池数据包括各电池电压数据以及对应的采集时间;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;
自动编码器模块:用于将预处理后的待诊断电池数据输入至改进的自动编码器中,输出重构数据;所述改进的自动编码器包括由多层TCN网络构成的编码器、改进的自注意力模块以及与所述编码器结构对称的解码器;所述改进的自注意力模块包括多个具有不同注意力头数的SA块,用于捕获长时间序列关系;Autoencoder module: used to input the preprocessed battery data to be diagnosed into the improved autoencoder and output the 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.
实施例三Embodiment 3
本实施例提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现如上述实施例一所述的基于改进的自动编码器的电池故障诊断方法中的步骤。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.
本具体实施例基于实施例一所述的基于改进的自动编码器的电池故障诊断方法,根据自动编码器的基本原理,使用时域卷积网络和改进的自注意力模块构建了改进的自动编码器,在此基础上,使用正常模组电池数据对其进行训练。在进行故障诊断时,将待诊断数据输入训练好的模型得到模组中各电芯重构数据,然后通过评估模组中各电芯重构损失可实现故障检测及定位。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.
实施例四Embodiment 4
本实施例提供了一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现如上述实施例一所述的基于改进的自动编码器的电池故障诊断方法中的步骤。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.
本具体实施例基于实施例一所述的基于改进的自动编码器的电池故障诊断方法,根据自动编码器的基本原理,使用时域卷积网络和改进的自注意力模块构建了改进的自动编码器,在此基础上,使用正常模组电池数据对其进行训练。在进行故障诊断时,将待诊断数据输入训练好的模型得到模组中各电芯重构数据,然后通过评估模组中各电芯重构损失可实现故障检测及定位。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.
以上实施例二至四中涉及的各步骤或模块与实施例一相对应,具体实施方式可参见实施例一的相关说明部分。术语“计算机可读存储介质”应该理解为包括一个或多个指令集的单个介质或多个介质;还应当被理解为包括任何介质,所述任何介质能够存储、编码或承载用于由处理器执行的指令集并使处理器执行本发明中的任一方法。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.
以上所述仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。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 (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202410394623.5A CN118169562B (en) | 2024-04-02 | 2024-04-02 | A battery fault diagnosis method and system based on improved automatic encoder |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202410394623.5A CN118169562B (en) | 2024-04-02 | 2024-04-02 | A battery fault diagnosis method and system based on improved automatic encoder |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN118169562A true CN118169562A (en) | 2024-06-11 |
| CN118169562B CN118169562B (en) | 2024-10-22 |
Family
ID=91360347
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202410394623.5A Active CN118169562B (en) | 2024-04-02 | 2024-04-02 | A battery fault diagnosis method and system based on improved automatic encoder |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN118169562B (en) |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111598222A (en) * | 2020-05-14 | 2020-08-28 | 哈尔滨工业大学(威海) | Re-optimization depth automatic encoder and engine automatic detection system |
| US20210088591A1 (en) * | 2019-09-19 | 2021-03-25 | Samsung Electronics Co., Ltd. | Method and system for battery-management in devices |
| CN113484772A (en) * | 2021-07-30 | 2021-10-08 | 湖北工业大学 | Battery fault identification method based on stacking automatic encoder |
| CN116451117A (en) * | 2023-04-10 | 2023-07-18 | 南京信息工程大学 | Power data anomaly detection method based on federal learning |
| US20240010100A1 (en) * | 2020-07-03 | 2024-01-11 | TWAICE Technologies GmbH | Processing of status data of a battery for aging estimation |
-
2024
- 2024-04-02 CN CN202410394623.5A patent/CN118169562B/en active Active
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20210088591A1 (en) * | 2019-09-19 | 2021-03-25 | Samsung Electronics Co., Ltd. | Method and system for battery-management in devices |
| CN111598222A (en) * | 2020-05-14 | 2020-08-28 | 哈尔滨工业大学(威海) | Re-optimization depth automatic encoder and engine automatic detection system |
| US20240010100A1 (en) * | 2020-07-03 | 2024-01-11 | TWAICE Technologies GmbH | Processing of status data of a battery for aging estimation |
| CN113484772A (en) * | 2021-07-30 | 2021-10-08 | 湖北工业大学 | Battery fault identification method based on stacking automatic encoder |
| CN116451117A (en) * | 2023-04-10 | 2023-07-18 | 南京信息工程大学 | Power data anomaly detection method based on federal learning |
Non-Patent Citations (1)
| Title |
|---|
| 韩云飞,谢佳,蔡涛,段善旭,程时杰: "基于自动编码器的锂离子电池状态评估方法", 《电力系统自动化》, 20 August 2021 (2021-08-20), pages 41 - 48 * |
Also Published As
| Publication number | Publication date |
|---|---|
| CN118169562B (en) | 2024-10-22 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN113094357B (en) | A traffic-missing data completion method based on spatiotemporal attention mechanism | |
| CN116068399A (en) | State of Health Estimation Method for Lithium Battery Based on Feature Selection and Temporal Attention | |
| CN115146739B (en) | Power transformer fault diagnosis method based on stacked time series network | |
| CN119004303A (en) | Power plant equipment fault diagnosis method and system based on artificial intelligence and automation | |
| CN116699410A (en) | A Lithium Battery State of Health Estimation Method Fusion of Unsupervised and Supervised Learning | |
| CN117034143B (en) | Distributed system fault diagnosis method and device based on machine learning | |
| CN112949930B (en) | PA-LSTM network-based road motor vehicle exhaust high-emission early warning method | |
| CN101614786A (en) | On-line Intelligent Fault Diagnosis Method for Power Electronic Circuits Based on FRFT and IFSVC | |
| CN111881627B (en) | Fault diagnosis method and system for nuclear power plant | |
| CN113791351A (en) | Lithium battery life prediction method based on transfer learning and difference probability distribution | |
| CN117113202A (en) | Power loop energy consumption detection method and equipment based on joint error stacking model | |
| CN119179919B (en) | An online monitoring and diagnosis system for hydropower equipment | |
| CN117540859A (en) | Method and system for estimating generated energy of photovoltaic power station based on neural network | |
| CN117366783A (en) | An air conditioning load monitoring and abnormality detection method and system | |
| CN116087790A (en) | Energy storage battery fault identification method and device | |
| CN118393371A (en) | Battery aging prediction method, device, medium and product | |
| CN114420333A (en) | A fault diagnosis tracking and rapid prediction system for third-generation passive nuclear power plants | |
| CN118169562B (en) | A battery fault diagnosis method and system based on improved automatic encoder | |
| CN119758925B (en) | Industrial process fault monitoring method based on time information enhancement chart convolution self-encoder | |
| CN113484772A (en) | Battery fault identification method based on stacking automatic encoder | |
| CN120162710A (en) | A water pipe network fault detection method and system combined with graph neural network | |
| CN118152877A (en) | Battery cell quality prediction system based on particle swarm algorithm and neural network | |
| CN119128432A (en) | A method and device for predicting the remaining service life of a proton exchange membrane fuel cell | |
| CN118981656A (en) | Anomaly detection method for hydraulic turbine units based on spatiotemporal large model combined with GAN network | |
| CN111815069A (en) | Voltage prediction method of satellite lithium battery based on time series analysis principle |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |