Electric leakage backflow accurate metering and inversion boost grid-connected harmonic active counteracting system fusing AI multi-feature fusion algorithm
By integrating AI multi-feature fusion algorithms to achieve precise leakage current backflow metering and inverter boost grid-connected harmonic active cancellation system, the problems of low accuracy in leakage current signal identification and poor harmonic control effect have been solved. This system achieves high-precision metering and efficient energy recovery, thereby improving power quality and safety.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- LUSIBAO ELECTRIC POWER TECH CO LTD
- Filing Date
- 2026-03-31
- Publication Date
- 2026-05-01
AI Technical Summary
Existing leakage current protection and energy recovery technologies suffer from problems such as low accuracy in leakage current signal identification, inaccurate metering, limited harmonic mitigation effects, and significant signal noise impact, making it difficult to meet the comprehensive requirements of safety, energy efficiency, and power quality in industrial scenarios.
The system employs a multi-feature fusion algorithm to accurately measure leakage current backflow and actively cancel harmonics in inverter-boosted grid connection. It includes modules for data acquisition, intelligent identification, metering management, and energy conversion and governance. It utilizes variational mode decomposition, hyperparameter optimization, gated loop units, and attention mechanisms for signal processing to achieve leakage current type identification and active harmonic cancellation.
It achieves high-precision identification of leakage current type, with metering error controlled within ±1%, excellent harmonic mitigation effect, total harmonic distortion rate reduced to below 5%, strong safety and reliability, energy recovery rate of 1%~5%, and is suitable for multiple power consumption environments.
Smart Images

