Line impedance anomaly detection method and system based on isolated forest

By using an isolated forest-based method for detecting line impedance anomalies, K-means clustering and three-phase impedance analysis are employed to identify topological relationships. Combined with the isolated forest algorithm for anomaly detection, this method solves the problems of high operation and maintenance costs and low detection accuracy in existing technologies, achieving efficient and accurate detection of line impedance anomalies.

CN121476716APending Publication Date: 2026-02-06国网福建省电力有限公司营销服务中心 +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511384005.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-26
Publication Date
2026-02-06

AI Technical Summary

Technical Problem

Existing line impedance detection methods suffer from high maintenance costs and low accuracy. In particular, direct measurement methods rely on external equipment, while indirect estimation methods are limited by data quality and model simplification assumptions, leading to misjudgments or omissions.

Method used

An isolated forest-based line impedance anomaly detection method is adopted. By collecting voltage time-series data from electricity meters, the topological relationships are identified using a time-series-based K-means clustering algorithm and a three-phase impedance analysis method. Anomaly detection is then performed in conjunction with the isolated forest algorithm, thus avoiding increased operation and maintenance costs.

Benefits of technology

It enables accurate and reliable identification of distribution network topology and line impedance without increasing operation and maintenance costs, improving the accuracy of anomaly detection and reducing false positives and false negatives.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121476716A_ABST
    Figure CN121476716A_ABST
Patent Text Reader

Abstract

The invention discloses a line impedance anomaly detection method and system based on an isolated forest, and the method comprises the steps: collecting the voltage time sequence data of an electric energy meter of a power distribution network, and obtaining a first topological relation between the electric energy meter and a meter box according to the voltage time sequence data through a K-means clustering algorithm based on a time sequence; based on the first topological relation, using a three-phase impedance analysis method to obtain a second topological relation between the meter box and the transformer, calculating line impedance based on the second topological relation, and using an isolated forest algorithm to perform anomaly detection on the line impedance to obtain a detection result, so as to depend on external test equipment. A time sequence-based K-means clustering algorithm is combined with a three-phase impedance analysis method, so that the topological structure of the power distribution network can be accurately and reliably identified, the accurate line impedance is calculated, finally, the anomaly detection is performed on the line impedance by using an isolated forest algorithm, the anomaly of the line impedance can be efficiently identified, the operation and maintenance cost does not need to be increased, and the efficiency is improved. And the accuracy of line impedance anomaly detection is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of line impedance anomaly detection technology, and in particular to a line impedance anomaly detection method and system based on isolated forests. Background Technology

[0002] With the widespread deployment of intelligent metering equipment in distribution substations, power companies have acquired massive amounts of power distribution and consumption data. How to efficiently utilize this data has become crucial for improving the operation and maintenance efficiency and intelligence level of low-voltage distribution networks. Line impedance, as a fundamental parameter for low-voltage distribution network operation analysis and intelligent prediction, plays a vital role in various application scenarios such as line loss calculation, control strategy formulation, and fault prediction. At the same time, accurate impedance values ​​are also significant for assessing line operating status and assisting in distribution network asset management.

[0003] Line impedance is a crucial reference indicator for sensing the operating status of power lines and indirectly monitoring the operating conditions of distribution transformer areas. In recent years, it has attracted considerable attention from scholars, leading to numerous research studies. While existing methods have made some progress in calculating and identifying distribution line impedance, the following shortcomings remain: First, while direct measurement methods offer high accuracy, they rely heavily on external testing equipment, significantly increasing maintenance costs and placing a heavy economic burden on the system. Second, indirect estimation methods are limited by data acquisition quality and model simplification assumptions, easily leading to impedance estimation errors. This can result in misjudgments or omissions of line impedance anomalies, affecting the reliability of practical applications. Summary of the Invention

[0004] The technical problem to be solved by the present invention is to provide a method and system for detecting line impedance anomalies based on isolated forests, which can improve the accuracy of line impedance anomaly detection without increasing operation and maintenance costs.

[0005] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows: A method for detecting line impedance anomalies based on isolated forests includes the following steps: Collect voltage time-series data from electricity meters in the power distribution network; The first topological relationship between the energy meter and the meter box is obtained using the voltage time series data and the K-means clustering algorithm based on time series. Based on the first topological relationship, the second topological relationship between the meter box and the transformer is obtained using the three-phase impedance analysis method. Calculate the line impedance based on the second topology; The isolated forest algorithm was used to detect anomalies in the line impedance, and the detection results were obtained.

