Method, device and storage medium for locating a user with wiring error and electric leakage

By using a complex-domain multiple linear regression model with dynamic weighting and iterative screening mechanisms, the robustness of existing leakage current user identification methods under abnormal sample interference is solved, achieving high-precision and high-stability identification in low-voltage distribution transformer areas and reducing false alarm and false alarm rates.

CN121410452BActive Publication Date: 2026-04-07CHANGSHA UNIVERSITY OF SCIENCE AND TECHNOLOGY
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-29
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Existing leakage current user identification methods based on multiple linear regression lack robustness in practical applications in low-voltage distribution substations. They are easily affected by abnormal samples, resulting in a significant decrease in identification accuracy and reliability, and they cannot effectively identify leakage current users with wiring errors.

Method used

A dynamic weighting and iterative screening mechanism is adopted. By dynamically allocating weights according to the residual size in each iteration, the influence of abnormal sample points is weakened. Through iterative optimization, the solution gradually converges to a solution that better reflects the intrinsic relationship between the residual current and the normal load current of the transformer area. A complex domain multiple linear regression model is established, and the parameters are optimized by combining the random sampling consensus algorithm and the weighted loss function.

Benefits of technology

It significantly improves the accuracy and stability of leakage current user identification in complex and noisy real-world data scenarios, reduces the probability of false alarms and false negatives, and ensures high accuracy and reliability of the model in noisy and interference environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121410452B_ABST
    Figure CN121410452B_ABST
Patent Text Reader

Abstract

The application discloses a wiring error and electric leakage user robust positioning method and device and a storage medium, and relates to the technical field of electric leakage detection. The method comprises the following steps: establishing a regression model with residual current as the dependent variable and user load current as the independent variable, and performing initial solving; calculating residual error based on the initial fitting parameters obtained by solving, and determining initial weight coefficients; repeating the steps until the iteration termination condition is met; according to the current weight coefficients, solving the parameters of the regression model to obtain a candidate model; when the fitting accuracy of the candidate model is better than that of the current optimal model, updating the candidate model to the current optimal model, calculating new residual error, and updating the weight coefficients according to the new residual error; and determining the user with wiring error and electric leakage fault according to the parameters corresponding to each user load current in the current optimal model after iteration. The application realizes clearer and more reliable fault user identification in real engineering data, and reduces the misjudgment rate and the missed judgment rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of leakage current detection technology, and in particular relates to a robust method, device and storage medium for locating leakage current in users with wiring errors. Background Technology

[0002] In low-voltage distribution substations, incorrect wiring of the neutral and ground wires is one of the main types of faults leading to abnormal residual current, electric shock, and electrical fire risks. Traditional manual, segment-by-segment troubleshooting methods are inefficient and affect power supply continuity, and can no longer meet the operation and maintenance needs of smart distribution networks.

[0003] With the development of advanced measurement systems in transformer substations, online fault location based on measurement data has become a research hotspot. The core principle is that when a user experiences a leakage current fault, their entire load current is converted into residual current in the substation, resulting in a strong correlation between the two. Based on this, fault location can be achieved by identifying users with the strongest correlation to the residual current through data analysis methods (such as regression analysis).

[0004] Currently, existing technical solutions employ multiple linear regression models to achieve this goal. For example, patent document CN118534253A discloses a method for locating wiring errors and leakage current based on complex multiple regression. Specifically, this method involves collecting phasor data of residual current in the transformer area and load current of each user, constructing a complex-domain multiple linear regression equation, introducing physical constraints with weight coefficients no greater than 1, and finally solving the convex optimization model using the primal-dual interior-point method to obtain the weight coefficients of each user's current, thereby identifying users with leakage current. Under ideal laboratory data conditions, this method can effectively distinguish between normal and abnormal users.

[0005] However, the aforementioned existing technologies face severe challenges in practical engineering applications. Low-voltage distribution substations are complex environments, measurement equipment is susceptible to interference, and communication links may experience interruptions or delays, inevitably resulting in a large number of outliers, noise, and discrepancies in the acquired current data. Traditional least-squares-based regression methods (including the optimization method used in CN118534253A) are extremely sensitive to data quality. To minimize the overall residual sum of squares, the model "accommodates" these outlier samples that deviate significantly from the true data distribution, leading to severely biased estimations of weight coefficients. Specifically, the weight coefficients of normal users are inflated by outliers, while the weight coefficients of genuine leakage users are diluted, ultimately causing false alarms (classifying normal users as abnormal) or false negatives (failing to identify genuine leakage users), significantly reducing identification accuracy and reliability in real-world scenarios.

[0006] Therefore, existing methods for identifying leakage current users lack robustness or resilience against low-quality data from engineering sites. Developing a method that can accurately and stably identify leakage current users with wiring errors even in the presence of a large number of abnormal samples has become a key technical problem that urgently needs to be solved to promote the application of this technology from the laboratory to the field. Summary of the Invention

