Battery pack fault diagnosis method fusing feature comparison coding and graph convolutional network

By combining feature comparison encoding and graph convolution networks, the data category imbalance and feature similarity problems of lithium-ion batteries under complex operating conditions are solved, and the accuracy and robustness of fault recognition are improved, which is suitable for the status monitoring and fault recognition of battery systems.

CN120470408APending Publication Date: 2025-08-12SOUTHEAST UNIV
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202510666502.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-22
Publication Date
2025-08-12

AI Technical Summary

Technical Problem

During long-term operation, lithium-ion batteries are susceptible to multiple factors such as cyclic aging, environmental factors and charging and discharging conditions, resulting in performance degradation. The existing fault diagnosis methods have data categories imbalance and high similarity between health samples and fault samples under complex and dynamic operating conditions, resulting in misdiagnosis or missed diagnosis, affecting the operational safety and stability of the battery system.

Method used

The method of fusion feature comparison encoding and graph convolution network is adopted, and the feature comparison encoder and graph convolution neural network are constructed through feature comparison learning and structured graph modeling to maximize the feature differences between classes and minimize the similarity within classes, and enhance the accuracy and robustness of fault recognition.

Benefits of technology

It significantly improves the accuracy and robustness of fault recognition, improves the model's discriminant performance under category imbalance and the global feature modeling ability under complex operating conditions, has good structural versatility and adaptability, and is suitable for battery system status monitoring and intelligent fault recognition with high safety requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120470408A_ABST
    Figure CN120470408A_ABST
Patent Text Reader

Abstract

The invention discloses a battery pack fault diagnosis method fusing feature comparison coding and a graph convolutional network, and relates to the technical field of battery fault diagnosis. The method comprises the steps that an original voltage sequence of a battery pack is received and preprocessed, a sample set is generated through a sliding window algorithm, the sample set is divided into a training set and a test set, and the sample set comprises healthy samples and fault samples; and constructing a feature comparison encoder, training the feature comparison encoder based on the training set and the test set until the comparison loss function is minimized, and obtaining the trained feature comparison encoder. According to the method, a feature comparison encoder module is constructed, the separability of healthy and fault samples in a feature space is enhanced by maximizing inter-class differences and minimizing intra-class differences, a graph convolutional network model is constructed, and sequence features and spatial relationships are extracted by using structural relevance between the samples, so that the recognition capability of a complex fault mode is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of battery fault diagnosis, and specifically to a battery pack fault diagnosis method that integrates feature contrast coding and graph convolutional networks. Background Art

[0002] As an important component of modern energy systems, lithium-ion batteries (LIBs) have been widely used in key areas such as electric vehicles, renewable energy storage systems, and portable electronic devices due to their excellent energy density, high cycle life, and low self-discharge rate. During long-term operation, lithium-ion batteries are susceptible to multiple factors such as cycle aging, environmental factors, and charge and discharge conditions, resulting in gradual performance degradation, which may cause safety accidents in severe cases. Although traditional fault diagnosis methods (such as statistical analysis and signal processing techniques) can identify and locate faults to a certain extent, their high dependence on prior knowledge or specific model structures limits their adaptability and promotion capabilities in complex and dynamic actual working conditions. In recent years, with the development of deep learning technology, data-driven intelligent diagnosis methods have gradually become mainstream and have shown significant advantages in automatic feature extraction and classification modeling.

[0003] Despite this, the data characteristics of battery systems in practical applications still pose a challenge to the effective promotion of deep learning methods. First, there is a serious class imbalance problem in battery operation data. In typical application scenarios, the number of healthy samples is far greater than that of fault samples. In particular, the data of rare or early fault samples is extremely scarce. This imbalance phenomenon can easily lead to a bias towards healthy samples during model training, thereby weakening the ability to perceive and identify the characteristics of minority class faults; and fault samples and healthy samples often have a high degree of similarity in the feature space, which can easily lead to model misjudgment. Under complex working conditions, the healthy state and the early fault state often show slight differences or even high overlap in feature expression. This feature similarity not only increases the difficulty of model learning, but also easily leads to misdiagnosis or missed diagnosis, thus posing a potential threat to the operational safety and stability of the battery system.

[0004] To this end, the present invention proposes a battery pack fault diagnosis method that integrates feature contrast coding and graph convolutional network. Summary of the Invention

[0005] The purpose of the present invention is to provide a battery pack fault diagnosis method that integrates feature contrast coding and graph convolutional networks. In response to the problems of data category imbalance and high similarity of features between healthy and faulty samples in the battery system, the advantages of feature contrast learning and structured graph modeling are used to achieve collaborative optimization between the distinguishability of feature space and the expression ability of structural information, thereby significantly improving the accuracy and robustness of fault identification.

[0006] To achieve the above objectives, the present invention provides the following technical solution: a battery pack fault diagnosis method integrating feature contrast coding and graph convolutional network, comprising the following steps:

[0007] Receive the original voltage sequence of the battery pack and perform preprocessing. Use the sliding window algorithm to generate a sample set, which is divided into a training set and a test set. The sample set contains healthy samples and fault samples.

[0008] Construct a feature contrast encoder and train it based on the training set and the test set until the contrast loss function is minimized. The trained feature contrast encoder is used to encode healthy samples and faulty samples to obtain a discriminative embedded feature representation between the healthy and faulty samples.

[0009] The pre-built graph convolutional neural network model is trained to construct an adjacency matrix based on the embedded feature representation output by the feature contrast encoder. This simulates the temporal correlation structure in the battery pack's original voltage sequence and models and fuses the relationship between healthy and faulty samples through multi-layer graph convolution.