[0006] To solve the above-mentioned technical problems, another technical solution adopted by the present invention is as follows: A line impedance anomaly detection system based on isolated forests includes a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it performs the following steps: Collect voltage time-series data from electricity meters in the power distribution network; The first topological relationship between the energy meter and the meter box is obtained using the voltage time series data and the K-means clustering algorithm based on time series. Based on the first topological relationship, the second topological relationship between the meter box and the transformer is obtained using the three-phase impedance analysis method. Calculate the line impedance based on the second topology; The isolated forest algorithm was used to detect anomalies in the line impedance, and the detection results were obtained.

[0007] The beneficial effects of this invention are as follows: Voltage time-series data of electricity meters in the distribution network are collected; based on the voltage time-series data, a time-series-based K-means clustering algorithm is used to obtain the first topological relationship between the electricity meter and the meter box; based on the first topological relationship, a three-phase impedance analysis method is used to obtain the second topological relationship between the meter box and the transformer; based on the second topological relationship, the line impedance is calculated; and anomaly detection of the line impedance is performed using the isolated forest algorithm to obtain the detection results. This invention, relying on external testing equipment, utilizes a time-series-based K-means clustering algorithm combined with three-phase impedance analysis to accurately and reliably identify the topology of the distribution network, calculate accurate line impedance, and finally use the isolated forest algorithm to perform anomaly detection of the line impedance. This efficiently identifies line impedance anomalies without increasing maintenance costs and improves the accuracy of line impedance anomaly detection. Attached Figure Description

[0008] Figure 1 This is a flowchart of a line impedance anomaly detection method based on isolated forests according to an embodiment of the present invention; Figure 2 This is a schematic diagram of a line impedance anomaly detection system based on isolated forests according to an embodiment of the present invention; Figure 3 This is a schematic diagram of the topological relationships identified in a line impedance anomaly detection method based on isolated forests according to an embodiment of the present invention. Detailed Implementation

[0009] To explain in detail the technical content, objectives, and effects of the present invention, the following description is provided in conjunction with the embodiments and accompanying drawings.

[0010] Before detailing the embodiments of this application, some related concepts will first be explained: Time-series-based K-means clustering algorithm: Based on the traditional K-means, it introduces dynamic time warping distance to effectively capture nonlinear time deformation in voltage series; Dynamic Time Warping (DTW) algorithm: Based on the principle of nearest proximity, it constructs the correspondence between elements of two sequences of different lengths and evaluates the similarity between the two sequences; Three-phase impedance analysis: a method for studying system stability, fault causes, and optimization design by measuring and analyzing the impedance characteristics of each phase in a three-phase circuit. Isolation Forest Algorithm: By constructing multiple binary trees, it uses the degree to which data points are isolated in the trees to determine whether they are anomalies. It is based on the idea of ​​randomly partitioning the data space and can effectively capture abnormal patterns in high-dimensional data.

[0011] In existing technologies, Reference 1 discloses a study on the influencing factors of transmission line parameter identification and systematically introduces the calculation method of line impedance from a theoretical perspective, but it does not consider the practicality of the method. Reference 2 performs impedance analysis based on direct measurement, which has high accuracy, but its reliance on external testing equipment makes it difficult to promote and apply in actual distribution networks. Reference 3 introduces line impedance parameters by constructing a low-voltage distribution network state estimation model, improving the theoretical completeness, but this method has high requirements for the quality of time-series acquired data. Reference 4 uses a method to back-calculate the transformer secondary voltage and branch impedance parameters under the premise of known topology; however, this method only considers active power and ignores the impact of reactive power on line impedance, resulting in a high degree of simplification and making it difficult to reflect the actual operating state of the distribution network. Therefore, none of the above methods can improve the accuracy of line impedance anomaly detection without increasing operation and maintenance costs.

[0012] To at least solve the above problems, please refer to Figure 1 This invention provides a method for detecting line impedance anomalies based on isolated forests, comprising the following steps: Collect voltage time-series data from electricity meters in the power distribution network; The first topological relationship between the energy meter and the meter box is obtained using the voltage time series data and the K-means clustering algorithm based on time series. Based on the first topological relationship, the second topological relationship between the meter box and the transformer is obtained using the three-phase impedance analysis method. Calculate the line impedance based on the second topology; The isolated forest algorithm was used to detect anomalies in the line impedance, and the detection results were obtained.