[0007] To address the aforementioned deficiencies in existing technologies, the present invention aims to provide a robust method, device, and storage medium for locating leakage current users with wiring errors. This addresses the technical problem that existing identification methods based on multiple linear regression suffer from biased model estimations and significantly reduced identification accuracy due to a lack of robustness in real-world engineering environments where transformer measurement data contains abnormal samples. Specifically, the invention aims to overcome the shortcomings of existing technologies, such as sensitivity to data quality and susceptibility to outliers, leading to false alarms and false negatives. It provides a robust leakage current user identification scheme that maintains high accuracy and stability even in complex and noisy real-world data scenarios.

[0008] This invention solves the above-mentioned technical problems through the following technical solution: a robust method for locating users with wiring errors and leakage current, comprising:

[0009] The residual current of the distribution substation and the load current of each user are obtained at multiple sampling times to form a sample set;

[0010] Based on the sample set, a regression model is established with the residual current as the dependent variable and the load current of each user as the independent variable. The parameters of the regression model are initially solved to obtain the initial model and its initial fitting parameters.

[0011] The residuals of each sample point are calculated based on the initial fitting parameters to determine the initial weight coefficients of each sample point; wherein, the sample point with the larger residual is assigned a smaller weight.

[0012] Using the initial model as the current optimal model and the initial weight coefficients as the current weight coefficients, iterative robust optimization is performed; wherein, the iterative robust optimization includes repeatedly performing the following steps until the iteration termination condition is met:

[0013] Based on the sample set and the current weight coefficients, the parameters of the regression model are solved by weighted regression to obtain the candidate model and its fitting parameters;

[0014] Determine whether the fitting accuracy of the candidate model is better than that of the current optimal model; if so, update the candidate model to the current optimal model, calculate the new residuals for each sample point based on the parameters of the updated current optimal model, and update the weight coefficients of each sample point according to the new residuals as the current weight coefficients for the next iteration; if not, do not update the current optimal model and the current weight coefficients.

[0015] Based on the parameters corresponding to the load current of each user in the current optimal model obtained after iteration, the users with wiring errors and leakage faults are identified.

[0016] This invention introduces a dynamic weight allocation mechanism based on residuals: in each iteration, the residuals of each sample point are calculated based on the fitting parameters of the current model, and weight coefficients are dynamically allocated according to the magnitude of the residuals, so that the sample points with larger residuals have lower weight coefficients. This mechanism can proactively identify and mitigate the influence of outlier sample points caused by abnormal data acquisition, communication noise, or environmental interference, preventing the model fitting parameter estimation process from being overly dominated by a few abnormal data. Through iterative optimization, the algorithm can gradually converge to a solution that better reflects the intrinsic correlation between the residual current and normal load current of the transformer area, thereby effectively suppressing systematic estimation bias caused by abnormal samples and significantly improving the reliability and consistency of model fitting parameter estimation.

[0017] This invention, through the aforementioned robustness mechanism, allows the fitted parameter values ​​corresponding to the load current of normal users to be stably reduced in the model to approach the theoretical minimum, while the fitted parameter values ​​corresponding to the load current of actual leakage users can significantly approach the theoretical maximum, thus forming a clearer separation boundary in the numerical distribution. This directly enhances the distinguishability of normal users and leakage users in terms of model fitted parameter values, making the fault identification process based on threshold judgment or ranking location more robust and confident. Consequently, in real engineering scenarios with data noise and interference, it significantly reduces the probability of false alarms and false negatives, systematically improving the accuracy and practical reliability of fault location.

[0018] This invention employs a weighted attenuation strategy, rather than hard rejection, to handle suspicious and anomalous samples. This strategy suppresses the excessive influence of outliers while preserving some of their information contribution, avoiding information loss and model overfitting risks caused by simply discarding samples. Combined with an iterative optimization process, the model can achieve collaborative adaptive calibration of fitting parameters and weight coefficients, continuously approximating a robust solution that optimally explains the structure of the main data set. This invention effectively resists anomaly interference while maintaining the model's ability to fit the overall features of the sample set, ultimately outputting an optimal regression model based on the distribution of high-quality main data sets and fully utilizing effective sample information. This ensures that the identification method maintains high accuracy and stability even in complex and non-ideal real-world transformer operating environments.

[0019] Furthermore, the regression model is a complex-domain multiple linear regression model; the residual current and the load current of each user are current phasors; and the fitting parameters are complex fitting parameters.

[0020] This invention employs a complex domain model and directly processes current phasors, ensuring that the mathematical model perfectly matches the physical essence (amplitude and phase) of the AC system. The complex fitting parameters can simultaneously characterize the contribution of the user load current to the residual current in terms of both amplitude ratio and phase relationship, overcoming the defect of scalar models in losing phase information. This results in fault identification results that are not only numerically accurate but also possess clear physical meaning and engineering interpretability.

[0021] In complex scenarios involving out-of-phase leakage or multi-user faults, phase information is a key distinguishing feature. Complex domain models, through vector synthesis, more accurately describe the composition of residual current, effectively distinguishing the contributions of users in different phases and avoiding the masking or confusion of contributions from out-of-phase users due to scalar superposition. This significantly improves the accuracy of identifying abnormal users and the adaptability of scenarios in complex scenarios with multi-user and cross-phase faults.

[0022] Furthermore, during the initial solution or iterative robust optimization process, the complex fitting parameters corresponding to the load current of each user satisfy the following constraints:

[0023] ;

