Electric leakage identification method and system for chemical power utilization scene
By using an improved lightweight gradient booster and Osprey optimization algorithm, a leakage current identification method for chemical power consumption scenarios is constructed. By utilizing features such as the total number of extreme points and pulse concentration coefficient, the method solves the problem of misjudgment of leakage current identification caused by harmonic interference in chemical scenarios, thereby improving the accuracy and robustness of leakage current identification.
Patent Information
- Application Number
- CN202511484355.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-17
- Publication Date
- 2026-01-13
AI Technical Summary
Existing leakage fault identification methods based on machine learning models are not adaptable enough to complex and variable harmonic interference in chemical power supply scenarios, resulting in insufficient leakage identification accuracy, easy misjudgment, and impact on power supply reliability and factory economic benefits.
An improved lightweight gradient booster and Osprey optimization algorithm are used to construct a fault feature vector. By combining the total number of extreme points, the pulse concentration coefficient, and time-frequency domain features with the attention weights of the leaf nodes of the lightweight gradient booster and the parameter optimization of the Osprey optimization algorithm, the accuracy of leakage current identification is improved.
It effectively distinguishes between equipment interference and actual leakage faults in chemical environments, improves the accuracy and robustness of leakage identification, reduces false alarms, and ensures the reliability and economic efficiency of the power supply system.
Smart Images