[0010] Battery pack faults are identified and output based on the trained feature comparison encoder and graph convolutional neural network model.

[0011] Furthermore, the original voltage sequence of the battery pack is received and preprocessed, and a sliding window algorithm is used to generate a sample set, as follows:

[0012] (21) The original voltage sequence of the battery pack is converted into a standard input format for model training, and a sliding window method is used for sample generation:

[0013] Assume that the length of the health data sequence is L healthy , the length of the fault data sequence is L fault ,, the length of a single sample is set to l; the goal is to extract N fault samples, extract N from the healthy sequence healthy Samples:

[0014] To achieve uniform sampling, the sampling window step size of the fault and healthy sequences is defined as Δ fault With Δ healthy as follows:

[0015]

[0016] The starting index fault set S of the sampling window fault With Health Collection S healthy As shown below:

[0017] Fault sample starting index as follows:

[0018]

[0019] Healthy sample starting index as follows:

[0020]

[0021] (22) Time series sample construction and training set generation

[0022] For each starting index, a data segment of length l is extracted from the data sequence, and the fault samples are as follows:

[0023]

[0024] Where i = 1, 2, ..., N fault , the healthy samples are

[0025]

[0026] Where j = 1, 2, ..., N healthy .

[0027] Furthermore, the division ratio of the training set to the test set is 1:5.

[0028] Furthermore, a feature contrast encoder is constructed and trained based on the training set and the test set until the contrast loss function is minimized. The trained feature contrast encoder is used to encode healthy samples and faulty samples, and an embedded feature representation with discrimination between healthy samples and faulty samples is obtained, as follows:

[0029] (41) Assume that the training set samples are in Represents the feature vector of the i-th sample, y i ∈{0,1} is a binary classification label, which is converted into a matrix form to adapt to the input requirements of the deep neural network:

[0030]

[0031] (42) A two-layer fully connected neural network is used for feature transformation, where the first layer includes linear mapping and ReLU activation, and the second layer outputs the embedded feature vector:

[0032]

[0033] In the formula and is the encoding output of the first and second layers, W (1) and W (2)Represent the weight matrices of the first and second layers respectively, b (1) and b (2) are the bias terms of the first and second layers respectively.

[0034] (43) A contrast loss function based on cosine similarity is introduced to achieve feature space separation by maximizing the feature distance between samples of different categories:

[0035]

[0036]

[0037] Among them, a·b represents the dot product of vectors a and b, ||a||2 and ||b||2 represent the bi-norm of vectors a and b respectively. and Represent the encoding feature representation of healthy and faulty samples respectively, N s To balance the number of sampling samples;

[0038] (44) The Adam optimizer is used for training, and the optimization goal is to minimize the contrast loss:

[0039]

[0040] Furthermore, the pre-built graph convolutional neural network model is trained. An adjacency matrix is constructed based on the embedded feature representation output by the feature comparison encoder. The temporal correlation structure in the original voltage sequence of the battery pack is simulated. The relationship between healthy and faulty samples is modeled and fused through multi-layer graph convolution. The trained graph convolutional neural network model is obtained as follows:

[0041] (51) Using the sample feature Z output by the encoder train , construct the adjacency matrix A that reflects the temporal dependency train Represents the adjacency relationship between the i-th sample and the j-th sample in the training set:

[0042]

[0043] (52) A neural network structure with three layers of graph convolution is designed to perform multi-layer graph domain abstraction and fusion of encoded features. The forward propagation process is as follows:

[0044] H (1) =Dropout(ReLU(A train Z train W (1) ), p = 0.3)

[0045] H (2) =Dropout(ReLU(A train H(1) W (2) ), p = 0.3)

[0046] H (3) =A train H (2) W (3)

[0047] Where Z train is the input encoding feature matrix, that is, the output of the previous stage comparison encoder; W (1) 、W (2) 、W (3) are the trainable weight matrices of the first, second, and third layers of graph convolution respectively; H (1) 、H (2) 、H (3) Represent the output features of each graph convolution layer respectively; Dropout represents the random drop operation;

[0048] (53) The final output is normalized by the Softmax function to obtain the classification probability of each sample:

[0049]

[0050] (54) Cross entropy is used as the classification loss function:

[0051]

[0052] (55) The Adam optimizer is used to optimize the network parameters with a learning rate of η = 0.01 Perform backpropagation update:

[0053]

[0054] (56) The classification accuracy is calculated as follows to quantify the performance of the model on the training or test set:

[0055]

[0056] Among them, δ(a,b) is the indicator function, which takes 1 when a=b and 0 otherwise;

[0057] (57) After the training is completed, in the testing phase, the adjacency matrix A of the test set samples is constructed in the same way as the training process. test , and use the trained encoder to train the test data X test Perform feature transformation to obtain the corresponding embedding representation Z test , and then compare it with A test Input the graph convolutional network together and obtain the final prediction result through the forward propagation process

[0058] According to a second aspect of the present invention, the present invention provides a battery pack fault diagnosis system that integrates feature contrast coding and graph convolutional networks, which is used to implement the above-mentioned battery pack fault diagnosis method that integrates feature contrast coding and graph convolutional networks, including:

[0059] The sample set generation module is used to receive the original voltage sequence of the battery pack and perform preprocessing, generate a sample set using a sliding window algorithm, and divide the sample set into a training set and a test set, where the sample set contains healthy samples and fault samples;

[0060] The feature encoding module is used to construct a feature contrast encoder. The feature contrast encoder is trained based on the training set and the test set until the contrast loss function is minimized. The trained feature contrast encoder is used to encode healthy samples and faulty samples to obtain a discriminative embedded feature representation between healthy and faulty samples.