Figure CN121965524A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of leakage current detection and power safety technology, specifically to a system for accurate metering of leakage current return and active harmonic cancellation of inverter boost grid connection, which integrates AI multi-feature fusion algorithm. It is applicable to leakage current protection, energy recovery and grid harmonic control in various scenarios such as industrial manufacturing, construction engineering and residential electricity use. Background Technology
[0002] Current leakage is a common safety hazard in power systems, mainly caused by factors such as damaged equipment insulation, aging lines, and poor grounding. It can not only lead to accidents such as electric shock and equipment damage, but also result in a significant waste of electrical energy. Traditional leakage protection methods, such as air switches and residual current devices (RCDs), can only "cut off power and stop the loss," and suffer from problems such as delayed response, easy failure, and inability to recover and utilize the energy from leakage.
[0003] Among existing leakage current mitigation technologies, some solutions attempt to recover leakage energy through inverter technology, but they have the following shortcomings: First, they lack accurate identification of leakage signals, making it difficult to distinguish between leakage current caused by intrinsic faults and normal capacitive / inductive leakage currents, resulting in insufficient targeting of control strategies; second, the signal processing uses a fixed parameter decomposition method, which cannot adapt to the non-stationary and multi-modal characteristics of leakage signals, resulting in low feature extraction accuracy; third, the harmonic mitigation effect is limited, and leakage energy is prone to polluting the power grid when connected to the grid; fourth, the metering accuracy is greatly affected by signal noise, making it difficult to accurately count the recovered energy.
[0004] Meanwhile, with the application of AI technology in the power sector, some models are used for power signal analysis. However, traditional models suffer from poor real-time performance and insufficient generalization ability when processing leakage signals, and they have not formed a complete collaborative solution encompassing "identification-metering-conversion-harmonic mitigation," making it difficult to meet the comprehensive requirements of industrial scenarios for safety, energy efficiency, and power quality. Therefore, there is an urgent need for an integrated system that combines intelligent identification, accurate metering, efficient conversion, and harmonic mitigation to address the pain points of existing technologies. Summary of the Invention
[0005] The purpose of this invention is to overcome the shortcomings of existing leakage protection and energy recovery technologies, and to provide a leakage current return accurate metering and inverter boost grid-connected harmonic active cancellation system that integrates AI multi-feature fusion algorithm.
[0006] To achieve the above objectives, the following technical solution is adopted:
[0007] This invention provides a system for accurate leakage current backflow metering and active harmonic cancellation via inverter boost grid connection, integrating an AI multi-feature fusion algorithm, comprising:
[0008] The data acquisition module is used to synchronously acquire leakage-related signals, including leakage voltage signals and leakage current signals on the casing of the leakage device and the grounding wire.
[0009] The intelligent identification module is connected to the data acquisition module and is used to run the fusion intelligent identification model. The intelligent identification model integrates variational mode decomposition, hyperparameter optimization, gated recurrent unit and attention mechanism to process and analyze the leakage current related signals, and output leakage current type identification results and corresponding classification confidence.
[0010] The metering management module is connected to the intelligent identification module and the data acquisition module respectively. It is used to adaptively adjust the leakage voltage signal and leakage current signal according to the classification confidence level, and to measure the leakage return energy parameters based on the adjusted signal.
[0011] The energy conversion and management module is connected to the metering management module and the intelligent identification module, respectively. It is used to convert and boost the leakage return energy, and simultaneously execute harmonic active cancellation control and grid-connected inverter control, so as to suppress the potential of the leakage equipment casing below the safety threshold while realizing energy recovery.
[0012] Furthermore, the operation process of the fusion intelligent recognition model includes the following steps:
[0013] Adaptive mode decomposition of leakage current signals is performed using variational mode decomposition. The number of modes K to be decomposed is based on the number of peak frequencies in the signal spectrum. Adaptive determination;
[0014] Time-domain, frequency-domain, and time-frequency joint features are extracted from each of the decomposed modal signals to construct a comprehensive feature vector as the model input;
[0015] The hyperparameter optimization algorithm adopts the dung beetle optimization algorithm, which is used to optimize the number of hidden layer neurons and the learning rate of the gated recurrent unit network offline, and then solidifies the optimized parameters.
[0016] The comprehensive feature vector is input into the parameter-optimized gated recurrent unit network to extract temporal features;
[0017] The temporal features are weighted and enhanced using a self-attention mechanism;
[0018] Based on the enhanced features, the classifier outputs a probability distribution of leakage types, including at least: intrinsic fault leakage, capacitive leakage, and inductive leakage.
[0019] Furthermore, the number K of the variational mode decomposition is based on the number of peak frequencies in the signal spectrum. Adaptively determined, and the value of K is related to... Positive correlation; the value of the bandwidth constraint parameter α of the variational mode decomposition is positively correlated with the number of modes K.
[0020] Furthermore, the classification confidence level is the maximum value among the probabilities of various leakage current types output by the fusion intelligent identification model; the metering management module is configured to: when the classification confidence level is lower than a preset threshold, initiate adaptive gain adjustment of the leakage voltage signal and leakage current signal.
[0021] Furthermore, the adaptive gain adjustment performed by the metering management module is implemented in the following way:
[0022] The initial adjustment gain is calculated based on the classification confidence level, wherein the initial adjustment gain is negatively correlated with the classification confidence level; the initial adjustment gain is constrained between a preset minimum gain value and a maximum gain value to obtain the final dynamic adjustment gain.
[0023] Furthermore, the leakage current return energy parameters measured by the metering management module include one or more of the following: instantaneous power, total energy, average power, and harmonic energy.
[0024] Furthermore, the harmonic active cancellation control performed by the energy conversion and governance module includes: detecting the background harmonic current at the grid connection point; controlling the inverter in the energy conversion and governance module to output a cancellation current with the same amplitude and opposite phase as the background harmonic current; and using a repetitive control algorithm to perform closed-loop correction on the cancellation current based on the superposition error between the background harmonic current and the cancellation current.
[0025] Furthermore, the grid-connected inverter control executed by the energy conversion and governance module adopts a voltage-current dual-loop control strategy, wherein: the voltage outer loop generates an active power reference value based on the deviation between the leakage current device casing voltage and a safety threshold; the current inner loop controls the inverter output current to track the current reference value determined by the active power reference value; the system dynamically adjusts the active power reference value based on the comparison result between the leakage current device casing voltage and the safety threshold.
[0026] Furthermore, the system can be implemented at multiple configuration levels, with different configuration levels differing in at least one aspect: the complexity of the fusion intelligent identification model, the implementation method of the active harmonic cancellation control, and the metering accuracy.
[0027] Furthermore, the intelligent identification module is deployed on the edge computing unit, and the fused intelligent identification model undergoes lightweight processing through quantization and / or network pruning, resulting in a single inference time that is less than the control cycle of the system.
[0028] Compared with the prior art, the present invention achieves the following beneficial effects:
[0029] 1. High identification accuracy: The proposed VMD-DBO-GRU-A model achieves a classification accuracy of ≥99.0% through adaptive mode decomposition, hyperparameter optimization and attention enhancement. Compared with traditional models (such as SVM and LSTM), RMSE is reduced by more than 77% and MAPE is reduced by more than 75%, which can accurately distinguish different types of leakage signals.
[0030] 2. More accurate metering: Adopting a constrained dynamic gain adjustment mechanism, combined with a multi-dimensional power calculation algorithm, the metering error is controlled within ±1%, which can accurately count the total energy of leakage current return, harmonic power and other parameters, providing data support for energy saving and cost reduction;
[0031] 3. Excellent harmonic mitigation effect: It actively cancels the 2nd to 13th major harmonics, reduces the total harmonic distortion rate to below 5%, avoids grid pollution caused by leakage energy, and improves power quality;
[0032] 4. High safety and reliability: The voltage-current dual-loop control stabilizes the equipment casing voltage at ≤5V, and a quadruple protection mechanism is set up with a response delay of ≤3ms, which solves the risk of failure of traditional protection measures and ensures the safety of personnel and equipment;
[0033] 5. High-efficiency energy recovery: It realizes the recovery and reuse of leakage energy, with an energy saving rate of 1%~5%. It also supports hierarchical configuration, which can be flexibly selected according to the needs of the scenario, balancing high performance and cost control.
[0034] 6. Good real-time performance and adaptability: Through model lightweighting and optimized computing power allocation, the AI inference time is ≤3ms / frame and the system control cycle is 10ms. It is suitable for complex power environments in various scenarios such as industry and construction, and is robust to changes in grounding resistance without the need for precise measurement.
[0035] It should be understood that the description in the Summary of the Invention is not intended to limit the key or essential features of the embodiments of the present invention, nor is it intended to restrict the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0036] The above and other features, advantages, and aspects of the various embodiments of the present invention will become more apparent from the accompanying drawings and the following detailed description. The drawings are provided for a better understanding of the invention and are not intended to limit the invention. In the drawings, the same or similar reference numerals denote the same or similar elements, wherein:
[0037] Figure 1This is a schematic diagram of the unit connection of the leakage current return accurate metering and inverter boost grid-connected harmonic active cancellation system provided in the embodiment of the present invention;
[0038] Figure 2 This is an algorithm flowchart of the fusion intelligent identification model (VMD-DBO-GRU-A) provided in an embodiment of the present invention;
[0039] Figure 3 This is a schematic diagram of the circuit topology of the energy conversion and management module provided in an embodiment of the present invention. Detailed Implementation
[0040] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0041] Furthermore, the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.
[0042] Figure 1 This is a schematic diagram of the unit connection of a leakage current return current accurate metering and inverter boost grid-connected harmonic active cancellation system provided by an embodiment of the present invention; as shown. Figure 1 As shown, the system for precise metering of leakage current return and active harmonic cancellation of inverter boost grid connection, which integrates AI multi-feature fusion algorithms, includes:
[0043] Data acquisition module 110 is used to synchronously acquire leakage current related signals, including leakage voltage signals and leakage current signals on the casing of the leakage device and the grounding wire;
[0044] Step S1: Construct data acquisition module 110:
[0045] The data acquisition module 110 of this embodiment of the invention achieves high-fidelity, low-latency acquisition of leakage current-related electrical signals through a high-precision sensor array and synchronous sampling scheme, providing a reliable data foundation for subsequent AI analysis and precise control.
[0046] Step S11, Data Acquisition:
[0047] The sensor array includes high-precision leakage voltage and leakage current sensors. The leakage voltage sensor has an accuracy of ±0.1V, and the leakage current sensor has a sampling rate of ≥10kHz. The sensors are deployed at the grounding terminal of the leakage current device's casing, simultaneously acquiring leakage voltage waveform signals from both the device's casing and the grounding wire. Leakage current waveform signal The sampling period is set to This ensures the capture of transient pulse leakage characteristics.
[0048] Step S12, Design of synchronous sampling scheme:
[0049] A synchronous sampling pulse mechanism using the main controller ensures data synchronization. The main controller (DSP) issues a synchronous sampling command every 100μs, driving the leakage voltage and current sensors to sample simultaneously, with the synchronization error controlled within 5μs. The acquired data is converted by a high-speed ADC (analog-to-digital converter, resolution ≥16 bits) and then uploaded to the local edge computing unit in real time via the communication module, with a transmission delay ≤10ms. It also supports encrypted data storage and breakpoint resumption, ensuring data integrity.
[0050] The intelligent identification module 120 is connected to the data acquisition module 110 and is used to run the fusion intelligent identification model. The intelligent identification model integrates variational mode decomposition, hyperparameter optimization, gated recurrent unit and attention mechanism to process and analyze the leakage current related signals, and output leakage current type identification results and corresponding classification confidence.
[0051] Step S2: Construct the intelligent identification module 120:
[0052] The intelligent identification module 120 receives the leakage voltage signal from the data acquisition module. Leakage current signal And process it as follows:
[0053] The core of the intelligent identification module 120 in this invention lies in AI multi-feature fusion analysis. To this end, the VMD-DBO-GRU-A model proposed in this invention addresses the problems of low identification accuracy and poor real-time performance caused by the non-stationarity and multimodal characteristics of leakage signals through a full-link collaborative process of "signal adaptive decomposition - intelligent hyperparameter optimization - temporal feature enhancement - classification output adaptation." The model first uses VMD (Variational Mode Decomposition) to perform modal decomposition on the leakage signal, separating useful features from noise; then, it uses the DBO (Dung Beetle Optimization) algorithm to offline optimize the key hyperparameters of the GRU (Gated Recurrent Unit) network, improving the model's generalization ability; subsequently, it combines a self-attention mechanism to strengthen the weight ratio of core fault features; finally, by adapting the output layer structure to the classification task, it achieves accurate identification of leakage types, providing a reliable decision-making basis for subsequent metering and control modules. The DBO algorithm is a swarm intelligence optimization algorithm based on dung beetle foraging and reproduction behaviors, used to efficiently search for the optimal hyperparameters of the GRU. GRU stands for Gated Recurrent Unit, an improved recurrent neural network (RNN) that efficiently captures the temporal dependencies of feature vectors through the synergistic effect of update and reset gates.
[0054] The intelligent identification module 120 of this invention achieves accurate classification of leakage current types by integrating time-frequency domain feature extraction, adaptive signal decomposition and intelligent identification algorithm of intelligent identification model. At the same time, it optimizes computing power allocation and model deployment to meet real-time requirements. The core uses the VMD-DBO-GRU-A model to complete intelligent identification and performs special structural adaptation for classification tasks.
[0055] Figure 2 This illustrates the complete data flow and module connections of the model, from signal input, VMD decomposition, feature extraction, DBO optimization, GRU processing, attention enhancement to classification output. Figure 2 As shown, the operation process of the fusion intelligent identification model (VMD-DBO-GRU-A) includes the following steps: adaptive mode decomposition of the leakage current signal is performed using variational mode decomposition, and the number of decomposed modes K is based on the number of peak frequencies in the signal spectrum. Adaptive determination; extracting time-domain, frequency-domain, and time-frequency joint features from each decomposed modal signal to construct a comprehensive feature vector as model input; using the dung beetle optimization algorithm for offline optimization of the number of hidden layer neurons and learning rate of the gated recurrent unit network, and fixing the optimized parameters; inputting the comprehensive feature vector into the parameter-optimized gated recurrent unit network to extract temporal features; weighting and strengthening the temporal features through a self-attention mechanism; based on the strengthened features, the classifier outputs at least the following leakage type probability distributions: intrinsic fault leakage, capacitive leakage, and inductive leakage.
[0056] Step S21, Feature Extraction:
[0057] For the collected leakage voltage signal Leakage current signal Multi-dimensional feature extraction is performed to form a comprehensive feature vector:
[0058] (1) Temporal characteristics: peak value Valid value Waveform distortion rate Rise time ;
[0059] (2) Frequency domain characteristics: The fundamental frequency is obtained through Fourier transform. Harmonic number and the amplitude of each harmonic Calculate the total harmonic distortion rate. ;
[0060] (3) Time-frequency joint features: Wavelet transform (using db4 wavelet basis) is used to decompose the signal into three levels, and the energy entropy of wavelet coefficients at each scale is extracted. Singular values This method captures the local abrupt changes in non-stationary leakage signals. The three-level decomposition refers to the number of decomposition levels in the wavelet transform, which means that the original leakage signal is decomposed into three high-frequency detail components and one low-frequency approximation component in sequence. The wavelet coefficients are the output results after the wavelet transform, and each coefficient corresponds to the feature intensity of the original signal at a specific scale and location.
[0061] After all features are normalized, a 32-dimensional feature vector is constructed. , as input to the AI recognition model.
[0062] in, The leakage voltage waveform signal between the casing of the leakage current device and the grounding wire is a continuous signal that varies with time t. The leakage current waveform signal between the casing of the leakage equipment and the grounding wire is a continuous signal that varies with time t. The peak value of the leakage voltage waveform signal, i.e., the maximum instantaneous value of the leakage voltage during the acquisition period; The peak value of the leakage current waveform signal, i.e., the maximum instantaneous value of the leakage current during the acquisition period; The effective value of the leakage voltage waveform signal, that is, the root mean square value of the leakage voltage within one cycle; The effective value of the leakage current waveform signal, that is, the root mean square value of the leakage current over one cycle; The waveform distortion rate of the leakage signal is used to characterize the degree of deviation between the actual leakage signal waveform and the sine wave. The rise time of the leakage signal, i.e., the time from the peak value of the leakage signal. Rising to peak Time required; The fundamental frequency of the leakage signal is the frequency of the lowest frequency and largest amplitude harmonic component in the leakage signal (usually the fundamental frequency of the power grid, 50Hz). Harmonic order, a positive integer from 2 to 20, representing a multiple of the fundamental frequency; The voltage amplitude of the nth harmonic is the amplitude of the harmonic component corresponding to n times the fundamental frequency in the leakage voltage signal. : The current amplitude of the nth harmonic, that is, the amplitude of the harmonic component corresponding to n times the fundamental frequency in the leakage current signal; THD: Total Harmonic Distortion, used to measure the degree of influence of all harmonic components in the leakage voltage signal on the fundamental frequency, and is the core evaluation indicator of harmonic pollution. The amplitude of the fundamental voltage, i.e. The corresponding harmonic voltage amplitude, which is the amplitude of the fundamental component in the leakage voltage signal; db4 wavelet basis: the wavelet function type used in the wavelet transform, which belongs to the Daubechies wavelet family, has good time-frequency localization characteristics, and is suitable for extracting the abrupt change features of the leakage signal; The energy entropy of wavelet coefficients is used to characterize the uniformity of the energy distribution of wavelet coefficients and reflects the complexity and abrupt change characteristics of leakage current signals. The singular values of wavelet coefficients are used to extract the core features of the wavelet coefficient matrix and enhance the key abrupt change information in the leakage current signal. The 32-dimensional comprehensive feature vector is composed of all extracted time-domain, frequency-domain, and time-frequency joint features, and serves as the input data for the AI recognition model. The eigenvector X is composed of 32 feature dimensions, including peak value, effective value, waveform distortion rate, rise time, fundamental frequency, amplitude of each harmonic, total harmonic distortion rate, wavelet coefficient energy entropy, and singular values.
[0063] Step S22: Constructing the applicability and parameter adaptation mechanism of VMD in leakage current signal processing:
[0064] Leakage current signals are typical non-stationary time-varying signals, containing fault characteristic components caused by equipment insulation damage, normal leakage components caused by line distributed capacitance / inductance, and high-frequency noise components introduced by power grid interference, exhibiting obvious "multimodal" characteristics. Compared with traditional EMD (Empirical Mode Decomposition), VMD (Variational Mode Decomposition) can actively separate signal components of different frequency scales by preset mode numbers, effectively avoiding mode aliasing problems, and the decomposition process has mathematical rigor (based on variational optimization theory).
[0065] In leakage current signal processing, the core advantages of VMD are reflected in:
[0066] (1) Accurately separate high-frequency noise components (such as 50Hz harmonic interference of the power grid) from low-frequency useful components (fault leakage characteristics) to improve the purity of feature extraction;
[0067] (2) It has good decomposition fidelity for instantaneous pulse leakage signals (such as spike signals at the moment of insulation breakdown) to ensure that fault characteristics are not lost;
[0068] (3) The non-recursive decomposition mechanism reduces computational complexity and adapts to the real-time processing requirements of edge computing units. VMD refers to variational mode decomposition, an adaptive signal decomposition algorithm based on variational optimization theory, used to decompose non-stationary leakage signals into multiple intrinsic mode functions (IMFs) to separate useful features from noise; adaptive parameter adjustment: based on the actual spectral characteristics of the leakage signal, the key parameters of VMD decomposition (number of modes K, bandwidth constraint α) are automatically adjusted to make the decomposition effect adapt to the leakage signal characteristics in different scenarios; signal spectral characteristics: the distribution characteristics of the leakage signal in the frequency domain, including the number of peak frequencies, frequency distribution range, amplitude ratio of each frequency component, etc.; the number of modes K is the number of intrinsic mode functions (IMFs) in VMD decomposition, which determines the fineness of signal decomposition, and the value is 4, 6 or 8.
[0069] VMD parameter adaptive adjustment: To adapt to different leakage current scenarios, an adaptive mechanism based on the signal spectrum characteristics of the mode number K is introduced. This involves rapidly analyzing the spectrum to count the number of peak frequencies of the signal. Fast spectrum analysis is an efficient frequency domain analysis method used to quickly extract the spectrum information of leakage current signals, focusing on counting the number of peak frequencies, balancing analysis efficiency and accuracy.
[0070] Furthermore, the number of modes K in variational mode decomposition is based on the number of peak frequencies in the signal spectrum. Adaptively determined, and the value of K is related to... Positive correlation; the value of the bandwidth constraint parameter α in the variational mode decomposition is positively correlated with the number of modes K. In a preferred embodiment of the present invention, the number of peak frequencies of the signal is counted through fast spectrum analysis. And set the modal number K according to the following rules: when hour, ;when hour, ;when hour, Bandwidth constraints The formula is dynamically adjusted based on the K value: , making Maintain a positive correlation with K to ensure the decomposition effect matches the signal characteristics. Default parameters ( , , Based on 100,000 data points on leakage current in industrial scenarios, the data was optimized and determined, covering... The above common application scenarios have basic applicability. It should be noted that the default parameters in this set are the baseline parameters for the offline training phase, used to initialize the online adaptive mechanism; during online operation, the system still adaptively adjusts K and α according to the signal spectrum characteristics. When the signal spectrum complexity matches the common scenario, the adaptive mechanism selects the baseline parameters; when the spectrum complexity deviates, it adjusts dynamically.
[0071] The number of peak frequencies of a leakage current signal, i.e., the total number of frequency points in the signal spectrum where the amplitude reaches a local maximum, is a core indicator for judging the modal complexity of a signal; bandwidth constraints. : Key parameters of VMD decomposition, used to control the bandwidth of each intrinsic mode function (IMF), affecting the purity of the decomposition and its resistance to mode mixing; Bandwidth constraints The dynamic adjustment formula, to time Based on the baseline, the K value is adaptively adjusted proportionally to ensure consistent decomposition results across different modal numbers; where 2000 is... The bandwidth constraint baseline value (default value) is determined based on 100,000 leakage current data in industrial scenarios and is compatible with most common leakage current signals. It is the fidelity coefficient of VMD decomposition, used to balance decomposition accuracy and computational complexity, and its value is 0.001.
[0072] It should be noted that the dynamic adjustment formula for bandwidth constraints In this algorithm, α controls the bandwidth of each Intrinsic Mode Function (IMF). A larger α value results in a narrower bandwidth for the decomposed IMF and higher frequency resolution, but also increases computational complexity. The positive correlation between α and K ensures that as the number of decomposed modes K increases, the bandwidth constraint of each IMF also strengthens synchronously, ensuring the decomposition effect adapts to the signal characteristics. This coordination logic ensures that α increases synchronously when K increases, strengthening the bandwidth constraint to avoid mode aliasing and ensuring effective separation of high-frequency components; conversely, α decreases synchronously when K decreases, appropriately relaxing the bandwidth constraint to reduce computational overhead. This coordination logic ensures that α always matches K, guaranteeing consistent decomposition results under different K values.
[0073] Step S23: Constructing the VMD-DBO-GRU-A model structure, adapting it, training it, and optimizing its real-time performance:
[0074] The VMD-DBO-GRU-A model proposed in this invention is an intelligent classification model that integrates variational mode decomposition (VMD), dung beetle optimization algorithm (DBO), gated recurrent unit (GRU) and self-attention mechanism (A), and is specifically designed for leakage current type identification.
[0075] Step S231, Design the model structure:
[0076] The invention adopts a fusion architecture of "VMD (Variational Mode Decomposition) decomposition + DBO (Dung Beetle Optimization) optimization + GRU (Gated Recurrent Unit) + self-attention mechanism + classification output layer", which integrates signal decomposition, hyperparameter optimization, temporal feature extraction, attention enhancement and classification output into an integrated model structure. Each module works together to improve the accuracy and real-time performance of leakage current identification. The invention is specifically adapted for classification tasks. In particular, this embodiment of the invention is designed to meet the classification requirements of three types of leakage current: "intrinsic fault leakage current / capacitive leakage current / inductive leakage current", and the model is customized for each link.
[0077] (1) Preprocessing: The signal preprocessing stage of the VMD-DBO-GRU-A model provides high-quality input for subsequent model inference through VMD decomposition and feature concatenation. Specifically, VMD decomposes the original leakage signal into intrinsic mode functions (IMFs) with adaptive K values, extracts the feature vectors of each IMF, and concatenates them into 32-dimensional input features. The intrinsic mode functions (IMFs) are the signal components obtained after VMD decomposition. Each IMF corresponds to a feature in a specific frequency range, which can separate noise, normal leakage, and fault features in the leakage signal. The adaptive K value is the number of VMD decomposition modes dynamically adjusted according to the spectral characteristics of the leakage signal, and the value can be 4, 6, or 8. The 32-dimensional input features are a comprehensive feature vector formed by concatenating the time domain, frequency domain, and time-frequency joint features of each IMF, which contains comprehensive feature information of the leakage signal.
[0078] (2) Hyperparameter optimization: The process of optimizing the key parameters of the GRU network through the DBO algorithm aims to improve the generalization ability and inference accuracy of the model. Specifically, the DBO algorithm optimizes the number of hidden layer neurons ([10, 100]) and learning rate ([0.001, 0.01]) of the GRU offline. The optimization results are fixed to the model, and DBO calculation is no longer performed during the inference stage, reducing real-time computing power consumption. The offline optimization is completed during the model training stage. After the optimization results are fixed, DBO calculation is no longer performed during the inference stage, reducing real-time computing power consumption. The number of hidden layer neurons is the number of neurons in the hidden layer of the GRU network. The optimization range is [10, 100], which affects the feature fitting ability of the model. The learning rate is the parameter update step size of the GRU network. The optimization range is [0.001, 0.01], which determines the convergence speed and stability of the model training. Optimization result fixation: The optimal hyperparameters (number of hidden layer neurons, learning rate) obtained by DBO optimization are fixed in the model to ensure stable performance during the inference stage.
[0079] (3) Temporal feature extraction: The core function of the GRU layer is to extract temporal features that characterize the leakage current type by learning the correlation between feature vectors in the time dimension. The GRU layer captures the temporal dependency of feature vectors and outputs a 64-dimensional temporal feature vector as the output of the GRU layer, which contains a high-dimensional feature representation of the temporal dependency of the leakage current signal.
[0080] (4) Attention Enhancement: By assigning different weights to the output features of the GRU through a self-attention mechanism, the contribution of fault-related features is highlighted, the contribution of fault-related features is enhanced, and interference from irrelevant features is suppressed. The self-attention mechanism is a mechanism that can automatically identify the importance of input features and assign weights by calculating the similarity between features to enhance core information. Specifically, the weight calculation... The formula is as follows:
[0081]
[0082] in, : Attention weight of the j-th feature, used to characterize the importance of the j-th hidden state of the GRU output in leakage current classification; Exponential function: used to amplify differences in feature similarity and strengthen the weight of important features; The dot product similarity function is used to calculate the similarity between the GRU hidden state and the query vector. The formula is: (Vector dot product); The j-th hidden state of GRU contains the temporal feature information of the j-th time step; : Query vector, a reference vector used to calculate similarity with each hidden state of GRU, obtained through adaptive learning during model training; M: Number of hidden states in GRU, consistent with the time step length of the GRU network; : The exponential sum of the similarities between all GRU hidden states and the query vector, used to normalize the attention weights to ensure that the total weight sum is 1.
[0083] (5) Classification Adaptation: The model output stage is designed to match multi-classification tasks, mapping high-dimensional features to leakage current type probability distributions. A fully connected layer (64-dimensional) is added after the GRU output layer. The model uses a combination of a 64-dimensional GRU layer and a softmax activation function to map the features into probability distributions for three types of leakage current, which serve as the final output of the model. These distributions correspond to the probability of occurrence of intrinsic fault leakage current, capacitive leakage, and inductive leakage, respectively, achieving classification output. Specifically, the fully connected layer (64-dimensional → 3-dimensional) maps the 64-dimensional temporal feature vector output by the GRU into a 3-dimensional vector, with each 3-dimensional vector corresponding to the feature score of the three leakage current types. The softmax activation function converts the 3-dimensional feature scores output by the fully connected layer into a probability distribution, with output values in the interval [0,1] and a sum of 1.
[0084] Step S232: Design the loss function:
[0085] The cross-entropy loss function is a loss calculation method suitable for multi-class classification tasks. It guides model parameter updates by quantifying the difference between predicted probabilities and true labels. In this embodiment, the leakage type identification task is a multi-class classification task, requiring the input features to be divided into three categories: intrinsic fault leakage, capacitive leakage, and inductive leakage. Specifically, the cross-entropy loss function is used to match the multi-class classification task, and the calculation formula is as follows:
[0086]
[0087] Cross-entropy loss function value: used to measure the difference between the probability distribution of leakage type predicted by the model and the true label. The smaller the value, the higher the accuracy of the model prediction. : Total number of training samples, i.e., the number of labeled leakage current data samples used in model training; Sample index, with a value range of 1 to... This is used to iterate through all training samples; Category index, with values ranging from 1 to 3, corresponding to three types of leakage current (1 = intrinsic fault leakage, 2 = capacitive leakage, 3 = inductive leakage). : No. The true label of the sample is obtained using one-hot encoding. If the first sample... The sample belongs to the first Class, then ,otherwise One-hot encoding is a method of encoding classification labels. Each label corresponds to a one-dimensional vector, with only the position corresponding to the category set to 1 and the other positions set to 0. It is suitable for loss calculation in multi-class classification tasks. The model predicts the first The sample belongs to the first The probability of leakage current type, the value range is: Furthermore, the sum of the three predicted probabilities for the same sample is 1; The natural logarithm function is used to convert predicted probabilities into logarithmic form, amplifying the loss of low-probability predictions and increasing the model's penalty for incorrect predictions. : Sum the loss values of all training samples; : Sum the predicted losses corresponding to the three types of leakage current; The total loss of all samples is averaged to obtain the global average loss, which avoids the influence of the number of samples on the loss value and ensures the comparability of the loss values.
[0088] Step S233, Source of training data:
[0089] Leakage current data were collected from various scenarios (industrial equipment, building electrical systems, and household appliances), covering both intrinsic fault leakage current (insulation damage, overload short circuit) and normal leakage current (capacitive leakage and inductive leakage). Data acquisition utilized a high-precision data acquisition platform (24-bit resolution, sampling rate ≥10kHz), with sensors including voltage probes (accuracy ±0.1V) and current clamps (accuracy ±0.5%). Data annotation was independently completed by three power system engineers based on waveform characteristics, with an annotation consistency coefficient (Kappa) ≥0.95. A total of 100,000 annotated samples were constructed, including 35,000 intrinsic fault leakage current samples, 32,000 capacitive leakage current samples, and 33,000 inductive leakage current samples, divided into training and test sets at an 8:2 ratio.
[0090] Step S234, Training Steps:
[0091] (1) Perform VMD decomposition and feature extraction on the original signal to generate a training sample set;
[0092] (2) Initialize the DBO population (population size = 5, number of iterations = 10), and optimize the GRU hyperparameters offline using the model classification accuracy as the fitness function;
[0093] (3) Fix the optimized hyperparameters, train the entire model using the Adam optimizer, and iterate until the loss function converges (convergence threshold = 10). -7 );
[0094] (4) The test set verifies that the classification accuracy of the model is ≥99.2% (before lightweighting), which meets the requirements of engineering applications.
[0095] Step S235, Key Parameters:
[0096] VMD decomposition parameters (adaptive K value, Fidelity ); The optimal parameters after DBO optimization (learning rate) Number of neurons in the hidden layer ); GRU network parameters (number of iterations) L2 regularization coefficient dropout rate );
[0097] The input is a 32-dimensional feature vector. The output is a 3-dimensional probability vector. ,when Triggering full-power inverter operation, when or Enter energy-saving mode.
[0098] The model predicts the probability that the input sample is a fundamental fault leakage, with a value range of [0,1].
[0099] The probability that the input sample is a capacitive leak is predicted by the model, with a value range of [0,1].
[0100] : The probability that the input sample is an emotional leak, with a value range of [0,1].
[0101] Step S236, Real-time Performance and Computing Power Optimization:
[0102] (1) Computing power allocation: VMD decomposition, feature extraction, and GRU inference are deployed on edge computing units (using NVIDIA Jetson Xavier NX, computing power 21 TOPS), and DBO optimization is completed offline, reducing AI model inference time. The system control cycle is 10ms, meaning that every 10ms, the latest 100 sampling points (one analysis frame) are sent to the AI model for processing to ensure the real-time nature of control decisions.
[0103] (2) Model Lightweighting: This invention adopts a lightweighting scheme of pruning and quantization for the VMD-DBO-GRU-A model. The specific implementation details are as follows:
[0104] ① Pruning method: An unstructured pruning method based on weight magnitude is adopted. Specifically, for the weight matrix of the fully connected layers of the GRU network, the absolute value of all weights is calculated, and a pruning threshold is set. (That is, 1% of the largest absolute value of the weights), weights with an absolute value less than T are reset to zero, thereby removing redundant connections. The pruning rate is set to 30%, that is, after training, the 30% of parameters with the smallest absolute value in the weight matrix are set to zero.
[0105] ② Post-pruning processing: After pruning, the model is fine-tuned for 10 iterations with a learning rate of 10% of the initial learning rate (i.e., 0.00026) to recover the accuracy loss caused by pruning.
[0106] ③ Quantization scheme: 8-bit fixed-point quantization (INT8) is used to convert model parameters from 32-bit floating-point numbers (FP32) to 8-bit integers. Specifically, for the weights and activation values of each layer, their numerical range is statistically analyzed, and the quantization scaling factor is calculated. This maps floating-point values to integers between 0 and 255. The quantized model size is approximately 25% of the original FP32 model (due to the combined effects of pruning and quantization).
[0107] ④ Accuracy Loss Assessment and Recovery: Accuracy Loss Assessment: Evaluate the classification accuracy of the model before and after quantization on the test set. Accuracy Recovery: Perform Quantization-Aware Training (QAT) on the quantized model, adjust parameters by simulating quantization error, and iterate for 5 rounds to restore the accuracy to over 99.0%.
[0108] ⑤ Lightweight effect verification: After the above lightweighting process, the model size was reduced from about 15MB of the original FP32 model to about 6MB (compression ratio of 60%), the single inference time on the edge computing unit (NVIDIA Jetson Xavier NX) was reduced from 4.5ms to 2.7ms (improvement of 40%), and the classification accuracy on the test set remained above 99.0%, meeting the requirements of engineering applications.
[0109] (3) Processing mode: AI analysis adopts a real-time processing strategy that is synchronized with the system control cycle. A complete AI inference is completed within each control cycle (10ms) (inference time ≤3ms) to ensure that the identification results can be used for control decisions in the current cycle.
[0110] Step S237, Classification Confidence A clear definition:
[0111] Classification confidence To integrate the maximum value among the probabilities of various leakage types output by the intelligent identification model, the metering management module 130 is configured to: when the classification confidence is lower than a preset threshold, initiate gain compensation for the leakage voltage signal and leakage current signal.
[0112] In a specific embodiment of the present invention, the model classification confidence score in step S231 is... Defined as That is, the highest class probability output by softmax, with a value range of... . The closer the value is to 1, the more reliable the model's judgment of the current leakage type. When the variance is below 0.7, the sample is classified as ambiguous. The system automatically improves the feature extraction accuracy (e.g., by increasing the number of wavelet decomposition layers) and re-identifies the sample, while recording this type of sample for incremental model training. Optional solution: For scenarios with extremely high reliability requirements, Monte Carlo dropout (MC Dropout) can be enabled, using the probability variance from 5 random dropout inferences. Supplementing uncertainty estimation, when When the confidence weight is reduced, the AI processing cycle needs to be extended to 15ms to accommodate the additional computation.
[0113] The metering management module 130 is connected to the intelligent identification module 120 and the data acquisition module 110 respectively. It is used to adaptively adjust the leakage voltage signal and leakage current signal according to the classification confidence level, and to measure the leakage return energy parameters based on the adjusted signal.
[0114] Step S3: Construct the metering management module 130:
[0115] The metering management module 130 receives the classification confidence level γ from the intelligent identification module 120, and the leakage voltage signal originally acquired from the data acquisition module 110. and leakage current signal And perform the following operations:
[0116] The metering management module 130 of this invention, based on the AI identification results of the intelligent identification module 120 and combined with a constrained dynamic gain compensation mechanism, achieves high-precision metering and full-cycle management of leakage current return energy, while taking into account both signal fidelity and metering accuracy.
[0117] Step S31, Constrained Dynamic Gain Adjustment:
[0118] To address the issue of weak leakage current signal amplitude (1V~50V) and susceptibility to noise interference, an AI compensation mechanism is introduced. Simultaneously, upper and lower gain limits are set to avoid signal distortion. Adaptive gain adjustment is achieved as follows: an initial adjustment gain is calculated based on the classification confidence level γ, and this initial adjustment gain is constrained between a preset minimum and maximum gain value to obtain the final dynamic adjustment gain; wherein, the final dynamic adjustment gain is negatively correlated with the classification confidence level. Specifically, this is achieved by setting a base gain. Compensation coefficient ζ, minimum gain With maximum gain ; Calculate the initial adjustment gain based on the classification confidence level γ ; Constrain the initial adjustment gain to [ , Within the range, the final dynamically adjusted gain is obtained. It monitors the peak value of the signal after gain G adjustment in real time. If the peak value exceeds 90% of the maximum input voltage of the analog-to-digital converter, it will automatically reduce the gain to avoid signal distortion.
[0119] Preferably, when the confidence level is low (e.g. When the confidence level is high (e.g.), increase the gain within the constraints; when the confidence level is high (e.g.), increase the gain within the constraints. When this occurs, the base gain is maintained. Simultaneously, the signal peak value is monitored in real time. ,like ( (Maximum input voltage of the ADC), automatically reducing the gain to Double protection ensures signal integrity.
[0120] The final dynamic adjustment gain of the leakage signal is the actual gain value after upper and lower limit constraints, which is used to amplify weak leakage signals. Base gain, with a value of 10, is the default gain value when the model classification confidence is high; : Compensation coefficient, with a value of 0.5, is used to adjust the magnitude of gain compensation and control the rate of gain increase; : Model classification confidence score, with a value of That is, the highest predicted probability among the three types of leakage current output by the model; Minimum gain, with a value of 2, is the lower limit for gain adjustment to prevent the loss of leakage signal characteristics due to excessively low gain. Maximum gain, with a value of 20, is the upper limit of gain adjustment to avoid excessive gain causing saturation distortion of the leakage signal; The maximum value function is used to compare the compensated gain value with the minimum gain value. Compare the values and take the larger one to ensure that the gain is not lower than the lower limit; The minimum value function is used to compare the output value of the maximum value function with the maximum gain. Compare the values and take the smaller one to ensure that the gain does not exceed the upper limit; : Low confidence threshold. At this point, the model has low reliability in judging the leakage type. Within the constraints, the gain is increased to enhance the signal characteristics. High confidence threshold: At this level, the model has high reliability in determining the leakage type and maintains the base gain. This ensures signal quality; Peak value of the original leakage voltage signal; The peak value of the leakage voltage signal after gain adjustment is the product of the original peak value and the adjusted gain. The maximum input voltage of an ADC (Analog-to-Digital Converter) is an inherent parameter of the ADC hardware and represents the upper limit of the signal input. : ADC maximum input voltage A threshold is used as a warning line for signal peaks to prevent the signal from approaching saturation. : Adaptive correction gain when leakage signal exceeds peak value, the actual gain value recalculated to avoid signal distortion; : ADC maximum input voltage This is the target value for the corrected leakage voltage peak, ensuring the signal stays away from the saturation region.
[0121] In a specific embodiment of the present invention, after gain adjustment, the system re-inputs the amplified signal into the intelligent identification module to calculate the confidence level. .like If the gain is ≥0.7, the current gain will continue to be used; if... If the gain is less than 0.7 and the current gain has not reached its limit, continue adjusting the gain, up to a maximum of 3 adjustments; if after 3 adjustments... If it remains below 0.7, stop adjusting, record the sample for incremental model training, and adopt a conservative control strategy (limiting the grid-connected power to within 50% of the rated value).
[0122] Step S32, Precise Measurement Algorithm:
[0123] The precise metering algorithm is based on the adjusted voltage and current signals to calculate leakage current return energy parameters, covering the calculation of instantaneous power, total energy, average power and harmonic energy.
[0124] Based on the adjusted leakage voltage With current Calculate at least one of the following leakage current return energy parameters:
[0125] (1) Instantaneous power: It is obtained by multiplying the instantaneous values of the adjusted voltage and current, with the sampling interval kept consistent with the acquisition module. The sampling interval is the calculation interval for instantaneous power, which is consistent with the sampling period of the data acquisition module. The preferred value in this invention is... This ensures the real-time performance of power calculations.
[0126] in, The instantaneous power of leakage current return is the real-time power, which is the instantaneous product of the adjusted leakage voltage and current, reflecting the energy transfer rate at a certain moment. The leakage voltage waveform signal after dynamic gain adjustment is the original leakage voltage. With adjusting gain The product of these is used to enhance the characteristics of weak signals; The original leakage voltage waveform signal is the voltage signal between the casing of the leakage device and the grounding wire without gain adjustment. The leakage current waveform signal after dynamic gain adjustment is the original leakage current. With adjusting gain The product of these values is kept in amplitude match with the adjusted voltage signal. The original leakage current waveform signal is the current signal between the casing of the leakage device and the grounding wire without gain adjustment. : Dynamically adjusts the gain, providing a constrained adaptive gain value to amplify weak leakage signals while avoiding distortion.
[0127] (2) Total energy: This indicates the absolute value of the instantaneous power at the leakage initiation time. Until the end time Integral over the interval, where Leakage start time , Leakage termination time ( (lasts 1 second)
[0128] in, It is the total energy, representing the total electrical energy returned by leakage. It is the integral of the absolute value of the instantaneous power over the duration of leakage, reflecting the total amount of leakage energy recovered. The leakage initiation time is the moment when the absolute value of the original leakage current first exceeds 0.1mA, marking the start of leakage. The leakage termination time is the moment when the absolute value of the original leakage current is less than or equal to 0.1mA for 1 second, marking the end of the leakage. The leakage current initiation threshold is set when the absolute value of the original leakage current exceeds 0.1mA, indicating that leakage has started. 1 second duration: Leakage termination threshold, when the absolute value of the original leakage current... And if it lasts for 1 second, the leakage is considered to have ended; : Definite integral operation is used to calculate the cumulative value of instantaneous power during the leakage current duration to obtain the total energy; : Absolute value symbol, used to ensure that the power and energy calculation results are non-negative and conform to the electricity metering logic.
[0129] (3) Average power: Through total energy Divide by the duration of leakage current Obtained. Average power It is the average transmission power of leakage current return, which is the ratio of total energy to leakage duration, reflecting the average transmission level of leakage energy; The duration of leakage current is the time interval from the start to the end of the leakage current.
[0130] (4) Harmonic energy: ,right The product of the voltage and current of each harmonic is integrated and summed over the leakage time period, and the energy of each harmonic is measured separately.
[0131] Harmonic power The total electrical energy corresponding to each harmonic in the leakage current return is: The sum of the voltage and current of the subharmonics during the leakage time period; Harmonic order, with values ranging from 1 to 10. A positive integer representing a multiple of the fundamental frequency; The leakage voltage waveform signal of the nth harmonic, that is, the harmonic component corresponding to the nth fundamental frequency in the leakage voltage; The leakage current waveform signal of the nth harmonic is the harmonic component in the leakage current corresponding to the nth fundamental frequency. :right The total harmonic energy is obtained by summing the calculated results of the subharmonic energy.
[0132] Measurement error control within Within a certain range, the metering error represents the accuracy index of the precise metering algorithm, that is, the deviation between the calculated electrical energy parameters and the actual values is controlled within a certain range. Within the specified range, it meets the accuracy requirements of electricity metering in industrial scenarios, ensuring that metering data can be used for energy consumption statistics and energy-saving analysis.
[0133] Step S33, Power Management Function:
[0134] The metering management module 130 has a built-in data storage unit (capacity ≥16GB) to record daily and monthly data such as total energy consumption, instantaneous peak power, and return duration distribution of leakage current, and generates energy consumption analysis reports. Data can be uploaded to a cloud management platform via a 5G network, providing enterprises with visualized analysis of leakage current energy consumption and energy-saving optimization suggestions to help reduce costs and increase efficiency.
[0135] The energy conversion and management module 140 is connected to the metering management module 130 and the intelligent identification module 120 respectively. It is used to convert and boost the leakage return energy, and simultaneously execute harmonic active cancellation control and grid-connected inverter control, so as to suppress the potential of the leakage equipment casing below the safety threshold while realizing energy recovery.
[0136] Step S4: Construct Energy Conversion and Governance Module 140:
[0137] The energy conversion and management module 140 receives metering results and energy signals from the metering management module 130, as well as leakage current type identification results from the intelligent identification module 120, and performs the following control:
[0138] The core of the energy conversion and control module 140 in this embodiment of the invention lies in inverter boost and active harmonic cancellation, which is used to achieve efficient conversion of leakage energy, harmonic control and safe grid connection. By clearly defining the controller selection, dual-loop control strategy, delay optimization and hierarchical configuration, performance, cost and complexity are balanced, and engineering feasibility is improved.
[0139] like Figure 3 As shown, the energy conversion and management module 140 mainly includes an AC / DC rectifier circuit, a DC / DC boost converter, and a three-phase full-bridge inverter. Figure 3 The circuit topology, key components (such as the rectifier bridge, inductor L, capacitor C, switching transistors, and inverter bridge) and their connections are shown in detail. Its operation is as follows:
[0140] Step S41, Design AC / DC Conversion and DC / DC Boost:
[0141] AC / DC conversion: Employs a three-phase bridge rectifier circuit to control leakage voltage. Rectification is performed, combined with an LC low-pass filter circuit (inductor) ,capacitance ), output stable DC power Filter ripple coefficient ;
[0142] DC / DC boost: Employs a phase-shifted full-bridge DC / DC converter to... The threshold required to boost voltage to the inverter bus The converter switching frequency is set to 20kHz, and the output voltage is controlled using a PID (proportional-integral-derivative) regulation algorithm. The voltage regulation rate is... The digital implementation of the ID control algorithm is as follows:
[0143] ;
[0144] The final output voltage after DC / DC boost, i.e., the inverter bus voltage, needs to be stabilized at... Within the range; The proportional gain of the PID control algorithm is set to 0.8, which is used for rapid response to voltage deviation. The integral coefficient of the PID control algorithm, with a value of 0.2, is used to eliminate static voltage deviation. The derivative coefficient of the PID control algorithm, with a value of 0.1, is used to suppress voltage fluctuations and improve stability. Voltage deviation at the kth sampling time; The reference voltage for PID regulation, i.e., the target voltage value for DC / DC boost; The feedback value of the DC / DC boost output voltage is used to compare with the reference voltage and calculate the voltage deviation. : Control cycle (corresponding to a 20kHz switching frequency).
[0145] The physical meaning of this control algorithm is: to quickly respond to the current deviation through the proportional term, to accumulate historical deviations through the integral term to eliminate static errors, and to predict the trend of deviation changes through the derivative term to suppress overshoot. The three work together to ensure that the output voltage is stable within the range of 380V±10V.
[0146] Step S42, Active Harmonic Cancellation (APF Control), Delay Optimization and Controller Selection:
[0147] The Energy Conversion and Governance Module 140 introduces APF (Active Power Filter) control logic, which reduces implementation complexity by clarifying controller performance, optimizing detection algorithms, and limiting the applicable harmonic range.
[0148] Harmonic active cancellation control includes: detecting the background harmonic current at the grid connection point; controlling the inverter output in the energy conversion and mitigation module 140 to produce a cancellation current with the same amplitude but opposite phase to the background harmonic current; and employing a repetitive control algorithm to perform closed-loop correction on the cancellation current based on the superposition error between the background harmonic current and the cancellation current. In some specific embodiments, the implementation process is as follows:
[0149] (1) Controller selection: The TI TMS320F28377D DSP (Digital Signal Processor) is adopted, with a main frequency of Supports 16-bit ADC synchronous sampling, with low computational latency. This meets the computing power requirements for harmonic detection and real-time control.
[0150] (2) Harmonic detection optimization: An improved Fast Fourier Transform (FFT) algorithm is adopted. By reducing the number of computation points (128 points) and hardware acceleration units, the detection delay is reduced from 5ms to 2ms, and the frequency resolution is improved. ;
[0151] (3) Applicable harmonic range: Clearly define that the system is mainly designed for low-order harmonics ( Next, that is To cancel out the harmonics in this frequency band, which account for a significant portion of the total harmonics in the power grid. The above, and with delay (detection) Operations SVPWM output (0.1ms) cumulative The effect on the cancellation effect is negligible; for high-frequency harmonics above the 13th order, LC filter circuits are used to assist in suppression.
[0152] (4) Cancellation current generation: Based on the detection results, a drive signal is generated through space vector pulse width modulation (SVPWM) to control the inverter to output a cancellation current with equal amplitude and opposite phase. The SVPWM switching frequency is set to 10kHz.
[0153] (5) Closed-loop regulation: The repetitive control algorithm is used to optimize the cancellation accuracy, as shown in the following formula, to ensure that the total harmonic distortion (THD) is reduced to the following:
[0154] ;
[0155] offset current The current signal output by the inverter to cancel the nth harmonic has the same amplitude and opposite phase as the corresponding background harmonic current. The formula for generating the canceling current; the negative sign indicates that the canceling current is out of phase with the background harmonic current, thus achieving mutual cancellation. The nth background harmonic current signal detected at the grid connection point, where n takes the value of (correspond ); SVPWM switching frequency The operating frequency of SVPWM modulation is set to 10 kHz, balancing modulation accuracy with device switching losses. The nth harmonic cancellation current command, optimized by the repetitive control algorithm, serves as the final control reference for the inverter. : Actual output value of the nth harmonic cancellation current before optimization; : Repetitive control gain, with a value of 0.3, is used to adjust the correction strength of repetitive control and balance response speed and stability; The superposition value of the nth background harmonic current and the current cancellation current reflects the residual error of the current harmonic cancellation and serves as the basis for correction of repetitive control.
[0156] Step S43, Inverter Grid-Connected Dual-Loop Control, Safety Boundaries and Control Principles:
[0157] The grid-connected inverter control executed by the energy conversion and governance module 140 adopts a voltage-current dual-loop control strategy, wherein: the voltage outer loop generates an active power reference value based on the deviation between the leakage equipment casing voltage and a safety threshold; the current inner loop controls the inverter output current to track the current reference value determined by the active power reference value; the system dynamically adjusts the active power reference value based on the comparison result between the leakage equipment casing voltage and the safety threshold.
[0158] In a specific embodiment of the present invention, a three-phase full-bridge inverter is used, and the output power is dynamically adjusted through a voltage-current dual-loop control strategy to maintain a safe low potential for the casing of the leakage equipment. The control logic and principle are as follows:
[0159] (1) Control principle: The core objective of control is to maintain From a theoretical perspective, Due to leakage current With grounding loop impedance (mainly grounding resistance) This system directly regulates the inverter output current through the outer voltage loop. To dynamically offset Thus achieving Direct control. This strategy has... Within a typical range ( The changes are robust and do not require precise measurement;
[0160] (2) Control closed-loop structure: ① Outer loop (voltage loop): detects the voltage of the leakage equipment casing. , and safety threshold The active power reference value is compared and output through the PI regulator. ② Inner loop (current loop): Detects the inverter output current. , and current reference value (Depend on The converted signal is compared, and the SVPWM modulation signal is output through the PID regulator to control the switching devices of the inverter to turn on and off.
[0161] (3) Power regulation logic: When At that time, the voltage loop PI regulator increases The inverter increases output power to recover leakage energy and lower the potential of the equipment casing; when hour, Setting it to 0 puts the inverter into standby mode, maintaining only the core circuitry (power consumption...). );when At the same time, maintain the current output power to achieve dynamic balance;
[0162] (4) Grid connection control: PQ control strategy is adopted, and the voltage outer loop outputs active power command. Reactive power command Set by grid reactive power demand (default) ), to ensure the quality of grid-connected power;
[0163] (5) Protection mechanism: Multiple safety boundaries are set: ① Overvoltage protection ② Overcurrent protection (inverter output current) ); ③ Over-temperature protection (IGBT (Insulated Gate Bipolar Transistor) module temperature) ); ④ Over-limit leakage protection (Lasts 20ms). When any protection is triggered, the DSP immediately cuts off the inverter drive signal and simultaneously connects the bypass circuit to ensure the safety of the system and the power grid.
[0164] Step S44, System Hierarchical Configuration and Cost Optimization:
[0165] The system of this invention can be implemented at multiple configuration levels, with each configuration level differing in at least one aspect: the complexity of the fused intelligent identification model, the implementation method of the active harmonic cancellation control, and the metering accuracy. Optionally, in some embodiments of this invention, to adapt to different scenario requirements, the following hierarchical configuration scheme is proposed:
[0166] (1) High-end configuration: It includes complete AI identification, accurate metering, APF harmonic cancellation and dual-loop inverter control functions, and adopts edge computing unit + high-performance DSP architecture. It is designed for high-value equipment, key power infrastructure (such as chemical plants, data centers) and other scenarios with extremely high requirements for safety and energy efficiency.
[0167] (2) Basic configuration: The AI model structure is simplified, the self-attention mechanism is removed, and the number of neurons in the GRU hidden layer is halved. At the same time, the harmonic control is simplified (only LC filtering is retained), the 5G communication module is removed, and a single-machine DSP control is adopted, which reduces the cost. It is suitable for general industrial manufacturing, civil construction and other scenarios;
[0168] (3) Economic configuration: Only the core AI identification and basic inverter protection functions are retained, and the metering accuracy is reduced to It is designed for low-cost needs such as small businesses and renovation of old facilities.
[0169] The leakage current return current accurate metering and inverter boost grid-connected harmonic active cancellation system provided in this invention embodiment can accurately identify leakage current types, distinguish between essential fault leakage current and normal leakage current, and provide a basis for differentiated control; improve the adaptability of leakage current signal processing, and extract high-purity features through adaptive mode decomposition using the proposed VMD-DBO-GRU-A model to ensure the accuracy of subsequent metering and control; achieve high-precision metering of leakage current return current energy, providing reliable data support for energy consumption optimization; efficiently convert leakage current energy and control harmonic pollution, ensuring safe grid connection while improving power quality; and balance system real-time performance with cost controllability, expanding the application scope by adapting to different scenario requirements through hierarchical configuration.
[0170] To verify the performance advantages of the VMD-DBO-GRU-A model (variational mode decomposition-dung beetle optimization algorithm-gated recurrent unit-self-attention mechanism fusion model) proposed in this invention in the leakage current type identification task, it was compared with eight mainstream models, including LSTM (long short-term memory network), SVR (support vector regression), SVR-DBN (support vector regression-deep belief network), CNN-LSTM (convolutional neural network-long short-term memory network), DBO-LSTM (dung beetle optimization algorithm-long short-term memory network), SVM (support vector machine) and XGB (extreme gradient boosting tree), in a comparative experiment. The model performance was evaluated using four indicators: root mean square error (RMSE), mean absolute error (MAE), mean absolute percentage error (MAPE), and coefficient of determination (R²). Table 1 compares the performance of the VMD-DBO-GRU-A model proposed in this invention with several existing models. Experimental results show that the VMD-DBO-GRU-A model has the best performance across all metrics, with RMSE of 0.5042, MAE of 0.4295, and MAPE of 0.1179, all significantly lower than other comparative models. Its R² reaches 0.9978, close to the ideal value of 1, indicating that the model's predictions fit the true values extremely well. Compared to the traditional machine learning model SVM (RMSE=3.2573, MAE=3.1170, MAPE=0.8665, R²=0.8954) and the classic deep learning model LSTM (RMSE=2.2298, MAE=1.7652, MAPE=0.4786, R²=0.9589), VMD- The VMD-DBO-GRU-A model reduced RMSE by 84.5% and 77.4%, MAE by 86.2% and 75.6%, and MAPE by 86.4% and 75.4%, respectively, while R² increased by 11.4% and 4.1%, respectively. Even compared with the superior XGB model (RMSE=0.8240, MAE=0.6933, MAPE=0.3674, R²=0.9957), its RMSE, MAE, and MAPE were reduced by 38.8%, 38.0%, and 67.9%, respectively, and R² increased by 0.21%. This fully demonstrates that the VMD-DBO-GRU-A model has significant advantages in leakage current signal feature extraction, time-series dependency capture, and classification accuracy, and can provide reliable identification results for accurate leakage current return metering and inverter boost control.
[0171] Table 1. Model Performance Comparison Table
[0172] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.
[0173] It should also be noted that, in the embodiments of this application, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0174] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined in the embodiments of this application may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown in this application, but is to be accorded the widest scope consistent with the principles and novel features disclosed in the embodiments of this application.
Claims
1. A system for precise metering of leakage current return current and active harmonic cancellation of inverter boost grid connection, integrating AI multi-feature fusion algorithms, characterized in that: include: The data acquisition module is used to synchronously acquire leakage-related signals, including leakage voltage signals and leakage current signals on the casing of the leakage device and the grounding wire. The intelligent identification module is connected to the data acquisition module and is used to run the fusion intelligent identification model. The intelligent identification model integrates variational mode decomposition, hyperparameter optimization, gated recurrent unit and attention mechanism to process and analyze the leakage current related signals, and output leakage current type identification results and corresponding classification confidence. The metering management module is connected to the intelligent identification module and the data acquisition module respectively. It is used to adaptively adjust the leakage voltage signal and leakage current signal according to the classification confidence level, and to measure the leakage return energy parameters based on the adjusted signal. The energy conversion and management module is connected to the metering management module and the intelligent identification module, respectively. It is used to convert and boost the leakage return energy, and simultaneously execute harmonic active cancellation control and grid-connected inverter control, so as to suppress the potential of the leakage equipment casing below the safety threshold while realizing energy recovery.
2. The system according to claim 1, characterized in that, The operation of the fusion intelligent recognition model includes the following steps: Adaptive mode decomposition of leakage current signals is performed using variational mode decomposition. The number of modes K to be decomposed is based on the number of peak frequencies in the signal spectrum. Adaptive determination; Time-domain, frequency-domain, and time-frequency joint features are extracted from each of the decomposed modal signals to construct a comprehensive feature vector as the model input; The hyperparameter optimization algorithm adopts the dung beetle optimization algorithm, which is used to optimize the number of hidden layer neurons and the learning rate of the gated recurrent unit network offline, and then solidifies the optimized parameters. The comprehensive feature vector is input into the parameter-optimized gated recurrent unit network to extract temporal features; The temporal features are weighted and enhanced using a self-attention mechanism; Based on the enhanced features, the classifier outputs a probability distribution of leakage types, including at least: intrinsic fault leakage, capacitive leakage, and inductive leakage.
3. The system according to claim 2, characterized in that, The number of modes K in the variational mode decomposition is based on the number of peak frequencies in the signal spectrum. Adaptively determined, and the value of K is related to... Positive correlation; the value of the bandwidth constraint parameter α of the variational mode decomposition is positively correlated with the number of modes K.
4. The system according to claim 1, characterized in that, The classification confidence level is the maximum value among the probabilities of various leakage current types output by the fusion intelligent identification model; the metering management module is configured to: when the classification confidence level is lower than a preset threshold, initiate adaptive gain adjustment of the leakage voltage signal and leakage current signal.
5. The system according to claim 4, characterized in that, The adaptive gain adjustment performed by the metering management module is achieved through the following methods: The initial adjustment gain is calculated based on the classification confidence level, wherein the initial adjustment gain is negatively correlated with the classification confidence level; the initial adjustment gain is constrained between a preset minimum gain value and a maximum gain value to obtain the final dynamic adjustment gain.
6. The system according to claim 1, characterized in that, The leakage current return energy parameters measured by the metering management module include one or more of the following: instantaneous power, total energy, average power, and harmonic energy.
7. The system according to claim 1, characterized in that, The active harmonic cancellation control performed by the energy conversion and governance module includes: detecting the background harmonic current at the grid connection point; controlling the inverter in the energy conversion and governance module to output a cancellation current with the same amplitude and opposite phase as the background harmonic current; and using a repetitive control algorithm to perform closed-loop correction on the cancellation current based on the superposition error between the background harmonic current and the cancellation current.
8. The system according to claim 1, characterized in that, The grid-connected inverter control executed by the energy conversion and management module adopts a voltage-current dual-loop control strategy, wherein: the voltage outer loop generates an active power reference value based on the deviation between the leakage current device casing voltage and a safety threshold; the current inner loop controls the inverter output current to track the current reference value determined by the active power reference value; the system dynamically adjusts the active power reference value based on the comparison result between the leakage current device casing voltage and the safety threshold.
9. The system according to claim 1, characterized in that, The system can be implemented at multiple configuration levels, with differences in at least one aspect of the complexity of the fusion intelligent identification model, the implementation method of the active harmonic cancellation control, and the metering accuracy.
10. The system according to claim 1, characterized in that, The intelligent identification module is deployed on the edge computing unit, and the fused intelligent identification model has undergone lightweight processing through quantization and / or network pruning, so its single inference time is less than the control cycle of the system.