Method for detecting abnormality of equipotential grounding grid based on dynamic weighted mahalanobis distance
By automatically identifying grounding grid anomalies using the dynamic weighted Mahalanobis distance method, the problem of power outages required for traditional detection is solved, achieving efficient and accurate grounding grid status monitoring.
Patent Information
- Application Number
- CN202610279897.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-09
- Publication Date
- 2026-05-29
Smart Images

Figure CN122109717A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of equipotential grounding grid detection technology, and specifically relates to an anomaly detection method for equipotential grounding grids based on dynamic weighted Mahalanobis distance. Background Technology
[0002] Substations contain various electrical equipment, all of which need to be grounded through an equipotential bonding network. When a lightning strike or short-circuit fault occurs, the equipotential bonding network distributes the large current to each piece of equipment, causing the potential of the entire system to rise simultaneously. The relative potential difference within the system becomes zero, and the current is then conducted to the ground. During this process, because the relative potential difference within the entire system is zero, step voltage and contact voltage are significantly reduced, ensuring that personnel will not be electrocuted during a fault and protecting equipment from breakdown due to the increased ground potential.
[0003] In summary, equipotential bonding grids are crucial equipment in substations, playing a vital role in maintaining substation operation. Therefore, ensuring the normal operation of the grounding grid is a key task. However, existing grounding grids are buried deep underground, making it impossible to observe their operation with the naked eye. Once corrosion, breakage, or poor connections occur, the surface equipment may still be operational, but an internal "breakpoint" has formed, leading to excessive grounding resistance. Furthermore, when a grounding grid fault occurs, it doesn't necessarily cause an immediate malfunction but accumulates risks. For example, when corrosion causes increased grounding resistance, there may be no abnormalities under normal circumstances, but once a lightning strike or short circuit occurs, the enormous current cannot be discharged, instantly triggering equipment explosions or electric shocks.
[0004] Traditional equipotential grounding grid testing techniques often require a complete or large-scale power outage, which not only affects power supply reliability but also increases operational risks and outage losses. Furthermore, it relies heavily on manual, point-by-point measurements using handheld instruments; testing the grounding grid of a large substation can take days or even weeks, resulting in high labor intensity and significant time and effort. Simultaneously, during operation, the current data at different points in the equipotential grounding grid fluctuates within a certain range due to changes in the local electromagnetic environment, uneven ground potential distribution, and system operating conditions. This fluctuation makes it difficult to promptly assess the operational status of the grounding grid even when measurement data is obtained. Summary of the Invention
[0005] The purpose of this invention is to provide an anomaly detection method for equipotential grounding grids based on dynamic weighted Mahalanobis distance, which can automatically identify whether the grounding current monitored by the grounding grid fluctuates normally with the load or increases or decreases abnormally, and dynamically adjust the judgment threshold to detect abnormal operating conditions of the grounding grid in a timely manner.
[0006] To achieve the above objectives, the technical solution adopted in this invention is an anomaly detection method for equipotential grounding grids based on dynamically weighted Mahalanobis distance, which is carried out according to the following steps:
[0007] Step 1: Record current data at different points for a single device, recording data at each point every 15 seconds to establish the original time series data. ;
[0008] Where i represents the monitoring point, i=1,2,…,N, with a total of N monitoring points, and t represents the sampling time, t=1,2,…,T, with a total of T sampling times;
[0009] Step 2: Raw time series data for each point i Clean data is obtained by removing outliers according to the 2σ interval of the distribution. Calculate the mean value of different detection points i. ;
[0010] Step 3: For each point i, obtain clean data after removing outliers. Based on the original time series data Calculate the relative deviation rate of each point. ;
[0011] Step 4: For each point i, obtain clean data after removing outliers. Using the deviation rate data as a benchmark After normalization, it is converted to the [0-1] interval, denoted as ;
[0012] Step 5: For each sampled data point, use normalized data... Based on this, calculate the fluctuation weighting coefficient. With deviation rate Based on this, calculate the weighting coefficient for single-point anomaly increases. ;
[0013] Step 6: For each sampling time, if the power system load changes and the monitored points at that time fluctuate in the same direction simultaneously, calculate the global same-direction attenuation weighting coefficient for that time. ;
[0014] Step 7: Based on the normalized data Calculate the initial weighted Mahalanobis distance for each point and its weight coefficient. Set the maximum number of iterations. Initial threshold Convergence threshold Normal datasets are filtered by combining initial weighted Mahalanobis distance. The final threshold is obtained through iterative calculation and convergence judgment. ;
[0015] Step 8: Use weighted Mahalanobis distance and final threshold and deviation rate at a certain point and load normal fluctuation threshold Determine the time and location of any abnormality.
[0016] The technical features of this invention also include:
[0017] The original time series data in step 2 Remove outlier data and calculate and Follow these steps:
[0018]
[0019]
[0020]
[0021]
[0022] in, Raw time series data The mean, Raw time series data standard deviation Abnormal data is marked, and its corresponding data will not be included in subsequent processing. The calculation, This represents the number of data remaining after removing outlier data.
[0023] Step 3 involves calculating the relative deviation rate. The formula is as follows:
[0024] .
[0025] Step 4 calculates the deviation rate data. It is converted to the [0-1] interval by minimum-maximum normalization. The specific calculation is as follows:
[0026]
[0027] in, For deviation rate data The minimum value at all times for a fixed point i. For deviation rate data The maximum value at all times for a fixed point i.
[0028] Step 5 calculates the fluctuation weighting coefficient. Single-point abnormal increase in weighting coefficient The formula is as follows:
[0029]
[0030]
[0031]
[0032] in, Let be the arithmetic mean of the i-th point at different times. The reference fluctuation value is set at 0.08;
[0033]
[0034] in, To determine the amplification factor for single-point anomalies, this method takes... =10, This is the fluctuation threshold during normal load changes.
[0035] The global unidirectional attenuation weighting coefficient in step 6 The calculation method is as follows:
[0036]
[0037]
[0038] in, This is an indicator function; it is counted as 1 when the condition is true and as 0 otherwise. Indicators of global homogeneity The global fluctuation attenuation weighting coefficient is taken in this method. =0.1.
[0039] Step 7 calculates the initial weighted Mahalanobis distance. And iterate, specifically following these steps:
[0040] Step 7.1: Calculate the basis fluctuation weighting coefficient Single-point abnormal increase in weighting coefficient Globally oriented decay weighting coefficient Calculate the composite weight system :
[0041] ;
[0042] Step 7.2: Calculate the covariance diagonal matrix :
[0043]
[0044] Where p is a diagonal matrix element of i. The off-diagonal data has an amplitude of 0;
[0045] Step 7.3: For the covariance diagonal matrix Perform minor perturbation corrections:
[0046]
[0047] in, It is an N-order identity matrix. This is the minimum perturbation value;
[0048] Step 7.4: Calculate the weighted Mahalanobis distance for each monitoring data point. :
[0049]
[0050] Step 7.5: Set the initial threshold Convergence threshold and maximum number of iterations The maximum number of iterations in this method ;
[0051] Step 7.6: Using the initial threshold Based on the baseline, calculate the weighted Mahalanobis distance. Select data to form a candidate normal data set The candidate normal time set And guarantee If there is insufficient valid data, all values will be used.
[0052] Step 7.7: Based on the candidate normal data set Recalculate the mean of Mahalanobis distance and standard deviation :
[0053]
[0054]
[0055] in, : For normal data sets The number of elements;
[0056] Step 7.8: Update the threshold by using "mean + β times standard deviation" for the k-th iteration.
[0057]
[0058] in To determine the magnification factor, this method uses... =8;
[0059] Step 7.9: Determine the updated anomaly detection threshold Whether it converges, if Or the number of iterations reaches the maximum number of iterations. If the condition is met, the iteration terminates; otherwise, the updated anomaly detection threshold is applied. As the initial anomaly detection threshold k=k+1, repeat steps 7.6 to 7.9 until the requirements are met, then output the corresponding anomaly detection threshold. The final threshold is... .
[0060] During the operational status assessment in step 8, if the weighted Mahalanobis distance at a certain moment exceeds the final threshold... : If a certain point exceeds the normal threshold for deviation rate, it is considered an abnormal moment; : If so, it is determined to be an abnormal location.
[0061] The maximum number of iterations in step 7 Set the threshold to 8. 1. Convergence threshold It is 0.01;
[0062] The threshold value during normal load fluctuations in step 8 It is 0.4.
[0063] Compared with the prior art, the present invention has the following advantages:
[0064] This method analyzes the current time-series data of each monitoring point in the grounding grid during normal operation to determine its operating status, enabling continuous monitoring of the grounding grid without exposure or power outages. This avoids the problems of decreased power supply reliability, increased operational risks, and power outage losses associated with traditional detection methods that require "complete or large-scale power outages." Furthermore, this method processes automatically collected data and uses algorithms for judgment, achieving automated and continuous anomaly detection, significantly shortening the detection cycle and reducing labor intensity.
[0065] This method constructs a weighted Mahalanobis distance using fluctuation weighting coefficients, single-point anomaly amplification weighting coefficients, and global unidirectional decay weighting coefficients. This effectively distinguishes normal fluctuations from true anomalies in the collected data, avoiding misjudgments. Furthermore, this method adaptively determines the final threshold through an iterative process. This process starts with an initial threshold and a candidate normal dataset, updating the threshold by continuously recalculating the mean and standard deviation of the Mahalanobis distance for the normal data subset until convergence. This iterative method, based on the statistical characteristics of the data itself, allows the threshold to adapt to the data distribution of different grounding grids or different operational stages, improving the accuracy and robustness of detection. Attached Figure Description
[0066] Figure 1This is a flowchart of the equipotential grounding grid anomaly detection method based on dynamic weighted Mahalanobis distance according to the present invention;
[0067] Figure 2 This is a time series curve of each point after normalization in this invention;
[0068] Figure 3 This is a comparison chart of the weighted Mahalanobis distance and the anomaly threshold at different times in this invention;
[0069] Figure 4 This is a distribution map of abnormal points in this invention. Detailed Implementation
[0070] The present invention will be further described below with reference to the accompanying drawings and specific embodiments.
[0071] Example 1:
[0072] like Figure 1 As shown, the equipotential grounding grid anomaly detection method based on dynamic weighted Mahalanobis distance proposed in this embodiment is carried out according to the following steps:
[0073] Step 1: Record current data at 8 points on a single device. Record current data at each point every 15 seconds, and record continuously for 885 seconds at each point, obtaining 60 data points from each point. Integrate this data to form the raw time series data. This serves as the foundational data for current testing.
[0074] Step 2: For the raw time series data Clean data is obtained by removing outliers according to the 2σ interval [μ−2σ,μ+2σ] of its distribution. The removal method is as follows:
[0075]
[0076] in, and The calculation method is as follows:
[0077]
[0078]
[0079] Then calculate the clean data. mean The calculation method is as follows:
[0080]
[0081] In the above formula, Raw time series data The mean, Raw time series data standard deviation Abnormal data is marked, and its corresponding data will not be included in subsequent processing. The calculation, This represents the number of data remaining after removing outliers;
[0082] Clean data is obtained by removing outlier data. This reflects the typical current level of the point under current operating conditions, which is used for subsequent deviation quantification. At the same time, the 2σ interval elimination is adaptively determined based on the statistical dispersion of the historical data of the point itself, without relying on a global threshold or prior model, thus avoiding false elimination due to differences in the dimensions, amplitude, and noise characteristics of multiple points.
[0083] Step 3: Clean data after removing outliers Based on the original time series data Calculate the relative deviation rate of each point. The calculation method is as follows:
[0084] .
[0085] The raw current data with physical units is transformed into a dimensionless relative change, eliminating the incomparability of absolute amplitudes caused by differences in installation location, conductor cross-sectional area, and contact resistance at different points, and giving multi-point data a unified semantic scale. At the same time, the deviation rate directly characterizes the disturbance intensity of local anomalies to the steady-state operating point, providing an interpretable input dimension for subsequent weighting and distance measurement.
[0086] Step 4: For each point i, obtain clean data after removing outliers. Based on, After normalization, it is converted to the [0-1] interval, denoted as The normalization method is as follows:
[0087]
[0088] in, For deviation rate data The minimum value at all times for a fixed point i. For deviation rate data The maximum value at all times for a fixed point i.
[0089] Normalization further eliminates the differences in the dynamic range of deviation rates between different points, ensuring that data from all points participate in subsequent covariance modeling and Mahalanobis distance calculations on the same numerical scale, thus avoiding the dominance of dimensions in distance measurement results. This normalization uses the extreme value of the deviation rate within a point as the boundary, without applying it across points, preserving the inherent volatility sensitivity of each point. The normalization results are as follows: Figure 2 As shown.
[0090] Step 5: Using normalized data Based on this, calculate the fluctuation weighting coefficient. With deviation rate Based on this, calculate the weighting coefficient for single-point anomaly increases. The calculation method is as follows:
[0091]
[0092]
[0093]
[0094] in, Let be the arithmetic mean of the i-th point at different times. The reference fluctuation value is set at 0.08;
[0095]
[0096] in, To determine the amplification factor for single-point anomalies, this method takes... =10, This is the fluctuation threshold during normal load changes.
[0097] Calculating the fluctuation weighting coefficient can assign higher weights to points that have been running stably for a long time and are less affected by disturbances, thereby enhancing their contribution to the anomaly criteria; conversely, it can automatically reduce the weights of points that are themselves highly volatile and have low signal-to-noise ratios, thereby suppressing the interference of their noise on the overall distance measurement.
[0098] Calculating the weighting coefficient for single-point anomalies can impose additional penalties on single-point deviations that have exceeded the reasonable fluctuation boundary of the system in the subsequent weighted Mahalanobis distance calculation, making the distance value more sensitive to this type of strong local anomaly and improving the detectability of early weak anomalies.
[0099] Step 6: For each sampling time, if the power system load changes and the monitored points at that time fluctuate in the same direction simultaneously, calculate the global same-direction attenuation weighting coefficient for that time. The calculation method is as follows:
[0100]
[0101]
[0102] in, This is an indicator function; it is counted as 1 when the condition is true and as 0 otherwise. Indicators of global homogeneity The global fluctuation attenuation weighting coefficient is taken in this method. =0.1.
[0103] When the overall increase or decrease of the system load causes a synchronous increase or decrease in the current at all points... Approaching 1, Approaching This significantly reduces the contribution of that moment to the weighted Mahalanobis distance, avoiding misjudging such system-level common-mode fluctuations as grounding grid anomalies; while when only individual points deviate abnormally... Significantly reduced, Approaching 1 ensures that local abnormal signals are fully involved in the weighted Mahalanobis distance calculation.
[0104] Step 7: Based on the normalized data Calculate the initial weighted Mahalanobis distance for each point and its weight coefficient. Set the maximum number of iterations. Initial threshold Convergence threshold Normal datasets are filtered by combining initial weighted Mahalanobis distance. The final threshold is obtained through iterative calculation and convergence judgment. .
[0105] The weighted Mahalanobis distance is a comprehensive statistical measure of the deviation of the joint state of all points at time t from the historical normal distribution. It breaks through the limitations of the traditional Euclidean distance in the equal weighting of each dimension. Through triple dynamic weighting, it focuses on key points, suppresses interference, and decouples common modes, making the distance value highly sensitive to local anomalies and robust to system fluctuations.
[0106] Final threshold The adaptive decision boundary, which is learned autonomously from the initial distance distribution through an iterative approach, can effectively avoid the problem of poor adaptability caused by manually setting a fixed threshold. It allows the decision boundary to evolve dynamically with the actual operating data distribution, thereby improving the tolerance to slow-changing trends such as long-term aging and seasonal temperature drift.
[0107] Step 8: Use weighted Mahalanobis distance and final threshold and deviation rate at a certain point and load normal fluctuation threshold The system identifies abnormal times and locations. If the weighted Mahalanobis distance at a certain time exceeds the final threshold... : If a certain point exceeds the normal threshold for deviation rate, it is considered an abnormal moment; : If so, it is determined to be an abnormal location.
[0108] like Figure 3 and Figure 4As shown, in this embodiment, the weighted Mahalanobis distance at time 60 is greater than the final anomaly detection threshold. Therefore, this indicates a fault occurred at this time in this test. Simultaneously, the deviation rate at point 1 at that moment was 0.8, which is greater than the normal load fluctuation threshold. Therefore, it can be concluded that point 1 experienced a fault at time 60.
[0109] This application constructs a multi-scale data transformation link with relative deviation rate as the bridge, from the original current... After cleaning the 2σ interval, we get Regenerate dimensionless Ultimately normalized to ; using fluctuation weights Suppressing low-information-content points and single-point abnormal weights Amplify significant deviations and globally unidirectional decay weights This weakens system common-mode fluctuations, forming a triple dynamic weighting mechanism; subsequently, it integrates three types of weights to drive the weighted Mahalanobis distance. The adaptive final threshold is calculated and obtained through iterative robust threshold learning. Ultimately, by locating abnormal points, it achieves highly sensitive, low-false-alarm, and locatable detection of early anomalies such as localized corrosion and loose connections in the grounding grid under uninterrupted power supply conditions.
Claims
1. A method for detecting anomalies in equipotential grounding grids based on dynamically weighted Mahalanobis distance, characterized in that, Follow these steps: Step 1: Record current data at different points for a single device, recording data at each point every 15 seconds to establish the original time series data. ; Where i represents the monitoring point, i=1,2,…,N, with a total of N monitoring points, and t represents the sampling time, t=1,2,…,T, with a total of T sampling times; Step 2: Raw time series data for each point i Clean data is obtained by removing outliers according to the 2σ interval [μ−2σ,μ+2σ] of its distribution. Calculate the mean value of different detection points i. ; Step 3: For each point i, obtain clean data after removing outliers. Based on the original time series data Calculate the relative deviation rate of each point. ; Step 4: For each point i, obtain clean data after removing outliers. Using this as a benchmark, the relative deviation rate After normalization, it is converted to the [0-1] interval, denoted as ; Step 5: For each sampled data point, use normalized data... Based on this, calculate the fluctuation weighting coefficient. With deviation rate Based on this, calculate the weighting coefficient for single-point anomaly increases. ; Step 6: For each sampling time, calculate the global in-direction attenuation weighting coefficient for that time. ; Step 7: Based on the normalized data Calculate the initial weighted Mahalanobis distance for each point and its weight coefficient. Set the maximum number of iterations. Initial threshold Convergence threshold Normal datasets are filtered by combining initial weighted Mahalanobis distance. The final threshold is obtained through iterative calculation and convergence judgment. ; Step 8: Use weighted Mahalanobis distance and final threshold and deviation rate at a certain point and load normal fluctuation threshold Determine the time and location of any abnormality.
2. The method for detecting anomalies in equipotential grounding grids based on dynamically weighted Mahalanobis distance according to claim 1, characterized in that, For the original time series data in step 2 Remove outlier data and calculate and Follow these steps: in, Raw time series data The mean, Raw time series data standard deviation Abnormal data is marked, and its corresponding data will not be included in subsequent processing. The calculation, This represents the number of data remaining after removing outlier data.
3. The method for detecting anomalies in equipotential grounding grids based on dynamically weighted Mahalanobis distance according to claim 1, characterized in that, Step 3 involves calculating the relative deviation rate. The formula is as follows: 。 4. The method for detecting anomalies in equipotential grounding grids based on dynamically weighted Mahalanobis distance according to claim 1, characterized in that, Step 4 calculates the deviation rate data. It is converted to the [0-1] interval by minimum-maximum normalization. The specific calculation is as follows: in, For deviation rate data The minimum value at all times for a fixed point i. For deviation rate data The maximum value at all times for a fixed point i.
5. The method for detecting anomalies in equipotential grounding grids based on dynamically weighted Mahalanobis distance according to claim 1, characterized in that, Step 5 calculates the fluctuation weighting coefficient. Single-point abnormal increase in weighting coefficient The formula is as follows: in, Let be the arithmetic mean of the i-th point at different times. The reference fluctuation value is set at 0.08; in, To determine the amplification factor for single-point anomalies, this method takes... =10, This is the fluctuation threshold during normal load changes.
6. The method for detecting anomalies in equipotential grounding grids based on dynamically weighted Mahalanobis distance according to claim 1, characterized in that, The global unidirectional attenuation weighting coefficient in step 6 The calculation method is as follows: in, This is an indicator function; it is counted as 1 when the condition is true and as 0 otherwise. Indicators of global homogeneity The global fluctuation attenuation weighting coefficient is taken in this method. =0.
1.
7. The method for detecting anomalies in equipotential grounding grids based on dynamically weighted Mahalanobis distance according to claim 1, characterized in that, Step 7 calculates the initial weighted Mahalanobis distance. And iterate, specifically following these steps: Step 7.1: Calculate the basis fluctuation weighting coefficient Single-point abnormal increase in weighting coefficient Globally oriented decay weighting coefficient Calculate the composite weight system : ; Step 7.2: Calculate the covariance diagonal matrix : Where p is a diagonal matrix element of i. The off-diagonal data has an amplitude of 0; Step 7.3: For the covariance diagonal matrix Perform minor perturbation corrections: in, It is an N-order identity matrix. This is the minimum perturbation value; Step 7.4: Calculate the weighted Mahalanobis distance for each monitoring data point. : ; Step 7.5: Set the initial threshold Convergence threshold and maximum number of iterations ; Step 7.6: Using the initial threshold Based on the baseline, calculate the weighted Mahalanobis distance. Select data to form a candidate normal data set The candidate normal time set And guarantee If there is insufficient valid data, all values will be used. Step 7.7: Based on the candidate normal data set Recalculate the mean of Mahalanobis distance and standard deviation : in, : For normal data sets The number of elements; Step 7.8: Update the threshold by using "mean + β times standard deviation" for the k-th iteration. in To determine the magnification factor, this method uses... =8; Step 7.9: Determine the updated anomaly detection threshold Whether it converges, if Or the number of iterations reaches the maximum number of iterations. If the condition is met, the iteration terminates; otherwise, the updated anomaly detection threshold is applied. As the initial anomaly detection threshold k=k+1, repeat steps 7.6 to 7.9 until the requirements are met, then output the corresponding anomaly detection threshold. The final threshold is... .
8. The method for detecting anomalies in equipotential grounding grids based on dynamically weighted Mahalanobis distance according to claim 1, characterized in that, During the operational status assessment in step 8, if the weighted Mahalanobis distance at a certain moment exceeds the final threshold... : If a certain point exceeds the normal threshold for deviation rate, it is considered an abnormal moment; : If so, it is determined to be an abnormal location.
9. The method for detecting anomalies in equipotential grounding grids based on dynamically weighted Mahalanobis distance according to claim 1, characterized in that, The maximum number of iterations in step 7 Set the threshold to 8.
1. Convergence threshold It is 0.01; The threshold value during normal load fluctuations in step 8 It is 0.4.