[0061] The graph convolution fault classification module is used to train a pre-built graph convolutional neural network model. It constructs an adjacency matrix based on the embedded feature representation output by the feature comparison encoder, simulates the temporal correlation structure in the battery pack's original voltage sequence, and models and fuses the relationship between healthy and faulty samples through multi-layer graph convolution to obtain a trained graph convolutional neural network model.

[0062] The recognition output module is used to identify and output battery pack faults based on the trained feature comparison encoder and graph convolutional neural network model.

[0063] According to the third aspect of the present invention, the present invention provides a terminal device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the memory stores a computer program capable of running on the processor, and when the processor loads and executes the computer program, the battery pack fault diagnosis method of the above-mentioned fusion feature comparison coding and graph convolutional network is adopted.

[0064] According to a fourth aspect of the present invention, the present invention provides a storage medium comprising computer-executable instructions, which, when executed by a computer processor, are used to perform the battery pack fault diagnosis method that integrates feature contrast coding and graph convolutional network as described above.

[0065] The present invention has at least the following beneficial effects:

[0066] (1) Based on the traditional battery fault diagnosis method, the present invention introduces a feature contrast encoding strategy. By maximizing the difference between inter-class features and minimizing the similarity within a class, the model's ability to distinguish minority class fault samples is effectively enhanced, significantly improving the model's discrimination performance under class imbalance conditions.

[0067] (2) The graph convolutional network structure proposed in this paper can model the temporal and structural dependencies between battery samples, making full use of the topological information between samples, thereby improving the global feature modeling capability and classification accuracy of the model under complex working conditions;

[0068] (3) The present invention organically integrates feature contrast learning with the graph neural mechanism of structure perception to construct an end-to-end discrimination-enhanced fault diagnosis system, improving the model's ability to handle boundary fuzzy samples at both the feature space and structure space levels;

[0069] (4) The method of the present invention does not rely on physical models or large amounts of label data, has good structural versatility and adaptability, and can be widely used in battery system status monitoring and intelligent fault identification tasks with high safety requirements. It has high engineering application prospects and promotion value.

[0070] Of course, any product implementing the present invention does not necessarily need to achieve all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS

[0071] Figure 1 Schematic diagram of the process of the diagnostic method of the present invention;

[0072] Figure 2 Schematic diagram of the implementation principle of the diagnostic method of the present invention;

[0073] Figure 3 Schematic diagram of the implementation principle of the feature comparison encoder in the present invention;

[0074] Figure 4 The structural principle diagram of the graph convolutional neural network model in the present invention;

[0075] Figure 5 Schematic diagram of data sampling and data set division in an embodiment of the present invention;

[0076] Figure 6 t-SNE visualization diagram of the feature comparison results before and after encoding in the present invention;

[0077] Figure 7 Schematic diagram of verification of ten rounds of ablation results according to an embodiment of the present invention. DETAILED DESCRIPTION

[0078] The following will be combined with the accompanying drawings in the embodiments of the present disclosure to clearly and completely describe the technical solutions in the embodiments of the present disclosure. Obviously, the embodiments described are only part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments of the present disclosure, all other embodiments obtained by ordinary technicians in this field without making any creative efforts are within the scope of protection of the present disclosure.

[0079] Example 1:

[0080] See also Figures 1 to 2 The present invention provides a technical solution: a battery pack fault diagnosis method integrating feature contrast coding and graph convolutional network, comprising the following steps:

[0081] S1. Receive the original voltage sequence of the battery pack and preprocess it, use the sliding window algorithm to generate a sample set, and divide the sample set into a training set and a test set, where the sample set contains healthy samples and fault samples, such as Figure 5 ;

[0082] (21) The original voltage sequence of the battery pack is converted into a standard input format for model training, and a sliding window method is used for sample generation:

[0083] Assume that the length of the health data sequence is L healthy , the length of the fault data sequence is L fault ,, the length of a single sample is set to l; the goal is to extract N fault samples, extract N from the healthy sequence healthy Samples:

[0084] To achieve uniform sampling, the sampling window step size of the fault and healthy sequences is defined as Δ fault With Δ healthy as follows:

[0085]

[0086] The starting index fault set S of the sampling window fault With Health Collection S healthy As shown below:

[0087] Fault sample starting index as follows:

[0088]

[0089] Healthy sample starting index as follows:

[0090]

[0091] (22) Time series sample construction and training set generation

[0092] For each starting index, from the complete fault data fault Data sequence and complete health sequence data healthy Extract the data segment of length l, the fault sample as follows:

[0093]

[0094] Where i = 1, 2, ..., N fault , the healthy samples are

[0095]

[0096] Where j = 1, 2, ..., N healthy ;

[0097] S2. Construct a feature contrast encoder and train it based on the training and test sets until the contrast loss function is minimized. The trained feature contrast encoder is used to encode healthy and faulty samples, obtaining discriminative embedded feature representations between the healthy and faulty samples.

[0098] S21) Comparison of encoder structure construction:

[0099] like Figure 3 As shown, the training data set is set to in Represents the feature vector of the i-th sample, d is the feature dimension, y i ∈{0,1} is the corresponding label, 0 represents a healthy sample, and 1 represents a faulty sample. In order to meet the input requirements of the deep learning model, this embodiment converts the features and labels into tensor form:

[0100]

[0101] Among them, X tan is the training feature matrix, with a shape of N×d, where N is the number of samples;

[0102]

[0103] Among them, Y train is the training label vector, length is N;

