A charging pile fault detection method based on probabilistic sparse self-attention mechanism

Through the probability sparse self-attention mechanism and Dingo optimization algorithm, the problem of inadequate accuracy and speed in the fault diagnosis of electric vehicle charging piles is solved, efficient and accurate fault identification is achieved, and the time and time of fault diagnosis of electric vehicle charging piles is reduced. cost.

CN118821031BActive Publication Date: 2025-01-10国网(山东)电动汽车服务有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411303142.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-19
Publication Date
2025-01-10
Estimated Expiration
2044-09-19

AI Technical Summary

Technical Problem

The prior art has problems such as inappropriate diagnostic accuracy and speed, long diagnosis time, and difficulty in data acquisition in the fault diagnosis of electric vehicle charging piles, making it difficult to effectively identify the fault type of charging piles.

Method used

The fault detection method of charging piles based on the probability sparse self-attention mechanism is adopted, and hyperparameters are selected through the Dingo optimization algorithm. The self-attention mechanism is used to convert the output voltage into a high-dimensional vector, and the fault information characteristics are extracted, model training and fault diagnosis are carried out to improve The learning ability and accuracy of the model are achieved.

Benefits of technology

It significantly improves the accuracy of fault diagnosis, reduces diagnosis time, reduces the generalization cost of the model, and ensures the accuracy and efficiency of fault diagnosis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118821031B_ABST
    Figure CN118821031B_ABST
Patent Text Reader

Abstract

The present invention proposes a charging pile fault detection method based on a probabilistic sparse self-attention mechanism, which belongs to the technical field of charging piles and includes the following steps: S1: simulating common fault types of charging piles; S2: the input layer converts the input voltage value sequence into a high-dimensional vector that can be processed by the encoding layer of the model; S3: the encoding layer of the model obtains the correlation score between different input variables through the self-attention mechanism; S4: the characteristic extraction layer of the model analyzes the pointer vector to obtain the fault type, and compares the fault type with the known fault information; S5: input the voltage data of the charging pile, and analyze the output pointer vector as a feature criterion to obtain the diagnosis result. The charging pile fault detection method based on the probabilistic sparse self-attention mechanism proposed by the present invention can autonomously obtain relatively accurate hyperparameter values, reduce the generalization cost of the model, effectively reduce the time of fault diagnosis, and ensure the accuracy of the model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of charging piles, and in particular relates to a charging pile fault detection method based on a probabilistic sparse self-attention mechanism. Background Art

[0002] With the increasing maturity of power batteries and fast charging technology, electric vehicles have made great progress and have become an important part of the automobile market. Electric vehicles use electrical energy converted into mechanical energy as power, replacing traditional fossil energy, thereby reducing dependence on non-renewable energy, reducing carbon dioxide emissions, and benefiting environmental protection.

[0003] In the process of electric vehicle development, the fault and safety issues of charging equipment have become increasingly prominent, thus affecting the user experience. This not only increases the maintenance cost and difficulty of charging piles, but also brings great difficulties to the popularization of electric vehicles. Therefore, improving the fault diagnosis technology of charging piles is of great significance to the maintenance, safe operation and development of charging piles.

[0004] As the types of charging pile faults become more diverse, traditional manual diagnosis becomes more difficult, which has led people to gradually conduct research in the field of artificial intelligence, and proposed methods such as linear neural networks and hidden Markov models. Although the above studies have optimized the methods of DC charging pile fault diagnosis, the above methods have problems such as poor adaptation of diagnostic accuracy and diagnostic speed, long diagnostic time, and difficulty in data acquisition. Summary of the invention

[0005] In order to solve the above problems existing in the prior art, a charging pile fault detection method based on probabilistic sparse self-attention mechanism is provided.

[0006] The technical solution adopted by the present invention to solve its technical problem is:

[0007] This technical solution proposes a charging pile fault detection method based on a probabilistic sparse self-attention mechanism, comprising the following steps:

[0008] S1: Simulate common fault types of charging piles, obtain the output voltage of the charging piles, select hyperparameters based on the Dingo optimization algorithm, and input the obtained hyperparameters into the model;

[0009] S2: Arrange the output voltages obtained in S1 in chronological order, and use the output voltages of various fault forms as the multi-dimensional input sequence of the model, and input them into the input layer of the model. The input layer converts the input voltage value sequence into a high-dimensional vector that can be processed by the encoding layer of the model.