[0013] As can be seen from the above description, the beneficial effects of the present invention are as follows: Voltage time-series data of electricity meters in the distribution network are collected; a first topological relationship between the electricity meter and the meter box is obtained using a time-series-based K-means clustering algorithm based on the voltage time-series data; a second topological relationship between the meter box and the transformer is obtained using a three-phase impedance analysis method based on the first topological relationship; line impedance is calculated based on the second topological relationship; and anomaly detection of line impedance is performed using an isolated forest algorithm to obtain the detection results. This allows for accurate and reliable identification of the distribution network topology and calculation of accurate line impedance by relying on external testing equipment and utilizing a time-series-based K-means clustering algorithm combined with a three-phase impedance analysis method. Finally, the isolated forest algorithm is used to perform anomaly detection of line impedance, which can efficiently identify anomalies in line impedance without increasing maintenance costs and improve the accuracy of line impedance anomaly detection.

[0014] Furthermore, the first topological relationship between the energy meter and the meter box is obtained using a time-series-based K-means clustering algorithm based on the voltage time-series data, including: The similarity between the voltage time series data was calculated using a dynamic time warping algorithm; Based on the similarity, the K-means clustering algorithm is used to classify the similar voltage time series data into one class, and the clustering result is obtained; By taking the energy meters corresponding to the voltage time series data in the same cluster of the clustering results as energy meters under the same meter box, the first topological relationship between the energy meters and the meter box is obtained.

[0015] As described above, the time-series-based K-means clustering algorithm introduces dynamic time warping distance on the basis of traditional K-means, effectively capturing nonlinear time distortions in voltage time-series data, and continuously adjusting the clustering results through iterative optimization. Therefore, using the time-series-based K-means clustering algorithm to identify the first topological relationship between the energy meter and the meter box improves the accuracy of topology identification.

[0016] Furthermore, based on the first topological relationship, the second topological relationship between the meter box and the transformer is obtained using three-phase impedance analysis, including: Calculate the three-phase voltage and three-phase current of the meter box based on the first topological relationship; Treat the watch box as a node, and obtain a set based on all nodes; Based on Ohm's law, establish a circuit model for each pair of nodes in the set based on the three-phase voltage and the three-phase current; Multiple linear regression analysis was performed on the circuit model to obtain the analysis results; If the regression error of a certain pair of nodes in the analysis results is less than the first preset value, then it is determined that the certain pair of nodes has a common node; Remove the pair of nodes from the set and add the common node to the set, while calculating the three-phase voltage and three-phase current of the common node; Return to the step of establishing a circuit model for each pair of nodes in the set based on the three-phase voltage and the three-phase current according to Ohm's law, until only one node remains in the set; The remaining node in the set is used as the top-level node connecting the transformer, thus obtaining the second topological relationship between the meter box and the transformer.

[0017] As described above, after obtaining the first topological relationship, the three-phase voltage and three-phase current of the meter box are calculated. Based on Ohm's law, a circuit model is established for each pair of nodes in the set based on the three-phase voltage and three-phase current. Multiple linear regression analysis is performed on the model. The regression error in the analysis results determines whether there is a common node between each pair of nodes. Then, the top-level node connecting the transformer is located, thereby obtaining the second topological relationship between the meter box and the transformer. This can efficiently and accurately identify the relationship between the meter box and the transformer.

[0018] Furthermore, based on Ohm's law, a circuit model is established for each pair of nodes in the set based on the three-phase voltage and the three-phase current, specifically as follows: ; In the formula, U 2 indicates the concentrator voltage. Represents the first regression coefficient. This represents the second regression coefficient. U 1 indicates the meter box voltage. R 1 represents the third regression coefficient. I 1,R Indicates the meter box current. X 1 represents the fourth regression coefficient. I 1,X Indicates the reactance current of the meter box. R 2 represents the fifth regression coefficient, - I 2,R Indicates the line current. X 2 represents the sixth regression coefficient, - I 2,X This indicates the line reactance current.

[0019] As described above, constructing a circuit model with mutual impedance using Ohm's law unifies the voltage and current relationships between nodes into a regressible equation, transforming the topological relationship into a parameter estimation problem, and improving the accuracy and robustness of common node identification.

[0020] Furthermore, the isolated forest algorithm is used to detect anomalies in the line impedance, and the detection results include: The line impedance is divided using a sliding window to obtain a sample set; The sample set is input into the isolated forest algorithm for anomaly detection to obtain the anomaly score for each data point. Determine whether the abnormal score is greater than a second preset value. If it is, then the data point is determined to be an abnormal line impedance data point; otherwise, the data point is determined to be a normal line impedance data point.