[0104] Next, the encoder is implemented using a two-layer fully connected neural network to map the input features to the hidden representation space. The first layer is a linear transformation plus a ReLU activation function:

[0105]

[0106] in, is the hidden representation of the i-th sample in the first layer, that is, the output feature of the encoder, with a dimension of k; is the weight matrix of the first layer, k is the hidden layer dimension, and in this embodiment, k is set to 32; is the bias vector of the first layer; ReLU(·) is the activation function, defined as ReLU(x)=max(0,x);

[0107] The second layer is a linear transformation as follows:

[0108]

[0109] in, is the hidden representation of the i-th sample in the second layer, that is, the output feature of the encoder; is the weight matrix of the second layer; is the bias vector of the second layer;

[0110] Therefore, the encoder output z i It is expressed as follows:

[0111]

[0112] S22) Contrastive loss function design:

[0113] In order to enhance the separation of inter-class features, a contrast loss function based on cosine similarity is introduced to Corresponding fault samples Construct a pairing relationship:

[0114]

[0115] in, Represents the cosine similarity of two vectors, N s is the number of balanced sampling samples.

[0116] S23) Class-balanced sampling and optimization strategy:

[0117] Due to the class imbalance in battery pack data, the number of healthy samples far exceeds the number of faulty samples. To address this issue, this embodiment randomly selects an equal number of healthy samples and faulty samples in each training cycle to ensure that the model fully learns the feature encoding of both types of samples. The training process is as follows:

[0118] Step 1 Sample selection: Randomly select N samples from healthy samples and fault samples s samples, forming a healthy sample set and fault sample sets

[0119] Step 2 Feature encoding: The encoder extracts features from the above samples to obtain encoding features. and

[0120] Step 3 Loss calculation: Calculate the contrast loss L between healthy samples and faulty samples contrastive ;

[0121] Step 4 Parameter update: Use Adam optimizer to update encoder parameters:

[0122]

[0123] Among them, θ encoder is the parameter set of the encoder, including the weight matrix and the bias vector; η is the learning rate, which is set to 0.0005 in this embodiment; is the gradient of the encoder parameters;

[0124] Specifically, the encoder constructed in this embodiment effectively solves the model bias problem caused by data imbalance and feature similarity by maximizing the inter-class distance and minimizing the intra-class similarity, providing a highly discriminative and clearly structured feature input for the subsequent graph convolutional network structure.

[0125] S3. Train the pre-built graph convolutional neural network model. Construct an adjacency matrix based on the embedded feature representation output by the feature contrast encoder. Simulate the temporal correlation structure in the battery pack's original voltage sequence. Model and fuse the relationship between healthy and faulty samples through multi-layer graph convolution to obtain the trained graph convolutional neural network model.

[0126] S31) Adjacency matrix construction and structural information modeling

[0127] In order to further explore the structured correlation characteristics between samples in battery pack data and enhance the fault diagnosis model's ability to model complex relationships, this paper designs a diagnostic model based on a graph convolutional network (GCN) based on a feature contrast learning encoder. Figure 4 As shown in the figure, the model simulates the temporal structure between battery samples by constructing an adjacency matrix and uses a graph convolution layer to deeply abstract the encoding features, thereby achieving efficient fusion of feature information and structural information;

[0128] First, based on the training feature matrix Z output by the encoder train , construct the adjacency matrix A between training samples train , considering the temporal and local structure of battery pack data, a first-order temporal adjacency strategy is used to connect adjacent samples. The adjacency matrix is defined as follows:

[0129]

[0130] in, is the adjacency matrix of the training samples, N is the number of training samples, i, j are the indexes of the samples, and the adjacency matrix represents the first-order neighborhood relationship of the samples in the sequence, which aims to simulate the temporal characteristics of the battery pack data and the association between adjacent samples;

[0131] S32) Graph Convolutional Network Structure Design

[0132] This paper designs a GCN model containing three layers of graph convolution units. The graph convolution operation of each layer consists of adjacency propagation, linear mapping and activation function, and is supplemented by the Dropout mechanism to prevent overfitting. The specific calculation process is as follows:

[0133] The first layer of graph convolution is as follows:

[0134] H (1) =σ(A train Z train W (1) ) (9)

[0135] in, is the node feature representation of the first layer, is the weight matrix of the first layer, d1 is the feature dimension of the first layer, the activation function σ(·) adopts ReLU, defined as σ(x) = max(0,x). To prevent overfitting, the Dropout operation is added with a probability of p = 0.3:

[0136] H (1) =Dropout(ReLU(A train Z train W (1) ),p=0.3) (10)

[0137] The second layer of graph convolution is as follows:

[0138] H (2) =σ(A train H (1) W (2) ) (11)

[0139] in, is the node feature representation of the second layer, is the weight matrix of the second layer, d2 is the feature dimension of the second layer, and the Dropout operation is also added as follows.

[0140] H (2) =Dropout(ReLU(A train H (1) W (2) ),p=0.3) (12)

[0141] The third layer of graph convolution is as follows:

[0142] H (3) =A train H (2) W (3) (13)

[0143] Among them, Z train is the input encoding feature matrix, that is, the output of the previous stage comparison encoder; W (1) 、W (2) 、W (3) are the trainable weight matrices of the first, second, and third layers of graph convolution respectively; H (1) 、H (2) 、H (3) They represent the output features of each graph convolutional layer; Dropout represents the random dropout operation, and C=2 is the number of categories (healthy and faulty);

[0144] S33) Classification prediction and loss function construction

[0145] The final output is normalized by the Softmax function to obtain the predicted probability of each sample belonging to each category:

[0146]

[0147] in, For the prediction output of the model, the Softmax function is defined as follows:

[0148]

[0149] The loss function of the model uses cross entropy loss, which is defined as follows:

[0150]

[0151] in, is the total loss value, y i,c is the one-hot encoding of the true label. If the i-th sample belongs to category c, then y i,c =1, otherwise 0; The probability that the i-th sample belongs to category c is predicted by the model;

[0152] S34) Parameter optimization and accuracy evaluation

[0153] The graph convolutional network parameter set is θ GCN ={W (1) ,W (2) ,W (3) The training process uses the Adam optimizer to update the parameters, and the learning rate is set to η = 0.01:

[0154]

[0155] in, The gradient of the loss function to the model parameters, the forward propagation process of the model is as follows: Input the encoded feature Z train and the adjacency matrix A trainThrough three layers of graph convolution layers and activation functions in sequence, the output H is obtained (3) ; Get the predicted probability distribution Y through the SoftMax function; then calculate the cross entropy loss In backpropagation, the gradient of the loss function with respect to the model parameters is calculated and the model parameters are updated. The number of training iterations is set to 150. In each training cycle, the loss value and the accuracy on the training set are recorded. The accuracy is calculated as follows:

[0156]

[0157] Among them, δ(a,b) is the indicator function, which takes 1 when a=b and 0 otherwise; The category of the i-th sample predicted by the model; y i is the true category label of the i-th sample;

[0158] S35) Test process and overall performance analysis

[0159] After the model training is completed, the adjacency matrix A of the test sample is constructed in the same way as the training in the test phase. test , and the encoded feature Z test Input the GCN network for forward propagation and finally obtain the predicted output

[0160] Through the above structural design and training strategy, the GCN model can significantly enhance its ability to model the underlying structural information in battery data while maintaining its feature discrimination capabilities, achieving an effective fusion of feature information and topological structure. In the overall system, the GCN module works in conjunction with the feature comparison encoder to significantly improve the accuracy and robustness of battery pack fault diagnosis.

[0161] S4. Identify and output battery pack faults based on the trained feature contrast encoder and graph convolutional neural network model.

[0162] Next, the technical solution of the present invention is further described with reference to specific embodiments:

[0163] In order to verify the effectiveness and robustness of the proposed fused feature contrast encoder and graph convolutional network (FCE-GCN) diagnosis method in actual scenarios, an experimental study was conducted based on an actual collected quadruped robot battery pack dataset.

[0164] 1. Dataset construction and sliding window sampling strategy

[0165] To verify the effectiveness and practicality of the fault diagnosis method proposed in this paper, a structured dataset based on the actual operation data of a quadruped robot was constructed, and a sliding window sampling process was performed. The specific process is as follows:

[0166] (11) Data collection and anomaly location

[0167] The present invention uses real-world operational data collected from multiple quadruped robots over a five-month operating cycle. The robots are powered by a battery pack consisting of seven independent cells connected in series, with a maximum charging voltage of 33.6V DC and a charging current range of 3.5A to 9A. The total number of voltage sampling points per battery cell reaches 200,000, demonstrating high resolution and a long time span.

[0168] During actual operation, when an abnormality occurs in the battery system, its voltage data distribution will show significant changes. This embodiment identifies the fault location by monitoring the voltage threshold change and, combined with long-term operation monitoring results, extracts representative abnormal interval data as fault samples, while selecting stable interval data as healthy samples.

[0169] (12) Sliding window sampling strategy design

[0170] In order to convert the original voltage sequence into a standard input format for model training, this embodiment uses a sliding window method to generate samples. Assume that the length of the health data sequence is L healthy , the length of the fault data sequence is L fault ,, the length of a single sample is set to l; the goal is to extract N fault samples, extract N from the healthy sequence healthy samples;

[0171] To achieve uniform sampling, the sampling window step size is defined as follows:

[0172]

[0173]

[0174] The starting index set of the sampling window is as follows:

[0175] Fault sample starting index as follows:

[0176]

[0177] Healthy sample starting index as follows:

[0178]

[0179] (13) Time series sample construction and training set generation

[0180] For each starting index, a data segment of length l is extracted from the data sequence, and the fault samples are as follows:

[0181]

[0182] Where i = 1, 2, ..., N fault , the healthy samples are

[0183]

[0184] Where j = 1, 2, ..., N healthy ;

[0185] In the experimental setting of this embodiment, the sample length is set to l=1000, and finally 100 fault samples and 500 healthy samples are collected from the original data for model training and testing.

[0186] 2. Feature Contrast Encoder Effect Analysis

[0187] To verify the effectiveness of the feature contrast encoder proposed in this example in terms of feature separability, a visual dimensionality reduction method was used to analyze the high-dimensional encoding features, and its performance in the classification task of healthy samples and faulty samples was quantitatively and qualitatively evaluated.

[0188] (21) Dimensionality reduction and visualization analysis of high-dimensional features

[0189] After completing the training of the feature contrast encoder, this embodiment uses the t-SNE (t-distributed Stochastic Neighbor Embedding) method to reduce the dimensionality of the encoded high-dimensional features and map them to a two-dimensional space for visual analysis. Figure 6 Shows the distribution of features in two-dimensional space before and after encoding;

[0190] (22) Comparison of feature distribution differences before and after encoding

[0191] from Figure 6 It can be seen that before encoding, the healthy samples and faulty samples are mixed in the feature space, the category boundaries are fuzzy, and there is significant overlap between samples, making it difficult to distinguish between different categories. The clustering between samples in the same category is poor, and the similarity of samples within the category is low. This makes the model face great difficulties in the fault identification process and affects the overall diagnostic performance.