[0024] in, Let N represent the complex fitting parameters for the j-th user; N represents the number of users.

[0025] The constraints of this invention are derived from the fundamental physical law that "the proportion of user load current converted into residual current cannot exceed 100%". By embedding this prior knowledge as a hard constraint into the mathematical optimization process, the algorithm is forced to search within the physically feasible solution space, fundamentally eliminating meaningless (e.g., proportion greater than 1) or physically unrealizable parameter estimates, and ensuring the physical rationality and engineering credibility of the final identification result.

[0026] Mathematically, this constraint introduces a compact feasible region to the unconstrained regression problem, acting as a regularization mechanism. It effectively limits the range of solutions, preventing ill-conditioned fluctuations or divergence of parameters during iterative optimization, thus significantly improving the stability and convergence speed of numerical computation. This ensures that the algorithm can reliably output stable and reasonable solutions even when faced with ill-conditioned data or numerical noise.

[0027] Further, based on the sample set and the current weight coefficients, the parameters of the regression model are solved using weighted regression, including:

[0028] In each iteration, an inner point subset is selected from the sample set; wherein the number of sample points contained in the inner point subset is greater than the preset minimum sample size;

[0029] Based on the subset of inliers and their corresponding current weight coefficients, the parameters of the regression model are solved by weighted regression to obtain the candidate parameters.

[0030] This invention organically combines "hard screening" (selecting a subset of inliers) with "soft weighting" (using weighting coefficients). The inlier subset ensures that each model proposal is based on the most consistent data core, eliminating direct interference from significant outliers; while the weighting coefficients are further fine-tuned based on reliability within the inlier subset. This dual-insurance mechanism of "screening first, then weighting" makes the model fitting process highly resistant to residual noise and marginal outliers. Compared to performing expensive weighted regression calculations on the entire sample set in each iteration, solving only on the inlier subset significantly reduces the computational complexity of a single iteration.

[0031] Further, a subset of internal points is selected from the sample set, including:

[0032] The residuals of each sample point are calculated based on the parameters of the current optimal model. Sample points whose residuals are less than a preset residual threshold are identified as inliers to form the subset of inliers.

[0033] Since the interior subset is a threshold-filtered, more consistent subset of data, the candidate model fitted from it is of higher quality and more likely to be closer to the true model. This significantly improves the "hit rate" of each random sampling, enabling the algorithm to explore the solution space with fewer iterations and higher efficiency, and converge to a globally better robust solution.

[0034] Furthermore, the iterative execution of robust optimization is implemented using a random sampling consensus algorithm, specifically including:

[0035] In each iteration, m sample points are randomly selected from the sample set to form an inner point subset; where m is greater than the preset minimum sample size.

[0036] Based on the subset of inliers and their corresponding current weight coefficients, the parameters of the regression model are solved by weighted regression to obtain the candidate parameters.

[0037] This invention breaks the trap of deterministic algorithms falling into local optima determined by initial values ​​or data order by randomly selecting sample points to form an interior point subset. This randomization strategy enables the algorithm to explore different regions of the solution space probabilistically, significantly increasing the likelihood of finding a globally robust solution, and is particularly suitable for complex scenarios with severe data contamination and multiple potential model assumptions.

[0038] The RANSAC framework has a solid foundation in probabilistic theory, and its performance (such as the number of iterations required to achieve the expected success rate) can be theoretically estimated and pre-configured. This provides a scientific basis for setting key algorithm parameters (such as the number of samples m and the number of iterations K), rather than relying solely on experience.

[0039] Furthermore, the parameters of the regression model are solved using weighted regression, including:

[0040] The weighted loss function for the regression model is constructed as follows:

[0041] ;

[0042] ;

[0043] ;

[0044] ;

[0045] in, Indicates the weighted loss value; Represents the fitted matrix, This represents the complex fitting parameters corresponding to the load current of the j-th user. This represents the natural residual current vector on the power supply line of the transformer substation; m represents the number of sample points. This represents the load current phasor matrix at the i-th sample point. This represents the load current phasor of the j-th user in the i-th sample point; This represents the weight coefficient of the i-th sample point; This represents the residual current vector at the i-th sample point;

[0046] Solve the weighted loss function to obtain the various complex fitting parameters.

[0047] This invention quantifies the reliability assessment of each sample point as its contribution to the overall optimization objective by directly embedding weight coefficients into the loss function. This allows the algorithm to automatically weaken the influence of high residual outliers in a precise mathematical manner, while maintaining or enhancing the role of highly consistent sample points. Compared to simple sample removal, this "soft control" mechanism suppresses outliers while preserving the overall information of the dataset to the maximum extent.

[0048] The constructed weighted loss function is essentially a weighted least squares problem, which is convex given the weight coefficients and linear model. This guarantees the existence of a global optimum for the optimization problem and allows for stable and fast solution using mature and efficient convex optimization algorithms (such as the primal-dual interior-point method). This overcomes the non-convexity and convergence difficulties that some robust estimation methods may face, ensuring the computational reliability and real-time performance of the method in engineering applications.

[0049] Furthermore, the formula for calculating the weight coefficient of each sample point is as follows:

[0050] ;