[0021] As described above, after dividing the line impedance using a sliding window, the sample set is input into the Isolation Forest algorithm for anomaly detection, obtaining an anomaly score for each data point. The larger the anomaly score, the more likely the data point is to be an anomaly. Data points with anomaly scores greater than a second preset value are identified as abnormal line impedance data points. Compared with traditional methods based on linear regression coefficients and thresholds, the Isolation Forest algorithm often assumes a linear relationship between data and fails to fully capture complex impedance change patterns, resulting in poor adaptability and accuracy. The Isolation Forest algorithm, through multi-dimensional isolation and randomization, can flexibly adapt to nonlinear data distributions and effectively identify anomalies in time series, thus significantly improving the accuracy of impedance anomaly detection. Moreover, compared with traditional methods, the Isolation Forest algorithm can not only handle more complex and nonlinear data relationships but also reduce false positives and false negatives, further improving the accuracy of anomaly detection.

[0022] Please refer to Figure 2 Another embodiment of the present invention provides a line impedance anomaly detection system based on isolated forests, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it performs the following steps: Collect voltage time-series data from electricity meters in the power distribution network; The first topological relationship between the energy meter and the meter box is obtained using the voltage time series data and the K-means clustering algorithm based on time series. Based on the first topological relationship, the second topological relationship between the meter box and the transformer is obtained using the three-phase impedance analysis method. Calculate the line impedance based on the second topology; The isolated forest algorithm was used to detect anomalies in the line impedance, and the detection results were obtained.

[0023] Collect voltage time-series data from electricity meters in the power distribution network; The first topological relationship between the energy meter and the meter box is obtained using the voltage time series data and the K-means clustering algorithm based on time series. Based on the first topological relationship, the second topological relationship between the meter box and the transformer is obtained using the three-phase impedance analysis method. Calculate the line impedance based on the second topology; The isolated forest algorithm was used to detect anomalies in the line impedance, and the detection results were obtained.

[0024] As can be seen from the above description, the beneficial effects of the present invention are as follows: Voltage time-series data of electricity meters in the distribution network are collected; a first topological relationship between the electricity meter and the meter box is obtained using a time-series-based K-means clustering algorithm based on the voltage time-series data; a second topological relationship between the meter box and the transformer is obtained using a three-phase impedance analysis method based on the first topological relationship; line impedance is calculated based on the second topological relationship; and anomaly detection of line impedance is performed using an isolated forest algorithm to obtain the detection results. This allows for accurate and reliable identification of the distribution network topology and calculation of accurate line impedance by relying on external testing equipment and utilizing a time-series-based K-means clustering algorithm combined with a three-phase impedance analysis method. Finally, the isolated forest algorithm is used to perform anomaly detection of line impedance, which can efficiently identify anomalies in line impedance without increasing maintenance costs and improve the accuracy of line impedance anomaly detection.

[0025] Furthermore, the first topological relationship between the energy meter and the meter box is obtained using a time-series-based K-means clustering algorithm based on the voltage time-series data, including: The similarity between the voltage time series data was calculated using a dynamic time warping algorithm; Based on the similarity, the K-means clustering algorithm is used to classify the similar voltage time series data into one class, and the clustering result is obtained; By taking the energy meters corresponding to the voltage time series data in the same cluster of the clustering results as energy meters under the same meter box, the first topological relationship between the energy meters and the meter box is obtained.

[0026] As described above, the time-series-based K-means clustering algorithm introduces dynamic time warping distance on the basis of traditional K-means, effectively capturing nonlinear time distortions in voltage time-series data, and continuously adjusting the clustering results through iterative optimization. Therefore, using the time-series-based K-means clustering algorithm to identify the first topological relationship between the energy meter and the meter box improves the accuracy of topology identification.

[0027] Furthermore, based on the first topological relationship, the second topological relationship between the meter box and the transformer is obtained using three-phase impedance analysis, including: Calculate the three-phase voltage and three-phase current of the meter box based on the first topological relationship; Treat the watch box as a node, and obtain a set based on all nodes; Based on Ohm's law, establish a circuit model for each pair of nodes in the set based on the three-phase voltage and the three-phase current; Multiple linear regression analysis was performed on the circuit model to obtain the analysis results; If the regression error of a certain pair of nodes in the analysis results is less than the first preset value, then it is determined that the certain pair of nodes has a common node; Remove the pair of nodes from the set and add the common node to the set, while calculating the three-phase voltage and three-phase current of the common node; Return to the step of establishing a circuit model for each pair of nodes in the set based on the three-phase voltage and the three-phase current according to Ohm's law, until only one node remains in the set; The remaining node in the set is used as the top-level node connecting the transformer, thus obtaining the second topological relationship between the meter box and the transformer.

[0028] As described above, after obtaining the first topological relationship, the three-phase voltage and three-phase current of the meter box are calculated. Based on Ohm's law, a circuit model is established for each pair of nodes in the set based on the three-phase voltage and three-phase current. Multiple linear regression analysis is performed on the model. The regression error in the analysis results determines whether there is a common node between each pair of nodes. Then, the top-level node connecting the transformer is located, thereby obtaining the second topological relationship between the meter box and the transformer. This can efficiently and accurately identify the relationship between the meter box and the transformer.