[0192] After using feature contrast encoding, healthy samples and faulty samples form tightly clustered classes in the feature space. The consistency of sample features within a class is enhanced, and the feature distance between classes is significantly widened. This result shows that the feature contrast encoder constructed in this embodiment has achieved significant results in minimizing intra-class differences and maximizing inter-class separation, successfully improving class separability and facilitating accurate judgment of sample status by downstream classifiers.

[0193] (23) Encoder robustness analysis under unbalanced sample conditions

[0194] Despite significant class imbalance in the battery data, the encoder proposed in this embodiment still maintains the ability to discriminate minority fault samples. The encoded features are clearly distributed in space, without fuzzy aliasing. This ability to maintain stable discrimination performance even under imbalanced sample conditions fully demonstrates the advantages of the contrastive learning strategy adopted in this embodiment in improving model robustness and fault feature representation.

[0195] 3. Analysis of the ablation experiment of the battery pack fault diagnosis task

[0196] To fully verify the effectiveness of the fused feature contrast encoder and graph convolutional network (FCE-GCN) approach proposed in this example for battery pack fault diagnosis, a systematic comparative experiment was designed and implemented, focusing on evaluating the impact of the feature contrast learning module on improving overall diagnostic performance.

[0197] (31) Model setting and evaluation indicators

[0198] This example uses a model ablation experiment to compare two model structures: (1) the traditional graph convolutional network model (GCN); (2) the enhanced GCN model FCE-GCN that fused the feature contrast encoder;

[0199] The two models were tested using the same dataset and experimental setup. The test set included 20 faulty samples and 20 healthy samples. Each experiment was repeated ten times, and the average results were used as the basis for the final performance evaluation.

[0200] To comprehensively evaluate the diagnostic performance, the following five indicators were used for quantitative analysis:

[0201] 1) Accuracy: The ratio of the number of samples correctly predicted by the model to the total number of samples;

[0202]

[0203] 2) Precision: The proportion of samples predicted by the model as faulty that are actually faulty;

[0204]

[0205] 3) Recall: The proportion of actual fault samples that are correctly predicted as faults by the model;

[0206]

[0207] 4) F1 Score: The harmonic mean of precision and recall, which measures the overall performance of the model in terms of precision and recall.

[0208]

[0209] 5) Specificity: the proportion of actual healthy samples that are correctly predicted as healthy by the model;

[0210]

[0211] Among them, TP represents the number of samples correctly predicted as faulty; TN represents the number of samples correctly predicted as healthy; FP represents the number of healthy samples mistakenly predicted as faulty; FN represents the number of faulty samples mistakenly predicted as healthy.

[0212] (32) Experimental results analysis and visualization

[0213] In this embodiment, under the above configuration, ten rounds of cross-validation experiments were completed, and the average performance indicators were as follows: Figure 7 As shown in Table 1:

[0214] Table 1 Average evaluation results of ten rounds

[0215]

[0216] The experimental results show that:

[0217] (1) In terms of accuracy, FCE-GCN achieves 94.50%, a significant improvement over GCN’s 84.75%, demonstrating its improvement in overall fault identification capabilities.

[0218] (2) In terms of recall rate, FCE-GCN increased from 72.00% of GCN to 93.00%, significantly reducing the risk of missed detection and improving the model's sensitivity to faulty samples;

[0219] (3) Although the accuracy of FCE-GCN decreases slightly (from 96.64% to 95.88%), this change is mainly due to the model's enhanced tendency to identify faults, which is a reasonable price to pay for the diagnostic fault tolerance mechanism;

[0220] (4) The F1 value increased from 82.52% to 94.42%, indicating that FCE-GCN achieved a better balance between precision and recall;

[0221] (5) The specificity decreased slightly (from 97.50% to 96.00%), but in return, a higher fault detection rate was achieved, which reflects the significant advantages of the method of this embodiment in terms of diagnostic comprehensiveness and robustness.

[0222] Based on the above experimental results, it can be seen that the FCE-GCN method proposed in this embodiment, which integrates feature contrast encoding and graph convolution, has better diagnostic performance and stronger generalization ability when processing battery pack fault data, especially when facing data imbalance and feature similarity problems.

[0223] Example 2:

[0224] This embodiment provides a battery pack fault diagnosis system that integrates feature contrast coding and graph convolutional networks, which is used to implement the above-mentioned battery pack fault diagnosis method that integrates feature contrast coding and graph convolutional networks, including:

[0225] The sample set generation module is used to receive the original voltage sequence of the battery pack and perform preprocessing, generate a sample set using a sliding window algorithm, and divide the sample set into a training set and a test set, where the sample set contains healthy samples and fault samples;

[0226] The feature encoding module is used to construct a feature contrast encoder. The feature contrast encoder is trained based on the training set and the test set until the contrast loss function is minimized. The trained feature contrast encoder is used to encode healthy samples and faulty samples to obtain a discriminative embedded feature representation between healthy and faulty samples.

[0227] The graph convolution fault classification module is used to train a pre-built graph convolutional neural network model. It constructs an adjacency matrix based on the embedded feature representation output by the feature comparison encoder, simulates the temporal correlation structure in the battery pack's original voltage sequence, and models and fuses the relationship between healthy and faulty samples through multi-layer graph convolution to obtain a trained graph convolutional neural network model.

[0228] The recognition output module is used to identify and output battery pack faults based on the trained feature comparison encoder and graph convolutional neural network model.