[0051] in, This represents the weight coefficient of the i-th sample point; represents the residual of the i-th sample point; RMSE represents the root mean square error of all sample points.

[0052] This invention uses the overall model fit accuracy (RMSE) as an objective benchmark to create a clear boundary line for sample quality: sample points with residuals less than RMSE are classified as "reliable inliers" and given full weight (e.g., 1), allowing them to fully play their role in the regression; sample points with residuals greater than RMSE are classified as "suspicious outliers" and subject to penalized weights. This "black and white" segmentation strategy is logically clear and intuitive, and can effectively isolate outliers that deviate significantly from the main distribution.

[0053] For sample points identified as outliers, their weight is inversely proportional to the residual; that is, the greater the deviation, the heavier the penalty. This adaptive penalty mechanism avoids the information loss or boundary disputes that may be caused by fixed thresholds or simple elimination. It ensures that the algorithm resolutely suppresses severe outliers while only applying moderate weakening to slightly deviating "marginal points," thus achieving a better balance between ensuring the robustness of the main model and preserving the detailed information of the data distribution.

[0054] Based on the same concept, the present invention also provides an electronic device, including a memory, a processor, and a computer program or instructions stored in the memory, wherein the processor executes the computer program or instructions to implement the robust user location method for wiring error leakage as described above.

[0055] Based on the same concept, the present invention also provides a computer-readable storage medium having a computer program or instructions stored thereon, which, when executed by a processor, implements the robust user location method for wiring error leakage as described above.

[0056] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0057] This invention ensures that the algorithm can continuously and dynamically re-evaluate the reliability of the data based on the current optimal model by making the updating of the weight coefficients a necessary step in each iteration. This overcomes the limitation of keeping the weights static in traditional weighted regression, forming an adaptive optimization closed loop of "solving → evaluating → updating weights → solving again", which makes the model's ability to suppress outliers continuously improve with iteration, rather than relying solely on the initial screening.

[0058] This invention eliminates ambiguity in the execution logic by explicitly defining three core state variables: the current model parameters, the current sample weight coefficients, and the current optimal model, as well as their relationships. This design ensures that even if a better model is not obtained in a single iteration, the weight coefficients will still be updated synchronously based on the current best fit result. This effectively avoids the algorithm getting stuck in a local deadlock due to weight stagnation, thus significantly improving the reliability and stability of convergence to a robust solution in complex and noisy data environments.

[0059] This invention decouples the "model optimization update" from the "weight synchronization update" process, ensuring that the weight coefficients closely follow the current optimal model's fit. This mechanism keeps the parameter values ​​for normal users consistently and stably suppressed to near the theoretical lower limit, while continuously emphasizing the parameter values ​​for users with leakage current to near the theoretical upper limit, thus proactively constructing a wider distinguishing boundary in the parameter estimation results. This ultimately achieves clearer and more reliable fault user identification in noisy real-world engineering data, directly reducing the probability of misjudgments and missed judgments. Attached Figure Description

[0060] To more clearly illustrate the technical solution of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only one embodiment of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0061] Figure 1 This is a flowchart of the robust user location method for wiring errors and leakage current in this invention;

[0062] Figure 2 This is a comparison chart of the fitting parameter calculation results of the traditional method and the method of this invention at each sample point. Detailed Implementation

[0063] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments. 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.

[0064] The technical solution of the present invention will be described in detail below with reference to specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.

[0065] Example 1

[0066] In a low-voltage distribution substation, if a user incorrectly connects the neutral and ground wires in their distribution box, all their load current will flow directly into the ground, creating an abnormal leakage path. This causes the entire current to be converted into residual current in the substation. At this point, the amplitude of the residual current generated by the user with the abnormal leakage is much greater than the natural leakage current of the line, becoming the main component of the substation's residual current. Furthermore, its fluctuation characteristics are highly synchronized with the user's electricity consumption behavior. Therefore, by analyzing the current data at each metering point in the substation and using attribution analysis, the correlation between each user's load current and the abnormal residual current in the substation can be quantified, thereby pinpointing the faulty user.

[0067] However, in real-world engineering environments, metering equipment in transformer substations is often affected by factors such as installation conditions, electromagnetic interference, and communication delays, resulting in unavoidable quality issues with the collected current data. These issues primarily manifest as outliers, noise interference, and time asynchrony. Furthermore, limitations in communication bandwidth and storage costs often restrict the effective data samples available for analysis. Traditional attribution analysis methods based on ordinary least squares (OLS), which optimize by minimizing the sum of squared residuals, are extremely sensitive to outliers. To reduce overall loss, the model is forced to shift towards outliers far from the main data set, leading to significant biases in the estimated user weight coefficients. Consequently, the weights of normal users are inflated by outliers, while the weights of users with leakage current are diluted, severely weakening the accuracy and reliability of fault identification and causing false alarms or missed alarms. Therefore, conventional least squares methods are only suitable for ideal scenarios with high-quality data in laboratory environments and are difficult to directly apply to real-world transformer substation data.

[0068] To address the aforementioned problems, this invention proposes a robust localization method that integrates dynamic sample weighting and iterative screening mechanisms. Its core lies in:

[0069] First, an innovative dynamic weighting strategy is adopted instead of directly eliminating suspicious samples. In each iteration, the residuals of each sample point are calculated based on the current optimal model, and weights are dynamically assigned based on the residual magnitude: sample points with small residuals (good fit) are given high weights, and sample points with large residuals (poor fit) are given low weights. Subsequently, regression is performed using a weighted loss function, allowing high-weighted samples to dominate the model fitting process, while the influence of low-weighted samples is effectively suppressed. This "soft screening" method significantly reduces the interference of outliers while preserving the overall information of the dataset to the maximum extent, avoiding the information loss and model overfitting risks that may result from hard sample removal.

[0070] Second, an iterative screening mechanism (such as Random Sampling Consensus (RANSAC)) is introduced to iteratively screen outlier samples. By repeatedly sampling subsets (interior subsets) for model fitting, and evaluating the model's consensus based on the residuals of the fitted model across all samples, a high-quality data subset consistent with the optimal model is gradually selected. This mechanism can robustly estimate model parameters reflecting the main structure of the data from data containing a large number of outliers.

[0071] In summary, this invention constructs a robust attribution analysis model that can adaptively resist data anomalies by organically combining a dynamic sample weighting strategy with an iterative screening mechanism. This method significantly improves the accuracy, robustness, and engineering practicality of identifying users with wiring errors and leakage current in real, noisy distribution network metering data environments, providing a reliable technical means for the intelligent operation and maintenance and safety management of low-voltage distribution networks. The detailed steps of this invention are as follows: Figure 1 As shown, it specifically includes:

[0072] Step S1: Obtain the residual current of the distribution substation and the load current of each user at multiple sampling times to form a sample set.

[0073] In a distribution substation, to construct a multiple linear regression model for locating users with wiring errors and leakage current, effective data on the residual current of the substation and the load current of each user are first collected to form a sample set for modeling. The specific implementation process is as follows:

[0074] S1.1: Determine the data collection time period and sampling interval.

[0075] The data collection period is set to one day (24 hours) to cover the typical electricity consumption cycle of users. The sampling interval can be determined according to the sampling capacity and data processing requirements of the metering equipment in the distribution area. For example, once per hour is suitable for scenarios with small data volume and low sampling frequency; once every 15 minutes is suitable for medium sampling density scenarios; once per minute is suitable for high sampling density scenarios, which can capture dynamic changes in current more precisely.

[0076] In this embodiment, the sampling interval is set to once per minute.

[0077] S1.2: Collect electrical quantity data.

[0078] At each sampling moment, data is collected synchronously: the residual current of the transformer area and the load current of each user.

[0079] Data acquisition can be achieved through smart meters in the distribution area, residual current protection devices, or advanced metering systems (AMIs) to ensure time synchronization and data consistency.

[0080] S1.3: Constructing the sample matrix

[0081] Assuming data is collected at M sampling times (i.e., there are M sample points), the complex form of the sample set can be represented as:

[0082] (1)

[0083] in, Represents the residual current phasor matrix. This represents the residual current phasor in the i-th sample point; Represents the user load current phasor matrix. This represents the load current phasor of the j-th user in the i-th sample point; M represents the number of sample points or sampling times, and N represents the number of users in the transformer area. Each row in the residual current phasor matrix and the user load current phasor matrix corresponds to a sampling time, and each column corresponds to a user.

[0084] To ensure the quality of the collected data, the validity of the collected current data can be checked, and data points that are obviously abnormal or missing can be removed. If the data is in complex form (such as containing phase information), complex matrices can be used directly for modeling; if it is a scalar effective value, a system of real number regression equations should be constructed.

[0085] Step S2: Based on the sample set, establish a regression model with residual current as the dependent variable and load current of each user as the independent variable, and perform initial solution of the parameters of the regression model to obtain the initial model and its initial fitting parameters.

[0086] After obtaining the sample set, step S2 establishes the mathematical relationship between the residual current and the load current of each user based on a multiple linear regression model, and uses the primordial dual interior-point method to initially solve the regression model parameters, thus obtaining the initial model. The specific implementation process includes:

[0087] Using the residual current of the transformer area as the dependent variable and the load current of each user as the independent variable, a multiple linear regression equation (in the complex domain) is established:

[0088] (2)

[0089] (3)

[0090] in, Represents the fitted matrix, This represents the complex fitting parameters corresponding to the load current of the j-th user. This represents the natural residual current phasor on the power supply line of the transformer substation, with the superscript T indicating transpose.

[0091] According to the principle of current conservation, the proportion of each user's load current converted into residual current should not exceed 100%, that is: (4)

[0092] The above constraints (i.e., formula (4)) ensure that the model is physically reasonable.

[0093] Substituting each sample point in the sample set (each sample point corresponds to the residual current phasor and the load current phasor of each user at sampling time i) into formula (2), we obtain the complex domain multiple linear regression equations of the residual current of the transformer area with respect to the load current:

[0094] (5)

[0095] in, The natural residual current phasor on the power supply line of the transformer substation is represented. The natural residual current phasor can be obtained by solving the system of equations (5). The original dual interior point method is used to solve the system of equations (5) to obtain the initial model and its initial fitting parameters. The initial model refers to a regression model consisting of the residual current of the transformer area as the dependent variable, the load current of each user as the independent variable, and initial fitting parameters, which can be expressed as: .