[0010] S3: By converting the high-dimensional vector output by the input layer of the model into Q, K, V matrices, the encoding layer of the model obtains the correlation scores between different input variables through the self-attention mechanism, and the correlation scores obtain the pointer vector containing the fault information features;

[0011] S4: The feature extraction layer of the model analyzes the pointer vector to obtain the fault type, compares the fault type with the known fault information, and modifies the trainable parameters through the back propagation layer of the model according to the result to realize the training of the model;

[0012] S5: Deploy the trained model, input the voltage data of the charging pile, analyze the output pointer vector as a feature criterion, and obtain the diagnosis result of the charging pile fault.

[0013] Preferably, in S1, the fault types include control element fault, open circuit fault of a single power device and open circuit fault of two power devices.

[0014] Preferably, in S2, the embedding layer of the model converts the original voltage value sequence into a high-dimensional vector through equations (1) and (2), and the formula is as follows:

[0015] (1);

[0016] (2);

[0017] In the formula, represents the positional coding sequence, Indicates the position of an element in a sequence. is the hidden layer size.

[0018] Preferably, in S2, the input layer includes an embedding layer and a linear layer. The embedding layer is the starting layer of the model structure. The high-dimensional vector contains the short-term features in the original input sequence. The embedding layer uses sine and cosine functions to encode the position of the input vector. The encoded input vector contains its own sequence feature information and position feature information. After that, the sequence features are mapped to a set of high-dimensional vectors through linear layer training as the input of the feature extraction layer.

[0019] Preferably, in S3, the first i The distribution of key vectors under query vectors gives the corresponding relevance score. The formula is as follows:

[0020] (3);

[0021] In the formula, For the i indivual vector, For the i indivual k vector, For the i indivual q Vector Next j indivual k Probability of a vector;

[0022] The relevance score is converted into a probability form through the softmax function, and then the result is weighted and summed with the value vector to obtain the output sequence.

[0023] Preferably, based on the distribution form calculated by formula (3), if the distribution form is uniform, it is eliminated; if the fluctuation of the distribution form exceeds a threshold, it is retained.

[0024] Preferably, the similarity of the distribution form is measured by KL divergence, and the KL divergence between the distribution of the key value under the condition of the i-th query vector and the uniform distribution is calculated to obtain the sparsity of each query vector. The KL divergence value calculation formula is as follows:

[0025] (4);

[0026] In the formula, For the i indivual vector, For the l indivual k vector, and are two trainable parameters.

[0027] Preferably, the feature extraction layer includes an encoding layer and a decoding layer. The encoding layer processes the feature matrices Q, K, and V of the input vector through a multi-head attention mechanism to obtain attention values, and then realizes sequence prediction through the attention values. A mask layer is added to the input of the decoding layer of the model. The mask layer replaces the sequence to be predicted with an empty sequence, and the decoding layer predicts the sequence.

[0028] Preferably, the regression layer of the model converts the sequence of feature extraction completed by the decoding layer into a pointer vector that can be used to judge the fault type. The sequence output by the decoding layer is in the form of a high-dimensional vector, which is mapped into a two-dimensional pointer vector through a linear layer, and the fault type is judged through the two dimensions of the pointer vector.

[0029] Compared with the prior art, the present invention has the following advantages:

[0030] This application greatly improves the learning ability of the model through the probabilistic sparse self-attention mechanism. At the same time, the overall model structure of the encoding layer and the decoding layer is less likely to experience gradient vanishing or gradient explosion compared to the linear structure, which effectively improves the fault diagnosis accuracy. The Dingo optimization algorithm is used to self-optimize the hyperparameters of the model. The model can autonomously obtain more accurate hyperparameter values, which reduces the generalization cost of the model, effectively reduces the time of fault diagnosis, and ensures the model accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:

[0032] Figure 1 It is the overall flow chart of the present invention;

[0033] Figure 2 It is a structural diagram of the charging pile fault diagnosis model in the present invention;

[0034] Figure 3 It is a flowchart of the Dingo optimization algorithm in the present invention. DETAILED DESCRIPTION

[0035] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.

[0036] like Figure 1-Figure 3 As shown, this embodiment proposes a charging pile fault detection method based on a probabilistic sparse self-attention mechanism, comprising the following steps:

[0037] S1: Simulate common fault types of charging piles, obtain the output voltage of the charging piles, select hyperparameters based on the Dingo optimization algorithm, and input the obtained hyperparameters into the model;