[0029] Furthermore, based on Ohm's law, a circuit model is established for each pair of nodes in the set based on the three-phase voltage and the three-phase current, specifically as follows: ; In the formula, U 2 indicates the concentrator voltage. Represents the first regression coefficient. This represents the second regression coefficient. U 1 indicates the meter box voltage. R 1 represents the third regression coefficient. I 1,R Indicates the meter box current. X 1 represents the fourth regression coefficient. I 1,X Indicates the reactance current of the meter box. R 2 represents the fifth regression coefficient, - I 2,R Indicates the line current. X 2 represents the sixth regression coefficient, - I 2,X This indicates the line reactance current.

[0030] As described above, constructing a circuit model with mutual impedance using Ohm's law unifies the voltage and current relationships between nodes into a regressible equation, transforming the topological relationship into a parameter estimation problem, and improving the accuracy and robustness of common node identification.

[0031] Furthermore, the isolated forest algorithm is used to detect anomalies in the line impedance, and the detection results include: The line impedance is divided using a sliding window to obtain a sample set; The sample set is input into the isolated forest algorithm for anomaly detection to obtain the anomaly score for each data point. Determine whether the abnormal score is greater than a second preset value. If it is, then the data point is determined to be an abnormal line impedance data point; otherwise, the data point is determined to be a normal line impedance data point.

[0032] As described above, after dividing the line impedance using a sliding window, the sample set is input into the Isolation Forest algorithm for anomaly detection, obtaining an anomaly score for each data point. The larger the anomaly score, the more likely the data point is to be an anomaly. Data points with anomaly scores greater than a second preset value are identified as abnormal line impedance data points. Compared with traditional methods based on linear regression coefficients and thresholds, the Isolation Forest algorithm often assumes a linear relationship between data and fails to fully capture complex impedance change patterns, resulting in poor adaptability and accuracy. The Isolation Forest algorithm, through multi-dimensional isolation and randomization, can flexibly adapt to nonlinear data distributions and effectively identify anomalies in time series, thus significantly improving the accuracy of impedance anomaly detection. Moreover, compared with traditional methods, the Isolation Forest algorithm can not only handle more complex and nonlinear data relationships but also reduce false positives and false negatives, further improving the accuracy of anomaly detection.

[0033] The isolated forest-based line impedance anomaly detection method and system described above are applicable to distribution network line impedance anomaly detection scenarios. The specific implementation methods are described below: Please refer to Figure 1 One embodiment of the present invention is as follows: A method for detecting line impedance anomalies based on isolated forests includes the following steps: S1. Collect voltage time sequence data from the power meters of the distribution network.

[0034] For example, 96 effective voltage values ​​from an electricity meter within a day can be collected as voltage time-series data.

[0035] In one alternative implementation, between S1 and S2, the following is further included: The missing data in the voltage timing data is filled in using the forward filling method to obtain the filled voltage timing data.

[0036] Subsequent operations can be performed based on the filled voltage time series data, thereby ensuring the timing consistency and trend integrity of the voltage time series data, which facilitates subsequent analysis and processing.

[0037] S2. Based on the voltage time-series data, the first topological relationship between the energy meter and the meter box is obtained using a time-series-based K-means clustering algorithm, specifically including S21-S23: S21. Calculate the similarity between the voltage timing data using the dynamic time warping algorithm.