[0096] Step S3: Calculate the residuals of each sample point based on the initial fitting parameters to determine the initial weight coefficients of each sample point.

[0097] After obtaining the initial fitting parameters, step S3 calculates the residuals for each sample point based on the initial model and determines the initial weight coefficients for each sample point based on the magnitude of the residuals. The weight calculation function is designed as a decreasing function of the residuals to reduce the impact of outliers on subsequent model fitting. The specific implementation process is as follows:

[0098] S3.1: Calculate the residuals for each sample point.

[0099] For each sample point i, calculate its residual. :

[0100] (6)

[0101] in, This represents the residual current phasor at the i-th sample point, i.e., the actual residual current collected. This represents the phasor of the user load current in the i-th sample point, i.e., the actual user load current collected. These are the initial fitting parameters obtained in step S2.

[0102] S3.2: Calculate the RMSE (Real-Time Precision) of the initial model. The specific formula is as follows:

[0103] (7)

[0104] in, M represents the fitting accuracy of the initial model, and M represents the number of sample points in the sample set.

[0105] S3.3: Calculate the initial weight coefficients for each sample point.

[0106] Based on the relationship between residuals and fitting accuracy, the following weighting function is designed:

[0107] (8)

[0108] in, This represents the initial weight coefficient of the i-th sample point.

[0109] When the residual of a sample point is less than or equal to the fitting accuracy of the current model, the sample point is considered to have high quality and is assigned a weight of 1.

[0110] When the residual of a sample point is greater than the fitting accuracy of the current model, the sample point is considered to be an outlier and is assigned a decay weight between 0 and 1. In another specific embodiment of the present invention, the weight calculation function can also be designed as follows:

[0111] (9)

[0112] The weighting function of formula (9) assumes that a sample point may be an outlier when the residual of the sample point is greater than the fitting accuracy of the current model. It assigns an exponentially decaying weight between 0 and 1, with the degree of decay being proportional to the degree of deviation of the residual.

[0113] Step S4: Using the initial model as the current optimal model and the initial weight coefficients as the current weight coefficients, iteratively perform robust optimization.

[0114] After completing the initial model fitting and weight coefficient initialization, step S4 performs iterative robust optimization of the model based on an iterative screening mechanism and a dynamic weighting strategy to improve its resistance to outliers and the model's fitting accuracy. The specific implementation process is as follows:

[0115] S4.1: Based on the sample set and the current weight coefficients, solve the parameters of the regression model through weighted regression to obtain the candidate model and its fitting parameters.

[0116] Based on the current weight coefficients, a weighted loss function is constructed, the specific expression of which is:

[0117] (10)

[0118] (11)

[0119] (12)

[0120] (13)

[0121] in, Indicates the weighted loss value; This represents the fitted matrix (composed of the current weight coefficients). The parameter represents the complex fitting parameter corresponding to the load current of the j-th user; m represents the number of sample points selected from the sample set, and m is greater than the preset minimum sample size (e.g., half of the number of sample points M in the sample set). This represents the load current phasor matrix at the i-th sample point. This represents the load current phasor of the j-th user in the i-th sample point; This represents the weight coefficient of the i-th sample point; This represents the residual current phasor in the i-th sample point.

[0122] There are two ways to select sample points (m points) from the sample set: one is to calculate the residual of each sample point based on the parameters of the current optimal model (as shown in formula (6)), and determine the sample points whose residuals are less than the preset residual threshold (such as 1.8) as inliers to form an inlier subset; the other is to use the random sampling consensus algorithm, that is, to randomly select m sample points from the sample set to form an inlier subset.

[0123] Under the constraints (Equation (4)), the candidate model and its fitting parameters can be obtained by optimizing the weighted loss function using the primal dual interior point method. .

[0124] S4.2: Calculate the fitting accuracy of the candidate model and the fitting accuracy of the current best model.

[0125] The fitting accuracy can be calculated using formula (7).

[0126] S4.3: Determine whether the fitting accuracy of the candidate model is better than that of the current best model.

[0127] If the fitting accuracy of the candidate model is better than that of the current best model, that is, the fitting accuracy of the candidate model is less than that of the current best model, then the candidate model is updated to the current best model, and the new residuals of each sample point are calculated based on the parameters of the updated current best model (as in formula (6)). The weight coefficients of each sample point are updated based on the new residuals (as in formula (8) or formula (9)) as the current weight coefficients for the next iteration.

[0128] If the fitting accuracy of the candidate model is not better than that of the current best model, that is, if the fitting accuracy of the candidate model is greater than or equal to that of the current best model, then the current best model and the current weight coefficients are not updated, that is, the current best model and the weight coefficients are kept unchanged.

[0129] Step S4.3 ensures that model updates are only performed when performance is improved through a rigorous accuracy comparison mechanism. Combined with dynamic adjustment of residual weighting, the robustness of the model to abnormal samples is gradually improved, ultimately achieving robust identification of users with leakage current.

[0130] S4.4: Determine whether the iteration termination condition is met. If yes, output the current optimal model and proceed to step S5; otherwise, repeat steps S4.1 to S4.4.