[0229] Specifically, the above-mentioned sample set generation module, feature encoding module, graph convolution fault classification module and recognition output module can be embedded in a computer processing system. The computer calls the above-mentioned modules to complete the task of battery fault diagnosis based on the above-mentioned battery pack fault diagnosis method that integrates feature comparison encoding and graph convolution network; the above-mentioned sample set generation module, feature encoding module, graph convolution fault classification module and recognition output module can perform operations according to the specific steps given in the battery pack fault diagnosis method that integrates feature comparison encoding and graph convolution network.

[0230] It should be noted that it should be understood that the division of the various modules of the above system is only a division of logical functions. In actual implementation, they can be fully or partially integrated into a physical entity, or they can be physically separated. Moreover, these modules can be implemented in the form of software called by processing elements; or they can be implemented in the form of hardware; or some modules can be implemented in the form of software called by processing elements, and some modules can be implemented in the form of hardware. For example, the sample set generation module can be a separately established processing element, or it can be integrated into a chip of the above device. In addition, it can be stored in the memory of the above device in the form of program code, and called by a processing element of the above device to perform the functions of the above signal processing module. The implementation of other modules is similar. In addition, these modules can be fully or partially integrated together, or they can be implemented independently. The processing element described here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each of the above modules can be completed by the hardware integrated logic circuit in the processor element or by instructions in the form of software.

[0231] For example, the above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application-specific integrated circuits (ASICs), one or more microprocessors (DSPs), or one or more field programmable gate arrays (FPGAs). For another example, when a module is implemented by scheduling program code through a processing element, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).

[0232] Example 3:

[0233] The present invention provides a terminal device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor. The memory stores a computer program capable of running on the processor. When the processor loads and executes the computer program, the battery pack fault diagnosis method of the above-mentioned fusion feature comparison coding and graph convolutional network is adopted.

[0234] It should be noted that the terminal device can be a computer device such as a desktop computer, a laptop computer or a cloud server, and the terminal device includes but is not limited to a processor and a memory. For example, the terminal device can also include input and output devices, network access devices and buses, etc.

[0235] Furthermore, the processor may adopt a central processing unit (CPU). Of course, depending on the actual usage, other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. may also be adopted. The general-purpose processor may adopt a microprocessor or any conventional processor, etc., and this application does not impose any restrictions on this.

[0236] Example 4:

[0237] This embodiment provides a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform the battery pack fault diagnosis method that integrates feature contrast coding and graph convolutional network as described above.

[0238] Among them, the computer program can be stored in a computer-readable medium, the computer program includes computer program code, the computer program code can be in the form of source code, object code, executable file or certain middleware, etc. The computer-readable medium includes any entity or device that can carry computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that computer-readable medium includes but is not limited to the above-mentioned components.

[0239] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that includes a list of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus.

[0240] For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to the specific circumstances. When an element is referred to as being "assembled on", "installed on", "fixed on" or "set on" another element, it can be directly on the other element or there can be a central element. When an element is considered to be "connected" to another element, it can be directly connected to the other element or there can be a central element at the same time. The terms "vertical", "horizontal", "up", "down", "left", "right" and similar expressions used herein are for illustrative purposes only and are not intended to be the only embodiment.

[0241] While embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions, and variations may be made to these embodiments without departing from the principles and spirit of the invention, and that the scope of the invention is defined by the appended claims and their equivalents.

[0242] Throughout this specification, references to terms such as "one embodiment," "example," or "specific example" indicate that a specific feature, structure, material, or characteristic described in conjunction with that embodiment or example is included in at least one embodiment or example of the present disclosure. In this specification, schematic representations of these terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.

Claims

1. A battery pack fault diagnosis method integrating feature contrast coding and graph convolutional network, characterized in that: The following steps are involved: Receive the original voltage sequence of the battery pack and perform preprocessing. Use the sliding window algorithm to generate a sample set, which is divided into a training set and a test set. The sample set contains healthy samples and fault samples. Construct a feature contrast encoder and train it based on the training set and the test set until the contrast loss function is minimized. The trained feature contrast encoder is used to encode healthy samples and faulty samples to obtain a discriminative embedded feature representation between the healthy and faulty samples. The pre-built graph convolutional neural network model is trained to construct an adjacency matrix based on the embedded feature representation output by the feature contrast encoder. This simulates the temporal correlation structure in the battery pack's original voltage sequence and models and fuses the relationship between healthy and faulty samples through multi-layer graph convolution. Battery pack faults are identified and output based on the trained feature comparison encoder and graph convolutional neural network model.

2. The battery pack fault diagnosis method integrating feature contrast coding and graph convolutional network according to claim 1 is characterized in that: Receive the original battery pack voltage sequence and perform preprocessing, and use the sliding window algorithm to generate a sample set, as follows: (21) The original voltage sequence of the battery pack is converted into a standard input format for model training, and a sliding window method is used for sample generation: Assume that the length of the health data sequence is L healthy , the length of the fault data sequence is L fault ,, the length of a single sample is set to l; the goal is to extract N fault samples, extract N from the healthy sequence healthy Samples: To achieve uniform sampling, the sampling window step size of the fault and healthy sequences is defined as Δ fault With Δ healthy as follows: The starting index fault set S of the sampling window fault With Health Collection S healthy As shown below: Fault sample starting index as follows: Healthy sample starting index as follows: (22) Time series sample construction and training set generation For each starting index, from the complete fault data fault Data sequence and complete health sequence data healthy Extract the data segment of length l, the fault sample as follows: Where i = 1, 2, ..., N fault , the healthy samples are Where j = 1, 2, ..., N healthy .

3. The battery pack fault diagnosis method integrating feature contrast coding and graph convolutional network according to claim 2 is characterized in that: The division ratio of the training set to the test set is 1:

5.