[0038] S2: Arrange the output voltages obtained in S1 in chronological order, and use the output voltages of various fault forms as the multi-dimensional input sequence of the model, and input them into the input layer of the model. The input layer converts the input voltage value sequence into a high-dimensional vector that can be processed by the encoding layer of the model.

[0039] S3: By converting the high-dimensional vector output by the input layer of the model into Q, K, V matrices, the encoding layer of the model obtains the correlation scores between different input variables through the self-attention mechanism, and the correlation scores obtain the pointer vector containing the fault information features;

[0040] S4: The feature extraction layer of the model analyzes the pointer vector to obtain the fault type, compares the fault type with the known fault information, and modifies the trainable parameters through the back propagation layer of the model according to the result to realize the training of the model;

[0041] S5: Deploy the trained model, input the voltage data of the charging pile, analyze the output pointer vector as a feature criterion, and obtain the diagnosis result of the charging pile fault.

[0042] In S1, by analyzing the possible fault types of the charging pile, the most common charging pile fault type is obtained as the basis for fault diagnosis. At the same time, an artificial fault is used to create a charging pile voltage output signal containing a fault signal. This part of the data is used to train the built model. After the training is completed, the model parameters are saved and the model can be used to detect such faults.

[0043] Since the probabilistic sparse self-attention mechanism has a strong analytical ability for time series information, and the voltage signal output by the charging pile can be regarded as a time series signal, this method can accurately analyze the fault feature information and identify the fault category.

[0044] Operation experience and statistics of charging pile failures show that the open circuit failure of the power device of the charging pile is the most serious failure in the charging pile. Among them, the open circuit failure of a single power device and the open circuit failure of two power devices are the most common.

[0045] Since there are many control schemes for PWM rectifiers, control component failures are also common. The output voltage waveforms of different faults are quite variable, and it is impossible to accurately judge the fault type by the waveform directly. Therefore, this method has a high applicability.

[0046] Therefore, the fault types mainly include control element failure, open circuit failure of a single power device and open circuit failure of two power devices.

[0047] In order to achieve the best prediction effect, some hyperparameters of the network model need to be tuned in practical applications. Different target input sequences have certain differences in feature complexity, sequence length, and noise interference intensity. Therefore, the hyperparameters that determine the model's explanatory power will affect the accuracy of the model's prediction.

[0048] Dingo algorithm is an optimization algorithm. Its framework is similar to that of Gray Wolf Algorithm. Their position update method is basically the same as the optimal solution search method. However, Gray Wolf Algorithm does not have a greedy mechanism, so the convergence speed is slow. Dingo algorithm combines Gray Wolf Algorithm with genetic algorithm, adds optimization mechanism to improve the convergence speed of the algorithm, and in order to maintain the search ability of the original algorithm and avoid falling into the local optimal solution, Dingo algorithm adds some other position update methods.

[0049] In this example, the three hyperparameters n-heads, d-model, and c-out have a greater impact on the model accuracy. Taking the three model hyperparameters n-heads, d-model, and c-out as optimization objects, the optimal solutions for these three hyperparameters in the current data set can be obtained.

[0050] In S2, the embedding layer of the model converts the original voltage value sequence into a high-dimensional vector through equations (1) and (2), as follows:

[0051] (1);

[0052] (2);

[0053] In the formula, represents the positional coding sequence, Indicates the position of an element in a sequence. is the hidden layer size.

[0054] In S2, the input layer includes an embedding layer and a linear layer. The embedding layer is the starting layer of the model structure. The attention mechanism is mainly implemented by the encoding and decoding layer, and the embedding layer needs to convert the input voltage value sequence into a high-dimensional vector that can be processed by the encoding layer.

[0055] The input time series will be converted into a set of input vectors through a sliding time window. The embedding layer will re-encode the input vector into a set of 512-dimensional vectors. The high-dimensional vector contains the short-term features of the original input sequence. The embedding layer uses sine and cosine functions to encode the position of the input vector. The encoded input vector contains its own sequence feature information and position feature information. After that, the sequence features are mapped to a set of high-dimensional vectors through linear layer training as the input of the feature extraction layer.

[0056] Since the attention mechanism provides a retrieval table of correlation, changing the position of any two elements in the table has no effect on the value in the table, only the position of the value is changed. Therefore, the attention mechanism cannot extract the position relationship features in the input sequence and cannot capture the long-term features of the original input sequence well. The embedding layer needs to provide the position information between the input vectors for subsequent calculations, so the sine and cosine functions can be used to encode the position of the input vector.