[0038] Specifically, (1) construct the distance matrix: Suppose we have two voltage timing data sets: Voltage timing data A: Voltage timing data B: ; (2) Define the alignment path: Path P is a set of matrix elements. satisfy: Starting point: (1,1) (starting from the first element of the two time series data); End point: (m, n) (ends at the last element of the two time series data); Continuity: The next element can only be (i+1,j), (i,j+1), or (i+1,j+1) (ensuring that the path does not skip any elements and is monotonically increasing). (3) Finding the optimal path: The optimal path is the path with the minimum sum of distances between all elements on it, expressed as follows: ; In the formula, DP ( i , j ) represents the interval from (1,1) to ( i , j The minimum cumulative distance, i.e., the similarity between voltage time series data, d ( i , j ) indicates the first i The point and the first j The distance between points DP ( i -1, j ) represents the interval from (1,1) to ( i -1, j The minimum cumulative distance, DP ( i , j -1) represents the interval from (1,1) to ( i , j The minimum cumulative distance of -1), DP ( i -1, j -1) represents the interval from (1,1) to ( i -1, j The minimum cumulative distance of -1).

[0039] This invention overcomes the limitation of simple distance metrics in handling time alignment problems by using a dynamic time warping algorithm.

[0040] S22. Based on the similarity, the K-means clustering algorithm is used to classify the similar voltage time series data into one class to obtain the clustering result.

[0041] S23. The energy meters corresponding to the voltage time series data in the same cluster of the clustering results are taken as energy meters under the same meter box, and the first topological relationship between the energy meters and the meter box is obtained.

[0042] Voltage time-series data, as a typical type of time-series data, has core characteristics (such as trends, periodicity, abrupt changes, and peak / valley occurrence patterns) that are fundamentally different from tabular data (structured static features). Directly "flattening" time-series data into a tabular format (e.g., treating the voltage value at each time point as a separate feature) and then applying traditional clustering algorithms (such as K-means) will lose the correlation along the time dimension, leading to inaccurate clustering results. Therefore, this invention employs a time-series-based K-means clustering algorithm to achieve more accurate clustering and obtain a precise first topological relationship between the electricity meter and the meter box.

[0043] S3. Based on the first topological relationship, the second topological relationship between the meter box and the transformer is obtained using the three-phase impedance analysis method, specifically including S31-S38: S31. Calculate the three-phase voltage and three-phase current of the meter box according to the first topological relationship, specifically as follows: ; ; In the formula, Indicates the watch case h Phase voltage, Indicates the watch case h Phase current, Indicates that in the table box h Number of phase electricity meters Indicates that in the table box h Xiangdi i The voltage of each electricity meter, Indicates that in the table box h Xiangdi i The current of each electricity meter a Indicates phase A. b Indicates phase B. c This indicates phase C.

[0044] S32. Treat the table box as a node and obtain a set based on all nodes.

[0045] For example, each meter box can be treated as a node, and a set G can be obtained based on all nodes.

[0046] S33. Based on Ohm's law, establish a circuit model for each pair of nodes in the set based on the three-phase voltage and the three-phase current, specifically as follows: ; In the formula, U 2 indicates the concentrator voltage. Represents the first regression coefficient. This represents the second regression coefficient. U 1 indicates the meter box voltage. R 1 represents the third regression coefficient. I 1,R Indicates the meter box current. X 1 represents the fourth regression coefficient. I 1,X Indicates the reactance current of the meter box. R 2 represents the fifth regression coefficient, - I 2,R Indicates the line current. X 2 represents the sixth regression coefficient, - I 2,X This indicates the line reactance current.

[0047] S34. Perform multiple linear regression analysis on the circuit model to obtain the analysis results.

[0048] in, U 2 is the dependent variable. U 1. I 1,R , I 1,X - I 2,R - I 2,X As the independent variable, , , R 1. R 2. X 1. X 2 represents the regression coefficient to be solved.

[0049] S35. If the regression error (MSE) of a certain pair of nodes in the analysis results is less than the first preset value, then it is determined that the certain pair of nodes has a common node.

[0050] S36. Delete the pair of nodes from the set and add the common node to the set, while calculating the three-phase voltage and three-phase current of the common node.

[0051] S37. Return to execute S33 until only one node remains in the set.

[0052] S38. Take the remaining node in the set as the top-level node connecting the transformer, thereby obtaining the second topological relationship between the meter box and the transformer.

[0053] S4. Calculate the line impedance based on the second topology.

[0054] For example, such as Figure 3 As shown, the voltages at nodes 2 and 3 are calculated using Ohm's law, and then the voltage drop from node 2 to node 3 is calculated. Then, based on Ohm's law, the line impedance of the branch from node 2 to node 3 is further calculated. Specifically: ; In the formula, I R This represents the resistive current at node 2. I X Let represent the reactive current at node 2. The current at node 2 is equal to the vector sum of the currents at bins 3 and 4.

[0055] Similarly, the line impedance of the branch from node 1 to node 3 can be obtained.

[0056] S5. Use the isolated forest algorithm to perform anomaly detection on the line impedance and obtain the detection results, specifically including S51-S53: S51. Use a sliding window to divide the line impedance to obtain a sample set.

[0057] For example, assuming the sliding window size is set to w, the entire line impedance data will be divided into 96 / w sample groups, with each sample group containing w impedance data points at consecutive time points. This method can effectively capture local features in time-series data and treat the impedance value within each time window as an independent sample point.

[0058] S52. Input the sample set into the isolated forest algorithm for anomaly detection to obtain the anomaly score for each data point.

[0059] Specifically, the abnormal score is: ; In the formula, Anomal Score ( x ) represents a data point x Abnormal scores, E h ( x ) represents a data point x The average isolation depth in each tree, c ( n ) represents a constant. nThis indicates the number of data points.

[0060] S53. Determine whether the abnormal score is greater than the second preset value. If yes, determine that the data point is an abnormal line impedance data point. If no, determine that the data point is a normal line impedance data point.

[0061] Isolation Forest is an unsupervised outlier detection method based on a tree structure. It constructs multiple trees in the data space, progressively isolating data points. Each tree iteratively assigns samples to leaf nodes by randomly selecting features and split points. Finally, it determines whether a sample is an anomalous impedance point based on its anomaly score. Traditional linear regression methods only calculate the mean impedance value for anomaly detection, ignoring the dynamic characteristics of impedance changes over time. In contrast, the Isolation Forest algorithm does not depend on the specific distribution of the data, and can better capture anomaly patterns and trends in the data, thus providing more stable line impedance anomaly detection results. Its unsupervised learning characteristics enable it to maintain high robustness and stability in complex power system operating environments, adapting to impedance fluctuations over different time periods.

[0062] The present invention discloses a line impedance anomaly detection method based on isolated forests. This method collects voltage time-series data from electricity meters in a distribution network. Based on this data, a K-means clustering algorithm based on time series is used to obtain the first topological relationship between the electricity meter and its enclosure. Based on this first topological relationship, a three-phase impedance analysis method is used to obtain the second topological relationship between the enclosure and the transformer. Based on this second topological relationship, the line impedance is calculated. An isolated forest algorithm is then used to detect line impedance anomalies, yielding the detection results. This method, relying on external testing equipment, utilizes a combination of K-means clustering based on time series and three-phase impedance analysis to accurately and reliably identify the topology of the distribution network and calculate accurate line impedance anomalies. Impedance is then assessed using the isolated forest algorithm for anomaly detection, which efficiently identifies impedance anomalies without increasing maintenance costs and improves the accuracy of impedance anomaly detection. Furthermore, after obtaining the first topology, the three-phase voltage and current of the meter box are calculated. Based on Ohm's law, a circuit model is established for each pair of nodes in the set based on the three-phase voltage and current. Multiple linear regression analysis is performed on this model, and the regression error in the analysis results determines whether each pair of nodes has a common node. Then, the top-level node connecting the transformer is located, thus obtaining the second topology between the meter box and the transformer, enabling efficient and accurate identification of the box-transformer relationship.

[0063] According to another aspect of the invention, Figure 2This is a schematic diagram illustrating a line impedance anomaly detection system based on an isolated forest according to an embodiment of the present invention. The electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the various steps of the line impedance anomaly detection method based on an isolated forest as described above.

[0064] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent modifications made based on the content of the present invention specification and drawings, or direct or indirect applications in related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A method for detecting line impedance anomalies based on isolated forests, characterized in that, Including the following steps: Collect voltage time-series data from electricity meters in the power distribution network; The first topological relationship between the energy meter and the meter box is obtained using the voltage time series data and the K-means clustering algorithm based on time series. Based on the first topological relationship, the second topological relationship between the meter box and the transformer is obtained using the three-phase impedance analysis method. Calculate the line impedance based on the second topology; The isolated forest algorithm was used to detect anomalies in the line impedance, and the detection results were obtained.

2. The method for detecting line impedance anomalies based on isolated forests according to claim 1, characterized in that, The first topological relationship between the electricity meter and the meter box is obtained using the K-means clustering algorithm based on the voltage time series data, including: The similarity between the voltage time series data was calculated using a dynamic time warping algorithm; Based on the similarity, the K-means clustering algorithm is used to classify the similar voltage time series data into one class, and the clustering result is obtained; By taking the energy meters corresponding to the voltage time series data in the same cluster of the clustering results as energy meters under the same meter box, the first topological relationship between the energy meters and the meter box is obtained.

3. The method for detecting line impedance anomalies based on isolated forests according to claim 1, characterized in that, Based on the first topological relationship, the second topological relationship between the meter box and the transformer is obtained using three-phase impedance analysis, including: Calculate the three-phase voltage and three-phase current of the meter box based on the first topological relationship; Treat the watch box as a node, and obtain a set based on all nodes; Based on Ohm's law, establish a circuit model for each pair of nodes in the set based on the three-phase voltage and the three-phase current; Multiple linear regression analysis was performed on the circuit model to obtain the analysis results; If the regression error of a certain pair of nodes in the analysis results is less than the first preset value, then it is determined that the certain pair of nodes has a common node; Remove the pair of nodes from the set and add the common node to the set, while calculating the three-phase voltage and three-phase current of the common node; Return to the step of establishing a circuit model for each pair of nodes in the set based on the three-phase voltage and the three-phase current according to Ohm's law, until only one node remains in the set; The remaining node in the set is used as the top-level node connecting the transformer, thus obtaining the second topological relationship between the meter box and the transformer.

4. The method for detecting line impedance anomalies based on isolated forests according to claim 3, characterized in that, Based on Ohm's law, a circuit model is established for each pair of nodes in the set, using the three-phase voltage and the three-phase current. Specifically: ; In the formula, U 2 indicates the concentrator voltage. Represents the first regression coefficient. This represents the second regression coefficient. U 1 indicates the meter box voltage. R 1 represents the third regression coefficient. I 1,R Indicates the meter box current. X 1 represents the fourth regression coefficient. I 1,X Indicates the reactance current of the meter box. R 2 represents the fifth regression coefficient, - I 2,R Indicates the line current. X 2 represents the sixth regression coefficient, - I 2,X This indicates the line reactance current.

5. The method for detecting line impedance anomalies based on isolated forests according to claim 1, characterized in that, The isolated forest algorithm was used to detect anomalies in the line impedance, and the detection results included: The line impedance is divided using a sliding window to obtain a sample set; The sample set is input into the isolated forest algorithm for anomaly detection to obtain the anomaly score for each data point. Determine whether the abnormal score is greater than a second preset value. If it is, then the data point is determined to be an abnormal line impedance data point; otherwise, the data point is determined to be a normal line impedance data point.

6. A line impedance anomaly detection system based on isolated forests, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it performs the following steps: Collect voltage time-series data from electricity meters in the power distribution network; The first topological relationship between the energy meter and the meter box is obtained using the voltage time series data and the K-means clustering algorithm based on time series. Based on the first topological relationship, the second topological relationship between the meter box and the transformer is obtained using the three-phase impedance analysis method. Calculate the line impedance based on the second topology; The isolated forest algorithm was used to detect anomalies in the line impedance, and the detection results were obtained.

7. The line impedance anomaly detection system based on isolated forests according to claim 6, characterized in that, The first topological relationship between the electricity meter and the meter box is obtained using the K-means clustering algorithm based on the voltage time series data, including: The similarity between the voltage time series data was calculated using a dynamic time warping algorithm; Based on the similarity, the K-means clustering algorithm is used to classify the similar voltage time series data into one class, and the clustering result is obtained; By taking the energy meters corresponding to the voltage time series data in the same cluster of the clustering results as energy meters under the same meter box, the first topological relationship between the energy meters and the meter box is obtained.

8. The line impedance anomaly detection system based on isolated forests according to claim 6, characterized in that, Based on the first topological relationship, the second topological relationship between the meter box and the transformer is obtained using three-phase impedance analysis, including: Calculate the three-phase voltage and three-phase current of the meter box based on the first topological relationship; Treat the watch box as a node, and obtain a set based on all nodes; Based on Ohm's law, establish a circuit model for each pair of nodes in the set based on the three-phase voltage and the three-phase current; Multiple linear regression analysis was performed on the circuit model to obtain the analysis results; If the regression error of a certain pair of nodes in the analysis results is less than the first preset value, then it is determined that the certain pair of nodes has a common node; Remove the pair of nodes from the set and add the common node to the set, while calculating the three-phase voltage and three-phase current of the common node; Return to the step of establishing a circuit model for each pair of nodes in the set based on the three-phase voltage and the three-phase current according to Ohm's law, until only one node remains in the set; The remaining node in the set is used as the top-level node connecting the transformer, thus obtaining the second topological relationship between the meter box and the transformer.

9. A line impedance anomaly detection system based on isolated forests according to claim 8, characterized in that, Based on Ohm's law, a circuit model is established for each pair of nodes in the set, using the three-phase voltage and the three-phase current. Specifically: ; In the formula, U 2 indicates the concentrator voltage. Represents the first regression coefficient. This represents the second regression coefficient. U 1 indicates the meter box voltage. R 1 represents the third regression coefficient. I 1,R Indicates the meter box current. X 1 represents the fourth regression coefficient. I 1,X Indicates the reactance current of the meter box. R 2 represents the fifth regression coefficient, - I 2,R Indicates the line current. X 2 represents the sixth regression coefficient, - I 2,X This indicates the line reactance current.

10. A line impedance anomaly detection system based on isolated forests according to claim 6, characterized in that, The isolated forest algorithm was used to detect anomalies in the line impedance, and the detection results included: The line impedance is divided using a sliding window to obtain a sample set; The sample set is input into the isolated forest algorithm for anomaly detection to obtain the anomaly score for each data point. Determine whether the abnormal score is greater than a second preset value. If it is, then the data point is determined to be an abnormal line impedance data point; otherwise, the data point is determined to be a normal line impedance data point.