Charging pile fault detection method, device, equipment, storage medium and product
Patent Information
- Application Number
- CN202510731243.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-03
- Publication Date
- 2026-09-08
- Estimated Expiration
- 2045-06-03
AI Technical Summary
[0005]本发明的主要目的在于提供一种充电桩故障检测方法、装置、设备、存储介质及产品,旨在解决现有技术中充电桩故障检测误报率较高,容易漏检隐蔽故障的技术问题
[0052]This invention discloses a method for acquiring a power dataset of a charging pile to be detected, which includes historical power datasets and current power data; calculating multimodal dynamic health indicators in the power dataset; generating time-series feature data of the dynamic health indicators; and inputting the time-series feature data into a trained power data fault level classification model for charging pile fault detection to obtain a fault detection report. Compared with existing technologies, this invention improves the accuracy of fault classification by capturing short-term trends of multimodal power data through convolutional neural network layers, mining global dependencies of time-series data through bidirectional long short-term memory layers to extract long-term trends, and finally calculating the correlation between time steps through multi-head attention layers. This improves the accuracy and breadth of charging pile fault identification and avoids the technical problems of high false alarm rates and easy omission of hidden faults in existing technologies.
Smart Images

Figure CN120654091B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of fault detection technology, and in particular to methods, devices, equipment, storage media and products for detecting faults in charging piles. Background Technology
[0002] Traditional methods in the field of charging pile fault diagnosis mainly rely on rule-based thresholding and single machine learning models. Rule-based thresholding refers to manually setting upper and lower limits for parameters such as voltage, current, and power. When the parameters exceed the preset range, an alarm is triggered. This method is simple and easy to implement, but its significant shortcoming is that it cannot adapt to dynamically changing charging conditions.
[0003] The operating status of charging piles may fluctuate significantly under different climatic conditions and load levels. A single fixed threshold is insufficient to effectively distinguish between normal fluctuations and abnormal faults, resulting in a high false alarm rate and making it easy to miss hidden faults.
[0004] The above content is only used to help understand the technical solution of the present invention and does not represent an admission that the above content is prior art. Summary of the Invention
[0005] The main objective of this invention is to provide a method, device, equipment, storage medium, and product for detecting charging pile faults, aiming to solve the technical problems of high false alarm rate and easy omission of hidden faults in the existing technology of charging pile fault detection.
[0006] To achieve the above objectives, the present invention provides a method for detecting faults in charging piles, the method comprising the following steps:
[0007] Obtain the power dataset of the charging pile to be detected, which includes historical power datasets and current power data;
[0008] Calculate the multimodal dynamic health indicators in the power dataset;
[0009] Generate time-series feature data of the dynamic health indicators;
[0010] The time series feature data is input into a trained power data fault level classification model to detect charging pile faults and obtain a fault detection report.
[0011] The trained power data fault level classification model includes a convolutional neural network layer, a bidirectional long short-term memory layer, a multi-head attention layer, a global average pooling layer, and a fully connected output layer, which are connected sequentially.
[0012] Optionally, the step of inputting the time-series feature data into a trained power data fault level classification model for charging pile fault detection and obtaining a fault detection report includes:
[0013] The time series feature data is input into the convolutional neural network layer to extract power features, resulting in a power data feature map.
[0014] The power data feature map is input into the bidirectional long short-term memory layer to calculate the temporal features of each time step;
[0015] The time series features are input into the multi-head attention layer to obtain the target attention matrix;
[0016] A one-dimensional vector is obtained by concatenating the target attention matrix and the temporal features of each time step through the global average pooling layer.
[0017] The fault level of each fault type is determined by passing the one-dimensional vector through the fully connected layer.
[0018] A fault detection report is generated based on the fault type and fault level.
[0019] Optionally, the bidirectional long short-term memory layer includes: a forward long short-term memory layer and a reverse long short-term memory layer. The forward long short-term memory layer includes at least: a forward input gate representation, a forward output gate representation, a forward forget gate representation, and a forward memory cell module. The reverse long short-term memory layer includes at least: a reverse input gate representation, a reverse output gate representation, a reverse forget gate representation, and a reverse memory cell module.
[0020] The step of inputting the power data feature map into the bidirectional long short-term memory layer to calculate the time-series features at each time step includes:
[0021] Calculate the forward hidden state based on the forward long short-term memory layer;
[0022] The forward output temporal features are calculated based on the forward input gate representation, forward output gate representation, forward forget gate representation, forward memory cell module, and forward hidden state of the forward long short-term memory layer.
[0023] Calculate the reverse hidden state based on the reverse long short-term memory layer;
[0024] The reverse output timing features are calculated based on the reverse input gate representation, the reverse output gate representation forward, the reverse forget gate representation of the reverse long short-term memory layer, the reverse memory cell module, and the reverse hidden state.
[0025] The timing features for each time step are generated based on the sum of the forward output timing features and the backward output timing features.
[0026] Optionally, the step of inputting the time series features into the multi-head attention layer to obtain the target attention matrix includes:
[0027] Determine the sequence length and feature dimension of the time series feature;
[0028] A linear transformation is performed on the time series features to obtain a query matrix, a key matrix, and a value matrix.
[0029] Calculate the dot product of the query matrix and the key matrix to obtain the attention score matrix;
[0030] The attention score matrix is normalized using the softmax function to obtain the attention weight matrix;
[0031] Generate an attention matrix corresponding to a single attention head based on the attention weight matrix and the value matrix;
[0032] The attention matrices of each attention head are concatenated, and the concatenated attention matrix is linearly transformed to obtain the target attention matrix.
[0033] Optionally, determining the fault level of each fault type based on the one-dimensional vector through the fully connected layer includes:
[0034] Extract the four elements from the one-dimensional vector;
[0035] The number of the four elements exceeding the limit is determined according to a preset standard threshold, which is used to characterize the standard health indicators under each fault type.
[0036] The fault level corresponding to each fault type is determined based on the number of times the limit is exceeded.
[0037] Optionally, the dynamic health indicators include: voltage fluctuation rate, power anomaly index, harmonic distortion rate, and load fluctuation intensity;
[0038] The time-series feature data for generating the dynamic health indicator includes:
[0039] A dynamic health index array is generated based on the voltage fluctuation rate, power anomaly index, harmonic distortion rate, and load fluctuation intensity.
[0040] Divide the data processing window into fixed lengths based on the preset window length and sliding step size;
[0041] Calculate the dynamic health indicator array corresponding to each data processing window to obtain multiple sets of dynamic health indicator arrays;
[0042] Determine the charging pile status at the end of each data processing window;
[0043] The labels of each group of dynamic health indicator arrays are updated according to the status of the charging piles to obtain time series feature data.
[0044] Furthermore, to achieve the above objectives, the present invention also proposes a charging pile fault detection device, the charging pile fault detection device comprising:
[0045] The acquisition module is used to acquire the power dataset of the charging pile to be detected, which includes historical power datasets and current power data;
[0046] A calculation module is used to calculate multimodal dynamic health indicators in the power dataset;
[0047] The generation module is used to generate the time-series feature data of the dynamic health indicators;
[0048] The detection module is used to input the time series feature data into the trained power data fault level classification model to detect charging pile faults and obtain a fault detection report.
[0049] In addition, to achieve the above objectives, the present invention also proposes a charging pile fault detection device, which includes: a memory, a processor, and a charging pile fault detection program stored in the memory and executable on the processor. The charging pile fault detection program is configured to implement the steps of the charging pile fault detection method described above.
[0050] In addition, to achieve the above objectives, the present invention also proposes a storage medium storing a charging pile fault detection program, which, when executed by a processor, implements the steps of the charging pile fault detection method described above.
[0051] In addition, to achieve the above objectives, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the charging pile fault detection method described above.
[0052] This invention discloses a method for acquiring a power dataset of a charging pile to be detected, which includes historical power datasets and current power data; calculating multimodal dynamic health indicators in the power dataset; generating time-series feature data of the dynamic health indicators; and inputting the time-series feature data into a trained power data fault level classification model for charging pile fault detection to obtain a fault detection report. Compared with existing technologies, this invention improves the accuracy of fault classification by capturing short-term trends of multimodal power data through convolutional neural network layers, mining global dependencies of time-series data through bidirectional long short-term memory layers to extract long-term trends, and finally calculating the correlation between time steps through multi-head attention layers. This improves the accuracy and breadth of charging pile fault identification and avoids the technical problems of high false alarm rates and easy omission of hidden faults in existing technologies. Attached Figure Description
[0053] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0054] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0055] Figure 1 This is a flowchart illustrating the first embodiment of the charging pile fault detection method of the present invention;
[0056] Figure 2 This is a flowchart illustrating the second embodiment of the charging pile fault detection method of the present invention;
[0057] Figure 3 This is a structural block diagram of the first embodiment of the charging pile fault detection device of the present invention;
[0058] Figure 4 This is a schematic diagram of the structure of a charging pile fault detection device in the hardware operating environment involved in the embodiments of the present invention.
[0059] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0060] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.
[0061] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.
[0062] Based on this, embodiments of the present invention provide a method for detecting charging pile faults, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of a charging pile fault detection method according to the present invention.
[0063] In this embodiment, the charging pile fault detection method includes the following steps:
[0064] Step S10: Obtain the power dataset of the charging pile to be tested.
[0065] Step S20: Calculate the multimodal dynamic health indicators in the power data set.
[0066] Step S30: Generate time series feature data of the dynamic health indicators.
[0067] Step S40: Input the time series feature data into the trained power data fault level classification model to detect charging pile faults and obtain a fault detection report.
[0068] It should be noted that the executing entity of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, personal computer, mobile phone, etc., or an electronic device or control computer that can realize the above functions. The following uses a control computer as an example to describe this embodiment and the following embodiments.
[0069] The power data set includes historical power data sets and current power data. The power data includes at least timestamps, voltage, active power, reactive power, and current intensity. The dynamic health indicators include voltage fluctuation rate, power anomaly index, harmonic distortion rate, and load fluctuation intensity. Among them, voltage fluctuation rate reflects the dynamic fluctuation of voltage, power anomaly index describes the degree of dynamic anomaly of power, that is, the degree of deviation of the power value at a certain point in time from the historical average, harmonic distortion rate reflects the degree of harmonic distortion of the system, and load fluctuation intensity reflects the dynamic fluctuation intensity of the load.
[0070] It is understandable that, in order to improve the credibility of the data, this embodiment may preprocess the power dataset after obtaining it. Specifically, this involves handling outliers and missing values by replacing unknown data with NaN and converting it to a numeric type, and filling missing values with column mean. This embodiment does not impose any specific restrictions on this.
[0071] Specifically, voltage fluctuation rate The root mean square error (RMSE) can be used for calculation. The specific formula is as follows:
[0072]
[0073] Among them, Voltage t It is the voltage value at time t. It is the average voltage within the sliding window, where N is the number of power data points. The RMSE is calculated within the sliding window, and the window size is selected to capture short-term voltage fluctuations.
[0074] The formula for calculating the Power Anomaly Index (PAI) is as follows:
[0075]
[0076] Global_active_power t This represents the active power at the current moment. `std(Global_active_power)` represents the power mean within the sliding window; `std(Global_active_power)` represents the standard deviation of the power within the sliding window.
[0077] Harmonic distortion rate (THD) is calculated by analyzing harmonic components and determining the proportion of harmonic components to the total power. The specific calculation formula is as follows:
[0078]
[0079] A higher THD indicates a higher harmonic content, which may lead to equipment malfunction; if the harmonic distortion rate increases abnormally, it may be an early sign of system malfunction.
[0080] Load fluctuation intensity (LVI) is calculated by measuring the sliding window variance of the current. The specific calculation formula is as follows:
[0081] LVI = Var(Global) intensity )
[0082] Here, Var represents the variance within the sliding window, and the window size can be adjusted according to application requirements.
[0083] Further, the time-series feature data for generating the dynamic health indicator includes:
[0084] A dynamic health index array is generated based on the voltage fluctuation rate, power anomaly index, harmonic distortion rate, and load fluctuation intensity.
[0085] Divide the data processing window into fixed lengths based on the preset window length and sliding step size;
[0086] Calculate the dynamic health indicator array corresponding to each data processing window to obtain multiple sets of dynamic health indicator arrays;
[0087] Determine the charging pile status at the end of each data processing window;
[0088] The labels of each group of dynamic health indicator arrays are updated according to the status of the charging piles to obtain time series feature data.
[0089] In the specific implementation process, assume that the original time series data is X = {x1, x2, ..., x} n}, where x i Indicates at time x i The multidimensional data of all collected dynamic health indicators, i.e., x i =[v i ,p i ,t i ,l i Let the port length be w (corresponding to w time steps), then the j-th fixed-length window W extracted from the original data j It can be represented as W j ={x (j-1)w+1 ,x (j-1)w+2 ,…,x jw},in ( (Indicates rounding down), then the characteristic matrix F corresponding to this window. i for:
[0090]
[0091] Where vi, pi, ti, and li correspond to the values of voltage fluctuation rate, power anomaly index, harmonic distortion rate, and load fluctuation intensity at time i, respectively.
[0092] Each window contains multidimensional features of all dynamic health indicators. The input feature matrix includes voltage fluctuation rate, power anomaly index, harmonic distortion rate, and load fluctuation intensity. The data is then segmented into multiple overlapping windows in chronological order. Let the sliding step size be s. Then, starting from the k-th overlapping window O... k For O k ={x k ,x k+1 ,…,x k+w-1}, where k = 1, 2, ..., n-w+1, for each overlapping window O k The above dynamic health indicators are calculated for each window, and the features of each window are used as model input.
[0093] The average value of Global_active_power within the window is The standard deviation is σ p,k ,but
[0094]
[0095] in It is within the window li The mean values of these calculated indices constitute the time-series feature data f used as input to the model. k :
[0096] f k =[Voltage_RMSE] k PAI k THD k LVI k ]
[0097] The label is determined by the state when the window ends; let the label be y. k If window O k If the charging station is in normal condition at the end, then y k =0; if it is a fault, then y k =1, thus transforming the original time-series data into the input data (f) required for model training. k ,y k Yes, these calculation results serve as input to the model. The labels are determined based on the charging pile's status at the end of the window; a normal operating state is labeled "normal," and a faulty state is labeled "faulty."
[0098] MinMaxScaler is used to normalize specific feature columns. For each feature column in the input data, each feature value x is converted into a normalized value x′:
[0099]
[0100] Where X represents the original data point, X min It is the minimum value in the feature column, X max It is the maximum value in the feature column, X scaled These are the normalized data points;
[0101] In this embodiment, the sliding window method can be used to generate time series features. Each series has a length of 60, and the input time series data is X = [x1, x2, ..., x...]. N Given a window size of w and a step size of s (s = 1, meaning it slides one time step at a time), the i-th subsequence X_i generated by the sliding window can be represented as:
[0102] X i =[x (i-1)×s+1 ,x (i-1)×s+2 ,…,x (i-1)×s+w ]
[0103] Where i = 1, 2, ..., M, and This indicates rounding down to the nearest integer.
[0104] For each time step i, extract the subsequence from index i to i+w-1 from the normalized data and use it as part of the input feature X.
[0105] Determining the charging pile status at the end of each data processing window involves comparing the calculated dynamic health indicator values with preset thresholds, counting the number of indicators c exceeding the thresholds, and then generating a target label y based on the value of c. The preset thresholds are Voltage_RMSE. th =242, PAI th =2.0, THD th =0.1, LVI th =5.0.
[0106] Here, 1(·) is an indicator function that takes the value 1 when the condition is true and 0 otherwise.
[0107] The target label y is determined based on the value of c:
[0108]
[0109] In this embodiment, the labels of the dynamic health indicator array are divided into the following categories: 0 represents healthy, indicating that all operating parameters of the charging pile are within a reasonable range, the operation is stable and no inspection is required; 1 represents normal, indicating that some parameters of the charging pile's operating status exceed the set value, but there is no trend of deterioration; 2 represents minor fault, indicating that the operating parameters of the charging pile have reached the set value, multiple faults have occurred and there is a trend of deterioration, and it is in a state of waiting for maintenance; 3 represents serious fault, indicating that the operating parameters of the charging pile have reached the set value, some functions have failed or are seriously faulty, and it cannot work normally, and should be stopped and inspected immediately.
[0110] From the normalized eigenma matrix F scaled Create a time series input sequence in the middle, for the k-th input sequence X k It is represented as:
[0111]
[0112] Among them, X k It is a matrix of shape (w, n), where w represents the window size and n represents the number of features.
[0113] The trained power data fault level classification model consists of a Convolutional Neural Network (CNN) layer, a Bidirectional Long Short-Term Memory (LSTM) layer, a Self-Attention Mechanism (SAM) layer, a Global Average Pooling layer, and a fully connected output layer. These layers are sequentially connected. The CNN layer extracts local features from the multimodal time-series data of charging piles, capturing short-term trends and local patterns. Then, the LSTM layer mines the global dependencies of the time-series data to extract long-term trends. Finally, a self-attention mechanism is used to calculate the correlation between time steps, highlighting the importance of key time steps and enhancing feature representation. This model integrates the capabilities of local feature extraction, global time dependency modeling, and key time step attention, which helps improve the accuracy of fault classification and the model's interpretability.
[0114] This embodiment improves the accuracy of fault classification by capturing short-term trends in multimodal power data through convolutional neural network layers, mining global dependencies in time-series data through bidirectional long short-term memory layers, extracting long-term trends, and finally calculating the correlation between time steps through multi-head attention layers. This enhances the accuracy and breadth of charging pile fault identification and avoids the technical problems of high false alarm rates and easy omission of hidden faults in existing technologies.
[0115] Based on the first embodiment of this application, in the second embodiment of this application, the content that is the same as or similar to that in the first embodiment described above can be referred to the above description, and will not be repeated hereafter. Based on this, please refer to... Figure 2 Step S40 includes:
[0116] Step S401: Input the time series feature data into the convolutional neural network layer to extract power features and obtain a power data feature map.
[0117] Step S402: Input the power data feature map into the bidirectional long short-term memory layer to calculate the time-series features of each time step.
[0118] Step S403: Input the time series features into the multi-head attention layer to obtain the target attention matrix.
[0119] Step S404: The target attention matrix and the temporal features of each time step are concatenated by the global average pooling layer to obtain a one-dimensional vector.
[0120] Step S405: Determine the fault level of each fault type based on the one-dimensional vector through the fully connected layer.
[0121] Step S406: Generate a fault detection report based on the fault type and fault level.
[0122] It should be noted that the processed and qualified electricity dataset is input into the input layer of the CNN-LSTM-SAM neural network. The input data is a three-dimensional tensor X∈R. N×W×F Where N is the number of samples, W is the window size, and F is the number of features.
[0123] The convolutional neural network layer contains two one-dimensional convolutional layers. The kernel size of the first convolutional layer is k1 = 3, and the number of filters is C1 = 64. The output of the i-th filter at the n-th sample and w-th time step is given by the convolutional neural network layer. The calculation formula is as follows:
[0124]
[0125] Among them, x n,w+k,f It is the value of the nth sample, the (w+k)th time step, and the fth feature in the input X. It represents the weight of the i-th filter in the first convolutional layer at the k-th position and the f-th feature. It is the bias of the i-th filter, and the activation function is:
[0126] ReLU(x) = max(0,x)
[0127] The parameters of the second convolutional layer are basically the same as those of the first convolutional layer, but the number of filters increases from 64 to 128, with the output H of the first convolutional layer as the reference. (1) As input, the final output is the output of the j-th filter at the n-th sample and the w-th time step.
[0128] Further, the step of inputting the power data feature map into the bidirectional long short-term memory layer to calculate the temporal features of each time step includes:
[0129] Calculate the forward hidden state based on the forward long short-term memory layer;
[0130] The forward output temporal features are calculated based on the forward input gate representation, forward output gate representation, forward forget gate representation, forward memory cell module, and forward hidden state of the forward long short-term memory layer.
[0131] Calculate the reverse hidden state based on the reverse long short-term memory layer;
[0132] The reverse output timing features are calculated based on the reverse input gate representation, the reverse output gate representation forward, the reverse forget gate representation of the reverse long short-term memory layer, the reverse memory cell module, and the reverse hidden state.
[0133] The timing features for each time step are generated based on the sum of the forward output timing features and the backward output timing features.
[0134] In the specific implementation, the power data feature map extracted by CNN is fed into the LSTM model for recognition learning to process the time series information of the data. For example, the length of the input sequence is Z, and the number of sequential and reverse LSTM units is W. The number of units is W, which is the same as the length of the input sequence Z. It contains a total of 2×Z LSTM units, namely the forward long short-term memory layer and the backward long short-term memory layer. Each unit contains an input gate, a forget gate, and an output gate. A softmax layer is also needed after each LSTM unit for fault classification.
[0135] The output of the forward long short-term memory layer can be represented as:
[0136] h forward =f(x) t +h t-1 )
[0137] Among them, h t Let x represent the hidden state at time step t. t Let f represent the input at time step t, and let f represent the computation function of the LSTM. The computation function of the LSTM can be expressed as:
[0138] f(x t +h t-1 )=(1-i t )*o t *h t-1 +i t *c t
[0139] Among them, i t The input gate is represented by o. t This indicates the output gate representation, c t Represents the memory cell module, g t This represents the forget gate.
[0140] The input gate controls whether new information is added to the memory cell. Its output is a value between 0 and 1. If the output is 0, no new information is added; if it is 1, all input information is added. In this application scenario, the input gate output is the feature value output by the CNN module. The output gate controls how information is output from the memory cell. Its output is also a value between 0 and 1. If it is 0, no information is output; if it is 1, all information is output. The memory cell stores the state of the LSTM network. Its output is the sum of the outputs of the input gate and the forget gate. The forget gate controls whether old information is discarded from the memory cell. Its output is also a value between 0 and 1. If it is 0, all old information in the memory cell is discarded; if it is 1, no old information is discarded.
[0141] The output of the inverted long short-term memory layer can be represented as:
[0142] h backforward =f(x) t’ ,h (t+1)’ )
[0143] Among them, h t’ Let x represent the reverse hidden state at time step t. t’ represents the reverse input at time step t, and f represents the computation function of LSTM;
[0144] Finally, the forward and backward LSTMs are concatenated to obtain the temporal features of the output at each time step of the bidirectional long short-term memory layer.
[0145] Further, the step of inputting the time-series features into the multi-head attention layer to obtain the target attention matrix includes:
[0146] Determine the sequence length and feature dimension of the time series feature;
[0147] A linear transformation is performed on the time series features to obtain a query matrix, a key matrix, and a value matrix.
[0148] Calculate the dot product of the query matrix and the key matrix to obtain the attention score matrix;
[0149] The attention score matrix is normalized using the softmax function to obtain the attention weight matrix;
[0150] Generate an attention matrix corresponding to a single attention head based on the attention weight matrix and the value matrix;
[0151] The attention matrices of each attention head are concatenated, and the concatenated attention matrix is linearly transformed to obtain the target attention matrix.
[0152] Understandably, the input sequence X is processed through three linear transformations to obtain the query matrix Q, the key matrix K, and the value matrix V. The similarity between the query and the key is calculated to obtain the attention score. The attention score is then normalized and applied to the value matrix to obtain a weighted sum as the output, where QK... T d represents the correlation weight between dynamic health indicators. k It is the feature dimension used for normalization.
[0153] Assume the input sequence (X∈R) n×d ), where n is the length of the sequence, d is the feature dimension of each element, and the relevant formulas for calculating the query matrix, key matrix, and value matrix through three linear transformation matrices are:
[0154]
[0155] Retrieve the query, key, and value matrix:
[0156]
[0157] The attention score matrix is obtained by calculating the dot product of the query matrix Q and the key matrix K:
[0158] S = QK T ∈R n×n :
[0159]
[0160] Where j is the time step.
[0161] Then the Softmax function is used to scale the attention score matrix. After normalization, we obtain the attention weight matrix A:
[0162]
[0163] Applying the attention weight matrix A to the value matrix V yields the output Z of the self-attention mechanism:
[0164]
[0165] Multi-head self-attention mechanisms work by feeding the input sequence into multiple independent self-attention heads, concatenating the outputs of each head, and finally obtaining the final output through a linear transformation. Assume there are h heads in total, and the output dimension of each head is (d... v / h If the output of the i-th head is Z, then the output of the i-th head is Z. i )for:
[0166]
[0167] Concatenate the outputs of all the heads:
[0168]
[0169] Finally, a linear transformation is applied to obtain the final output. :
[0170]
[0171] in,
[0172] In this embodiment, the number of heads in the multi-head attention layer is M=4, and the key dimension is d. k =128, firstly, the temporal characteristics of each time step. Perform a linear transformation to obtain the query matrix Q, key matrix K, and value matrix V. Divide Q, K, and V into M heads. For the m-th head, calculate the attention score. Then, concatenate the attention results from all heads and perform a linear transformation.
[0173]
[0174] The temporal features and the target attention matrix at each time step are concatenated, and global average pooling is performed on the concatenated features to obtain a one-dimensional vector h. p and the one-dimensional vector h p As a fully connected input, the output layer has C neurons. In this embodiment, the number of neurons C is preferably 4. The softmax activation function is used to output the final classification probability. The formula for calculating the output P is:
[0175]
[0176] in, D is the dimension of the output of the global average pooling layer, w j,c b_c is the weight of the c-th neuron and the j-th input feature in the fully connected layer, and b_c is the bias of the c-th neuron.
[0177] Further, determining the fault level of each fault type based on the one-dimensional vector through the fully connected layer includes:
[0178] Extract the four elements from the one-dimensional vector;
[0179] The number of the four elements exceeding the limit is determined according to a preset standard threshold, which is used to characterize the standard health indicators under each fault type.
[0180] The fault level corresponding to each fault type is determined based on the number of times the limit is exceeded.
[0181] In practice, the standard health indicators of charging piles are different under different fault types. By detecting the number of out-of-limit indicators of four elements—voltage fluctuation rate, power anomaly index, harmonic distortion rate, and load fluctuation intensity—under each fault type, the fault level and confidence level under each fault type are determined. For the specific confidence level formula, please refer to the calculation formula for the final classification probability output using the softmax activation function mentioned above.
[0182] Each indicator of the charging pile is standardized according to the operational status threshold level. Based on the quality of the operating parameters, the fault levels are categorized as follows: Healthy: All operating parameters of the charging pile are within a reasonable range, very close to the set values, operating stably and requiring no inspection; Normal: Some parameters of the charging pile exceed the set values, but there is no trend of deterioration; inspection can be delayed or scheduled maintenance can be performed; Minor Fault: Operating parameters of the charging pile reach the set values, multiple faults have occurred and there is a trend of deterioration; it is in a state awaiting repair; Severe Fault: Operating parameters of the charging pile reach the set values, some functions have failed or there is a serious fault, it cannot work normally, and it should be stopped immediately for inspection.
[0183] Specifically, the fault level is classified according to the number of exceedances, using the following formula:
[0184]
[0185] In this embodiment, the time-series feature data is input into the convolutional neural network layer for power feature extraction to obtain a power data feature map; the power data feature map is input into the bidirectional long short-term memory layer to calculate the temporal features of each time step; the time-series features are input into the multi-head attention layer to obtain a target attention matrix; the target attention matrix and the temporal features of each time step are concatenated through the global average pooling layer to obtain a one-dimensional vector; the fault level of each fault type is determined by the fully connected layer based on the one-dimensional vector; a fault detection report is generated based on the fault type and fault level. By combining the convolutional neural network layer, the bidirectional long short-term memory layer, and the multi-head attention layer, a unified processing of spatial feature extraction, temporal dependency modeling, and key feature enhancement of charging pile operation data is achieved, improving the accuracy of fault identification and refining the granularity.
[0186] This application also provides a charging pile fault detection device, please refer to... Figure 3 The charging pile fault detection device includes:
[0187] The acquisition module 10 is used to acquire the power dataset of the charging pile to be detected, which includes historical power datasets and current power data.
[0188] The calculation module 20 is used to calculate the multimodal dynamic health indicators in the power data set.
[0189] The generation module 30 is used to generate the time series feature data of the dynamic health indicators.
[0190] The detection module 40 is used to input the time series feature data into the trained power data fault level classification model to detect charging pile faults and obtain a fault detection report.
[0191] This embodiment improves the accuracy of fault classification by capturing short-term trends in multimodal power data through convolutional neural network layers, mining global dependencies in time-series data through bidirectional long short-term memory layers, extracting long-term trends, and finally calculating the correlation between time steps through multi-head attention layers. This enhances the accuracy and breadth of charging pile fault identification and avoids the technical problems of high false alarm rates and easy omission of hidden faults in existing technologies.
[0192] In one embodiment, the detection module 40 is further configured to: input the time-series feature data into the convolutional neural network layer for power feature extraction to obtain a power data feature map; input the power data feature map into the bidirectional long short-term memory layer to calculate the temporal features of each time step; input the time-series features into the multi-head attention layer to obtain a target attention matrix; concatenate the target attention matrix and the temporal features of each time step through the global average pooling layer to obtain a one-dimensional vector; determine the fault level of each fault type through the fully connected layer based on the one-dimensional vector; and generate a fault detection report based on the fault type and fault level.
[0193] In one embodiment, the detection module 40 is further configured to: calculate a forward hidden state based on the forward long short-term memory layer; calculate a forward output timing feature based on the forward input gate representation, forward output gate representation, forward forget gate representation, forward memory cell module, and the forward hidden state of the forward long short-term memory layer; calculate a reverse hidden state based on the reverse long short-term memory layer; calculate a reverse output timing feature based on the reverse input gate representation, reverse output gate representation, reverse forget gate representation, reverse memory cell module, and the reverse hidden state of the reverse long short-term memory layer; and generate timing features for each time step based on the sum of the forward output timing features and the reverse output timing features.
[0194] In one embodiment, the detection module 40 is further configured to: determine the sequence length and feature dimension of the time series features; perform a linear transformation on the time series features to obtain a query matrix, a key matrix, and a value matrix; calculate the dot product of the query matrix and the key matrix to obtain an attention score matrix; normalize the attention score matrix using a softmax function to obtain an attention weight matrix; generate an attention matrix corresponding to a single attention head based on the attention weight matrix and the value matrix; concatenate the attention matrices of each attention head and perform a linear transformation on the concatenated attention matrix to obtain a target attention matrix.
[0195] In one embodiment, the detection module 40 is further configured to extract four elements from the one-dimensional vector; determine the number of the four elements exceeding the limit according to a preset standard threshold, wherein the preset standard threshold is used to characterize the standard health index under each fault type; and determine the fault level corresponding to each fault type according to the number of the number exceeding the limit.
[0196] In one embodiment, the generation module 30 is further configured to generate a dynamic health indicator array based on the voltage fluctuation rate, power anomaly index, harmonic distortion rate, and load fluctuation intensity; divide a data processing window of fixed length according to a preset window length and a sliding step size; calculate the dynamic health indicator array corresponding to each data processing window to obtain multiple sets of dynamic health indicator arrays; determine the charging pile status at the end of each data processing window; and update the labels of each set of dynamic health indicator arrays according to the charging pile status to obtain time series feature data.
[0197] This application provides a charging pile fault detection device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the charging pile fault detection method in the above embodiment 1.
[0198] The following is for reference. Figure 4 The diagram illustrates a structural schematic suitable for implementing the charging pile fault detection device in the embodiments of this application. The charging pile fault detection device in the embodiments of this application may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), PMPs (Portable Media Players), vehicle terminals (e.g., vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 4The charging pile fault detection device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0199] like Figure 4 As shown, the charging pile fault detection device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1003 into a random access memory (RAM) 1004. The RAM 1004 also stores various programs and data required for the operation of the charging pile fault detection device. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touch screen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 1003 including, for example, magnetic tape, hard disk, etc.; and communication devices 1009. The communication device 1009 allows the charging pile fault detection equipment to communicate wirelessly or wiredly with other devices to exchange data. Although the figure shows charging pile fault detection equipment with various systems, it should be understood that implementation or possession of all the systems shown is not required. More or fewer systems may be implemented alternatively.
[0200] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.
[0201] The charging pile fault detection device provided in this application, employing the charging pile fault detection method in the above embodiments, can solve the technical problem of charging pile fault detection. Compared with the prior art, the beneficial effects of the charging pile fault detection device provided in this application are the same as those of the charging pile fault detection method provided in the above embodiments, and other technical features in this charging pile fault detection device are the same as those disclosed in the method of the previous embodiment, and will not be repeated here.
[0202] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.
[0203] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0204] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, which are used to execute the charging pile fault detection method in the above embodiments.
[0205] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.
[0206] The aforementioned computer-readable storage medium may be included in the charging pile fault detection equipment; or it may exist independently and not be assembled into the charging pile fault detection equipment.
[0207] The aforementioned computer-readable storage medium carries one or more programs, which, when executed by the charging pile fault detection device, cause the charging pile fault detection device to detect the charging pile fault.
[0208] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0209] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0210] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.
[0211] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-described charging pile fault detection method, thereby solving the technical problem of charging pile fault detection. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the charging pile fault detection method provided in the above embodiments, and will not be repeated here.
[0212] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the charging pile fault detection method described above.
[0213] The computer program product provided in this application can solve the technical problem of charging pile fault detection. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as the beneficial effects of the charging pile fault detection method provided in the above embodiments, and will not be repeated here.
[0214] The above description is only a part of the embodiments of this application and does not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.
Claims
1. A method for detecting faults in charging piles, characterized in that, The charging pile fault detection method includes: Obtain the power dataset of the charging pile to be detected, which includes historical power datasets and current power data; Calculate the multimodal dynamic health indicators in the power dataset; Generate time-series feature data of the dynamic health indicators; The time series feature data is input into a trained power data fault level classification model to detect charging pile faults and obtain a fault detection report. The trained power data fault level classification model includes a convolutional neural network layer, a bidirectional long short-term memory layer, a multi-head attention layer, a global average pooling layer, and a fully connected output layer, which are connected sequentially. The step of inputting the time-series feature data into a trained power data fault level classification model for charging pile fault detection, and obtaining a fault detection report, includes: The time series feature data is input into the convolutional neural network layer to extract power features, resulting in a power data feature map. The power data feature map is input into the bidirectional long short-term memory layer to calculate the temporal features of each time step; The temporal features are input into the multi-head attention layer to obtain the target attention matrix; The target attention matrix and the temporal features of each time step are concatenated by the global average pooling layer, and the concatenated features are then subjected to global average pooling to obtain a one-dimensional vector. The fault level of each fault type is determined based on the one-dimensional vector passed through the fully connected output layer; A fault detection report is generated based on the fault type and fault level.
2. The charging pile fault detection method as described in claim 1, characterized in that, The bidirectional long short-term memory layer includes: a forward long short-term memory layer and a reverse long short-term memory layer. The forward long short-term memory layer includes at least: a forward input gate representation, a forward output gate representation, a forward forget gate representation, and a forward memory cell module. The reverse long short-term memory layer includes at least: a reverse input gate representation, a reverse output gate representation, a reverse forget gate representation, and a reverse memory cell module. The step of inputting the power data feature map into the bidirectional long short-term memory layer to calculate the time-series features at each time step includes: Calculate the forward hidden state based on the forward long short-term memory layer; The forward output temporal features are calculated based on the forward input gate representation, forward output gate representation, forward forget gate representation, forward memory cell module, and forward hidden state of the forward long short-term memory layer. Calculate the reverse hidden state based on the reverse long short-term memory layer; The reverse output timing features are calculated based on the reverse input gate representation, the reverse output gate representation forward, the reverse forget gate representation of the reverse long short-term memory layer, the reverse memory cell module, and the reverse hidden state. The timing features for each time step are generated based on the sum of the forward output timing features and the backward output timing features.
3. The charging pile fault detection method as described in claim 2, characterized in that, The step of inputting the time series features into the multi-head attention layer to obtain the target attention matrix includes: Determine the sequence length and feature dimension of the time series feature; A linear transformation is performed on the time series features to obtain a query matrix, a key matrix, and a value matrix. Calculate the dot product of the query matrix and the key matrix to obtain the attention score matrix; The attention score matrix is normalized using the softmax function to obtain the attention weight matrix; Generate an attention matrix corresponding to a single attention head based on the attention weight matrix and the value matrix; The attention matrices of each attention head are concatenated, and the concatenated attention matrix is linearly transformed to obtain the target attention matrix.
4. The charging pile fault detection method as described in claim 2, characterized in that, The step of determining the fault level of each fault type based on the one-dimensional vector through the fully connected output layer includes: Extract the four elements from the one-dimensional vector; The number of the four elements exceeding the limit is determined according to a preset standard threshold, which is used to characterize the standard health indicators under each fault type. The fault level corresponding to each fault type is determined based on the number of times the limit is exceeded.
5. The charging pile fault detection method as described in claim 1, characterized in that, The dynamic health indicators include: voltage fluctuation rate, power anomaly index, harmonic distortion rate, and load fluctuation intensity. The time-series feature data for generating the dynamic health indicator includes: A dynamic health index array is generated based on the voltage fluctuation rate, power anomaly index, harmonic distortion rate, and load fluctuation intensity. Divide the data processing window into fixed lengths based on the preset window length and sliding step size; Calculate the dynamic health indicator array corresponding to each data processing window to obtain multiple sets of dynamic health indicator arrays; Determine the charging pile status at the end of each data processing window; The labels of each group of dynamic health indicator arrays are updated according to the status of the charging piles to obtain time series feature data.
6. A charging pile fault detection device, used to implement the charging pile fault detection method according to any one of claims 1-5, characterized in that, The charging pile fault detection device includes: The acquisition module is used to acquire the power dataset of the charging pile to be detected, which includes historical power datasets and current power data; A calculation module is used to calculate multimodal dynamic health indicators in the power dataset; The generation module is used to generate the time-series feature data of the dynamic health indicators; The detection module is used to input the time series feature data into the trained power data fault level classification model to detect charging pile faults and obtain a fault detection report.
7. A charging pile fault detection device, characterized in that, The charging pile fault detection device includes: a memory, a processor, and a charging pile fault detection program stored in the memory and executable on the processor, wherein the charging pile fault detection program is configured to implement the charging pile fault detection method as described in any one of claims 1 to 5.
8. A storage medium, characterized in that, The storage medium stores a charging pile fault detection program, which, when executed by a processor, implements the charging pile fault detection method as described in any one of claims 1 to 5.
9. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the steps of the charging pile fault detection method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
ZPW-2000A track circuit fault diagnosis method based on CNN-LSTM-Attention
CN117932262A
Diesel engine fault diagnosis method, system, equipment and medium
CN119830074A