[0057] In S3, the first i The distribution of key vectors under query vectors gives the corresponding relevance score. The formula is as follows:

[0058] (3);

[0059] In the formula, For the i indivual vector, For the i indivual k vector, For the i indivual q Vector Next j indivual k Probability of a vector;

[0060] The relevance score is converted into a probability form through the softmax function, and then the result is weighted and summed with the value vector to obtain the output sequence.

[0061] Based on the distribution form calculated by formula (3), if the distribution form is uniform, it proves that the query vector is lazy and cannot contribute to the effective attention value, so it is eliminated. If the fluctuation of the distribution form exceeds the threshold, it proves that the query vector has a large contribution to the calculation of the attention value, so it is retained. In this way, effective query vectors can be quickly screened out.

[0062] The KL divergence is used to measure the similarity of the distribution form. The KL divergence between the distribution of the key value under the condition of the i-th query vector and the uniform distribution is calculated to obtain the sparsity of each query vector. The KL divergence value calculation formula is as follows:

[0063] (4);

[0064] In the formula, For the i indivual vector, For the l indivual k vector, and are two trainable parameters.

[0065] By using a deep learning model with a probabilistic sparse self-attention mechanism as the core, the model architecture adopts an encoding layer-decoding layer architecture. The overall structure of the model can be divided into an input layer, a feature extraction layer, and a regression layer. Its structure is as follows Figure 2 As shown, Figure 2 It is a structural diagram of the charging pile fault diagnosis model in the present invention.

[0066] The feature extraction layer includes an encoding layer and a decoding layer. The encoding layer processes the feature matrices Q, K, and V of the input vector through a multi-head attention mechanism to obtain attention values, and then uses the attention values ​​to achieve sequence prediction. A mask layer is added to the input of the decoding layer of the model. The mask layer replaces the sequence to be predicted with an empty sequence, and the decoding layer predicts the sequence.

[0067] The encoding layer is the core part of feature extraction. The feature matrices Q, K, and V of the input vector are processed through the multi-head attention mechanism to obtain the attention value, and then the sequence prediction is realized through the attention value. In the traditional self-attention implementation, for each input vector, its query vector is dot-producted with the key vector of each input vector to obtain the corresponding relevance score. The relevance score is converted into a probability form through softmax, and then the result is weighted and summed with the value vector to obtain the output sequence.

[0068] The structure of the decoding layer is basically the same as that of the encoding layer. When performing sample training, the decoding layer needs to predict the sequence. Since the attention mechanism is based on global perception, all input sequences are known information to the model. Therefore, a mask layer needs to be added to the input to replace the sequence to be predicted with an empty sequence.

[0069] When calculating the self-attention value, the query vector of each encoded input vector must be inner-producted with the key vector of all input vectors. If the length of the original input sequence is long, the amount of calculation at the encoding layer will be too large, affecting the operating efficiency of the model. Therefore, the probabilistic sparse self-attention mechanism improves the attention mechanism based on the self-attention mechanism.

[0070] In fact, for each query vector, not every key vector has a strong correlation with it. Experiments have shown that most query vectors have no correlation with key vectors, and their inner product values ​​are close to 0. Therefore, the calculation of this part is meaningless. The probabilistic sparse self-attention mechanism uses this phenomenon to optimize self-attention. If a valid pairing can be found in all sequence pairings, the amount of calculation of the attention mechanism can be effectively reduced.

[0071] The regression layer of the model converts the sequence of feature extraction completed by the decoding layer into a pointer vector that can be used to judge the fault type. The sequence output by the decoding layer is in the form of a high-dimensional vector. A linear layer maps the high-dimensional vector into a two-dimensional pointer vector, and the fault type is judged through the two dimensions of the pointer vector.

[0072] The probabilistic sparse self-attention mechanism improves the attention mechanism on the basis of the self-attention mechanism. It screens the q vector in the self-attention calculation and finds valid pairs in all q and k vector sequence pairs, effectively reducing the amount of calculation of the attention mechanism. At the same time, it reduces the impact of irrelevant quantities on the attention value and improves the prediction accuracy of the model.

[0073] There are various types of faults in charging piles, and currently most of them are diagnosed by heuristic optimization algorithms. The deep neural network method has the advantages of strong learning ability and wide application. However, linear neural networks may have problems of gradient vanishing or gradient explosion when processing long time series, which affects the judgment accuracy of the model. The neural network model is easily affected by the initial parameters and has high requirements for the hyperparameter restrictions of the model.