4. The battery pack fault diagnosis method integrating feature contrast coding and graph convolutional network according to claim 2 is characterized in that: Construct a feature contrast encoder and train it based on the training set and the test set until the contrast loss function is minimized. The trained feature contrast encoder is used to encode healthy samples and faulty samples to obtain discriminative embedded feature representations between healthy and faulty samples, as follows: (41) Assume that the training set samples are in Represents the feature vector of the i-th sample, y i ∈{0,1} is a binary classification label, which is converted into a matrix form to adapt to the input requirements of the deep neural network: (42) A two-layer fully connected neural network is used for feature transformation, where the first layer includes linear mapping and ReLU activation, and the second layer outputs the embedded feature vector: In the formula and is the encoding output of the first and second layers, W (1) and W (2) Represent the weight matrices of the first and second layers respectively, b (1) and b (2) are the bias items of the first and second layers respectively; (43) A contrast loss function based on cosine similarity is introduced to achieve feature space separation by maximizing the feature distance between samples of different categories: Among them, a·b represents the dot product of vectors a and b, ||a||2 and ||b||2 represent the bi-norm of vectors a and b respectively. and Represent the encoding feature representation of healthy and faulty samples respectively, N s To balance the number of sampling samples; (44) The Adam optimizer is used for training, and the optimization goal is to minimize the contrast loss: where θ encoder represents all trainable parameters in the feature contrast encoder; η is the learning rate; represents the gradient of the contrastive loss function with respect to the encoder parameters; L contrastive It is a contrast loss function based on cosine similarity, which is used to enhance the discrimination of samples of different categories in the feature space.

5. The battery pack fault diagnosis method integrating feature contrast coding and graph convolutional network according to claim 4 is characterized in that: The pre-built graph convolutional neural network model is trained. An adjacency matrix is constructed based on the embedded feature representation output by the feature comparison encoder. The temporal correlation structure in the original voltage sequence of the battery pack is simulated. The relationship between healthy and faulty samples is modeled and integrated through multi-layer graph convolution to obtain the trained graph convolutional neural network model. The details are as follows: (51) Using the sample feature Z output by the encoder train , construct the adjacency matrix A that reflects the temporal dependency train Represents the adjacency relationship between the i-th sample and the j-th sample in the training set: (52) A neural network structure with three layers of graph convolution is designed to perform multi-layer graph domain abstraction and fusion of encoded features. The forward propagation process is as follows: A (1) =Dropout(ReLU(A train Z train W (1) ),p=0.3) A (2) =Dropout(ReLU(A train A (1) W (2) ),p=0.3) H (3) =A train H (2) W (3) Where Z train is the input encoding feature matrix, that is, the output of the previous stage comparison encoder; W (1) 、W (2) 、W (3) are the trainable weight matrices of the first, second, and third layers of graph convolution respectively; H (1) 、H (2) 、H (3) Represent the output features of each graph convolution layer respectively; Dropout means random dropout operation; (53) The final output is normalized by the Softmax function to obtain the classification probability of each sample: (54) Cross entropy is used as the classification loss function: (55) The Adam optimizer is used to optimize the network parameters with a learning rate of η = 0.01 Perform backpropagation update: (56) The classification accuracy is calculated as follows to quantify the performance of the model on the training or test set: Among them, δ(a,b) is the indicator function, which takes 1 when a=b and 0 otherwise; (57) After the training is completed, in the testing phase, the adjacency matrix A of the test set samples is constructed in the same way as the training process. test , and use the trained encoder to train the test data X test Perform feature transformation to obtain the corresponding embedding representation Z test , and then compare it with A test Input the graph convolutional network together and obtain the final prediction result through the forward propagation process 6. A battery pack fault diagnosis system integrating feature contrast coding and graph convolutional network, used to implement the battery pack fault diagnosis method integrating feature contrast coding and graph convolutional network according to any one of claims 1 to 5, characterized in that: include: The sample set generation module is used to receive the original voltage sequence of the battery pack and perform preprocessing, generate a sample set using a sliding window algorithm, and divide the sample set into a training set and a test set, where the sample set contains healthy samples and fault samples; The feature encoding module is used to construct a feature contrast encoder. The feature contrast encoder is trained based on the training set and the test set until the contrast loss function is minimized. The trained feature contrast encoder is used to encode healthy samples and faulty samples to obtain a discriminative embedded feature representation between healthy and faulty samples. The graph convolution fault classification module is used to train a pre-built graph convolutional neural network model. It constructs an adjacency matrix based on the embedded feature representation output by the feature comparison encoder, simulates the temporal correlation structure in the battery pack's original voltage sequence, and models and fuses the relationship between healthy and faulty samples through multi-layer graph convolution to obtain a trained graph convolutional neural network model. The recognition output module is used to identify and output battery pack faults based on the trained feature comparison encoder and graph convolutional neural network model.

7. A terminal device comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that: The memory stores a computer program that can be run on a processor. When the processor loads and executes the computer program, the battery pack fault diagnosis method of the fusion feature contrast coding and graph convolutional network described in any one of claims 1 to 5 is adopted.

8. A storage medium containing computer-executable instructions, characterized in that: When executed by a computer processor, the computer executable instructions are used to perform the battery pack fault diagnosis method of integrating feature contrast coding and graph convolutional network as described in any one of claims 1 to 5.

Citation Information

Cited By

  • Motor fault diagnosis method and system based on hybrid graph neural network and path graph

    CN120873764A

  • Battery system fault identification method and system based on time sequence contrast learning encoder

    CN120892801A

  • Battery system fault identification method and system based on time sequence contrast learning encoder

    CN120892801B