[0131] Before the iteration begins, an iteration termination condition is set. The iteration termination condition in this embodiment includes at least one of the following conditions:

[0132] Condition 1: If the maximum number of iterations K is reached, the iteration is terminated;

[0133] Condition 2: If the fitting accuracy of the current best model is lower than the preset accuracy threshold, then the current best model is considered to be accurate enough, and the iteration is terminated.

[0134] Condition 3: If the improvement in the fitting accuracy of the current optimal model is less than a preset threshold in multiple consecutive iterations, then the current optimal model is considered to have converged and the iteration is terminated.

[0135] Step S5: Based on the parameters corresponding to the load current of each user in the current optimal model obtained after iteration, determine the users with wiring errors and leakage faults.

[0136] After completing iterative optimization and obtaining the final optimal model, step S5 uses the fitting parameters corresponding to the load current of each user in the optimal model and a threshold judgment mechanism to locate users with wiring errors and leakage faults. The specific implementation process is as follows:

[0137] Extract the fitting parameters corresponding to the load current of each user from the optimal model.

[0138] Based on physical mechanisms and historical data analysis, an anomaly detection threshold is set to distinguish between normal users and users with abnormal leakage current. The anomaly detection threshold can be set according to actual conditions; for example, it can be set to 0.5, meaning that users whose fitted parameters exceed 50% are considered to have significant leakage current suspicion. It can also be dynamically adjusted based on historical leakage current cases or simulation data of the transformer area.

[0139] Iterate through the fitted parameters corresponding to the load current of all users, mark users whose fitted parameters are greater than the abnormal judgment threshold as users with wiring errors and leakage faults, and then generate an abnormal user list.

[0140] To verify the effectiveness and superiority of the robust user location method for wiring errors and leakage provided by this invention, a simulation experiment was conducted in a realistic low-voltage distribution substation environment, and a comparative analysis was performed with the traditional complex multivariate regression method.

[0141] Distribution area structure: The experiment uses a full-scale simulated low-voltage distribution area with 208 users, actually including 204 users in three phases (A, B, and C). Fault scenario: A complex fault scenario is set up in which three users simultaneously experience wiring errors and leakage. The abnormal users are: user A (number 16), user A (number 22), and user B (number 110).

[0142] The data sampling interval is 1 minute (min-level), and the sampling duration is 1 day (24 hours). A sufficient sample set is obtained based on the sampling interval and duration. The sample size m of the inlier subset is set to 1200, and the maximum number of sampling iterations K is set to 10.

[0143] The fitting parameter calculation results for each sample point calculated by the traditional method (complex multivariate regression (based on ordinary least squares, without robust optimization)) and the method of this invention are compared, such as... Figure 2 As shown. By Figure 2 It is known that in traditional complex multivariate regression methods, the fitting parameters for normal users are generally too high, with some users (such as user 53) having fitting parameters close to 0.4, which can easily lead to misjudgment near a set threshold (such as 0.5). The method of this invention, through iterative screening and weighting mechanisms, significantly compresses the fitting parameters for normal users, making them generally below 0.1, effectively reducing the possibility of normal users being misjudged as abnormal.

[0144] Under the same fault scenario, the fitting parameters of abnormal users calculated by traditional methods are too low and fail to fully reflect their leakage current contribution; while the fitting parameters of abnormal users calculated by the method of this invention are significantly improved, and more realistically reflect the actual impact of abnormal users on the residual current.

[0145] The method of this invention is significantly better than traditional methods in terms of RMSE index, indicating that its model fits the real data distribution better and has better robustness to abnormal samples.

[0146] Traditional methods suffer from low differentiation between fitted parameters for normal and abnormal users, making it difficult to set anomaly detection thresholds and leading to missed or false alarms. The method of this invention effectively suppresses fitted parameters for normal users while significantly highlighting fitted parameters for abnormal users, greatly improving the differentiation between the two. This facilitates setting clear and stable anomaly detection thresholds and enhances recognition accuracy.

[0147] Simulation results show that the method of the present invention can significantly improve the discrimination of abnormal user identification in complex multi-user leakage scenarios; through robust optimization, it effectively suppresses the interference of data outliers on model parameter estimation; while ensuring the model fitting accuracy, it greatly reduces the false alarm rate and false negative rate; the method has strong engineering applicability and robustness, and provides a reliable technical means for online identification of leakage users in transformer substations.

[0148] Example 2

[0149] This invention also provides an electronic device, which includes a memory, a processor, and a computer program or instructions stored in the memory. The processor executes the computer program or instructions to implement the robust user location method for wiring errors and leakage current in this invention.

[0150] Although not shown, the electronic device includes a processor that can perform various appropriate operations and processes based on programs and / or data stored in read-only memory (ROM) or loaded from a storage portion into random access memory (RAM). The processor can be a multi-core processor or may contain multiple processors. In some embodiments, the processor may include a general-purpose main processor and one or more specialized coprocessors, such as a central processing unit, graphics processing unit (GPU), neural network processor (NPU), digital signal processor (DSP), etc. Various programs and data required for device operation are also stored in RAM. The processor, ROM, and RAM are interconnected via a bus. Input / output (I / O) interfaces are also connected to the bus.

