Metering anomaly detection method for direct-current charging pile
Through the time sequence convolution network method based on deep learning, a DC charging pile metering abnormality detection model is built, which solves the problem of low metering state detection efficiency of large-scale DC charging piles in the existing technology, and realizes high-precision and fast metering state detection, ensuring the safety and reliability of charging services.
Patent Information
- Application Number
- CN202411845887.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-03-25
AI Technical Summary
The prior art is difficult to efficiently detect the metering status of large-scale DC charging piles, which makes it difficult to detect and correct the measurement errors in a timely manner, affecting the accuracy and safety of electric vehicle charging.
The time-sequence convolution network method based on deep learning is adopted to construct a metering abnormality detection model for DC charging piles. By obtaining the voltage, current, ripple signals and metering chip temperature of DC charging piles in real time, and using the time-sequence convolution module, timing enhancement module and timing optimization module for feature extraction and prediction, realizing contactless metrological state detection.
It realizes high-precision and rapid detection of the metering status of DC charging piles, improves detection efficiency, reduces labor costs, promptly detects and warns of metering abnormalities, and ensures the safety and reliability of charging services.
Smart Images

Figure CN119689112A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of intelligent detection of charging piles based on machine learning, and in particular relates to a method for detecting metering anomalies of direct current charging piles. Background Art
[0002] As one of the main ways to charge electric vehicles, DC charging piles play a vital role in the development of the new energy industry. The accuracy and reliability of their measurement are related to the credit of operators and the rights and interests of users. Ideally, DC charging piles should be able to accurately and correctly transmit electrical energy to electric vehicle batteries, but in reality, due to technical limitations and external interference, the DC voltage and current signals output by DC charging piles are often accompanied by a certain degree of ripple. These ripples, that is, small fluctuations in the signal, will have a significant impact on the measurement accuracy of the DC energy meter, causing the measurement results to deviate from the true value and produce large measurement errors; in addition, the measurement chip inside the DC energy meter is a core component, and its measurement performance is also restricted by temperature. As the temperature of the metering chip increases or decreases, the physical properties and electronic behavior of the metering chip will change, thereby introducing additional measurement errors. Although this error caused by the temperature effect may be relatively small, it still has an important impact on the accurate calculation of charging costs over a long period of time. Therefore, it is necessary to regularly test the measurement performance of DC charging piles and calibrate the DC energy meter for DC charging piles with large measurement errors.
[0003] Traditional testing methods mostly use manual contact methods, that is, testers need to approach each charging pile one by one and conduct metering performance tests through physical connections. This method is particularly clumsy and inefficient when facing the growing number of DC charging piles. It not only consumes a lot of human resources, but also makes it difficult to complete large-scale testing tasks in a short period of time, and it is difficult to meet the fast-paced development needs of the current new energy industry. Summary of the invention
[0004] To solve the above problems, a DC charging pile metering anomaly detection method based on temporal convolutional network was proposed based on deep learning technology to realize large-scale DC charging pile metering status detection in a short time. Deep learning technology was used to realize non-contact metering detection of DC charging piles, which improved the detection efficiency and saved labor costs.
[0005] The present invention provides a method for detecting abnormality in DC charging pile metering, comprising the following steps: Real-time acquisition of the DC voltage signal, DC current signal, voltage ripple signal and current ripple signal of the DC charging pile; and the temperature of the charging pile metering chip at the same time; Input the data into the constructed and trained DC charging pile metering anomaly detection model, and output the state prediction result; the DC charging pile metering anomaly detection model includes a timing convolution module, a timing enhancement module, a timing optimization module and a prediction output module; The temporal convolution module includes an expansion convolution layer, an LSTM layer, and a gated unit layer. A residual connection is used between the expansion convolution layer and the LSTM layer to learn the long-term temporal dependency of sample data to obtain temporal features. The timing enhancement module adopts a multi-scale network architecture based on the self-attention mechanism, including three convolutional layers of different scales, a self-attention mechanism layer, a feature concatenation layer and a fully connected layer. The obtained timing features are input into the timing enhancement module, and information of different granularities on the timing features are extracted to obtain enhanced timing features. The timing optimization module is based on a simplified self-vector network architecture, and optimizes the enhanced timing features by designing two branches to optimize the long-term temporal dependency of the enhanced timing features and reduce the number of parameters in the model; The prediction output module obtains a DC charging pile metering state prediction value based on the obtained optimization features.
[0006] Preferably, when training the DC charging pile metering anomaly detection model, the method for acquiring the training data set is: Using an oscilloscope The DC voltage signal, DC current signal, voltage ripple signal and current ripple signal of a DC charging pile are measured to obtain a length of Time series data, DC voltage signal time series data , DC current signal time series data , voltage ripple signal time series data , current ripple signal time series data ; At the same time, the temperature sensor is used to The temperature of the metering chip of a DC charging pile is measured and the length is Temperature time series data ; Preprocess the collected data, including removing outliers, incorrect coding and filling missing values; measure The DC charging piles with measurement errors that meet the allowable error range are marked as normal 0, and the DC charging piles with measurement errors that exceed the allowable error range are marked as abnormal 1, thereby obtaining sample labels ;Will , , , , and Combine to obtain data set .
[0007] Preferably, the temporal convolution module is specifically: The DC voltage signal , DC current signal , voltage ripple signal , current ripple signal and temperature time series data Vector Input the first dilated convolutional layer to obtain local temporal features ,Will Input the second dilated convolutional layer to obtain mid-term temporal features ,Will Input the third dilated convolutional layer to obtain long-term temporal features , the specific calculation formula is as follows:
[0008]
[0009]
[0010] in: is the dilated convolution kernel in The weights on the scale; To expand the size of the convolution kernel, the number of time steps spanned by the convolution kernel is determined; is the dilation factor, which is used to control the receptive field of the dilated convolution kernel and indicates the number of steps skipped by the convolution kernel on the time axis. The features are gradually extracted by connecting the dilated convolution layers in series, and the receptive field of the features increases exponentially with the increase of network depth, and finally the features at three levels, local, medium-term and long-term, are obtained. The local time feature , mid-term time characteristics and long-term temporal characteristics Input the first LSTM layer, the second LSTM layer, and the third LSTM layer respectively, and add the outputs of the first LSTM layer, the second LSTM layer, and the third LSTM layer to the outputs of the first dilated convolution layer, the second dilated convolution layer, and the third dilated convolution layer respectively to obtain the residual features R , R and R ; The residual feature R , R and R After vector concatenation, input the gated unit layer to obtain timing features , using the gated unit layer R , R and R The residual features of the three time dimensions are fused to forget unimportant feature information and retain important features.
[0011] Preferably, the timing enhancement module is specifically: The obtained time series characteristics Input convolution kernel scales respectively , and The convolutional layer extracts information of different granularities in time series and obtains time series features of three different scales , and ; Will , and The self-attention mechanism layer is input separately to interact with the elements in the feature at a fine-grained level, and the attention weight of each element in the feature is dynamically adjusted according to the current context, so that the model can better understand and utilize the complex relationships in the data and obtain fine-grained features. , and , the specific calculation formula is as follows:
[0012]
[0013]
[0014] in represent Activation function, , and They are query weight matrix, key weight matrix and value weight matrix respectively, adaptively learning the degree of interaction between elements; is the dimension of the key weight matrix, which is used to scale the dot product to prevent the value from being too large during gradient descent; The fine-grained features , and Input feature concatenation layer to concatenate vectors to obtain concatenated features Then input the fully connected layer to reduce the dimension of features, reduce the redundant parameters in the features, and obtain enhanced time series features. .
[0015] Preferably, the timing optimization module is composed of two branches and a feature fusion layer, one branch is composed of a Relu activation layer and a 1×1 convolution layer, and the other branch is composed of a softmax activation layer and a 1×1 convolution layer. The specific processing process is: Will enhance the timing characteristics O Input the branch consisting of a softmax activation layer and a 1×1 convolutional layer to obtain branch features , the specific calculation formula is as follows:
[0016]
[0017] in For use The autocorrelation coefficient calculated by the function, is the weight of the 1×1 convolutional layer; use Functions to enhance time series features O Normalize the data to ensure that the sum of the weights of different element positions is equal to 1, so that the model can focus on the information at different positions in the input sequence. Will enhance the timing characteristics O Input the branch consisting of Relu activation layer and 1×1 convolution layer to obtain branch features , the specific calculation formula is as follows:
[0018]
[0019] in For use The autocorrelation coefficient calculated by the function is used to enhance the time series features using the Relu function O The elements in are weighted activated to weaken the effect of irrelevant channels; Branch characteristics and branch characteristics Input feature fusion layer, branch features and branch characteristics Perform sum operation to obtain optimized features , the specific calculation formula is as follows: 。
[0020] Preferably, the prediction output module consists of a feature flattening layer and a fully connected layer, and the specific calculation formula is as follows:
[0021] in Indicates the effect of tiling operation on the optimization features Flatten the features and reduce the dimension, and input the flattened features into the fully connected layer to obtain the DC charging pile metering state prediction value .
[0022] Preferably, when training the DC charging pile metering anomaly detection model, the dynamic weight optimization strategy is used to jointly train the timing convolution module, the timing enhancement module, the timing optimization module and the prediction output module, and the root mean square error loss is used. and mean absolute error loss , by initializing weights, calculating loss gradients, and dynamically adjusting weights to balance the two loss functions, the formula is as follows:
[0023]
[0024] in, Indicates the number of DC charging piles, Indicates The actual value of the DC charging pile measurement status, Indicates The predicted value of the metering status of a DC charging pile.
[0025] Preferably, the dynamic weight optimization strategy is specifically: S1, Initialization weight: At the beginning of training, an initial weight is assigned to each sub-loss function ,The weights are set manually based on prior knowledge; S2, calculate the loss gradient: In each iteration, calculate the gradient of each sub-loss function ; S3, update weights: dynamically adjust weights based on the performance of the model in the current iteration , the weight update formula is:
[0026] in, is the weight of the kth sub-loss function at the tth iteration, Is a learning rate used to control the speed of weight adjustment. The denominator is the sum of the squares of the gradients of all sub-loss functions, which is used to normalize the weight update; S4, Apply weights: Use the updated weights Calculate the new total loss ,in, ) is the kth sub-loss function, is the corresponding weight, are the parameters of the model; S5, iterative process: repeat steps S2 to S4 until the model converges or reaches the predetermined number of training rounds.
[0027] Compared with the prior art, the present invention has the following beneficial effects: (1) High-precision anomaly detection: By constructing a data set containing multiple signals (DC voltage, DC current, voltage ripple, current ripple, and metering chip temperature), and using the timing convolution module, timing enhancement module, and timing optimization module for deep learning and feature extraction, this method can more accurately capture subtle changes and abnormal patterns in the DC charging pile metering data, thereby improving the accuracy of anomaly detection.
[0028] (2) Mining long-term temporal relationships: The dilated convolution layer and LSTM layer in the time series convolution module are combined with residual connections to effectively learn the long-term temporal relationships of sample data, which is crucial for identifying metering anomalies that may take a long time to appear. This capability enables the model to have a more comprehensive understanding of the operating status of the charging pile and improve the comprehensiveness of anomaly detection.
[0029] (3) Multi-scale information extraction: The time series enhancement module adopts a multi-scale network architecture based on the self-attention mechanism, which can extract information of different granularities on the time series features. This helps the model capture abnormal features at different time scales and enhances the robustness and adaptability of the model.
[0030] (4) Optimizing feature representation: The time series optimization module further optimizes and enhances the long-term temporal dependencies of time series features, while reducing the impact of noise on model stability. This helps improve the performance of the model when processing complex, noisy real-world data.
[0031] (5) Dynamic weight optimization: The dynamic weight optimization strategy is used to jointly train each module to ensure the optimal overall performance of the model. This strategy can automatically adjust the weights of each module based on feedback during the training process, thereby improving training efficiency and model performance.
[0032] (6) Remote real-time monitoring: The trained model is deployed on the service provider's backend server to achieve remote real-time monitoring of the metering status of DC charging piles. This not only improves the efficiency and accuracy of monitoring, but also reduces the cost and risk of manual inspections, providing strong technical support for the maintenance and management of charging piles.
[0033] (7) Early warning and prevention: By timely detecting and warning of potential metering anomalies, this method helps service providers take timely measures for calibration or maintenance, thereby avoiding economic losses or safety issues caused by the accumulation of metering errors, and improving the overall quality of charging services and user satisfaction. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 It is a flow chart of the overall technical route of the present invention.
[0035] Figure 2 Schematic diagram of the temporal convolution module model structure of the present invention.
[0036] Figure 3 It is a schematic diagram of the structure of the timing enhancement module of the present invention.
[0037] Figure 4 It is a schematic diagram of the structure of the timing optimization module model of the present invention.
[0038] Figure 5 This is a visualization result diagram of the method of the present invention. DETAILED DESCRIPTION
[0039] The overall technical route of the present invention is as follows Figure 1 As shown: The present invention proposes a DC charging pile metering anomaly detection method based on a temporal convolutional network, which is used to remotely detect whether the DC charging pile metering is abnormal at the back end, including the following process: Construct a data set: The data samples are the DC voltage signal, DC current signal, voltage ripple signal, current ripple signal and metering chip temperature of the DC charging pile; the data label is the DC charging pile metering status, which is divided into normal and abnormal. The normal DC charging pile metering status indicates that the metering error of the DC charging pile is within the allowable accuracy range, and the abnormal DC charging pile metering status indicates that the metering error of the DC charging pile exceeds the allowable accuracy range and needs to be calibrated.
[0040] Construct a temporal convolution module: Input the obtained data set into the temporal convolution module to learn the long-term time relationship of the sample data to obtain the temporal features. The temporal convolution module includes an expanded convolution layer, an LSTM layer, and a gated unit layer. A residual connection is used between the expanded convolution layer and the LSTM layer.
[0041] Construct a timing enhancement module: The timing enhancement module adopts a multi-scale network architecture based on the self-attention mechanism. The obtained timing features are input into the timing enhancement module, which extracts information of different granularities on the timing features and outputs enhanced timing features.
[0042] Construct a timing optimization module: Input the obtained enhanced timing features into the timing optimization module to obtain optimized features, optimize the long-term temporal dependence of the enhanced timing features, and reduce the negative impact of noise in the sample data on the stability of the model as the time step increases.
[0043] Prediction output module: The obtained optimization features are input into the prediction output module to obtain the DC charging pile metering status prediction results.
[0044] The timing convolution module, timing enhancement module, timing optimization module and prediction output module constructed by the dynamic weight optimization strategy are jointly trained to obtain the trained overall DC charging pile metering anomaly detection model. The trained DC charging pile metering anomaly detection model is deployed on the service provider's backend server for remote real-time monitoring of the DC charging pile metering status.
[0045] 1. Construction of training dataset Using an oscilloscope The DC voltage signal, DC current signal, voltage ripple signal and current ripple signal of a DC charging pile are measured to obtain a length of Time series data, specifically DC voltage signal time series data , DC current signal time series data , voltage ripple signal time series data And current ripple signal time series data ; At the same time, the temperature sensor is used to The temperature of the metering chip of a DC charging pile is measured and the length is Temperature time series data ; Review and correct the collected data, including deleting outliers, incorrect coding and filling missing values to ensure data rationality. Kriging method is used to interpolate missing values. , , and , filter out non-negative data within a reasonable range and remove outliers; measure The measurement error of a DC charging pile is calculated, and the DC charging pile whose measurement error meets the allowable error range is marked as normal (0), and the DC charging pile whose measurement error exceeds the allowable error range is marked as abnormal (1), so as to obtain the sample label ;Will , , , , and Combine to get the data set: .
[0046] 2. Building a DC Charging Pile Metering Anomaly Detection Model The DC charging pile metering anomaly detection model includes a timing convolution module, a timing enhancement module, a timing optimization module and a prediction output module; the timing convolution module includes an expanded convolution layer, an LSTM layer, and a gated unit layer. A residual connection is used between the expanded convolution layer and the LSTM layer to learn the long-term time dependency of the sample data to obtain the timing features; the timing enhancement module adopts a multi-scale network architecture based on the self-attention mechanism, which includes three convolution layers of different scales, a self-attention mechanism layer, a feature splicing layer and a fully connected layer. The obtained timing features are input into the timing enhancement module, and information of different granularities on the timing features is extracted to obtain enhanced timing features; the timing optimization module is based on a simplified self-vector network architecture, and two branches are designed to optimize the enhanced timing features respectively, optimize the long-term time dependency of the enhanced timing features, and reduce the number of parameters in the model; the prediction output module obtains the DC charging pile metering state prediction value based on the obtained optimized features.
[0047] 1. Temporal Convolution Module The temporal convolution module model structure is as follows Figure 2 As shown in Figure 1, it includes an expanded convolution layer, an LSTM layer, and a gated unit layer. A residual connection is used between the expanded convolution layer and the LSTM layer. The obtained dataset The input time series convolution module learns the long-term time dependency of sample data to obtain time series features. The specific steps are as follows: (1) , , , and Vector Input the first dilated convolutional layer to obtain local temporal features ,Will Input the second dilated convolutional layer to obtain mid-term temporal features ,Will Input the third dilated convolutional layer to obtain long-term temporal features , the specific calculation formula is as follows:
[0048]
[0049]
[0050] in: is the dilated convolution kernel in The weights on the scale; To expand the size of the convolution kernel, the number of time steps spanned by the convolution kernel is determined; It is the expansion factor, which is used to control the receptive field of the expanded convolution kernel and indicates the number of steps skipped by the convolution kernel on the time axis. The features are gradually extracted by connecting the expanded convolution layers in series, and the receptive field of the features will increase exponentially with the increase of the network depth, and finally the features of the local, medium-term and long-term levels are obtained.
[0051] (2) Local time features , mid-term time characteristics and long-term temporal characteristics Input the first LSTM layer, the second LSTM layer, and the third LSTM layer respectively, and add the outputs of the first LSTM layer, the second LSTM layer, and the third LSTM layer to the outputs of the first dilated convolution layer, the second dilated convolution layer, and the third dilated convolution layer respectively to obtain the residual features R , R and R , the specific calculation formula is as follows:
[0052]
[0053]
[0054] in express Neural Networks; The advantage of residual connections is that they allow layers to learn to modify the identity mapping and optimize gradient backpropagation; (3) Residual features R , R and R After vector concatenation, input the gated unit layer to obtain timing features , using the gated unit layer R , R and R The residual features of the three time dimensions are fused to forget unimportant feature information and retain important features.
[0055] 2. Timing enhancement module The model structure of the timing enhancement module is as follows Figure 3As shown in the figure, this module adopts a multi-scale network architecture based on the self-attention mechanism, which includes three convolutional layers of different scales, a self-attention mechanism layer, a feature concatenation layer, and a fully connected layer. The time series features obtained in step 2 are input into the time series enhancement module, and information of different granularities on the time series features are extracted to obtain enhanced time series features. The specific calculation steps are as follows: (1) Obtained time series features Input convolution kernel scales respectively , and The convolutional layer extracts information of different granularities in time series and obtains time series features of three different scales , and ; (2) , and The self-attention mechanism layer is input separately to interact with the elements in the feature at a fine-grained level, and the attention weight of each element in the feature is dynamically adjusted according to the current context, so that the model can better understand and utilize the complex relationships in the data and obtain fine-grained features. , and , the specific calculation formula is as follows:
[0056]
[0057]
[0058] in represent Activation function, , and They are the query weight matrix, key weight matrix and value weight matrix, which can adaptively learn the degree of element interaction. is the dimension of the key weight matrix, which is used to scale the dot product to prevent the value from being too large during gradient descent; (3) Fine-grained features , and Input feature concatenation layer to concatenate vectors to obtain concatenated features Then input the fully connected layer to reduce the dimension of features, reduce the redundant parameters in the features, and obtain enhanced time series features. , the specific calculation formula is as follows: O=
[0059] in is the feature concatenation operation, is a fully connected layer.
[0060] 3. Timing Optimization Module The timing optimization module model structure is as follows Figure 4 As shown in Figure 2, this module is based on a simplified self-vector network architecture and designs two branches to enhance the timing features. The optimization is performed, thereby greatly reducing the number of parameters in the model and alleviating the complexity of the model; specifically, the module consists of two branches and a feature fusion layer, one branch consists of a Relu activation layer and a 1×1 convolutional layer, and the other branch consists of a softmax activation layer and a 1×1 convolutional layer; the enhanced temporal features obtained are O The input timing optimization module optimizes and enhances the long-term dependency of timing features in time, reduces the negative impact of noise in sample data on the stability of the model as the time step increases, and obtains optimized features. The specific steps are as follows: (1) Enhanced timing characteristics O Input the branch consisting of a softmax activation layer and a 1×1 convolutional layer to obtain branch features , the specific calculation formula is as follows:
[0061]
[0062] in For use The autocorrelation coefficient calculated by the function, is the weight of the 1×1 convolutional layer; use Functions to enhance time series features O Normalization is performed to ensure that the sum of the weights of different element positions is equal to 1, so that the model can better focus on the information at different positions in the input sequence and enhance the expression of useful information; (2) Enhanced timing characteristics O Input the branch consisting of Relu activation layer and 1×1 convolution layer to obtain branch features , the specific calculation formula is as follows:
[0063]
[0064] in For use The autocorrelation coefficient calculated by the function is used to enhance the time series features using the Relu function O The weights of the elements in are activated, which weakens the effect of irrelevant channels, reduces noise, and reduces the risk of gradient disappearance to a certain extent; (3) Branch characteristics and branch characteristics Input feature fusion layer, branch features and branch characteristics Perform sum operation to obtain optimized features , the specific calculation formula is as follows: 。
[0065] 4. Prediction output module The optimized features obtained The prediction output module is input to obtain the DC charging pile metering state prediction value. The prediction output module consists of a feature flattening layer and a fully connected layer. The specific calculation formula is as follows:
[0066] in Indicates the effect of tiling operation on the optimization features Flatten the features and reduce the dimension, and input the flattened features into the fully connected layer to obtain the DC charging pile metering state prediction value .
[0067] 3. Model Training Strategy The dynamic weight optimization strategy is used to jointly train the constructed time series convolution module, time series enhancement module, time series optimization module and prediction output module to obtain a trained model; the dynamic weight optimization strategy uses the root mean square error loss and the mean absolute error loss to train the module, and balances the two loss functions by initializing the weights, calculating the loss gradient, and dynamically adjusting the weights to improve the convergence speed and prediction accuracy of the model. The specific steps are as follows: In order to accelerate the convergence speed of the model and enable the model to accurately predict the metering status of the DC charging pile, the present invention adopts the root mean square error loss and mean absolute error loss , the formula is as follows:
[0068]
[0069] in, Indicates the number of DC charging piles, Indicates The actual value of the DC charging pile measurement status, Indicates The predicted value of the metering status of a DC charging pile.
[0070] In order to better balance the two loss functions during the training process, the present invention proposes a model training strategy based on dynamic weights. The model training strategy based on dynamic weights is as follows: 1) Initialize weights: At the beginning of training, assign an initial weight to each sub-loss function , these weights are manually set based on prior knowledge.
[0071] 2) Calculate loss gradient: In each iteration, calculate the gradient of each sub-loss function ; 3) Update weights: Dynamically adjust weights based on the performance of the model in the current iteration The weight update formula is:
[0072] in, It is t The first iteration k The weight of each sub-loss function, is a learning rate that controls the speed of weight adjustment, and the denominator is the sum of the squares of the gradients of all sub-loss functions, which is used to normalize the weight update.
[0073] 4) Apply weights: Use the updated weights Calculate the new total loss .in, ) is the kth sub-loss function, is the corresponding weight, are the parameters of the model.
[0074] 5) Iteration process: Repeat steps 2) to 4) until the model converges or reaches the predetermined number of training rounds.
[0075] 4. Model Deployment and Application The trained timing convolution module, timing enhancement module, timing optimization module and prediction output module are deployed on the service provider's backend server for remote real-time monitoring of the metering status of DC charging piles.
[0076] Data acquisition sensor deployment: Install an oscilloscope on the DC charging pile to obtain the DC voltage signal, DC current signal, voltage ripple signal and current ripple signal of the DC charging pile; at the same time, install a temperature sensor on the metering chip of the DC charging pile to obtain the temperature of the metering chip; The DC voltage signal, DC current signal, voltage ripple signal, current ripple signal and the temperature of the metering chip of the DC charging pile are simultaneously input into the timing convolution module to obtain timing features; Input the time series features output by the time series convolution module into the time series enhancement module to obtain enhanced time series features; Inputting the enhanced timing features output by the timing enhancement module into the timing optimization module to obtain the optimized features; The optimized features output by the timing optimization module are input into the prediction output module to obtain the predicted value of the DC charging pile metering status. If the DC charging pile metering status is predicted to be abnormal, the operator sends staff to the site to perform metering calibration on the DC charging pile.
[0077] In order to further verify the effectiveness of the present invention, the present invention is compared with some existing models, including recurrent neural networks, multi-layer feedforward neural networks and long short-term memory networks; the evaluation indicators include the absolute error of the prediction results and the model training time, and the comparison results are shown in Table 1. It can be seen from Table 1 that the prediction absolute error of the method of the present invention is the smallest, indicating that the method of the present invention has the highest prediction accuracy; at the same time, the training time of the model of the present invention is the shortest, indicating that the method proposed by the present invention has a faster training convergence speed.
[0078] Table 1 Comparison of experimental results
[0079] The visualization results are as follows Figure 5 As shown by Figure 5 It can be seen that the method of the present invention only makes an incorrect prediction of the metering state of the DC charging pile with sample number 3, which indicates that the prediction accuracy of the method of the present invention is relatively high.
[0080] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
[0081] Although the above describes the specific implementation methods of the present invention, it is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art on the basis of the technical solution of the present invention without creative work are still within the scope of protection of the present invention.
Claims
1. A DC charging pile metering anomaly detection method, characterized in that: The following steps are involved: Real-time acquisition of the DC voltage signal, DC current signal, voltage ripple signal and current ripple signal of the DC charging pile; and the temperature of the charging pile metering chip at the same time; Input the data into the constructed and trained DC charging pile metering anomaly detection model, and output the state prediction result; the DC charging pile metering anomaly detection model includes a timing convolution module, a timing enhancement module, a timing optimization module and a prediction output module; The temporal convolution module includes an expansion convolution layer, an LSTM layer, and a gated unit layer. A residual connection is used between the expansion convolution layer and the LSTM layer to learn the long-term temporal dependency of sample data to obtain temporal features. The timing enhancement module adopts a multi-scale network architecture based on the self-attention mechanism, including three convolutional layers of different scales, a self-attention mechanism layer, a feature concatenation layer and a fully connected layer. The obtained timing features are input into the timing enhancement module, and information of different granularities on the timing features are extracted to obtain enhanced timing features. The timing optimization module is based on a simplified self-vector network architecture, and optimizes the enhanced timing features by designing two branches to optimize the long-term temporal dependency of the enhanced timing features and reduce the number of parameters in the model; The prediction output module obtains a DC charging pile metering state prediction value based on the obtained optimization features.
2. A DC charging pile metering anomaly detection method according to claim 1, characterized in that: When training the DC charging pile metering anomaly detection model, the method for obtaining the training data set is as follows: Using an oscilloscope The DC voltage signal, DC current signal, voltage ripple signal and current ripple signal of a DC charging pile are measured to obtain a length of Time series data, DC voltage signal time series data , DC current signal time series data , voltage ripple signal time series data , current ripple signal time series data ; At the same time, the temperature sensor is used to The temperature of the metering chip of a DC charging pile is measured and the length is Temperature time series data ; Preprocess the collected data, including removing outliers, incorrect coding and filling missing values; measure The DC charging piles with measurement errors that meet the allowable error range are marked as normal 0, and the DC charging piles with measurement errors that exceed the allowable error range are marked as abnormal 1, thereby obtaining sample labels ;Will , , , , and Combine to obtain data set .
3. A DC charging pile metering anomaly detection method as claimed in claim 1, characterized in that: The temporal convolution module is specifically: The DC voltage signal , DC current signal , voltage ripple signal , current ripple signal and temperature time series data The vector composed of Input the first dilated convolutional layer to obtain local temporal features ,Will Input the second dilated convolutional layer to obtain mid-term temporal features ,Will Input the third dilated convolutional layer to obtain long-term temporal features , the specific calculation formula is as follows: in: is the dilated convolution kernel in The weights on the scale; To expand the size of the convolution kernel, the number of time steps spanned by the convolution kernel is determined; is the dilation factor, which is used to control the receptive field of the dilated convolution kernel and indicates the number of steps skipped by the convolution kernel on the time axis. The features are gradually extracted by connecting the dilated convolution layers in series, and the receptive field of the features increases exponentially with the increase of network depth, and finally the features at three levels, local, medium-term and long-term, are obtained. The local time feature , mid-term time characteristics and long-term temporal characteristics Input the first LSTM layer, the second LSTM layer, and the third LSTM layer respectively, and add the outputs of the first LSTM layer, the second LSTM layer, and the third LSTM layer to the outputs of the first dilated convolution layer, the second dilated convolution layer, and the third dilated convolution layer respectively to obtain the residual features R , R and R ; The residual feature R , R and R After vector concatenation, input the gated unit layer to obtain timing features , using the gated unit layer R , R and R The residual features of the three time dimensions are fused to forget unimportant feature information and retain important features.
4. A DC charging pile metering anomaly detection method as claimed in claim 3, characterized in that: The timing enhancement module is specifically: The obtained time series characteristics Input convolution kernel scales respectively , and The convolutional layer extracts information of different granularities in time series and obtains time series features of three different scales , and ; Will , and The self-attention mechanism layer is input separately to interact with the elements in the feature at a fine-grained level, and the attention weight of each element in the feature is dynamically adjusted according to the current context, so that the model can better understand and utilize the complex relationships in the data and obtain fine-grained features. , and , the specific calculation formula is as follows: in represent Activation function, , and They are query weight matrix, key weight matrix and value weight matrix respectively, adaptively learning the degree of interaction between elements; is the dimension of the key weight matrix, which is used to scale the dot product to prevent the value from being too large during gradient descent; The fine-grained features , and Input feature concatenation layer to concatenate vectors to obtain concatenated features Then input the fully connected layer to reduce the dimension of features, reduce the redundant parameters in the features, and obtain enhanced time series features. .
5. A DC charging pile metering anomaly detection method as claimed in claim 4, characterized in that: The timing optimization module consists of two branches and a feature fusion layer. One branch consists of a Relu activation layer and a 1×1 convolution layer, and the other branch consists of a softmax activation layer and a 1×1 convolution layer. The specific processing process is as follows: Will enhance the timing characteristics O Input the branch consisting of a softmax activation layer and a 1×1 convolution layer to obtain branch features , the specific calculation formula is as follows: in For use The autocorrelation coefficient calculated by the function, is the weight of the 1×1 convolutional layer; use Functions to enhance time series features O Normalize the data to ensure that the sum of the weights of different element positions is equal to 1, so that the model can focus on the information at different positions in the input sequence. Will enhance the timing characteristics O Input the branch consisting of Relu activation layer and 1×1 convolution layer to obtain branch features , the specific calculation formula is as follows: in For use The autocorrelation coefficient calculated by the function is used to enhance the time series features using the Relu function O The elements in are weighted activated to weaken the effect of irrelevant channels; Branch characteristics and branch characteristics Input feature fusion layer, branch features and branch characteristics Perform sum operation to obtain optimized features .
6. A DC charging pile metering anomaly detection method according to claim 1, characterized in that: The prediction output module consists of a feature flattening layer and a fully connected layer. The specific calculation formula is as follows: in Indicates the effect of tiling operation on the optimization features Flatten the features and reduce the dimension, and input the flattened features into the fully connected layer to obtain the DC charging pile metering state prediction value .
7. A DC charging pile metering anomaly detection method according to claim 1, characterized in that: When training the DC charging pile metering anomaly detection model, the dynamic weight optimization strategy is used to jointly train the timing convolution module, timing enhancement module, timing optimization module and prediction output module, and the root mean square error loss is used. and mean absolute error loss , by initializing weights, calculating loss gradients, and dynamically adjusting weights to balance the two loss functions, the formula is as follows: in, Indicates the number of DC charging piles, Indicates The actual value of the DC charging pile measurement status, Indicates The predicted value of the metering status of a DC charging pile.
8. A DC charging pile metering anomaly detection method as claimed in claim 7, characterized in that: The dynamic weight optimization strategy is specifically as follows: S1, Initialization weight: At the beginning of training, an initial weight is assigned to each sub-loss function ,The weights are set manually based on prior knowledge; S2, calculate the loss gradient: In each iteration, calculate the gradient of each sub-loss function ; S3, update weights: dynamically adjust weights based on the performance of the model in the current iteration , the weight update formula is: in, is the weight of the kth sub-loss function at the tth iteration, Is a learning rate used to control the speed of weight adjustment. The denominator is the sum of the squares of the gradients of all sub-loss functions, which is used to normalize the weight update; S4, Apply weights: Use the updated weights Calculate the new total loss ,in, is the kth sub-loss function, is the corresponding weight, are the parameters of the model; S5, iterative process: repeat steps S2 to S4 until the model converges or reaches the predetermined number of training rounds.
Citation Information
Cited By
Direct current charging pile detection system and method applied to field
CN120779134A
A direct current charging pile detection system and method applied to a site
CN120779134B
Intelligent monitoring method for strength of mine cemented filling body
CN121636984A
Intelligent monitoring method for strength of mine cemented filling body
CN121636984B