[0074] The overall model structure of encoding layer and decoding layer is less likely to have gradient vanishing or gradient exploding phenomena than linear structure, and is less likely to cause error accumulation, which effectively improves the fault diagnosis accuracy. The Dingo optimization algorithm is used to self-optimize the model's hyperparameters. The model can autonomously obtain more accurate hyperparameter values, which reduces the generalization cost of the model, effectively reduces the time of fault diagnosis, and ensures the model accuracy.

[0075] Although the 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 the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.

Claims

1. A charging pile fault detection method based on probabilistic sparse self-attention mechanism, characterized in that: The following steps are involved: S1: Simulate common fault types of charging piles, obtain the output voltage of the charging piles, select hyperparameters based on the Dingo optimization algorithm, and input the obtained hyperparameters into the model; S2: Arrange the output voltages obtained in S1 in chronological order, and use the output voltages of various fault forms as the multi-dimensional input sequence of the model, and input them into the input layer of the model. The input layer converts the input voltage value sequence into a high-dimensional vector that can be processed by the encoding layer of the model. S3: By converting the high-dimensional vector output by the input layer of the model into Q, K, V matrices, the encoding layer of the model obtains the correlation scores between different input variables through the self-attention mechanism, and the correlation scores obtain the pointer vector containing the fault information features; S4: The feature extraction layer of the model analyzes the pointer vector to obtain the fault type, compares the fault type with the known fault information, and modifies the trainable parameters through the back propagation layer of the model according to the result to realize the training of the model; S5: deploy the trained model, input the voltage data of the charging pile, analyze the output pointer vector as a feature criterion, and obtain the diagnosis result of the charging pile fault; The Dingo algorithm combines the gray wolf algorithm with the genetic algorithm, adds an optimization mechanism, and takes the three model hyperparameters of n-heads, d-model, and c-out as optimization objects to obtain the optimal solutions of these three hyperparameters in the current data set; In S1, the fault types include control element fault, open circuit fault of a single power device and open circuit fault of two power devices; In S2, the embedding layer of the model converts the original voltage value sequence into a high-dimensional vector through equations (1) and (2), and the formula is as follows: (1); (2); In the formula, represents the positional coding sequence, Indicates the position of an element in a sequence. is the hidden layer size; In S2, the input layer includes an embedding layer and a linear layer. The embedding layer is the starting layer of the model structure. The high-dimensional vector contains the short-term features in the original input sequence. The embedding layer uses sine and cosine functions to encode the position of the input vector. The encoded input vector contains its own sequence feature information and position feature information. After that, the sequence features are mapped to a set of high-dimensional vectors through linear layer training as the input of the feature extraction layer; In S3, the first i The distribution of key vectors under query vectors gives the corresponding relevance score. The formula is as follows: (3); In the formula, For the i indivual vector, For the i indivual k vector, For the i indivual q Vector Next j indivual k Probability of a vector; The relevance score is converted into a probability form through the softmax function, and then the result is weighted and summed with the value vector to obtain the output sequence; Based on the distribution form calculated by formula (3), if the distribution form is uniform, it will be eliminated; if the fluctuation of the distribution form exceeds the threshold, it will be retained; The KL divergence is used to measure the similarity of the distribution form. The KL divergence between the distribution of the key value under the condition of the i-th query vector and the uniform distribution is calculated to obtain the sparsity of each query vector. The KL divergence value calculation formula is as follows: (4); In the formula, For the i indivual vector, For the l indivual k vector, and are two trainable parameters; The feature extraction layer includes an encoding layer and a decoding layer. The encoding layer processes the feature matrices Q, K, and V of the input vector through a multi-head attention mechanism to obtain attention values, and then realizes sequence prediction through the attention values. A mask layer is added to the input of the decoding layer of the model. The mask layer replaces the sequence to be predicted with an empty sequence, and the decoding layer predicts the sequence. The regression layer of the model converts the sequence of feature extraction completed by the decoding layer into a pointer vector that can be used to judge the fault type. The sequence output by the decoding layer is in the form of a high-dimensional vector. A linear layer maps the high-dimensional vector into a two-dimensional pointer vector, and the fault type is judged through the two dimensions of the pointer vector.

Citation Information

Patent Citations

  • Train bogie fault long-time prediction method based on Informer

    CN118114089A

  • Track geometric irregularity and vehicle vertical acceleration fitting method and device

    CN118468009A