[0151] The processor and memory described above are used together to execute programs / instructions stored in the memory. When the program / instructions are executed by the computer, they can implement the methods, steps, or functions described in the above embodiments.

[0152] Although not shown, embodiments of the present invention also provide a computer-readable storage medium having a computer program or instructions stored thereon, which, when executed by a processor, implements the robust user location method for wiring error leakage in embodiments of the present invention.

[0153] Readable storage media include both permanent and non-permanent, removable and non-removable media that can store information by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0154] The above description only discloses specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or modifications that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.

Claims

1. A robust method for locating users with wiring errors and leakage current, characterized in that, The positioning method includes: The residual current of the distribution substation and the load current of each user are obtained at multiple sampling times to form a sample set; Based on the sample set, a regression model is established with the residual current as the dependent variable and the load current of each user as the independent variable. The parameters of the regression model are initially solved to obtain the initial model and its initial fitting parameters. The residuals of each sample point are calculated based on the initial fitting parameters to determine the initial weight coefficients of each sample point; wherein, the sample point with the larger residual is assigned a smaller weight. Using the initial model as the current optimal model and the initial weight coefficients as the current weight coefficients, iterative robust optimization is performed; wherein, the iterative robust optimization includes repeatedly performing the following steps until the iteration termination condition is met: Based on the sample set and the current weight coefficients, the parameters of the regression model are solved by weighted regression to obtain the candidate model and its fitting parameters; Determine whether the fitting accuracy of the candidate model is better than that of the current optimal model; if so, update the candidate model to the current optimal model, calculate the new residuals for each sample point based on the parameters of the updated current optimal model, and update the weight coefficients of each sample point according to the new residuals as the current weight coefficients for the next iteration; if not, do not update the current optimal model and the current weight coefficients. Based on the parameters corresponding to the load current of each user in the current optimal model obtained after iteration, the users with wiring errors and leakage faults are identified.

2. The robust user location method for wiring errors and leakage current as described in claim 1, characterized in that, The regression model is a complex-domain multiple linear regression model; the residual current and the current of each user load are current phasors; the fitting parameters are complex fitting parameters.

3. The robust method for locating users with wiring errors and leakage current according to claim 1, characterized in that, During the initial solution or iterative robust optimization process, the fitting parameters corresponding to the load current of each user satisfy the following constraints: ; in, Let N represent the complex fitting parameters for the j-th user; N represents the number of users.

4. The robust user location method for wiring errors and leakage current as described in claim 1, characterized in that, Based on the sample set and the current weight coefficients, the parameters of the regression model are solved using weighted regression, including: In each iteration, an inner point subset is selected from the sample set; wherein the number of sample points contained in the inner point subset is greater than the preset minimum sample size; Based on the subset of inliers and their corresponding current weight coefficients, the parameters of the regression model are solved by weighted regression to obtain candidate parameters.

5. The robust method for locating users with wiring errors and leakage current according to claim 4, characterized in that, A subset of internal points is selected from the sample set, including: The residuals of each sample point are calculated based on the parameters of the current optimal model. Sample points whose residuals are less than a preset residual threshold are identified as inliers to form the subset of inliers.

6. The robust method for locating users with wiring errors and leakage current according to claim 1, characterized in that, The iterative execution of robust optimization is implemented using a random sampling consensus algorithm, specifically including: In each iteration, m sample points are randomly selected from the sample set to form an inner point subset; where m is greater than the preset minimum sample size. Based on the subset of inliers and their corresponding current weight coefficients, the parameters of the regression model are solved by weighted regression to obtain candidate parameters.

7. The robust method for locating users with wiring errors and leakage current according to claim 1, characterized in that, The parameters of the regression model are solved by weighted regression, including: The weighted loss function for the regression model is constructed as follows: ; ; ; ; in, Indicates the weighted loss value; Represents the fitted matrix, This represents the complex fitting parameters corresponding to the load current of the j-th user. This represents the natural residual current vector on the power supply line of the transformer substation; m represents the number of sample points. This represents the load current phasor matrix at the i-th sample point. This represents the load current phasor of the j-th user in the i-th sample point; This represents the weight coefficient of the i-th sample point; This represents the residual current vector at the i-th sample point; Solve the weighted loss function to obtain the various complex fitting parameters.

8. The robust method for locating users with wiring errors and leakage current according to any one of claims 1 to 7, characterized in that, The formula for calculating the weight coefficient of each sample point is as follows: ; in, This represents the weight coefficient of the i-th sample point; represents the residual of the i-th sample point; RMSE represents the root mean square error of all sample points.

9. An electronic device comprising a memory, a processor, and a computer program or instructions stored in the memory, characterized in that, The processor executes the computer program or instructions to implement the robust user location method for wiring errors and leakage current as described in any one of claims 1 to 8.

10. A computer-readable storage medium having a computer program or instructions stored thereon, characterized in that, When the computer program or instructions are executed by the processor, they implement the robust user location method for wiring errors and leakage current as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Wiring error electric leakage positioning method based on complex multiple regression, medium and equipment

    CN118534253A

  • Wiring error electric leakage user high-precision positioning method and device and storage medium

    CN121432067A