Figure CN121327677A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of leakage current protection technology, and in particular to a method and system for identifying leakage current in chemical power application scenarios. Background Technology
[0002] Safe electricity use and improved overall energy efficiency are key concerns for businesses. Safe electricity use is crucial for improving enterprise energy efficiency. It allows for the timely detection of potential safety hazards, reducing energy waste caused by sudden shutdowns due to malfunctions. Furthermore, it enables timely and appropriate maintenance and inspections based on identified hazards, directly and indirectly preventing economic losses from malfunctions and improving energy efficiency. In recent years, production stoppages caused by internal electrical safety hazards at electricity customers, and even electrical safety incidents at the societal level, have occurred frequently. These incidents not only affect businesses but also cause significant fluctuations in grid power and may even impact the safe and reliable power supply to surrounding areas.
[0003] Electrical leakage is a serious safety hazard in power supply systems, especially in scenarios with high safety requirements, such as chemical plants. Chemical industrial parks may store large quantities of flammable and explosive chemicals, such as olefins, xylene, hydrogen, and ammonia. When a power supply line experiences a leakage fault due to insulation damage, it can cause safety accidents such as electric shock or fire.
[0004] With the increasing demand for safety protection in low-voltage power supply systems, leakage current fault identification technology has evolved from traditional detection to intelligent analysis. Current research on leakage current fault protection in low-voltage power supply systems mainly relies on machine learning models to analyze the time-domain and frequency-domain characteristics of residual current, achieving precise separation between fault current and normal leakage current, significantly improving identification accuracy. Building on this, some studies further focus on the characteristics of biological electric shock signals, particularly in high-risk scenarios like electric shock. By experimentally collecting current waveform data during electric shock, researchers have discovered inherent characteristics of biological electric shock currents, including "high initial peak value, rapid decay rate, and fluctuations caused by muscle spasms," known as unique waveform characteristics of biological electric shock. Based on these characteristics, researchers have developed various precise detection schemes for biological electric shock, including waveform matching algorithms and feature threshold detection. These schemes can quickly identify electric shock faults and trigger protective actions, effectively strengthening the last line of defense for electric shock safety and providing more targeted technical support for personal safety protection in low-voltage power supply systems.
[0005] While existing leakage current fault identification methods demonstrate high reliability in typical industrial scenarios, their application in chemical engineering scenarios presents challenges. Chemical production processes involve numerous power electronic devices such as frequency converters, rectifiers, and inverters connected to the load terminals to meet the demands of speed control and multi-load coordinated operation of reaction equipment. The core working principle of these devices is to convert and control electrical energy through the high-frequency switching of switching devices (such as IGBTs). This high-frequency switching process generates a large amount of harmonic current, which is injected into the power supply circuit, causing waveform distortion of the residual current. Although existing methods can handle conventional fault current characteristics, they are insufficiently adaptable to the complex and variable harmonic interference in chemical environments. This can easily lead to misjudging the residual current distortion caused by harmonics as leakage current, triggering protection actions. Consequently, existing machine-model-based leakage current fault identification methods face severe interference problems due to the extensive use of power electronic devices, resulting in frequent malfunctions of leakage current protection devices, thus affecting power supply reliability and factory economic efficiency. Summary of the Invention
[0006] Therefore, the technical problem to be solved by the present invention is to overcome the shortcomings of existing leakage fault identification methods based on machine learning models, which are not adaptable to the complex and ever-changing harmonic interference in chemical industry scenarios, resulting in insufficient leakage identification accuracy.
[0007] To address the aforementioned technical problems, this invention provides a method for identifying leakage current in chemical power consumption scenarios, comprising: Set the sampling frequency, collect the residual current of the low-voltage power supply circuit within the preset time window, and perform preprocessing to obtain the residual current value corresponding to each sampling moment within the preset time window, and construct the residual current sequence within the preset time window. Based on the total number of extreme points in the residual current sequence within the preset time window, the time-domain characteristics and frequency-domain characteristics of the residual current sequence within the preset time window, a fault feature vector within the preset time window is constructed. By using the fault feature vectors within a preset time window and the leakage fault identification model, the leakage identification results of the low-voltage power supply system within the preset time window are obtained.
[0008] Preferably, constructing the fault feature vector within a preset time window further includes: Calculate the position index of each pulse in the residual current sequence within a preset time window; Calculate the variance of the position indices of all pulses in the residual current sequence to obtain the pulse concentration coefficient of the residual current sequence within the preset time window; The pulse concentration coefficient of the residual current sequence within the preset time window, the total number of extreme points in the residual current sequence within the preset time window, and the time-domain and frequency-domain characteristics of the residual current sequence within the preset time window are used as the fault feature vector within the preset time window.
[0009] Preferably, the leakage fault identification model is either a lightweight gradient lift or an improved lightweight gradient lift.
[0010] Preferably, the fault feature vectors within a preset time window are processed by an improved lightweight gradient booster to obtain the leakage current identification results of the low-voltage power supply system within the preset time window, including: To improve the lightweight gradient booster, two learnable vectors are set for each leaf node of each decision tree. The fault feature vector within a preset time window is input into each decision tree in the improved lightweight gradient booster to obtain the predicted value of the leaf node corresponding to the fault feature vector within the preset time window in each decision tree. The predicted values of the leaf nodes corresponding to the fault feature vectors within the preset time window in each decision tree are summed to obtain the target predicted value. Extract the query vector of fault feature vectors within a preset time window; Based on the query vector of the fault feature vector within the preset time window and the first learnable vector of each leaf node in each decision tree, calculate the leaf-level attention weight of each leaf node in each decision tree. The correction term for each decision tree is calculated based on the leaf-level attention weight of each leaf node in each decision tree and the second learnable vector of each leaf node in each decision tree. The correction term of each decision tree is weighted and fused with the predicted value of the leaf node corresponding to the fault feature vector within the preset time window in each decision tree to obtain the corrected predicted value of the leaf node corresponding to the fault feature vector within the preset time window in each decision tree. The corrected prediction values of the leaf nodes corresponding to the fault feature vectors within the preset time window in all decision trees are accumulated to obtain the final target prediction value; based on the final target prediction value, the leakage current identification result of the low-voltage power supply system within the preset time window is obtained.
[0011] Preferably, the query vector based on the fault feature vector within a preset time window and the first learnable vector of each leaf node in each decision tree are used to calculate the leaf-level attention weight of each leaf node in each decision tree, using the following formula: , in, For the first The first decision tree Leaf-level attention for each leaf node. This is a query vector for fault feature vectors within a preset time window. for transpose, The fault feature vector within a preset time window. for function, For the first The first decision tree The first learnable parameter of each leaf node The dimension of the query vector for fault feature vectors within a preset time window. For decision tree indexing, Index for leaf nodes.
[0012] Preferably, by improving the Osprey optimization algorithm, the parameters of the leakage fault identification model are confirmed, including: The initial osprey population is used as the initial candidate set, and the initial target osprey population set is constructed; where the position of each osprey is a vector, and each element in the vector corresponds to a parameter to be confirmed in the leakage fault identification model. Construct a temporary set for each osprey in the current candidate set. Each temporary set for an osprey contains that osprey and all ospreys in the current target osprey population set. Calculate the difference in overall entropy between the temporary set of each osprey in the current candidate set and the current target osprey population set. Add the osprey with the largest difference to the current target osprey population set until the size of the current target osprey population set is consistent with the set population number, and then use it as the target initial osprey population.
[0013] Preferably, the process of calculating the overall entropy of the current osprey set includes: The value range of each parameter to be confirmed in the leakage fault identification model is evenly divided into... There are several intervals; among them, To set the number of intervals; For each value range of each parameter to be confirmed, count the total number of ospreys in the current osprey set whose element values corresponding to the parameter to be confirmed fall within that range, and calculate the proportion of that total number of ospreys in the current osprey set as the estimated probability for each value range of each parameter to be confirmed. Based on the estimated probability of each value range of each parameter to be confirmed, the entropy value of each parameter to be confirmed is calculated using Shannon entropy. The entropy values of all parameters are added together to obtain the overall entropy of the current osprey set.
[0014] Preferably, the time-domain characteristics of the residual current sequence within the preset time window include: variance characteristics, impulse factor characteristics, sample entropy, kurtosis ratio characteristics, and root mean square value of the residual current sequence within the preset time window.
[0015] Preferably, the frequency domain characteristics of the residual current sequence within the preset time window include: the third harmonic characteristics of the residual current sequence within the preset time window.
[0016] This invention also provides a leakage current detection device for chemical power applications, comprising: The memory is used to store computer programs; the processor is used to implement the steps of the above-mentioned method for identifying leakage current in a chemical power consumption scenario when executing the computer programs.
[0017] Compared with the prior art, the above-described technical solution of the present invention has the following advantages: This invention discloses a method and system for identifying leakage current in chemical power supply scenarios. The invention uses the total number of extreme points in the residual current sequence within a preset time window as a crucial component of the fault feature vector. In chemical scenarios, equipment such as variable-speed blowers in non-leakage states can superimpose pulse spikes, causing severe distortion of the residual current waveform and generating numerous additional extreme points. However, in actual leakage faults, the energy of the faulty branch masks this pulse interference, reducing waveform distortion and significantly decreasing the total number of extreme points. Therefore, this invention introduces the total number of extreme points to accurately distinguish between waveform distortion caused by equipment interference and waveform changes caused by actual leakage faults. Through this intuitive and easily calculated feature of the total number of extreme points, the interference from equipment such as variable-speed blowers specific to chemical scenarios is effectively eliminated, significantly improving the accuracy of leakage current identification in low-voltage power supply circuits in chemical power supply scenarios.
[0018] At the moment of a leakage fault, the grounding branch conduction generates a large number of concentrated residual current spikes, which is a hallmark of leakage faults. However, ordinary leakage current can also cause pulse interference. Relying solely on the presence or absence of pulses as a basis for judgment is prone to misdiagnosis. To address this, this invention proposes a pulse concentration coefficient feature, which can accurately characterize the fault state through pulse position distribution. First, the position index of each pulse in the residual current sequence within a preset time window is statistically analyzed. Then, the variance of all position indices is calculated. The larger the variance, the greater the fluctuation in pulse spacing, and the more concentrated the pulse distribution, consistent with the pulse characteristics during a fault. The smaller the variance, the more stable the pulse spacing, and the more uniform the pulse distribution, consistent with the interference pulse characteristics during normal operation. Based on this core difference, the pulse concentration coefficient can effectively distinguish between the concentrated pulses characteristic of faults and the uniform pulses of normal interference, effectively improving the accuracy of leakage identification in low-voltage power supply circuits in chemical power consumption scenarios.
[0019] This invention utilizes an improved lightweight gradient booster to process fault feature vectors and obtain leakage current identification results. The improved model assigns two learnable vectors to each leaf node of the decision tree, calculates leaf-level attention weights by combining the query vector of the fault feature vector, dynamically adjusts the contribution of each leaf node to the prediction result, and achieves precise correction through weighted fusion of the correction term and the original predicted value. Finally, the identification result is obtained by accumulating the corrected prediction value. This design enables the model to adaptively focus on more critical feature information for leakage current identification, enhancing its ability to capture effective fault features under complex interference in chemical engineering scenarios. It overcomes the limitations of traditional models where leaf node contributions are fixed and difficult to dynamically adapt to complex operating conditions, effectively improving the accuracy and robustness of leakage current identification in low-voltage power supply systems within a preset time window.
[0020] Furthermore, this invention confirms the parameters of the leakage fault identification model through an improved osprey optimization algorithm. This algorithm uses an initial osprey population as a candidate set, with the osprey position vectors corresponding to the model parameters to be confirmed. By constructing a temporary set for each candidate osprey and calculating the overall entropy difference between it and the target population, the algorithm selects the ospreys with the largest entropy gain to gradually expand the target population. This effectively avoids the premature convergence problem that is prone to occur in traditional optimization algorithms, enabling the initial target osprey population to more comprehensively cover the reasonable search space of model parameters, significantly enhancing the global search capability for the optimal parameters of the leakage fault identification model. At the same time, the uniform population distribution reduces invalid searches during the parameter optimization process, accelerates the algorithm's convergence speed, and ensures that the model parameters adapted to the complex interference environment of chemical power consumption scenarios can be determined more efficiently and accurately. This provides a reliable parameter basis for the subsequent leakage identification model to achieve high-accuracy identification, further improving the practicality and efficiency of the entire leakage identification scheme. Attached Figure Description
[0021] To make the content of this invention easier to understand, the invention will be further described in detail below with reference to specific embodiments and accompanying drawings, wherein: Figure 1 This is a flowchart illustrating a method for identifying leakage current in a chemical power consumption scenario according to the present invention.
[0022] Figure 2 This is a flowchart for identifying leakage faults.
[0023] Figure 3 It is a distribution diagram of the number of extreme points of the waveform.
[0024] Figure 4 This is a distribution diagram of pulse concentration coefficients.
[0025] Figure 5 It is a traditional time-domain and frequency-domain feature distribution map.
[0026] Figure 6This is a flowchart of the improved Osprey optimization algorithm.
[0027] Figure 7 This is a schematic diagram of the simulation experiment platform setup.
[0028] Figure 8 This is the confusion matrix of the results of the method of the present invention on the test set. Detailed Implementation
[0029] The present invention will be further described below with reference to the accompanying drawings and specific embodiments, so that those skilled in the art can better understand and implement the present invention. However, the embodiments described are not intended to limit the present invention.
[0030] Reference Figure 1 As shown in the figure, this embodiment provides a method for identifying leakage current in a chemical power consumption scenario, including: like Figure 2 As shown, Figure 2 This is a flowchart for identifying leakage faults.
[0031] In chemical engineering power consumption scenarios, the variation of residual current waveform is affected by two key factors: equipment interference in non-leakage states and energy changes under actual leakage faults. Specifically, equipment such as variable-speed blowers used in chemical workshops to ensure ventilation will superimpose multiple pulse spikes on the residual current waveform. These pulse spikes are not caused by leakage, but they directly cause waveform distortion. When the distortion is severe, the residual current waveform within a preset time window will no longer only exhibit the inherent peaks and troughs of a sine wave, but will generate multiple additional extreme points due to the pulse spikes. This can easily be confused with the waveform characteristics of leakage faults, posing a risk of misjudgment to traditional identification methods. However, in the case of an actual leakage fault, the energy released by the faulty branch will naturally mask the pulse interference generated by the aforementioned variable-speed blowers and other equipment, significantly reducing the degree of waveform distortion. In this case, the residual current waveform within the preset time window may still have a few additional extreme points, but the total number of extreme points will be far less than in the case of severe distortion caused by equipment interference in the absence of leakage.
[0032] like Figure 3 As shown, Figure 3 The distribution diagram shows the characteristic of the number of extreme points in the waveform. The normal operating state is represented by (0), and the leakage fault state is represented by (1). In the comparative analysis, it was found that the current waveform under normal operating conditions is more complex due to the influence of load and disturbance, and the number of extreme points is generally higher; while when a leakage fault occurs, the waveform tends to be stable, and the number of extreme points is significantly reduced. Traditional studies have focused on indicators such as current amplitude, harmonics, or phase, and paid less attention to time-domain geometric characteristics, thus failing to discover this pattern. This study experimentally verified the stable correspondence between the number of extreme points and the leakage fault state, indicating that it can be used as an effective and easy-to-calculate fault criterion.
[0033] It has been proven that leakage faults can be identified by the total number of extreme points in the residual current sequence within a preset time window. The specific scheme is as follows: Step S1: Set the sampling frequency, collect the residual current of the low-voltage power supply circuit within a preset time window through the residual current transformer, and perform preprocessing to obtain the residual current value corresponding to each sampling moment within the preset time window, and construct the residual current sequence within the preset time window; the preprocessing includes: filtering out high-frequency noise through wavelet transform; Step S2: Based on the total number of extreme points in the residual current sequence within the preset time window, the time-domain characteristics and frequency-domain characteristics of the residual current sequence within the preset time window, construct the fault feature vector within the preset time window; Step S3: The fault feature vectors within the preset time window are used to obtain the leakage identification results of the low-voltage power supply system within the preset time window through the leakage fault identification model.
[0034] At the moment of a leakage current fault, the conduction of the grounding branch causes a large number of concentrated residual current spikes, which can serve as a hallmark of the fault. However, judging solely by the appearance of these pulses may be susceptible to interference from pulses caused by ordinary leakage current. Therefore, to accurately characterize the leakage current fault state, this invention proposes a pulse concentration coefficient feature. This feature characterizes the occurrence of the fault by statistically analyzing the positional distribution of each pulse within a preset time window in the residual current sequence. More concentrated pulses suggest a fault state, while more uniform pulses suggest a normal operating state. After obtaining the positional distribution of each pulse within the preset time window in the residual current sequence, the pulse spacing sequence is obtained based on the positional information. Finally, the variance of the spacing sequence is calculated. The variance reflects the degree of fluctuation in the sequence; a larger variance indicates greater fluctuation in pulse spacing, suggesting a potentially concentrated pulse distribution, while a smaller variance indicates a potentially uniform pulse distribution.
[0035] like Figure 4 As shown, Figure 4The diagram shows the pulse concentration coefficient distribution. Observation reveals that under normal operating conditions, the pulse concentration coefficient is generally low and relatively dispersed and uniformly distributed. The corresponding spacing sequence variance is small, indicating that the pulse positions within the residual current sequence are relatively regular, without a large number of concentrated residual current spikes. This is consistent with the relatively uniform distribution characteristics of pulse interference caused by ordinary leakage current, indicating that the system is in a stable normal operating state with no obvious signs of leakage fault. However, under leakage fault operating conditions, the pulse concentration coefficient increases significantly and exhibits a clear clustered distribution characteristic. The corresponding spacing sequence variance is large, meaning that the pulse spacing fluctuates violently, reflecting a large number of concentrated spikes in the residual current sequence. This coincides with the characteristic phenomenon of a large number of concentrated residual current spikes caused by the instantaneous conduction of the grounding branch during a leakage fault, clearly indicating that a leakage fault has occurred in the system.
[0036] It has been proven that leakage faults can be identified using the pulse concentration coefficient of the residual current sequence within a preset time window. The specific scheme is as follows: In this embodiment, preferably, constructing the fault feature vector within a preset time window further includes: Calculate the position index of each pulse in the residual current sequence within a preset time window; Calculate the variance of the position indices of all pulses in the residual current sequence to obtain the pulse concentration coefficient of the residual current sequence within the preset time window; The pulse concentration coefficient of the residual current sequence within the preset time window, the total number of extreme points in the residual current sequence within the preset time window, and the time-domain and frequency-domain characteristics of the residual current sequence within the preset time window are used as the fault feature vector within the preset time window.
[0037] like Figure 5 As shown, Figure 5 It is a traditional time-domain and frequency-domain feature distribution map.
[0038] In this embodiment, specifically, the time-domain characteristics of the residual current sequence within the preset time window include: variance characteristics, impulse factor characteristics, sample entropy, kurtosis ratio characteristics, and root mean square value of the residual current sequence within the preset time window.
[0039] Variance characteristics can reflect the degree of fluctuation of a sequence. When the degree of fluctuation is higher, it is more likely to correspond to a leakage fault state; when the degree of fluctuation is lower, it is more likely to correspond to a normal operating state.
[0040] The pulse factor characteristic characterizes the system state by the degree of outlier of the pulse peak relative to the overall signal level: Under normal operating conditions, power electronic devices in chemical workshop equipment will introduce a large number of pulses into the residual current, while the average value of the residual current is generally at a low level, resulting in a high pulse factor characteristic value; when a leakage fault occurs, the conduction of the fault branch causes the average value of the residual current to rise significantly, and the relative difference between the pulse peak and the average value decreases, so the pulse factor characteristic value shows a low state.
[0041] Sample entropy is used to assess the complexity of a signal; a higher value indicates greater signal complexity and correspondingly increased system state complexity. During a leakage fault, the residual current is composed of both the fault branch current and the leakage current from the capacitance to ground, resulting in a more complex signal composition. Therefore, the sample entropy eigenvalue is at a high level.
[0042] Kurtosis ratio reflects the steepness of peaks in a sequence. Under normal operating conditions, equipment interference in a chemical environment generates a large number of spike pulses, resulting in a high degree of peaks in the residual current sequence and a correspondingly high kurtosis ratio. However, under leakage fault conditions, the intervention of the fault branch current weakens the steepness of the original pulses, leading to a decrease in the degree of peaks in the sequence and a correspondingly low kurtosis ratio.
[0043] The root mean square value can reflect the overall energy level of the residual current. When a leakage fault occurs, the energy level of the residual current will increase significantly. This characteristic is a basic indicator for judging leakage faults.
[0044] The frequency domain characteristics of the residual current sequence within the preset time window include: the third harmonic characteristics of the residual current sequence within the preset time window.
[0045] The third harmonic characteristic is the proportion of signals with a frequency equal to three times the power frequency in the residual current sequence within a preset time window. In the event of a leakage fault, a large number of high-frequency components will be added to the residual current sequence, and the third harmonic characteristic can effectively characterize the proportion of these high-frequency components.
[0046] From the perspective of each feature, there are fuzzy intervals where it is difficult to distinguish the system state. Therefore, it is necessary to use multiple features to reflect the fault state from different angles. Thus, this invention combines the above eight features into a fault feature vector and uses a machine learning model to classify the fault.
[0047] In this embodiment, specifically, the leakage fault identification model is either a lightweight gradient lift machine or an improved lightweight gradient lift machine.
[0048] In this embodiment, specifically, when the leakage fault identification model is a lightweight gradient booster, the fault feature vector within a preset time window is passed through the lightweight gradient booster to obtain the leakage identification result of the low-voltage power supply system within the preset time window, including: For each decision tree in the lightweight gradient booster, starting from the root node of the decision tree, extract the split feature index (i.e., the position of the feature to be used for judgment in the fault feature vector) and the split threshold of that node; based on the split feature index, find the corresponding fault feature value from the fault feature vector. Based on the fault feature value and the splitting threshold of the root node of the decision tree, the fault feature value and the splitting threshold are compared, and the next child node to be entered is determined according to a preset rule (e.g., if the feature value is greater than or equal to the threshold, enter the left child node, otherwise enter the right child node). Repeat the above steps until you reach a leaf node of the decision tree and record the predicted value stored in that leaf node. The predicted values of the leaf nodes corresponding to the fault feature vectors within the preset time window in all decision trees are summed to obtain the target predicted value. Based on the preset judgment rules (such as judging a leakage fault when the target predicted value reaches or exceeds the set threshold, otherwise judging normal operation), the leakage identification result of the low-voltage power supply system within the preset time window is determined and output based on the target predicted value.
[0049] To improve the accuracy and robustness of leakage fault identification in chemical power consumption scenarios, this invention is based on a Lightweight Gradient Boosting Machine (LightGBM, LGBM). Leaf attention is added, and each tree in the LGBM is pre-set with learnable values. After calculating the leaf-level attention, the output is reconstructed and fused with the residual output of the original tree to construct a classifier. The specific scheme is as follows: In this embodiment, preferably, the fault feature vector within a preset time window is processed by an improved lightweight gradient booster (Chaos-OOA-LGBM) to obtain the leakage current identification result of the low-voltage power supply system within the preset time window, including: Within the scope of LGBM, two learnable vectors are set for each leaf node of each decision tree to improve the lightweight gradient booster. The fault feature vector within the preset time window Input the value into each decision tree in the improved lightweight gradient booster and obtain the predicted value of the leaf node corresponding to the fault feature vector within a preset time window in each decision tree; The predicted values of the leaf nodes corresponding to the fault feature vectors within the preset time window in each decision tree are summed to obtain the target predicted value. Query vector for extracting fault feature vectors within a preset time window ; Based on the query vector of the fault feature vector within a preset time window and the first learnable vector of each leaf node in each decision tree, the leaf-level attention weight of each leaf node in each decision tree is calculated using the following formula: , in, For the first The first decision tree Leaf-level attention for each leaf node. This is a query vector for fault feature vectors within a preset time window. for transpose, The fault feature vector within a preset time window. for function, For the first The first decision tree The first learnable parameter of each leaf node The dimension of the query vector for fault feature vectors within a preset time window. For decision tree indexing, Index for leaf nodes.
[0050] Based on the leaf-level attention weights of each leaf node in each decision tree and the second learnable vector of each leaf node in each decision tree, the correction term for each decision tree is calculated using the following formula: , in, For the first The correction terms of the decision tree For the first The first decision tree The second learnable parameter of each leaf node.
[0051] The correction term of each decision tree is weighted and fused with the predicted value of the leaf node corresponding to the fault feature vector within the preset time window in each decision tree. The output of each decision tree is reconstructed to obtain the corrected predicted value of the leaf node corresponding to the fault feature vector within the preset time window in each decision tree. The corrected predicted values of the leaf nodes corresponding to the fault feature vectors within the preset time windows of all decision trees are summed to obtain the final target predicted value, as shown in the formula: , in, For the final target predicted value, For decision tree indexing, For the first In a decision tree, the predicted value of the leaf node corresponds to the fault feature vector within a preset time window. This is the scaling factor. The total number of decision trees.
[0052] Based on the final target prediction value, obtain the leakage current identification results of the low-voltage power supply system within a preset time window.
[0053] Before using LGBM, its hyperparameters need to be set, as these settings directly affect the model's training speed, computation speed, accuracy, and memory usage. To optimize training parameters and improve the convergence of LGBM, the Osprey Optimization Algorithm (OOA) is introduced for hyperparameter optimization.
[0054] Traditional Osprey optimization algorithms employ uniform randomization to randomly generate an initial Osprey population, as shown in the formula: , in, Indicates the first candidate in the initial candidate set. Only the osprey in the The position of each osprey in the dimension of the unconfirmed parameter is represented by a vector of unconfirmed parameters for the leakage fault identification model. element That is the first The leakage fault identification model corresponding to the Osprey is the first One parameter to be confirmed. For the leakage fault identification model The lower bound of the value of the parameter to be confirmed (number of leaf nodes). For the leakage fault identification model The upper bound of the values for the parameter to be confirmed (number of leaf nodes). Represents a random number for a leaf node. express It follows a uniform distribution on the interval [0,1]. It indicates a uniform distribution.
[0055] Traditional Osprey optimization algorithms use uniform randomization, which can lead to uneven distribution of initial solutions. This uneven distribution is not due to the non-uniformity of random numbers themselves, but rather because the limited population size makes it difficult to completely fill all effective regions of the multidimensional parameter space through pure randomness. Especially when the parameter dimension is high and the range of parameter values varies greatly, the randomly generated solutions are more likely to be biased towards certain intervals, resulting in the initial solutions failing to fully cover the parameter search space. This affects the global search capability of subsequent algorithms and may even lead to premature convergence due to the initial solutions being concentrated near local optima.
[0056] Therefore, this invention proposes an improved Osprey Optimization Algorithm (Chaos-OOA), the specific algorithm of which is as follows: Define the osprey population, i.e., the search space, within the parameter range of the corrected LGBM: , in, For the first The fish group of the osprey, namely the first The position of the osprey is sufficient The union of the osprey group set and the optimal position. For the first The group corresponding to the osprey The optimal position for the osprey, i.e., the optimal solution, is... For the first The objective function value corresponding to the osprey. For the first The objective function value corresponding to the osprey.
[0057] like Figure 6 As shown, Figure 6 A flowchart for the improved Osprey optimization algorithm.
[0058] In this embodiment, preferably, step S31: by improving the Osprey optimization algorithm, the parameters of the leakage fault identification model are confirmed, including: Step S311: Set the population size, maximum number of iterations, and initialize the current number of iterations. Define the value range of each parameter to be confirmed in the leakage fault identification model, and use uniform randomization to generate the initial osprey population. Step S312: Use the initial osprey population as the initial candidate set and construct the initial target osprey population set; wherein, the initial target osprey population set is an empty set, the position of each osprey is a vector, and each element in the vector corresponds to a parameter to be confirmed in the leakage fault identification model. Step S313: Construct a temporary set for each osprey in the current candidate set. The temporary set for each osprey contains the osprey itself and all ospreys in the current target osprey population set. Step S314: Calculate the difference between the total entropy of the temporary set of each osprey in the current candidate set and the current target osprey population set. Add the osprey with the largest difference to the current target osprey population set until the size of the current target osprey population set is consistent with the set population number, and then use it as the target initial osprey population. In this embodiment, specifically, the process of calculating the overall entropy of the current osprey set includes: The value range of each parameter to be confirmed in the leakage fault identification model. Evenly divided into There are several intervals; among them, To set the number of intervals; For each value range of each parameter to be confirmed, count the total number of ospreys in the current osprey set whose element value corresponding to the parameter to be confirmed falls within that range, and calculate the proportion of that total number of ospreys in the current osprey set. This proportion is used as the estimated probability for each value range of each parameter to be confirmed, as follows: , in, For the first The parameter to be confirmed is in its first... The estimated probability within a range of values. Index of parameters to be confirmed. For range index, For the current Osprey assembly, Represents any one of the ospreys in the current osprey set. For Osprey The position vector of the first The value of each element, i.e., the osprey Corresponding to the The specific value of the parameter to be confirmed. For the first The first parameter to be confirmed A range of values, This represents the total number of ospreys in the current osprey set.
[0059] Based on the estimated probability of each value range for each parameter to be confirmed, the entropy value of each parameter to be confirmed is calculated using Shannon entropy, as follows: , in, For the first The entropy value of the parameter to be confirmed. For the current Osprey assembly, The total number of intervals, It is a very small positive number.
[0060] The total entropy of the current osprey set is obtained by summing the entropy values of all parameters, using the following formula: , in, Let be the total entropy of the current set of ospreys.
[0061] When the current set of ospreys is a temporary set for each osprey, the overall entropy of the temporary set for each osprey is calculated through the above steps; when the current set of ospreys is the current target osprey population set, the overall entropy of the current target osprey population set is calculated through the above steps.
[0062] The formula for calculating the difference in overall entropy between the temporary set of each osprey in the current candidate set and the current target osprey population set is as follows: , in, This is the difference in overall entropy between the current temporary set of ospreys and the current target osprey population set. This is a temporary assembly of the current ospreys. For the current target osprey population, The total entropy of the current temporary set of ospreys. The total entropy is the current target osprey population set.
[0063] Step S315: Enter the first stage of global surveying. Update the position of each osprey in the current iteration through global surveying. Use the ospreys to identify the target location and perform a search. The formula is: , , , in, For the first phase of the current iteration In the updated position vector of the Osprey The value of each element, A random number in the range [0,1]. For the current iteration The first target location identified by the osprey The value of each element, For the current iteration The position vector of the osprey The value of each element, A random number in the range [1,2]. For the first phase of the current iteration In the updated position vector of the Osprey The target value of each element. For the current iteration The target location of the osprey. The objective function value corresponding to the position of each osprey in the current iteration. The objective function value corresponding to the updated position of each osprey in the first stage of the current iteration. For the first phase of the current iteration The location of the Osprey after the update.
[0064] Step S316: Enter the second stage, the local mining stage. The position of each osprey in the current iteration is updated through local mining. The osprey moves a small distance from its current position, as shown in the formula: , , , in, For the current iteration, second phase, In the updated position vector of the Osprey The value of each element, For the current iteration, second phase, In the updated position vector of the Osprey The target value of each element. The objective function value corresponding to the updated position of each osprey in the second phase of the current iteration. For the current iteration, second phase, The updated location of the Osprey. This represents the current iteration number.
[0065] Step S317: Determine If the maximum number of iterations has been reached, output the position of the Osprey corresponding to the highest objective function value in the current iteration, and use it as the parameter combination for the leakage fault identification model; otherwise, return to step S315.
[0066] The Chaos-OOA algorithm simulates the predatory behavior of ospreys to automatically search for the optimal parameter combination, improving the model's convergence speed and global optimization ability, ultimately enhancing the model's prediction accuracy. The hyperparameters include the number of leaf nodes, the number of evaluators, the learning rate, the minimum number of leaf node samples, and the maximum depth. After optimization, the selected hyperparameter combinations are shown in Table 1, which presents the hyperparameter selection results for the leakage fault identification model.
[0067] Table 1
[0068] Based on the above hyperparameter combinations, a corresponding improved LGBM model is established and fitted to the training set samples. During the training process, the model will perform unilateral gradient sampling on the samples to make full use of high-value features. At the same time, it will also perform mutually exclusive feature binding on multi-dimensional features to achieve dimensionality reduction calculation and improve the fitting efficiency of the training samples. After the model is trained, it can be used for leakage fault identification and enter the subsequent testing and analysis stage.
[0069] The fault feature vectors within a preset time window are input into the trained improved LGBM model to calculate the sample categories. Finally, after the category calculation is completed, a result vector equivalent to the number of base evaluators is output. The final output result of the model is usually determined by the principle of majority rule. If the output result is normal, no action is taken; if the result is a leakage fault, an alarm and tripping action are taken.
[0070] This invention employs an Osprey optimization algorithm with a chaotic initialization mechanism to optimize its hyperparameters. This method improves the distribution uniformity of the initial population through chaotic mapping, avoids premature convergence, and thus significantly enhances the model's global search capability and convergence speed.
[0071] This invention addresses the problem that in chemical power consumption scenarios, the extensive use of power electronic devices often leads to significant interference that can cause leakage current protection devices to malfunction. It proposes a leakage current identification method for chemical power consumption scenarios that takes into account various types of interference, enabling more accurate identification of electrical safety risks and reducing on-site device malfunctions.
[0072] Based on Example 1, this Example 2 establishes a simulation test platform for leakage faults in a chemical power supply system for testing and analyzing the proposed method. Common chemical power-consuming equipment is used at the load end, such as variable-speed blowers, heated reaction vessels, and high-speed centrifuges. Under normal operating conditions, a fault leakage branch is added, and the occurrence of the fault is controlled by a fault start switch. 34,731 time window samples are obtained in this way as the test set for the proposed method to verify its effectiveness.
[0073] like Figure 7 As shown, Figure 7 This is a schematic diagram of the simulation experiment platform setup.
[0074] The method proposed in this invention was tested and analyzed on a simulation platform test set to verify its effectiveness. The confusion matrix of the test results is as follows. Figure 8 As shown, Figure 8 This is the confusion matrix of the method of the present invention on the test set. The rows of the confusion matrix represent the model calculation results, the columns represent the sample labels, and each element in the matrix represents the number of times the corresponding sample label was identified as a certain result by the model.
[0075] Label (0) represents normal operation, and (1) represents fault leakage. Figure 8As can be seen, this invention correctly identified normal operation as normal operation 15744 times, and incorrectly identified normal operation as fault leakage 114 times. Furthermore, the model identified fault leakage as fault leakage 18827 times and fault leakage as normal operation 46 times. The overall accuracy rate is 99.54%, the accuracy rate for normal state identification is 99.28%, and the accuracy rate for fault state identification is 99.76%. The results show that the proposed method has a high accuracy rate for identifying leakage faults in chemical power supply scenarios.
[0076] This embodiment three provides a leakage current detection device for chemical power consumption scenarios, including: The memory is used to store computer programs; the processor is used to implement the steps of the above-mentioned method for identifying leakage current in a chemical power consumption scenario when executing the computer programs.
[0077] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0078] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0079] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0080] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0081] Obviously, the above embodiments are merely illustrative examples for clear explanation and are not intended to limit the implementation. Those skilled in the art will recognize that other variations or modifications can be made based on the above description. It is neither necessary nor possible to exhaustively list all possible implementations here. However, obvious variations or modifications derived therefrom are still within the scope of protection of this invention.
Claims
1. A method for identifying leakage current in chemical power consumption scenarios, characterized in that, include: Set the sampling frequency, collect the residual current of the low-voltage power supply circuit within the preset time window, and perform preprocessing to obtain the residual current value corresponding to each sampling moment within the preset time window, and construct the residual current sequence within the preset time window. Based on the total number of extreme points in the residual current sequence within the preset time window, the time-domain characteristics and frequency-domain characteristics of the residual current sequence within the preset time window, a fault feature vector within the preset time window is constructed. By using the fault feature vectors within a preset time window and the leakage fault identification model, the leakage identification results of the low-voltage power supply system within the preset time window are obtained.
2. The method for identifying leakage current in a chemical power consumption scenario according to claim 1, characterized in that, Constructing a fault feature vector within a preset time window also includes: Calculate the position index of each pulse in the residual current sequence within a preset time window; Calculate the variance of the position indices of all pulses in the residual current sequence to obtain the pulse concentration coefficient of the residual current sequence within the preset time window; The pulse concentration coefficient of the residual current sequence within the preset time window, the total number of extreme points in the residual current sequence within the preset time window, and the time-domain and frequency-domain characteristics of the residual current sequence within the preset time window are used as the fault feature vector within the preset time window.
3. The method for identifying leakage current in a chemical power consumption scenario according to claim 1, characterized in that, The leakage fault identification model can be either a lightweight gradient lift or an improved lightweight gradient lift.
4. The method for identifying leakage current in a chemical power consumption scenario according to claim 3, characterized in that, The fault feature vectors within a preset time window are processed using an improved lightweight gradient booster to obtain leakage current identification results for the low-voltage power supply system within the preset time window, including: To improve the lightweight gradient booster, two learnable vectors are set for each leaf node of each decision tree. The fault feature vector within a preset time window is input into each decision tree in the improved lightweight gradient booster to obtain the predicted value of the leaf node corresponding to the fault feature vector within the preset time window in each decision tree. The predicted values of the leaf nodes corresponding to the fault feature vectors within the preset time window in each decision tree are summed to obtain the target predicted value. Extract the query vector of fault feature vectors within a preset time window; Based on the query vector of the fault feature vector within the preset time window and the first learnable vector of each leaf node in each decision tree, calculate the leaf-level attention weight of each leaf node in each decision tree. The correction term for each decision tree is calculated based on the leaf-level attention weight of each leaf node in each decision tree and the second learnable vector of each leaf node in each decision tree. The correction term of each decision tree is weighted and fused with the predicted value of the leaf node corresponding to the fault feature vector within the preset time window in each decision tree to obtain the corrected predicted value of the leaf node corresponding to the fault feature vector within the preset time window in each decision tree. The corrected prediction values of the leaf nodes corresponding to the fault feature vectors within the preset time window in all decision trees are accumulated to obtain the final target prediction value; based on the final target prediction value, the leakage current identification result of the low-voltage power supply system within the preset time window is obtained.
5. The method for identifying leakage current in a chemical power consumption scenario according to claim 3, characterized in that, The query vector based on the fault feature vector within the preset time window and the first learnable vector of each leaf node in each decision tree are used to calculate the leaf-level attention weight of each leaf node in each decision tree, using the following formula: , in, For the first The first decision tree Leaf-level attention for each leaf node. This is a query vector for fault feature vectors within a preset time window. for transpose, The fault feature vector within a preset time window. for function, For the first The first decision tree The first learnable parameter of each leaf node The dimension of the query vector for fault feature vectors within a preset time window. For decision tree indexing, Index for leaf nodes.
6. The method for identifying leakage current in a chemical power consumption scenario according to claim 3, characterized in that, By improving the Osprey optimization algorithm, the parameters of the leakage fault identification model were confirmed, including: The initial osprey population is used as the initial candidate set, and the initial target osprey population set is constructed; where the position of each osprey is a vector, and each element in the vector corresponds to a parameter to be confirmed in the leakage fault identification model. Construct a temporary set for each osprey in the current candidate set. Each temporary set for an osprey contains that osprey and all ospreys in the current target osprey population set. Calculate the difference in overall entropy between the temporary set of each osprey in the current candidate set and the current target osprey population set. Add the osprey with the largest difference to the current target osprey population set until the size of the current target osprey population set is consistent with the set population number, and then use it as the target initial osprey population.
7. The method for identifying leakage current in a chemical power consumption scenario according to claim 3, characterized in that, The process of calculating the overall entropy of the current osprey set includes: The value range of each parameter to be confirmed in the leakage fault identification model is evenly divided into... There are several intervals; among them, To set the number of intervals; For each value range of each parameter to be confirmed, count the total number of ospreys in the current osprey set whose element values corresponding to the parameter to be confirmed fall within that range, and calculate the proportion of that total number of ospreys in the current osprey set as the estimated probability for each value range of each parameter to be confirmed. Based on the estimated probability of each value range of each parameter to be confirmed, the entropy value of each parameter to be confirmed is calculated using Shannon entropy. The entropy values of all parameters are added together to obtain the overall entropy of the current osprey set.
8. The method for identifying leakage current in a chemical power consumption scenario according to claim 1, characterized in that, The time-domain characteristics of the residual current sequence within the preset time window include: variance characteristics, impulse factor characteristics, sample entropy, kurtosis ratio characteristics, and root mean square value of the residual current sequence within the preset time window.
9. The method for identifying leakage current in a chemical power consumption scenario according to claim 1, characterized in that, The frequency domain characteristics of the residual current sequence within the preset time window include: the third harmonic characteristics of the residual current sequence within the preset time window.
10. A leakage current detection device for chemical power applications, characterized in that, include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the steps of the leakage current identification method for a chemical power consumption scenario as described in any one of claims 1 to 9.
Citation Information
Cited By
Electric leakage test method for mining combined low-voltage feed system
CN121899702A
