Charging pile ground fault intelligent monitoring method based on deep learning
The combination of a transformer encoder and improved squirrel search algorithm addresses the limitations of existing deep learning methods for charging station ground fault detection, achieving high accuracy and rapid response in fault classification.
Patent Information
- Application Number
- CN202510486042.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-17
- Publication Date
- 2025-07-15
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing charging pile grounding fault detection methods are difficult to achieve real-time and efficient fault warning when facing complex electrical environments and noise interference. In addition, traditional deep learning models have limitations in feature extraction and hyperparameter optimization, resulting in insufficient detection accuracy and response speed.
The converter encoder is used to extract the feature of electrical signals, combine with the improved squirrel search algorithm for hyperparameter optimization, update the candidate solutions through multiple iterations, build a charging pile grounding fault detection model, and deploy it in the monitoring system for real-time detection.
It achieves high accuracy and rapid response to charging pile grounding faults, with detection accuracy exceeding 98%, and alarm response time below 0.3 seconds, which significantly improves the robustness and adaptability of the system and reduces operating costs.
Smart Images

Figure CN120316583A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of deep learning, and particularly to an intelligent monitoring method for grounding faults of charging piles based on deep learning. Background Art
[0002] With the rapid development of new energy vehicles and charging infrastructure, as an important part of the electric vehicle charging system, the safety and stability of charging piles have received increasing attention. Traditional charging pile monitoring technologies mainly rely on hardware sensors and simple threshold judgment methods, and their real-time monitoring and fault detection capabilities for electrical parameters are relatively limited. These methods are easily affected by noise and interference in the face of complex electrical environments and changing working conditions, resulting in untimely fault warnings or frequent false alarms. In recent years, deep learning technologies have achieved remarkable results in fields such as pattern recognition, image processing, and signal analysis, and have gradually become an important means in the field of intelligent monitoring. However, existing monitoring methods based on deep learning still have some obvious defects and deficiencies in the detection of charging pile grounding faults.
[0003] Currently, at home and abroad, the charging pile fault detection technology mainly adopts solutions based on traditional signal processing algorithms and shallow neural networks. Although such methods can achieve fault detection to a certain extent, their feature extraction capabilities and model generalization capabilities are limited. Traditional algorithms often require a large number of manually designed feature engineering, and lack sufficient robustness to environmental changes and noise interference; while shallow neural networks are prone to falling into local optima when dealing with high-dimensional and large-scale data, and it is difficult to capture the potential complex patterns in electrical signals. Especially in the practical application of charging pile grounding faults, the multi-dimensionality and time-variability of electrical signals make it difficult for traditional methods to accurately identify the precursor features of faults and cannot provide a real-time and efficient warning mechanism.
[0004] In addition, some studies have begun to introduce convolutional neural networks and recurrent neural networks in deep learning to solve the charging pile monitoring problem. Such methods have certain advantages in feature extraction and time series analysis, but convolutional neural networks are sensitive to the extraction of local features and have certain limitations in dealing with long-distance dependence problems; although recurrent neural networks can capture temporal features, they are prone to problems of gradient disappearance or gradient explosion in the processing of long sequence data, and the training efficiency is low. Therefore, how to construct a deep learning model that can fully integrate local details and global dependence information in multi-dimensional electrical signals, and at the same time has strong robustness and real-time response capabilities has become an important problem that needs to be solved urgently in the current charging pile grounding fault monitoring technology.
[0005] When deep learning is applied to the fault detection of charging piles, the existing technology usually adopts a transformer encoder structure based on the self-attention mechanism. This structure can capture global features to a certain extent. However, in practical applications, the computational complexity of the self-attention mechanism is relatively high, which poses certain difficulties for the deployment of edge devices. Moreover, when facing large-scale real-time data, it is prone to processing delay problems. In addition, most of the existing methods rely on traditional random search or grid search methods for hyperparameter optimization. These methods have low search efficiency and cannot fully utilize the structural information contained in the data to guide the adjustment of model parameters, resulting in less than ideal performance of the final detection model. For application scenarios such as charging piles that require real-time monitoring and quick response, such deficiencies seriously affect the safety and stability of the system.
[0006] In addition, the existing technology lacks an effective diversity maintenance mechanism during the update process of the candidate solution population, resulting in being prone to falling into local optimal solutions during the iteration process and being difficult to achieve global search. As a newly emerging swarm intelligence optimization algorithm, the squirrel search algorithm has achieved a certain balance between global and local search by simulating the behavior of squirrels looking for food and avoiding danger in nature. However, when applied to the intelligent monitoring method for the grounding fault of charging piles, directly applying the traditional squirrel search algorithm fails to fully consider the maintenance of candidate solution diversity, which easily leads to too fast convergence of the search space, thus reducing the global optimization ability of the model.
[0007] Therefore, how to provide an intelligent monitoring method for the grounding fault of charging piles based on deep learning is an urgent problem to be solved by those skilled in the art. Summary of the Invention
[0008] An object of the present invention is to propose an intelligent monitoring method for the grounding fault of charging piles based on deep learning. The present invention makes full use of the transformer encoder and the improved squirrel search algorithm in deep learning technology to perform full-scale data training and hyperparameter optimization on the multi-dimensional electrical signals collected by the charging piles, and details the technical solutions for intelligently realizing real-time detection of grounding faults and fault state classification, having the advantages of high detection accuracy, fast response speed, strong robustness, and excellent global search and optimization ability.
[0009] An intelligent monitoring method for the grounding fault of charging piles based on deep learning according to an embodiment of the present invention includes the following steps:
[0010] S1. Real-time collect the electrical signals generated by the charging pile during the working state and store the electrical signals;
[0011] S2. Preprocess the stored electrical signals to form a standardized data set;
[0012] S3. Use the transformer encoder to extract features from the standardized data set to obtain the local details and global dependency information in the preprocessed electrical signals;
[0013] S4. Generate a candidate solution population for the transformer encoder according to the preset candidate hyperparameters, construct an initial parameter configuration, perform partial training on each candidate solution on the preset training data set, and calculate the objective function values of each candidate solution;
[0014] S5. Use the improved squirrel search algorithm to perform local search and global migration operations on the candidate solution population, continuously update the candidate solutions through multiple iterations until the preset termination condition is reached, and obtain the optimal hyperparameter configuration;
[0015] S6. Use the optimal hyperparameter configuration to perform full-scale data training on the transformer encoder, construct a charging pile grounding fault detection model, and deploy the charging pile grounding fault detection model in the monitoring system to perform real-time detection and classification of charging pile grounding faults.
[0016] Optionally, the S3 specifically includes:
[0017] S31. Process the standardized data set in batches. The input data matrix is X = {x1, x2,..., x n}, where x n represents the nth sample, n is the total number of samples, d is the data dimension, and at the same time, initialize the parameters of the transformer encoder, including the frequency domain transformation kernel, the phase correlation matrix calculation parameters, the feed-forward network weight matrices W1, W2, and the normalization parameters;
[0018] S32. Perform discrete Fourier transform on the input data matrix X to convert the time-domain signal into a frequency-domain representation matrix F:
[0019]
[0020] where i is the imaginary unit, k represents the frequency component index, x j represents the value of the jth sample in the input data matrix X, and F(k) represents the value of the frequency-domain feature;
[0021] S33. Extract the amplitude matrix M and the phase matrix P from the frequency-domain representation matrix F respectively;
[0022] S34. Build a frequency-domain phase correlation mechanism based on the transformer encoder to calculate the frequency-domain phase correlation matrix C:
[0023]
[0024] where ⊙ represents element-wise multiplication, softmax( ) represents normalizing each row of the matrix, is the normalization factor, and cos() is the cosine function;
[0025] S35. Perform feature mapping based on the transformer encoder, and use the frequency-domain phase correlation matrix C to perform weighted mapping on the input data matrix X to obtain the frequency-domain enhanced feature representation matrix Z. Subsequently, input the frequency-domain enhanced feature representation matrix into a two-branch feed-forward neural network, where:
[0026] The first branch adopts feed-forward mapping:
[0027] X′1 = ReLU(ZW1 + b1)W2 + b2;
[0028] The second branch adopts dynamic scaling mapping:
[0029] X′2 = sigmoid(ZW3 + b3) ⊙ (ZW4 + b4);
[0030] where W1, W2, W3, W4 are weight matrices respectively, b1, b2, b3, b4 are bias vectors respectively, ReLU() is the rectified linear unit activation function, sigmoid() is the sigmoid activation function, X′1 represents the output feature obtained by the first branch through traditional feed-forward mapping, X′2 represents the output feature obtained by the second branch through dynamic scaling mapping, and fuse the outputs of the two branches through a learnable weighting factor α:
[0031] X″ = α · X′1 + (1 - α) · X′2;
[0032] where α is a learnable scaling factor, and X″ represents the fused mapping feature;
[0033] S36. Perform adaptive residual connection and layer normalization on the fused mapping feature to obtain an adaptive gating vector, and fuse the input data matrix X and the fused mapping feature X″ through the adaptive gating vector and perform layer normalization:
[0034] X out = LayerNorm(G ⊙ X″ + (1 - G) ⊙ X);
[0035] where LayerNorm() represents the layer normalization operation, and X out is the finally output feature representation.
[0036] Optionally, the specific steps of S4 include:
[0037] S41. Construct a candidate hyperparameter space Θ:
[0038]
[0039] where θ (i)The hyperparameter vector representing the \(i\)-th candidate solution in the candidate hyperparameter space, represents the \(k\)-th hyperparameter in the \(i\)-th candidate solution, \(N\) is the total number of candidate solutions, and \(k\) is the dimension of the hyperparameters;
[0040] S42. According to the hyperparameter space \(\Theta\), use the mapping function \(f\) to map each hyperparameter vector \(\theta\) (i) to the initial parameter configuration of the transformer encoder to generate a population of candidate solutions:
[0041] \(S = \{s\) i \mid s\) i \(= f(\theta\) (i) ), i = 1, 2, \ldots, N\}\);
[0042] where, the initial parameter configuration corresponding to each candidate solution \(s\) i is denoted as \(P\) i :
[0043]
[0044] where, are the initial weight parameters of the query, key, and value matrices respectively, and are the initial weight parameters of the feed-forward network;
[0045] S43. On the preset training dataset \(D\), perform partial training on the set of initial parameter configurations of the transformer encoder for \(T\) epochs to obtain the updated set of parameter configurations of the transformer encoder
[0046] S44. For each updated parameter configuration \(P'\) of the transformer encoder i , calculate the objective function value \(J(P'\) i ):
[0047]
[0048] where, \(D\) v represents the preset validation dataset, \(f(x; P'\) i ) represents the predicted output, \(l(\cdot, \cdot)\) represents the loss function, \(y\) represents the true label of the sample, \(\lambda\) is the regularization coefficient, and \(\Omega(P'\) i ) represents the Frobenius norm.
[0049] Optionally, the specific content of S5 includes:
[0050] S51. For each candidate solution \(P'\) i , calculate the diversity score \(\Delta\) of the candidate solution i :
[0051]
[0052] Among them, ‖P′ i -P′ j ‖2 represents the Euclidean distance between the candidate solution P′ i and P′ j . T is the current temperature parameter, N represents the total number of candidate solutions in the candidate solution population, and exp is the exponential function;
[0053] S52. Update the temperature parameter T according to the current iteration number t and the average diversity score of the candidate solution population :
[0054]
[0055] Among them, T0 is the initial temperature, β is the cooling coefficient, and κ is the diversity sensitivity coefficient;
[0056] S53. Set the diversity threshold δ. For each candidate solution P′ i , if the diversity score satisfies Δ i <δ, it is determined that the candidate solution is in a low-diversity state and needs to be updated by adaptive mutation;
[0057] S54. For the candidate solution P′ i identified as having low diversity, perform mutation update to obtain the local mutation result
[0058]
[0059] Among them, μ is the mutation coefficient, η is the non-linear adjustment parameter, and ξ i is a random vector obeying the uniform distribution ;
[0060] S55. For each candidate solution P′ i , update the parameter configuration using the global migration strategy to obtain the global migration result
[0061]
[0062] Among them, P * represents the candidate solution with the lowest objective function value in the current population, ζ is the global migration coefficient, μ1 is the adjustment parameter, and max is the maximum value operation;
[0063] S56. For each candidate solution P′ i , compare the objective function values of the local mutation result and the global migration result and and update the candidate solution using the following rules:
[0064]
[0065] Among them, is a candidate solution for update;
[0066] S57. Updated candidate solution set Recalculate the diversity scores of each candidate solution and combine them with the objective function values of each candidate solution Judge whether the preset termination condition is met, that is, the number of iterations reaches T max or the objective function value converges. If not, return to S522 for the next round of iteration; if so, select the candidate solution with the lowest objective function value as the optimal hyperparameter configuration for output.
[0067] Optionally, the specific steps of S6 include:
[0068] S61. Integrate the electrical signals collected during the operation of the charging pile, perform noise filtering, missing value filling, normalization and standardization processing on the electrical signals to form a complete and consistent training data set;
[0069] S62. Call the obtained optimal hyperparameter configuration, including structural parameters and training strategy parameters, to initialize the converter encoder;
[0070] S63. Input the training data set into the converter encoder for multiple rounds of iterative training. During the training process, use the batch input method and continuously monitor the loss function, accuracy, and recall rate;
[0071] S64. Connect a classification decision layer to the output end of the trained converter encoder, map the features extracted by the encoder into specific fault state classification results, and form a charging pile grounding fault detection model;
[0072] S65. Evaluate the charging pile grounding fault detection model on an independent validation data set, and output performance indicators such as accuracy, recall rate, precision, and F1 score;
[0073] S66. Deploy the constructed and verified charging pile grounding fault detection model to the monitoring system, perform real-time inference through an embedded device or an edge computing platform, and perform fault detection and classification on the collected real-time electrical signals to trigger an alarm in a timely manner.
[0074] The beneficial effects of the present invention are:
[0075] The present invention has achieved remarkable technological breakthroughs in the field of intelligent monitoring of grounding faults in charging piles by making full use of the transformer encoder in deep learning technology and the improved squirrel search algorithm. Traditional monitoring methods, due to relying on hardware sensors and simple threshold judgments, often have difficulty in quickly and accurately identifying grounding faults in complex electrical environments, and have great limitations in dealing with variable working conditions and noise interference. The present invention uses a deep learning model to train all the data of the electrical signals collected by the charging pile, extracts local details and global dependence information in the signals through the transformer encoder, and effectively overcomes the defects of traditional methods that rely too much on manual feature design and have insufficient extraction capabilities of shallow networks.
[0076] In the present invention, first, the full amount of collected data is preprocessed to uniformly handle problems such as noise, missing values, and inconsistencies, thereby ensuring the reliability of the input data quality; subsequently, the transformer encoder model is initialized by loading the improved hyperparameter configuration and trained with all the data, enabling the model to fully mine the time-varying features and potential fault patterns hidden in the electrical signals during the operation of the charging pile. As an important part of deep learning, the multi-layer stacked structure and deep feed-forward network of the transformer encoder can not only capture complex patterns in the electrical signals, but also, after being trained with all the data, its weights and parameters can be finely adjusted, providing strong feature support for subsequent fault classification and decision-making.
[0077] On the other hand, the present invention introduces an improved squirrel search algorithm in the hyperparameter optimization stage. Its core innovation lies in the effective maintenance of candidate solution diversity through the dynamic temperature update and adaptive mutation update mechanisms. In the traditional squirrel search algorithm, although the local search and global migration operations can achieve a certain global search ability, due to the lack of diversity maintenance, it is easy to fall into local optimal solutions, affecting the final performance of the model. The present invention makes the algorithm automatically adjust the search step size and migration amplitude in each iteration by introducing a diversity score and a dynamic temperature parameter during the candidate solution update process, thereby greatly improving the efficiency and accuracy of global search. This improvement not only ensures the diversity and breadth of candidate solutions during the update process, but also significantly improves the convergence speed and robustness of the deep learning model in the hyperparameter optimization stage, providing a solid foundation for the construction of the charging pile grounding fault detection model.
[0078] Based on the above technical solutions, the beneficial effects of the present invention are mainly reflected in the following aspects. First, the grounding fault detection model of the charging pile constructed by the present invention can make full use of the feature extraction ability of deep learning, and realizes the deep fusion of local details and global dependence information in electrical signals through the converter encoder, greatly improving the accuracy and real-time response ability of fault detection. Second, the improved squirrel search algorithm effectively breaks through the limitations of traditional hyperparameter optimization methods by dynamically adjusting search parameters and maintaining the diversity of candidate solutions, enabling the model to quickly converge to the global optimal solution during the training process and further improving the overall performance of the system. Moreover, since the present invention realizes full-process automation in the model training and hyperparameter optimization process, it reduces the dependence on manual intervention and professional knowledge, thereby reducing the system maintenance and operation costs, and has good scalability and adaptability, suitable for charging pile monitoring scenarios of different types and scales.
[0079] In addition, during the actual deployment process of the present invention, by integrating the trained fault detection model into the online monitoring system, continuous monitoring and intelligent fault classification of the real-time electrical signals of the charging pile are realized. Once an abnormal state is detected, the system can quickly issue a warning signal and trigger corresponding safety measures, effectively preventing safety accidents caused by grounding faults. This real-time and efficient monitoring ability is of great significance for ensuring the safe operation of the charging pile and the electric vehicle charging system, and also provides technical support for the construction of smart grids and smart cities.
[0080] Generally speaking, the intelligent monitoring method for grounding faults of charging piles based on deep learning proposed by the present invention successfully overcomes the deficiencies of traditional methods in feature extraction, hyperparameter optimization and real-time monitoring. Through the organic combination of deep learning and improved swarm intelligence algorithms, it not only significantly improves the accuracy and response speed of fault detection, but also achieves good results in system robustness, adaptability and economy. This method can effectively reduce the fault risk of charging piles in practical applications, improve the safety and reliability of the charging system, and provide a new technical path and solution for the intelligent upgrade of new energy vehicle charging infrastructure. Description of the Drawings
[0081] The drawings are used to provide further understanding of the present invention and constitute a part of the specification. They are used together with the embodiments of the present invention to explain the present invention and do not constitute a limitation to the present invention. In the drawings:
[0082] Figure 1 is a flowchart of an intelligent monitoring method for grounding faults of charging piles based on deep learning proposed by the present invention;
[0083] Figure 2This is a deployment schematic diagram of real-time detection and classification of charging pile grounding faults in a monitoring system for an intelligent monitoring method of charging pile grounding faults based on deep learning proposed by the present invention. Detailed implementation manners
[0084] Now, the present invention will be further described in detail with reference to the accompanying drawings. These drawings are all simplified schematic diagrams, only illustrating the basic structure of the present invention in a schematic manner, so they only show the components related to the present invention.
[0085] Refer to Figure 1 and Figure 2 An intelligent monitoring method for charging pile grounding faults based on deep learning includes the following steps:
[0086] S1. Real-time collect the electrical signals generated by the charging pile during the working state and store the electrical signals;
[0087] S2. Preprocess the stored electrical signals to form a standardized data set;
[0088] S3. Use a transformer encoder to extract features from the standardized data set to obtain local details and global dependency information in the preprocessed electrical signals;
[0089] S4. According to the preset candidate hyperparameters, generate a candidate solution population of the transformer encoder and construct an initial parameter configuration, and perform partial training on each candidate solution on the preset training data set, and calculate the objective function values of each candidate solution;
[0090] S5. Adopt an improved squirrel search algorithm to perform local search and global migration operations on the candidate solution population, continuously update the candidate solutions through multiple rounds of iteration until the preset termination condition is reached, and obtain the optimal hyperparameter configuration;
[0091] S6. Use the optimal hyperparameter configuration to perform full-data training on the transformer encoder, construct a charging pile grounding fault detection model, and deploy the charging pile grounding fault detection model in the monitoring system to perform real-time detection and classification of charging pile grounding faults.
[0092] By combining deep learning with an improved swarm intelligence algorithm, the present invention realizes high-precision real-time monitoring of charging pile grounding faults. The transformer encoder is used to perform deep feature extraction on multi-dimensional electrical signals, fully capturing local details and global dependencies in the signals. At the same time, an improved squirrel search algorithm is adopted to optimize the hyperparameter configuration, effectively maintaining the diversity of candidate solutions and accelerating the convergence speed of the model's full-data training. In practical applications, this method can give early warnings before the charging pile fails, the alarm response time is less than 0.3 seconds, and the detection accuracy remains above 98%, greatly improving the fault detection efficiency and system robustness, providing a solid guarantee for the safe operation of the charging pile.
[0093] In this embodiment, S3 specifically includes:
[0094] S31. Process the standardized data set in batches. The input data matrix is X = {x1, x2, …, x n}, where x n represents the nth sample, n is the total number of samples, d is the data dimension. At the same time, initialize the parameters of the transformer encoder, including the frequency-domain transformation kernel, the phase correlation matrix calculation parameters, the feed-forward network weight matrices W1, W2, and the normalization parameters;
[0095] S32. Perform a discrete Fourier transform on the input data matrix X to convert the time-domain signal into a frequency-domain representation matrix F:
[0096]
[0097] where i is the imaginary unit, k represents the frequency component index, x j represents the value of the jth sample in the input data matrix X, and F(k) represents the value of the frequency-domain feature;
[0098] S33. Extract the amplitude matrix M and the phase matrix P from the frequency-domain representation matrix F respectively;
[0099] S34. Build a frequency-domain phase correlation mechanism based on the transformer encoder to calculate the frequency-domain phase correlation matrix C:
[0100]
[0101] where ⊙ represents element-wise multiplication, softmax() represents normalizing each row of the matrix, is the normalization factor, and cos() is the cosine function;
[0102] S35. Perform feature mapping based on the transformer encoder. Use the frequency-domain phase correlation matrix C to perform weighted mapping on the input data matrix X to obtain the frequency-domain enhanced feature representation matrix Z. Subsequently, input the frequency-domain enhanced feature representation matrix into the two-branch feed-forward neural network, where:
[0103] The first branch uses feed-forward mapping:
[0104] X′1 = ReLU(ZW1 + b1)W2 + b2;
[0105] The second branch uses dynamic scaling mapping:
[0106] X′2 = sigmoid(ZW3 + b3) ⊙ (ZW4 + b4);
[0107] Among them, W1, W2, W3, and W4 are weight matrices respectively, b1, b2, b3, and b4 are bias vectors respectively, ReLU() is the rectified linear unit activation function, sigmoid() is the sigmoid activation function, X′1 represents the output feature obtained by the first branch through traditional feed-forward mapping, X′2 represents the output feature obtained by the second branch through dynamic scaling mapping, and the outputs of the two branches are fused through a learnable weighting factor α:
[0108] X″ = α·X′1 + (1 - α)·X′2;
[0109] Among them, α is a learnable scaling factor, and X″ represents the fused mapping feature;
[0110] S36. Perform adaptive residual connection and layer normalization on the fused mapping feature to obtain an adaptive gating vector, and fuse the input data matrix X and the fused mapping feature X through the adaptive gating vector ″ And perform layer normalization:
[0111] X out = LayerNorm(G⊙X ″ +(1 - G)⊙X);
[0112] Among them, LayerNorm() represents the layer normalization operation, and X out is the final output feature representation.
[0113] Through the frequency-domain phase correlation mechanism and the dual-branch feed-forward neural network constructed based on the transformer encoder, the present invention realizes the efficient extraction of deep features of the standardized data set. The time-domain signal is converted into a frequency-domain representation by using the discrete Fourier transform, and the amplitude and phase information is further extracted from it. Then, by constructing a frequency-domain phase correlation matrix, the local details and global dependencies in the signal can be fully captured. After the feature mapping and fusion of the dual-branch feed-forward neural network, the system can adaptively generate high-quality feature representations. Furthermore, through the adaptive residual connection and layer normalization mechanism, the original input and the mapping feature are robustly fused to ensure the stability and robustness of the model output features. This method effectively improves the feature extraction accuracy and signal expression ability of the charging pile grounding fault detection model, reduces the influence of noise interference on fault recognition, and thus significantly improves the accuracy and response speed of fault detection. Through the above technical solutions, the present invention not only realizes the accurate capture of weak fault precursors in complex electrical signals, but also has strong self-adaptability and global optimization ability during the model training process, providing reliable and stable technical support for the real-time monitoring and intelligent classification of charging pile grounding faults.
[0114] In this embodiment, the S4 specifically includes:
[0115] S41. Construct the candidate hyperparameter space Θ:
[0116]
[0117] where θ (i) denotes the hyperparameter vector of the i-th candidate solution in the candidate hyperparameter space, represents the k-th hyperparameter in the i-th candidate solution, N is the total number of candidate solutions, and k is the dimension of the hyperparameters;
[0118] S42. Based on the hyperparameter space Θ, use the mapping function f to map each hyperparameter vector θ (i) to the initial parameter configuration of the transformer encoder, generating a population of candidate solutions:
[0119] S = {s i |s i = f(θ (i) ), i = 1, 2, …, N};
[0120] where the initial parameter configuration corresponding to each candidate solution s i is denoted as P i :
[0121]
[0122] where are respectively the initial weight parameters of the query, key, and value matrices, and are the initial weight parameters of the feed-forward network;
[0123] S43. On the preset training dataset D, perform partial training on the set of initial parameter configurations of the transformer encoder for T epochs, obtaining the updated set of parameter configurations of the transformer encoder
[0124] S44. For each updated parameter configuration P′ i of the transformer encoder, calculate the objective function value J(P′ i ):
[0125]
[0126] where D v denotes the preset validation dataset, f(x; P′ i ) represents the predicted output, l(·, ·) represents the loss function, y represents the true label of the sample, λ is the regularization coefficient, and Ω(P′ i ) represents the Frobenius norm.
[0127] The present invention realizes the automatic generation of a candidate solution population by constructing a candidate hyperparameter space and using a mapping function to map each hyperparameter vector into an initial parameter configuration of a transformer encoder. Subsequently, partial training is performed on these initial parameter configurations on a preset training dataset, enabling a preliminary evaluation of the performance of the transformer encoder under different candidate solutions. The quality of each candidate solution is further quantified by calculating the objective function value. This method effectively integrates hyperparameter optimization and deep learning model training, ensuring both the diversity of the model's initial parameter configuration and, through the objective function value combined with regularization and Frobenius norm constraints, the stability and generalization ability of the candidate solutions during the optimization process. Thus, the present invention can automatically and efficiently screen out the model configuration with the optimal performance during the hyperparameter search process, thereby significantly improving the extraction accuracy and robustness of the transformer encoder for complex electrical signal features. Overall, this technical solution realizes the global optimization and dynamic adjustment of hyperparameters, reduces manual intervention, improves training efficiency, provides a solid technical support for constructing a high-precision and highly reliable model for the intelligent monitoring system of charging pile grounding faults, and demonstrates good applicability and stability in practical applications.
[0128] In this embodiment, S5 specifically includes:
[0129] S51. For each candidate solution P′ i , calculate the diversity score Δ i of the candidate solution:
[0130]
[0131] where, ‖P′ i - P′ j ‖2 represents the Euclidean distance between candidate solutions P′ i and P′ j , T is the current temperature parameter, N represents the total number of candidate solutions in the candidate solution population, and exp is the exponential function;
[0132] S52. Update the temperature parameter T according to the current iteration number t and the average diversity score of the candidate solution population:
[0133]
[0134] where, T0 is the initial temperature, β is the cooling coefficient, and κ is the diversity sensitivity coefficient;
[0135] S53. Set a diversity threshold δ. For each candidate solution P′ i , if the diversity score satisfies Δ i < δ, it is determined that the candidate solution is in a low diversity state and needs to be updated by adaptive mutation;
[0136] S54. For the candidate solution P′ identified as having low diversity i , perform mutation update to obtain the local mutation result
[0137]
[0138] where μ is the mutation coefficient, η is the non - linear adjustment parameter, and ξ i is a random vector subject to a uniform distribution ;
[0139] S55. For each candidate solution P′ i , adopt the global migration strategy to update the parameter configuration to obtain the global migration result
[0140]
[0141] where P * represents the candidate solution with the lowest objective function value in the current population, ζ is the global migration coefficient, μ1 is the adjustment parameter, and max is the maximum value operation;
[0142] S56. For each candidate solution P′ i , compare the objective function values of the local mutation result and the global migration result and update the candidate solution using the following rule: and where
[0143]
[0144] where is the updated candidate solution;
[0145] S57. For the updated candidate solution set , recalculate the diversity scores of each candidate solution, and combine with the objective function values of each candidate solution to determine whether the preset termination condition is met, that is, the number of iterations reaches T max or the objective function value converges. If not, return to S522 for the next round of iteration; if so, select the candidate solution with the lowest objective function value as the optimal hyperparameter configuration for output.
[0146] The present invention adopts an improved squirrel search algorithm. By calculating the diversity score for each candidate solution, quantifying the differences between candidate solutions using Euclidean distance and exponential function, and combining with the adaptive update of dynamic temperature parameters, intelligent regulation of the search step size is achieved. Aiming at the problem of insufficient diversity of candidate solutions, the present invention sets a diversity threshold and introduces a non-linear adjustment mechanism to perform adaptive mutation update on low-diversity candidate solutions to achieve local optimization through random perturbation. At the same time, through the global migration strategy, the parameter configuration of other candidate solutions is adjusted specifically according to the current best candidate solution, and the migration amplitude of low-diversity candidate solutions is amplified, so as to effectively jump out of the local optimum. By continuously comparing the objective function values after local mutation and global migration, the dynamic update and global optimization of the candidate solution population are finally realized in multiple rounds of iteration. The improvement of the present invention not only ensures the diversity and global search ability of candidate solutions, but also significantly improves the hyperparameter optimization efficiency, making the finally obtained hyperparameter configuration of the transformer encoder more stable and reliable, providing a solid technical support for the construction of the charging pile grounding fault detection model, and effectively improving the accuracy, response speed and system robustness of fault detection.
[0147] In this embodiment, step S6 specifically includes:
[0148] S61. Integrate the electrical signals collected during the operation of the charging pile, perform noise filtering, missing value filling, normalization and standardization processing on the electrical signals to form a complete and consistent training data set;
[0149] S62. Call the obtained optimal hyperparameter configuration, including structural parameters and training strategy parameters, to initialize the transformer encoder;
[0150] S63. Input the training data set into the transformer encoder and perform multiple rounds of iterative training. During the training process, use the batch input method and continuously monitor the loss function, accuracy, and recall rate;
[0151] S64. Connect a classification decision layer at the output end of the trained transformer encoder, map the features extracted by the encoder into specific fault state classification results, and form a charging pile grounding fault detection model;
[0152] S65. Evaluate the charging pile grounding fault detection model on an independent verification data set and output performance indicators such as accuracy, recall rate, precision rate, and F1 score;
[0153] S66. Deploy the constructed and verified charging pile grounding fault detection model to the monitoring system, perform real-time inference through an embedded device or an edge computing platform, and perform fault detection and classification on the collected real-time electrical signals to trigger an alarm in a timely manner.
[0154] The present invention constructs a complete and consistent training dataset by integrating the electrical signals collected during the operation of the charging pile, and performing noise filtering, missing value completion, normalization, and standardization on them, providing a high-quality data basis for model training. The optimal hyperparameter configuration obtained is used to initialize the transformer encoder, so that both the model structure and the training strategy are fully optimized, effectively improving the model's ability to extract signal features. During the multi-round iterative training process of inputting the training dataset into the transformer encoder, the batch input method and continuous monitoring of loss function, accuracy, and recall rate metrics ensure the stability and convergence speed of model training. After training, a classification decision layer is connected to the output end of the encoder to map the deep features into specific fault states, forming a high-precision grounding fault detection model for the charging pile. After evaluating the model on an independent validation dataset, indicators such as accuracy, recall rate, precision, and F1 score all reach ideal levels, verifying the high robustness and practicality of the model. Finally, after being deployed to the monitoring system, real-time inference is achieved through embedded devices or edge computing platforms, which can quickly analyze the collected real-time electrical signals, perform fault detection and classification, trigger alarms in a timely manner, effectively ensure the safe operation of the charging pile, and significantly improve the reliability and intelligence level of the entire system.
[0155] Embodiment 1:
[0156] To verify the feasibility of the present invention in implementation, the present invention is applied to a large charging station in a provincial capital city. The charging station has 200 charging piles, which are distributed in the parking lot with a site area of 3,000 square meters. Due to the complex installation environment of the charging piles, long usage time, and large external electromagnetic interference, the traditional monitoring system often has problems such as low grounding fault detection rate and high alarm delay. To solve this problem, the present invention uses a transformer encoder as the core deep learning module to perform full-scale data training on the collected electrical signals, and introduces an improved squirrel search algorithm in the hyperparameter optimization stage. By dynamically adjusting the diversity of candidate solutions, it ensures that the model can accurately extract fault features in a complex signal environment and output detection results in real time.
[0157] During the pilot operation period, we first collected full-scale data from all the charging piles in the charging station. The data acquisition device continuously records electrical parameters such as current, voltage, and temperature of the charging piles for 24 hours a day. After preprocessing, the data is subjected to noise filtering, normalization, and standardization to form a complete training and validation dataset. Using these data, we loaded the optimal hyperparameter configuration optimized by the improved squirrel search algorithm and performed full-scale data training on the transformer encoder. During the training process, the deep model continuously optimizes its weights and parameter configurations through multiple rounds of iteration, causing the loss value of the model on the training dataset to rapidly decrease and achieving a high detection accuracy on the validation set.
[0158] After training, a complete grounding fault detection model for charging piles is constructed. A classification decision layer is connected to the output end of the converter encoder of this model, mapping the extracted deep features into classification results of grounding faults or normal states. Subsequently, the model is exported and deployed into the online monitoring system of the charging station, embedded in the edge computing device of the charging station, to achieve online analysis and fault warning of real-time collected electrical signals. After continuous operation and testing for one month, the system performs excellently in practical applications. It can detect abnormalities within 2 seconds before a grounding fault occurs in the charging pile and issue an alarm within 0.3 seconds after the fault occurs. Data statistics show that the fault detection accuracy of this system exceeds 98%, and the success rate of fault warning reaches 97%, which is about 20 percentage points higher than that of traditional monitoring methods. At the same time, the average response time is reduced to 0.3 seconds, significantly improving the safety and maintenance efficiency of the charging pile.
[0159] Table 1 Comparison Table of Grounding Fault Detection Data of Charging Piles in a Certain Charging Station
[0160]
[0161]
[0162] As can be seen from Table 1 of the data, during multiple monitoring cycles from March to May 2024, the detection accuracy of traditional methods generally remained between 78% and 82%, showing relatively large fluctuations. Due to its mainly relying on fixed thresholds and simple discrimination mechanisms, it is prone to noise interference, with a high misjudgment rate and poor stability when facing complex and changeable electrical environments. At the same time, its alarm response time exceeds 1 second, reaching 1.3 seconds at the slowest, with a certain alarm lag problem, which may delay the fault handling time in practical applications and pose a relatively large safety hazard.
[0163] In contrast, the monitoring system constructed by using the method of the present invention always maintains an accuracy rate of more than 98% in terms of detection accuracy. And in the latest data in May, the accuracy rate is further increased to 98.5%, showing good stability and transferability. This is mainly due to the deep modeling ability of the deep learning model for electrical signals. Especially, the converter encoder can effectively identify the internal relationships between complex data in terms of feature extraction. At the same time, the improved squirrel search algorithm enhances the generalization ability of the model through dynamic hyperparameter optimization, thus further enhancing the detection performance.
[0164] In terms of response time, the average alarm response time of the method of the present invention is stably maintained between 0.27 seconds and 0.32 seconds, significantly superior to the traditional method, indicating that this method can achieve near real-time fault identification and alarm in practical applications, providing key safety guarantees for the operation of charging piles. In addition, the failure warning success rate has also been maintained above 97% for a long time, fully reflecting the high reliability and robustness of this method. Especially in the two rounds of detections in April and May, the failure warning success rates reached 97.5% and 97.2% continuously, indicating that the system can still maintain a high monitoring ability after long-term operation without performance degradation.
[0165] Based on the above comprehensive data analysis, the intelligent monitoring method for grounding faults of charging piles proposed by the present invention is significantly superior to the traditional monitoring method in terms of key performance indicators such as fault identification accuracy, alarm response timeliness, and warning success rate, with significant technical advantages. This method not only improves the intelligent level of grounding fault monitoring, but also effectively reduces the operation and maintenance costs and safety risks, showing good engineering applicability and promotion value in actual deployment.
[0166] The above is only the preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention, according to the technical solution and inventive concept of the present invention, making equivalent substitutions or changes, should be covered by the protection scope of the present invention.
Claims
1. An intelligent monitoring method for grounding faults of charging piles based on deep learning, characterized in that, It includes the following steps: S1. Collect the electrical signals generated by the charging pile in the working state in real time and store the electrical signals; S2. Preprocess the stored electrical signals to form a standardized data set; S3. Use a transformer encoder to extract features from the standardized data set to obtain local details and global dependency information in the preprocessed electrical signals; S4. According to the preset candidate hyperparameters, generate a candidate solution population of the transformer encoder, construct an initial parameter configuration, perform partial training on each candidate solution on the preset training data set, and calculate the objective function values of each candidate solution; S5. Use an improved squirrel search algorithm to perform local search and global migration operations on the candidate solution population, continuously update the candidate solutions through multiple rounds of iteration until the preset termination condition is reached, and obtain the optimal hyperparameter configuration; S6. Use the optimal hyperparameter configuration to perform full-scale data training on the transformer encoder, construct a charging pile grounding fault detection model, and deploy the charging pile grounding fault detection model in the monitoring system to perform real-time detection and classification of the charging pile grounding fault.
2. The intelligent monitoring method for grounding faults of a charging pile based on deep learning according to claim 1, characterized in that, The specific content of S3 includes: S31. Process the standardized data set batch by batch. The input data matrix is X = {x1, x2, …, x n}, where x n represents the nth sample, n is the total number of samples, d is the data dimension. At the same time, initialize the parameters of the transformer encoder, including the frequency domain transformation kernel, the calculation parameters of the phase correlation matrix, the weight matrices W1 and W2 of the feed-forward network, and the normalization parameters; S32. Perform a discrete Fourier transform on the input data matrix X to convert the time-domain signal into a frequency-domain representation matrix F: where \(i\) is the imaginary unit, \(k\) represents the frequency component index, and \(x\) j represents the value of the \(j\)-th sample in the input data matrix \(X\), and \(F(k)\) represents the value of the frequency domain feature; S33. Extract the amplitude matrix M and the phase matrix P from the frequency-domain representation matrix F respectively; S34. Based on the transformer encoder, construct a frequency-domain phase correlation mechanism and calculate the frequency-domain phase correlation matrix C: Among them, ⊙ represents element-wise multiplication, and softmax() represents normalizing each row of the matrix. is the normalization factor, and cos() is the cosine function. S35. Based on the transformer encoder, perform feature mapping, use the frequency-domain phase correlation matrix C to perform weighted mapping on the input data matrix X, and obtain a frequency-domain enhanced feature representation matrix Z. Subsequently, input the frequency-domain enhanced feature representation matrix into a two-branch feed-forward neural network, where: The first branch uses a feed-forward mapping: X′1 = ReLU(ZW1 + b1)W2 + b2; The second branch uses a dynamic scaling mapping: X′2 = sigmoid(ZW3 + b3) ⊙ (ZW4 + b4); Among them, W1, W2, W3, and W4 are weight matrices respectively, b1, b2, b3, and b4 are bias vectors respectively, ReLU() is a rectified linear unit activation function, sigmoid() is a logistic activation function, X′1 represents the output feature obtained by the first branch through the traditional feed-forward mapping, X′2 represents the output feature obtained by the second branch through the dynamic scaling mapping, and fuse the outputs of the two branches through a learnable weighting factor α: X″ = α·X′1 + (1 - α)·X′2; Among them, α is a learnable scaling factor, and X″ represents the fused mapping feature; S36. Perform adaptive residual connection and layer normalization on the fused mapping feature to obtain an adaptive gating vector, fuse the input data matrix X and the fused mapping feature X″ through the adaptive gating vector and perform layer normalization: X out = LayerNorm(G ⊙ X ″ + (1 - G) ⊙ X); Among them, LayerNorm() represents the layer normalization operation, and X out is the feature representation of the final output.
3. The intelligent monitoring method for grounding faults of charging piles based on deep learning according to claim 1, wherein, The specific content of S4 includes: S41. Construct a candidate hyperparameter space Θ: Among them, θ (i) represents the hyperparameter vector of the i-th candidate solution in the candidate hyperparameter space, represents the k-th hyperparameter in the i-th candidate solution, N is the total number of candidate solutions, and k is the dimension of the hyperparameters; S42. According to the hyperparameter space Θ, use the mapping function f to map each hyperparameter vector θ (i) to the initial parameter configuration of the transformer encoder, generating a candidate solution population: S = {s i | s i = f(θ (i) ), i = 1, 2, …, N}; Among them, each candidate solution s i The corresponding initial parameter configuration is denoted as P i : Among them, are respectively the initial weight parameters of the query, key, and value matrices, and are the initial weight parameters of the feed-forward network; S43. On the preset training dataset D, perform partial training on the initial parameter configuration set of the transformer encoder for T epochs to obtain the updated parameter configuration set of the transformer encoder S44. For each updated transducer encoder parameter configuration P′ i , calculate the objective function value J(P′ i ): Among them, D v represents a preset verification data set, f(x; P′ i ) represents the predicted output, l(·, ·) represents the loss function, y represents the true label of the sample, λ is the regularization coefficient, and Ω(P′ i ) represents the Frobenius norm.
4. The intelligent monitoring method for grounding faults of charging piles based on deep learning according to claim 1, wherein, The specific content of S5 includes: S51. For each candidate solution P′ i , calculate the diversity score Δ i of the candidate solution: where, ‖P′ i - P′ j ‖2 represents the Euclidean distance between the candidate solution P′ i and P′ j , T is the current temperature parameter, N represents the total number of candidate solutions in the candidate solution population, and exp is the exponential function; S52. Update the temperature parameter T according to the current iteration number t and the average diversity score of the candidate solution population as follows: Among them, T0 is the initial temperature, β is the cooling coefficient, and κ is the diversity sensitivity coefficient; S53. Set the diversity threshold δ. For each candidate solution P′ i , if the diversity score satisfies Δ i < δ, it is determined that the candidate solution is in a low diversity state and needs to be updated by adaptive mutation; S54. For the candidate solution P' identified as having low diversity i , perform mutation update to obtain a local mutation result where μ is the mutation coefficient, η is the non-linear adjustment parameter, and ξ i is a random vector subject to a uniform distribution ; S55. For each candidate solution P′ i , update the parameter configuration using the global migration strategy to obtain the global migration result Among them, P * represents the candidate solution with the lowest objective function value in the current population. ζ is the global migration coefficient, μ1 is the adjustment parameter, and max is the maximum value operation; S56. For each candidate solution P′ i , compare the local mutation result with the global migration result in terms of the objective function value and Update the candidate solution according to the following rules: Among them, is a candidate solution for update; S57, Updated Candidate Solution Set Recalculate the diversity scores of each candidate solution and combine with the objective function values of each candidate solution Determine whether the preset termination condition is met, i.e., the number of iterations reaches T max Or the objective function value converges. If not satisfied, return to S522 for the next round of iteration; if satisfied, select the candidate solution with the lowest objective function value as the optimal hyperparameter configuration for output.
5. The intelligent monitoring method for grounding faults of charging piles based on deep learning according to claim 1, wherein The specific content of S6 includes: S61. Integrate the electrical signals collected during the operation of the charging pile, perform noise filtering, missing value completion, normalization, and standardization processing on the electrical signals to form a complete and consistent training data set; S62. Call the obtained optimal hyperparameter configuration, including structural parameters and training strategy parameters, to initialize the transformer encoder; S63. Input the training data set into the transformer encoder and perform multiple rounds of iterative training. During the training process, use the batch input method and continuously monitor the loss function, accuracy, and recall rate; S64. Connect a classification decision layer to the output end of the trained transformer encoder, map the features extracted by the encoder to specific fault state classification results, and form a charging pile grounding fault detection model; S65. Evaluate the charging pile grounding fault detection model on an independent validation data set and output performance indicators such as accuracy, recall rate, precision, and F1 score; S66. Deploy the constructed and validated charging pile grounding fault detection model to the monitoring system, perform real-time inference through an embedded device or an edge computing platform, and perform fault detection and classification on the collected real-time electrical signals to trigger an alarm in a timely manner.
Citation Information
Cited By
Energy storage cabinet monitoring method and device based on data analysis
CN120910771A
Energy storage cabinet monitoring method and device based on data analysis
CN120910771B
EEG signal abnormity identification method and system based on big data analysis
CN120918683A