Line loss abnormity diagnosis method based on electric quantity fluctuation analysis

By calculating the rate of change of power supply and power consumption, combining the analysis of load curves with causal forest and TCN models, and using SHAP interpretation, the problems of concealed identification and poor interpretability in the diagnosis of abnormal line loss in transformer areas are solved, and high-precision and reliable line loss anomaly diagnosis is achieved.

CN121454221APending Publication Date: 2026-02-03MARKETING SERVICE CENT OF STATE GRID LIAONING ELECTRIC POWER CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202511617260.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-06
Publication Date
2026-02-03

AI Technical Summary

Technical Problem

Existing technologies do not fully utilize time-series fluctuation information in the diagnosis of abnormal line losses in transformer substations, resulting in weak ability to identify hidden anomalies, poor interpretability of diagnostic results, and difficulty in distinguishing between power supply side and user side faults.

Method used

By calculating the rate of change of power supply and the rate of change of power consumption, and combining the causal forest model and the TCN model to analyze the user load curve, the SHAP model is used for interpretation, and a line loss anomaly diagnosis report is generated.

Benefits of technology

It achieves high-precision identification of concealed electricity theft or faults, improves the reliability of diagnostic results and the efficiency of on-site verification, and enhances the interpretability and robustness of the method.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121454221A_ABST
    Figure CN121454221A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of electric power, in particular to a line loss abnormity diagnosis method based on electric quantity fluctuation analysis. The method comprises the following steps: acquiring an electricity user and electricity data; calculating a power supply quantity change rate and a power consumption change rate according to the daily power supply quantity of the transformer area and the fluctuation degree of the daily power consumption of the transformer area, and further judging a line loss abnormity type; if the line loss abnormity type is user side abnormity, screening the electricity users, and obtaining a user side abnormity type according to the screened electricity users; if the line loss abnormity type is power supply side abnormity, calculating a power supply quantity multiple, and performing fault attribution to obtain a power supply side abnormity type; and explaining the two exception types through the SHAP so as to generate a line loss exception diagnosis report. In this way, the adaptability and robustness of the diagnosis method in a novel scene containing a distributed power supply and the like can be enhanced, the interpretability of a diagnosis result is further improved, and a clear and credible feature basis is provided for field check.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention generally relates to the field of power, and more specifically, to a method for diagnosing line loss anomalies based on power fluctuation analysis. Background Technology

[0002] In the power system, distribution substations (hereinafter referred to as "substations") are the final link in the transmission of electricity to end users, and their operation and management level directly affects the economic benefits and power supply quality of the power grid. Line loss rate is one of the core indicators for measuring the operating status of a substation; it refers to the percentage difference between the amount of electricity supplied and the amount of electricity sold within a certain period of time. Substation line loss management is a key task for power companies to reduce losses, increase efficiency, and improve lean management. Abnormal line loss rates (such as excessively high or negative values, i.e., "high loss" or "negative loss") usually indicate technical or management problems, such as metering device failures, line leakage, electricity theft, or incorrect customer-substation relationships. These anomalies not only cause power and economic losses but may also conceal serious equipment safety hazards. Therefore, quickly and accurately diagnosing the causes of abnormal line losses and precisely locating the source of the problem is the core of line loss management and is crucial for power companies to improve operational efficiency.

[0003] Traditional methods for diagnosing abnormal line losses in transformer substations mainly rely on manual inspection and simple data analysis. With the popularization of electricity information collection systems, massive amounts of power data have provided a foundation for intelligent diagnosis. Currently, widely used intelligent diagnosis methods can be mainly divided into three categories: (1) Methods based on macro-indicator analysis: problems are discovered by analyzing macro-operational indicators such as the success rate and coverage of collection in the transformer substation. (2) Methods based on instantaneous or curve feature analysis: instantaneous measurements or load curve features such as current, voltage, and power of the transformer substation's main meter and user meters are analyzed to determine whether there is electricity theft or metering abnormalities. (3) Methods based on user-transformer relationship analysis: investigations are conducted by monitoring changes in user relationships in the transformer substation.

[0004] However, existing technologies generally have the following drawbacks: (1) They do not make full use of time-series fluctuation information and neglect in-depth analysis of the rate of change of power supply and power consumption before and after the anomaly occurs, which is the key to distinguishing between power supply side and user side faults. (2) They have weak ability to identify hidden anomalies. For electricity theft behavior with small changes in power consumption but significant deviations in power consumption pattern (load curve), traditional threshold methods are prone to miss detection. (3) The interpretability of diagnostic results is poor. Although many deep learning-based methods have high accuracy, their decision-making process is like a "black box". Front-line maintenance personnel find it difficult to understand the diagnostic basis, which reduces the credibility of the results and the efficiency of on-site verification. Summary of the Invention

[0005] According to the present invention, a method for diagnosing line loss anomalies based on power fluctuation analysis is provided. This method can enhance the adaptability and robustness of the diagnostic method in new scenarios including distributed power sources, thereby improving the interpretability of the diagnostic results and providing clear and reliable characteristic evidence for on-site verification.

[0006] The method includes: Acquire electricity users and electricity consumption data; the electricity consumption data includes: daily electricity consumption of users, user load curves, user tags, user time-series fluctuation indicators, daily power supply of distribution areas, daily electricity consumption of distribution areas, and topological characteristics of distribution areas; The power supply change rate and power consumption change rate are calculated based on the fluctuation of the daily power supply and power consumption of the transformer area, respectively; then, the line loss anomaly type is determined based on the power supply change rate and power consumption change rate, wherein the line loss anomaly type includes user-side anomaly and power supply-side anomaly. If the line loss anomaly type is user-side anomaly, then the electricity users are screened based on the user's daily electricity consumption, user load curve, user tag, user time-series fluctuation index and transformer area topology characteristics, and the user-side anomaly type is obtained based on the screened electricity users. If the abnormal line loss type is a power supply side abnormality, then calculate the power supply multiple based on the daily power supply of the transformer area, and attribute the fault to the cause based on the power supply multiple to obtain the power supply side abnormality type. The user-side anomaly type or the power supply-side anomaly type is interpreted using SHAP, thereby generating a line loss anomaly diagnosis report.

[0007] Furthermore, the step of determining the line loss anomaly type based on the power supply change rate and the power consumption change rate includes: if the power supply change rate is greater than the anomaly threshold and the power consumption change rate is not greater than the anomaly threshold, then the line loss anomaly type is a power supply side anomaly; if the power supply change rate is not greater than the anomaly threshold and the power consumption change rate is greater than the anomaly threshold, then the line loss anomaly type is a user side anomaly.

[0008] Furthermore, the step of screening electricity users based on daily electricity consumption, user load curves, user tags, user time-series fluctuation indicators, and transformer area topology features, and obtaining user-side anomaly types based on the screened electricity users, includes: constructing a causal forest model, calculating the splitting returns of transformer area topology features, user tags, and user time-series fluctuation indicators respectively using the mean squared error splitting method, training the causal forest model based on the three splitting returns, inputting the daily electricity consumption of users into the trained causal forest model for electricity anomaly screening to obtain a first set of abnormal users; performing electricity consumption pattern anomaly screening on the first set of abnormal users to obtain a second set of abnormal users; traversing the second set of abnormal users and calculating the electricity consumption matching degree of the current abnormal user through global electricity consumption matching verification; deleting users whose electricity consumption matching degree is greater than the matching degree threshold to obtain an abnormal user set; and obtaining the user-side anomaly type of the electricity user based on the abnormal user set and the second set of abnormal users.

[0009] Furthermore, the step of inputting the user's daily electricity consumption into the trained causal forest model for electricity consumption anomaly screening to obtain the first abnormal user set includes: traversing the user's daily electricity consumption, inputting the daily electricity consumption of each user into the trained causal forest model, outputting the net impact of each user's electricity consumption; and selecting users whose absolute value of the net impact of electricity consumption is greater than the effect threshold as the first abnormal user set.

[0010] Further, the step of screening the first abnormal user set for abnormal electricity consumption patterns to obtain a second abnormal user set includes: extracting the baseline period daily load curve and the abnormal period daily load curve for each user in the first abnormal user set from the user load curves, and performing feature extraction on the two curves to obtain the baseline feature vector and the abnormal feature vector for each user; inputting the baseline feature vector and the abnormal feature vector for each user into the TCN model respectively, and outputting the baseline weighted feature vector and the abnormal weighted feature vector for each user; calculating the cosine similarity of the weighted feature vector for each user based on the baseline weighted feature vector and the abnormal weighted feature vector; and including users whose weighted feature vector cosine similarity is less than the cosine similarity threshold as the second abnormal user set. The formula for calculating the weighted feature vector cosine similarity is as follows:

[0011] in, Cosine similarity of weighted feature vectors; This is an anomaly-weighted feature vector; The baseline weighted eigenvector.

[0012] Furthermore, the TCN model includes: The multi-branch parallel convolution module is used to extract multi-dimensional features from the feature vector to obtain hourly short-term fluctuation features, daily medium-term fluctuation features, and weekly long-term fluctuation features, and to calculate multi-dimensional feature vectors; the electricity consumption pattern attention module is used to calculate feature weights based on the multi-dimensional feature vectors; the weighting module is used to multiply the multi-dimensional feature vectors and feature weights element by element to obtain weighted feature vectors. The formula for calculating the multidimensional feature vector is as follows:

[0013] The formula for calculating the feature weights is as follows:

[0014] The formula for calculating the weighted feature vector is:

[0015] in, It is a multidimensional feature vector; It exhibits short-term fluctuation characteristics at the hourly level; This exhibits characteristics of daily-level medium-term fluctuations. It exhibits long-term fluctuation characteristics at the weekly level; For feature weights; The first learning parameter; This is the second learning parameter; These are weighted eigenvectors.

[0016] Furthermore, after obtaining the user-side anomaly type, the process also includes using a meta-learner to score the filtered electricity users, verifying the user-side anomaly type based on the scoring results, and using the verified user-side anomaly type as the final user-side anomaly type. The process of using a meta-learner to score the selected electricity users includes:

[0017] in, The user-side comprehensive anomaly score; Weights for causal effects; For the first Net impact on electricity consumption per user; For time-series pattern weights; Cosine similarity of weighted feature vectors; As scene feature weights; This is a set of abnormal users.

[0018] Furthermore, the calculation of the power supply multiple based on the daily power supply of the distribution area includes:

[0019] in, It is a multiple of the power supply. This represents the daily power supply to the transformer substation during abnormal periods. This represents the daily power supply of the transformer substation during the baseline period.

[0020] Furthermore, the fault attribution based on the power supply multiple to obtain the power supply side anomaly type includes: If the power supply multiple is approximately equal to the first power supply threshold, the power supply side anomaly type is an open circuit on the secondary side of the current transformer or an incorrect multiplier configuration; if the power supply multiple is approximately equal to the second power supply threshold, the power supply side anomaly type is a short circuit in the secondary circuit of the current transformer or an incorrect multiplier entry; if the power supply multiple is approximately equal to the third power supply threshold, the power supply side anomaly type is a stopped test table or a communication interruption.

[0021] Furthermore, the step of interpreting the user-side anomaly type or the power supply-side anomaly type using SHAP to generate a line loss anomaly diagnostic report includes: The user-side anomaly type or power supply-side anomaly type is used as input features to calculate... The input features and The system constructs an anomaly analysis combination; it builds a rule mapping library and extracts the business scenarios corresponding to the anomaly analysis combination from the rule mapping library; and it generates a line loss anomaly diagnosis report based on the business scenarios. The The calculation formula is as follows:

[0022] in, for ; A subset of features; For the complete set of features; As a characteristic; The total number of features; Total number of features factorial; For feature subset factorial; Features The alliance; For the model to have features i Predictions at that time; For the model without features i Prediction of time. Compared with the prior art, the present invention has the following beneficial technical effects: This invention breaks through the limitations of traditional threshold methods, thereby achieving high-precision, low-false-alarm identification of concealed electricity theft or faults such as "sudden drop in power consumption accompanied by load pattern deviation". By using the SHAP (SHapley Additive exPlanations) value attribution framework, the diagnostic decisions of the model are explained after the fact. In this way, the key points of verification can be quickly identified, which greatly improves the efficiency of on-site verification and the credibility of diagnostic results.

[0023] It should be understood that the description in the Summary of the Invention is not intended to limit the key or essential features of the embodiments of the present invention, nor is it intended to restrict the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0024] The above and other features, advantages, and aspects of the various embodiments of the present invention will become more apparent from the accompanying drawings and the following detailed description. In the drawings, the same or similar reference numerals denote the same or similar elements, wherein: Figure 1 A flowchart of a line loss anomaly diagnosis method based on power fluctuation analysis according to an embodiment of the present invention is shown; Figure 2 A flowchart of a method for obtaining user-side exception types according to an embodiment of the present invention is shown; Figure 3 A flowchart of a first abnormal user set acquisition method according to an embodiment of the present invention is shown; Figure 4 A flowchart of a second abnormal user set acquisition method according to an embodiment of the present invention is shown; Figure 5 A flowchart of a method for generating a line loss anomaly diagnostic report according to an embodiment of the present invention is shown. Detailed Implementation

[0025] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0026] Furthermore, the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.

[0027] In this invention, the rate of change in power supply and the rate of change in power consumption are calculated based on electricity usage data to determine the type of line loss anomaly. Then, based on the type of line loss anomaly, user-side anomalies and power supply-side anomalies are processed separately to obtain the user-side anomaly type and the power supply-side anomaly type. SHAP is used to interpret the two anomaly types, thereby generating a line loss anomaly diagnostic report. In this way, a line loss anomaly diagnostic method with high diagnostic accuracy, strong interpretability, and ease of on-site verification is provided.

[0028] Figure 1 A flowchart of a line loss anomaly diagnosis method based on power fluctuation analysis according to an embodiment of the present invention is shown.

[0029] The method includes: S101. Obtain electricity users and electricity consumption data; where electricity consumption data includes: daily electricity consumption of users, user load curves, user tags, user time-series fluctuation indicators, daily power supply of distribution areas, daily electricity consumption of distribution areas, and topological characteristics of distribution areas.

[0030] In this embodiment, electricity users and electricity consumption data are collected from the electricity consumption information collection system, wherein the electricity consumption data refers to the target transformer area during the reference period (denoted as...). The period is usually selected as the past 30 days when the line loss rate is normal and stable, and the abnormal period (denoted as...). The period typically selects complete and accurate raw transformer area operation data (usually the most recent 7 days after the occurrence of abnormal line loss rate).

[0031] Among them, the daily power supply of the distribution area is the cumulative daily meter readings or daily frozen electricity of all assessment meters within the distribution area; the daily electricity consumption of the distribution area is the sum of the daily frozen electricity of all user meters under the distribution area; the daily electricity consumption of a user is the daily frozen electricity data of each low-voltage user's electricity meter under the distribution area; the user load curve is the active power curve data of 96 points (or 48 points) of each user's electricity meter under the distribution area; the user tag is the user behavior category data directly obtained from the power consumption system; the user time-series fluctuation index is the peak-valley difference of the user's electricity consumption ( ,in Peak electricity consumption of users; For users' electricity consumption peak value), volatility ( ,in σ Standard deviation; μ The topological characteristics of the transformer area are the nodal degree (mean value), correlation coefficient with temperature, etc. By calculating "node degree", the influence of users in the network structure of the distribution area can be effectively quantified, and it can be used as an important weight or feature to make the model pay more attention to the subtle changes of "key users", thus providing key input for subsequent causal forest weighted analysis.

[0032] In this embodiment, after acquiring electricity consumption data, it needs to be preprocessed. Specific preprocessing includes data cleaning (handling missing values ​​and outliers that clearly do not conform to physical laws) and data alignment (ensuring...). and The data is standardized and integrated with the feature set to form a high-quality, time-aligned analysis dataset for subsequent steps. The dataset is designed to be consistent in length and user set within the two time periods (including handling new or closed accounts).

[0033] S102. Calculate the power supply change rate and power consumption change rate based on the fluctuation of the daily power supply and power consumption of the transformer area, respectively; then determine the line loss anomaly type based on the power supply change rate and power consumption change rate, wherein the line loss anomaly type includes user-side anomaly and power supply-side anomaly.

[0034] The calculation formula for the power supply change rate is as follows:

[0035] The rate of change in electricity consumption is calculated using the following formula:

[0036] in, The rate of change of power supply; This represents the daily power supply to the transformer substation during abnormal periods. The daily power supply of the transformer substation during the baseline period; The rate of change in electricity consumption; This represents the daily electricity consumption of the transformer substation during abnormal periods. The daily electricity consumption of the transformer substation is for the baseline period.

[0037] In this embodiment, determining the line loss anomaly type based on the power supply change rate and the power consumption change rate includes: if the power supply change rate is greater than the anomaly threshold and the power consumption change rate is not greater than the anomaly threshold, the line loss anomaly type is a power supply side (transformer area assessment table) anomaly; if the power supply change rate is not greater than the anomaly threshold and the power consumption change rate is greater than the anomaly threshold, the line loss anomaly type is a user side anomaly (user metering failure or abnormal electricity consumption behavior); if both the power supply change rate and the power consumption change rate are greater than the anomaly threshold, the line loss anomaly type is a composite anomaly, indicating that there may be multiple anomalies simultaneously (i.e., simultaneous user side anomalies and power supply side anomalies) or complex situations, and the system outputs a warning message "Manual verification recommended"; if neither the power supply change rate nor the power consumption change rate is greater than the anomaly threshold, there is no line loss anomaly. The anomaly threshold is typically 0.05.

[0038] As some optional implementation methods of this embodiment, it is assumed that under normal power supply levels in the distribution area, the average daily power supply of the distribution area ( =1000 kWh, average daily electricity consumption in the distribution area ( ) = 950 kWh, then the result is obtained through calculation. , Since the power supply change rate is >0.05 and the power consumption change rate is <0.5, the line loss anomaly is determined to be a power supply side anomaly.

[0039] The core advantages of this technique, which determines the type of line loss anomaly by calculating the rate of change in power supply and the rate of change in power consumption and comparing two thresholds, lie in its efficiency and guidance. By quantitatively analyzing the temporal fluctuation differences in power consumption on the power supply side and the user side, it can quickly and accurately pinpoint the source of the anomaly (power supply side, user side, or combined anomaly), overcoming the limitations of traditional methods that rely solely on single power consumption or instantaneous characteristics. This approach enhances scenario adaptability and interpretability. Furthermore, by judging anomalies through relative changes in volatility rather than absolute values, it can effectively distinguish between positive power fluctuations caused by distributed power source access and actual faults, enhancing the robustness of new power systems. Simultaneously, the threshold determination rules are clear and intuitive, making the diagnostic logic easy for frontline maintenance personnel to understand, improving the credibility of the results, and providing immediate decision-making basis for on-site verification.

[0040] S103, such as Figure 2 As shown, if the line loss anomaly type is a user-side anomaly, then electricity users are screened based on user daily electricity consumption, user load curve, user tags, user time-series fluctuation indicators, and transformer area topology characteristics. The user-side anomaly type is obtained from the screened electricity users, including: S201. Construct a causal forest model, and calculate the splitting rewards of transformer area topology features, user tags and user time-series fluctuation indicators respectively by mean square error splitting method. Train the causal forest model based on the three splitting rewards, and then input the daily electricity consumption of users into the trained causal forest model to screen for electricity anomalies, and obtain the first abnormal user set.

[0041] Specifically, each user in The electricity consumption during that period was used as a control group. The electricity consumption during the period was used as the processing group to construct a causal forest model.

[0042] In this embodiment, training the causal forest model based on three splitting rewards includes: integrating three splitting rewards—station topology features, user tags, and user temporal fluctuation indicators—calculated using the mean squared error splitting method, into the splitting criteria of the causal forest model. The calculation formula for the splitting reward is as follows:

[0043] in, This is the first weighting coefficient; This is the second weighting coefficient.

[0044] Specifically, the power characteristic discrimination is each indicator among the transformer area topology characteristics, user tags, or user time-series fluctuation indicators. For example, a user's electricity consumption volatility is itself an important time-series characteristic that can be directly involved in the calculation of splitting revenue; user behavior categories (i.e., user tags, such as 'industrial and commercial volatility type') can serve as prior knowledge to help determine whether its current fluctuations are abnormal. First weighting coefficient Second weighting coefficient The weight coefficients, obtained through training with historical power grid data (optimized via grid search or gradient descent), aim to prioritize power characteristics more strongly correlated with line loss anomalies when splitting the causal forest model, thereby improving the screening accuracy for users with hidden electricity theft or metering faults.

[0045] In this embodiment, as Figure 3 As shown, the step of inputting users' daily electricity consumption into the trained causal forest model for electricity consumption anomaly screening yields a first set of anomalous users, including: S301. Iterate through the daily electricity consumption of each user, input the daily electricity consumption of each user into the trained causal forest model, and output the net impact of each user's electricity consumption.

[0046] Specifically, the formula for calculating the net impact of each user's electricity consumption is as follows:

[0047] in, Net impact on electricity consumption for each user; B The total number of trees; For the index of the tree; For the first b Trees for users i Effect estimation.

[0048] S302. Users whose net impact on electricity consumption is greater than the effect threshold are designated as the first set of abnormal users. The effect threshold is typically 0.2.

[0049] As some optional implementation methods of this embodiment, it is assumed that the baseline daily average electricity consumption is 10 kWh when the user's electricity consumption is stable, and the electricity consumption fluctuation is within ±5% for a normal user. If the user's daily average electricity consumption drops to 4 kWh and its load curve pattern changes significantly (such as the disappearance of electricity consumption at night and no load during the day), then the net impact on the user's electricity consumption is -0.6 (i.e., a 60% decrease in electricity consumption). Since |net impact on electricity consumption| = 0.6 > 0.2, the user is added to the first abnormal user set.

[0050] By inputting users' daily electricity consumption into a trained causal forest model for electricity anomaly screening, it is possible to effectively identify hidden anomalies where electricity consumption fluctuations are small but clearly affected by abnormal events. This approach allows for precise quantification of the individual impact on each electricity user's consumption, accurately identifying the "net impact" of events during abnormal periods on user electricity consumption. It effectively overcomes the limitations of traditional threshold methods, which easily miss "small but persistent anomalies" in group fluctuations. It is particularly adept at identifying hidden anomalies caused by specific reasons such as electricity theft or early metering malfunctions, despite small fluctuations in electricity consumption, thus significantly improving the accuracy and recall of screening. Furthermore, the causal forest model possesses good anti-confusion and interpretability. Its weighted splitting mechanism based on power characteristics (such as topology and user labels) resists interference from complex internal correlations within distribution areas, ensuring the reliability of causal inferences. Simultaneously, the output... The net impact of electricity consumption is itself an intuitive quantitative indicator, providing a clear chain of evidence for subsequent analysis steps, enhancing the transparency of the entire diagnostic process and the credibility of the results, and laying a solid foundation for accurate on-site verification.

[0051] S202. Perform power consumption pattern anomaly screening on the first abnormal user set to obtain a second abnormal user set.

[0052] In this embodiment, as Figure 4 As shown, the step of filtering the first abnormal user set for abnormal electricity consumption patterns to obtain the second abnormal user set includes: S401. Extract the baseline period daily load curve and the abnormal period daily load curve of each user in the first abnormal user set from the user load curve, and perform feature extraction on the two curves to obtain the baseline feature vector and abnormal feature vector of each user.

[0053] Specifically, feature extraction is performed on the two curves, including: (1) Calculate time series characteristics, including: 1) Mean: The average power value of all points on the curve, used to reflect the average level of electricity consumption.

[0054] 2) Standard Deviation (Std): The standard deviation of the curve power values ​​is used to measure the degree of electricity consumption fluctuation. The calculation formula is as follows:

[0055] in, This is the standard deviation of the load curve, i.e., the characteristic value to be calculated; This represents the total number of sampling points in the load curve (e.g., for a daily curve sampled every 15 minutes, N=96). Index of the number of sampling points in the load curve; The first load curve Power values ​​at each sampling point (unit: kW); This is the arithmetic mean of the power values ​​at all sampling points of the load curve.

[0056] 3) Maximum and minimum values: peak and trough power in the curve.

[0057] 4) Peak-Valley Difference: The difference between the maximum and minimum values, used to represent the variation in electricity consumption.

[0058] 5) Load Factor: The ratio of the mean to the maximum value, used to reflect load stability.

[0059] 6) Volatility (Fluctuation Rate): The ratio of standard deviation to mean, used to represent relative volatility.

[0060] 7) Time Period Characteristics: Divide the curve into peak periods (e.g., 8:00-12:00 and 18:00-22:00), flat periods, and valley periods, and calculate the average power percentage for each period. The calculation formula is as follows:

[0061]

[0062]

[0063] in, This represents the number of sampling points for the current time period (e.g., 16 points during peak hours from 8:00 to 12:00, assuming sampling every 15 minutes). This is the index for the number of sampling points in the current time period; For the current period Power values ​​at each sampling point; For the first time in the whole day Power values ​​at each sampling point; This represents the total number of sampling points for the entire day (e.g., a curve with 96 points corresponds to N=96). This represents the average power value of the sampling points during the current time period. This represents the average power value of all sampling points throughout the day.

[0064] 8) Slope Change: Calculate the absolute value of the average slope between adjacent points on the curve, used to capture the rate of load change. The calculation formula is as follows:

[0065] in, The first load curve Power values ​​at each sampling point; The first load curve Power values ​​at each sampling point; The sampling time interval (in minutes or hours) is used. For a curve sampled over 15 minutes, =0.25 hours, for curves sampled per hour, =1 hour; This represents the total number of sampling points in the load curve (e.g., for a daily curve sampled at 15 minutes, N=96).

[0066] (2) The temporal features are concatenated to obtain the feature vector.

[0067] S402. Input the baseline feature vector and abnormal feature vector of each user into the TCN model respectively, and output the baseline weighted feature vector and abnormal weighted feature vector of each user.

[0068] In this embodiment, the TCN model includes: (1) Multi-branch parallel convolution module, used to extract multi-dimensional features from feature vectors, obtain hourly short-term fluctuation features, daily medium-term fluctuation features and weekly long-term fluctuation features, and calculate multi-dimensional feature vectors.

[0069] Specifically, multidimensional feature extraction includes: (1) Set the dilation rate of the multi-branch parallel convolution module to control the receptive field size in order to capture patterns at different temporal granularities.

[0070] Branch 1 (d=1): The inflation coefficient is 1, and the convolution kernel slides with a stride of 1, focusing on capturing short-term fluctuations at the hourly level (such as load mutations within every minute or every 15 minutes).

[0071] Branch 2 (d=2): The expansion coefficient is 2, which expands the receptive field and captures daily mid-term patterns (such as the periodic changes of daily peaks and troughs).

[0072] Branch 3 (d=4): The expansion coefficient is 4, which further expands the receptive field and captures long-term weekly trends (such as the overall upward or downward trend of weekly electricity consumption).

[0073] (2) The output feature maps of the three branches are concatenated along the feature dimension to form a multidimensional feature vector. This multidimensional feature vector integrates short-term, medium-term and long-term fluctuation features, providing rich input for subsequent attention weighting.

[0074] In this embodiment, the formula for calculating the multidimensional feature vector is:

[0075] in, It is a multidimensional feature vector; It exhibits short-term fluctuation characteristics at the hourly level; This exhibits characteristics of daily-level medium-term fluctuations. It exhibits long-term fluctuation characteristics at the weekly level; The coefficient of thermal expansion is 1 / 3. Capture short-term fluctuation characteristics at the hourly level. Capture the characteristics of daily-level medium-term fluctuations. It captures long-term fluctuation characteristics at the weekly level.

[0076] This invention, by setting different expansion coefficients (e.g., d=1, d=2, d=4), simultaneously extracts hourly short-term fluctuations, daily medium-term patterns, and weekly long-term trend features. This enables the model to simultaneously and sensitively capture instantaneous anomalies (e.g., minute-level power drops caused by electricity theft), changes in daily habits (e.g., disappearance of peak hours), and long-term trend shifts (e.g., continuous decline in weekly electricity consumption), enhancing the detection sensitivity of hidden anomalies and avoiding the limitations of a single time scale. Furthermore, the parallel branch structure allows for simultaneous processing of multiple time scales without increasing network depth or the number of parameters, significantly reducing computational complexity and training time. This makes it suitable for real-time or near-real-time processing of large-scale transformer area data, improving the feasibility of engineering deployment. Multi-scale feature fusion allows the model to better adapt to different user types (e.g., residential, commercial / industrial) and scenarios (e.g., transformer areas with distributed photovoltaic power), reducing misjudgments caused by seasonal or random fluctuations and improving the stability of diagnostic results.

[0077] (2) Electricity consumption mode attention module, used to calculate feature weights based on multidimensional feature vectors.

[0078] The formula for calculating the feature weights is as follows:

[0079] in, It is a multidimensional feature vector; The higher the feature weight, the greater the influence of the input multidimensional feature vector on the judgment of whether it is an anomaly; The first learning parameter; This is the second learning parameter.

[0080] This invention generates feature weights through Softmax normalization, automatically assigning higher importance to key features such as peak electricity consumption periods and abnormal fluctuation ranges. This allows the model to ignore irrelevant or noisy features (such as stable nighttime loads) and concentrate resources on analyzing the most suspicious time-series segments, thereby improving the accuracy of identifying subtle pattern deviations (such as electricity theft). Simultaneously, the output of the attention weights is visualized as a "heatmap," intuitively showing the model's decision-making basis (such as which time periods contribute the most), helping maintenance personnel understand why a user is deemed abnormal, improving the transparency and credibility of diagnostic results, and facilitating on-site verification and location. Furthermore, the learning parameters of the weights are obtained through training data and can be dynamically adjusted to adapt to different transformer area characteristics (such as concentrated peak hours in urban areas and dispersed loads in rural areas), reducing the subjectivity of manual threshold setting and enhancing the method's generalization ability in diverse scenarios.

[0081] (3) Weighting module, used to multiply the multidimensional feature vector and feature weights element by element (i.e., to finely weight the multidimensional feature vector through feature weights) to obtain the weighted feature vector.

[0082] The formula for calculating the weighted feature vector is:

[0083] in, It is a multidimensional feature vector; For feature weights; These are weighted eigenvectors.

[0084] This invention employs a weighting module to finely weight multi-dimensional feature vectors, aiming to enable the TCN model to automatically focus on abnormal periods in the load curve (such as peak electricity consumption and abnormal fluctuation ranges) and amplify the contribution of features during these abnormal periods. By applying attention weights to multi-scale feature vectors through element-wise multiplication (Hadamard product), the contribution of key features is highlighted while suppressing interference from low-weight features (such as normal fluctuations), effectively reducing the false alarm rate and allowing subsequent similarity calculations to more accurately reflect real pattern changes. The weighted feature vectors more purely carry information related to anomalies, making cosine similarity comparisons (such as the baseline and abnormal period curves) more fundamentally distinguish between normal and abnormal behaviors (such as pattern breaks caused by electricity theft), reducing misjudgments caused by natural load fluctuations. Furthermore, as the output interface of the attention mechanism, this module is lightweight and efficient, seamlessly connecting feature extraction and similarity calculation steps, ensuring the smoothness of the entire TCN process and overall performance optimization.

[0085] S403. Calculate the cosine similarity of the weighted feature vector for each user based on the baseline weighted feature vector and the anomaly weighted feature vector; users whose weighted feature vector cosine similarity is less than the cosine similarity threshold are designated as the second set of anomaly users. The cosine similarity threshold is typically 0.7.

[0086] Specifically, the formula for calculating the weighted feature vector cosine similarity is as follows:

[0087] in, The weighted feature vector cosine similarity is used to measure the similarity of users' electricity consumption behavior patterns. This is an anomaly-weighted feature vector; The baseline weighted eigenvector.

[0088] Specifically, user electricity consumption behavior patterns include: (1) Time-series load pattern: including peak periods, off-peak periods, duration of electricity consumption, power fluctuation cycle, etc. in the user load curve. For example, typical residential users show a double-peak pattern in the morning and evening (corresponding to peaks for cooking, lighting, etc.), while industrial and commercial users may show a stable or single-peak pattern.

[0089] (2) Multi-scale fluctuation patterns: based on the hourly short-term pattern (such as power change per minute), the daily medium-term pattern (such as daily peak-valley difference), and the weekly long-term pattern (such as weekly electricity consumption trend) extracted by TCN multi-branch extraction. The three patterns together reflect the user's electricity consumption habits and potential anomalies.

[0090] (3) Abnormal behavior patterns: Specifically refers to deviations from established patterns caused by electricity theft, metering malfunctions, etc., including: 1) Electricity theft pattern: sudden changes in load curve shape (such as disappearance of electricity consumption at night, abnormal reduction in power during peak hours).

[0091] 2) Metering failure mode: The curve shifts downward or flattens out (e.g., the meter stops running, resulting in no fluctuation), but the timing shape may be preserved.

[0092] This invention, by analyzing the deep time-series patterns of load curves, can better detect hidden anomalies where "electricity consumption changes little, but the electricity usage pattern has fundamentally deviated." For example, in the case of a cunning electricity theft behavior—where users only steal electricity briefly during specific peak hours, resulting in a negligible decrease in their total daily electricity consumption, but a drastic change in the shape of the load curve (such as the disappearance of the evening peak)—this invention can accurately detect such anomalies where "shape changes but quantity remains the same" by extracting multi-scale features using the TCN model and calculating cosine similarity, significantly reducing the false negative rate. Furthermore, the weighted feature vector cosine similarity is a quantitative and intuitive indicator. Low similarity not only indicates anomalies, but the underlying feature differences (such as which periods show the greatest changes in electricity usage patterns) can be explained through attribution using tools like SHAP. This provides clear direction for on-site inspectors; for example, the report can explicitly state that "the user's anomaly is mainly manifested in the disappearance of the evening peak electricity usage pattern," thus guiding inspectors to focus on checking evening electrical equipment or meter wiring, greatly improving the efficiency and accuracy of the investigation. Meanwhile, by using weighted feature vector cosine similarity, the system can effectively distinguish between electricity theft and metering faults, providing decisive evidence for generating refined diagnostic conclusions such as "suspected electricity theft" or "suspected metering fault".

[0093] S203. Traverse the second abnormal user set and calculate the electricity consumption matching degree of the current abnormal user through global electricity consumption matching verification; delete users whose electricity consumption matching degree is greater than the matching degree threshold to obtain the abnormal user set; obtain the user-side abnormal type of the electricity user based on the abnormal user set and the second abnormal user set. The matching degree threshold is typically 0.5.

[0094] In this embodiment, the power consumption matching degree of the current abnormal user is calculated through global power consumption matching verification, including:

[0095] in, The matching degree of power consumption for the current abnormal users; It is the sum of the absolute values ​​of the total electricity consumption difference between the current abnormal users in the baseline period and the abnormal period. It is used to verify whether the abnormal users initially screened are sufficient to explain the overall electricity consumption change in the transformer area. It is an important basis for judging the completeness of the diagnostic results. This represents the actual change in electricity consumption for currently abnormal users.

[0096] Specifically, if the matching degree of abnormal user's electricity consumption is not greater than the matching degree threshold, then the abnormal user is sufficient to explain the overall electricity consumption change in the distribution area, and the result is reliable; if the matching degree of abnormal user's electricity consumption is greater than the matching degree threshold, there may be missed detections, and it is recommended to manually intervene to expand the screening scope.

[0097] In this embodiment, the user-side anomaly type of the electricity user is obtained based on the abnormal user set and the second abnormal user set, including: (1) If a user belongs to the abnormal user set and the user belongs to the second abnormal user set, then it is confirmed as the first user-side abnormal type (such as "suspected electricity theft" is upgraded to "high probability of electricity theft") and marked as a high confidence abnormality.

[0098] (2) If a user does not belong to the abnormal user set, but belongs to the second abnormal user set, then it is confirmed as the second user-side abnormal type, indicating that the abnormal type may be downgraded or marked as pending verification (such as changing from "suspected electricity theft" to "suspected metering failure", because metering failure may only affect the electricity reading without changing the electricity consumption mode).

[0099] (3) If a user belongs to the abnormal user set but does not belong to the second abnormal user set, it is confirmed as the third user-side abnormal type. The system adds the user as an abnormal and initially marks it as "hidden behavior abnormal" (such as small-scale electricity theft or early fault), prompting that manual key verification is required.

[0100] As some optional implementation methods of this embodiment, the judgment rule for user-side anomaly type can also be based on the net impact of user electricity consumption, specifically including: (1) If the net impact of user electricity consumption is less than or equal to the effect threshold, then the net impact of electricity consumption is significantly negative, indicating that user electricity consumption decreased significantly during the abnormal period. This is preliminarily classified as "abnormal reduction in electricity consumption," and possible reasons include: 1) Suspected electricity theft: If the net impact of a user's electricity consumption is very negative (e.g., net impact of electricity consumption < -0.5) and the user's historical electricity consumption is high, then electricity theft is suspected.

[0101] 2) Suspected metering malfunction: If the net impact of a user's electricity consumption is moderately negative (e.g., -0.5 ≤ net impact of electricity consumption < -0.2) and the user's electricity consumption pattern is stable, then the metering device is suspected to be malfunctioning (e.g., the meter stops running).

[0102] (2) If the net impact of electricity consumption is greater than the effect threshold, then the net impact of user electricity consumption is significantly positive, indicating that user electricity consumption increased significantly during the abnormal period. This is preliminarily classified as "abnormal increase in electricity consumption," and possible reasons include: 1) Suspected meter misoperation: If the net impact of the user's electricity consumption is very large (e.g., net impact of electricity consumption > 1.0), it is suspected that the metering element of the electricity meter is faulty, resulting in over-metering of electricity consumption.

[0103] 2) Suspicion of sudden load increase: If the net impact of a user's electricity consumption is moderate (e.g., 0.2 < net impact of electricity consumption ≤ 1.0), it is necessary to judge in conjunction with the user type (e.g., industrial and commercial users expanding production).

[0104] Specifically, the classification is based on a preliminary anomaly type mapping table (see Table 1), derived from historical fault data statistics, used to quickly map the net impact of electricity consumption. From common exception types. This is the effect threshold.

[0105] Table 1 Value range Preliminary anomaly type Possible reasons Subsequent verification requirements <-0.5 Suspected electricity theft Deliberate electricity theft TCN mode verification required -0.5≤< Suspected metering malfunction Meter stopped or error TCN mode verification required >1.0 The watch is suspected of flying away. Metering component failure On-site verification required <≤1.0 Suspicion of sudden increase in load Increased normal electricity consumption Business confirmation required This invention utilizes a causal forest model to accurately quantify the "net change" in electricity consumption for each user, effectively filtering out users with significantly abnormal electricity consumption. By analyzing load curve patterns (such as whether peak electricity consumption has disappeared) and performing global electricity consumption matching verification, it can keenly capture hidden anomalies where "electricity consumption changes are not significant, but behavioral patterns have fundamentally deviated." Multiple verification mechanisms are provided to enhance the credibility and operability of the results. Electricity consumption pattern verification eliminates electricity consumption anomalies caused by normal changes in lifestyle (such as prolonged absence), thereby reducing misjudgments. Global electricity consumption matching verification, as a "completeness check," ensures that the set of abnormal users found is sufficient to explain the overall electricity consumption changes in the distribution area. If the matching degree is poor, the system will prompt "potential missed detections," guiding manual intervention for verification. This provides clear confidence indicators and action guidelines for operation and maintenance decisions, avoiding decision-making risks caused by model limitations. Furthermore, by using a computationally efficient causal forest for rapid initial screening to narrow down the range of suspicious targets, and then performing more time-consuming TCN pattern analysis on a small number of suspicious users, this "coarse-to-fine" strategy significantly reduces the overall computational complexity while ensuring high accuracy. This enables the invention to meet the need for rapid and regular analysis of massive amounts of data from various distribution areas, and has the potential to be applied to actual production management systems.

[0106] In this embodiment, after obtaining the user-side anomaly type, the method further includes using a meta-learner to score the filtered electricity users, verifying the user-side anomaly type based on the scoring results, and taking the verified user-side anomaly type as the final user-side anomaly type.

[0107] Specifically, meta-learners (such as gradient boosting trees) are used to score the selected electricity users. This includes dynamically learning the optimal weight combination of each model in different scenarios (such as urban areas, rural areas, and areas with high photovoltaic penetration) through meta-learners, and calculating the final comprehensive anomaly score.

[0108] In this embodiment, the step of using a meta-learner to score the screened electricity users includes:

[0109] in, The user-side comprehensive anomaly score; The weights represent the individual treatment effects output by the causal forest model. The confidence level or importance of [the decision-making process] in the final decision; For the first Net impact on electricity consumption per user; The time-series pattern weights represent the similarity of the load curves output by the TCN model. The confidence level or importance of [the decision-making process] in the final decision; Cosine similarity of weighted feature vectors; The scenario feature weights represent the degree of direct influence of scenario features in the power grid field (such as transformer substation type, topology, season, etc.) on the final decision. For the abnormal user set. Specifically, causal effect weights. Time-series pattern weights and scene feature weights It is trained using historical data and can adaptively adjust according to the type of photovoltaic distribution area; for example, for photovoltaic distribution areas, it assigns... (TCN weight) Higher values ​​are used to better distinguish between photovoltaic power generation and electricity theft.

[0110] The meta-learner of this invention (such as a gradient boosting tree) acts as a "decision commander," capable of going beyond fixed weight combinations and dynamically learning and integrating individual causal effects from causal forest models. ) and temporal pattern similarity of the TCN model ( This invention utilizes multi-source evidence, including data from various sources, and analyzes numerous historical cases to learn which evidence is more reliable in different scenarios. Furthermore, given the complex and diverse nature of power business scenarios (e.g., urban areas, rural areas, and areas with distributed power generation), the introduction of a meta-learner gives this invention strong scenario adaptability. It can automatically adjust decision-making strategies based on input scenario information such as transformer topology features and user tags. This means the same diagnostic system can maintain high accuracy across vastly different business scenarios without manual parameter reconfiguration, greatly enhancing the method's universality and engineering deployment potential, and meeting the needs of large-scale, standardized applications in power grid companies. In addition, the meta-learner outputs a comprehensive anomaly score (…). Q This provides on-site maintenance personnel with an intuitive and quantifiable priority ranking; the user with the highest score has their abnormal behavior strongly verified by both causal effect and pattern deviation, making them the optimal target for on-site verification; in this way, the traditional investigation mode has been changed, enabling limited maintenance resources to be accurately directed to the most suspicious target, significantly improving the efficiency and return on investment of line loss management, and providing a decisive basis for achieving closed-loop management from "precise diagnosis" to "precise management".

[0111] S104. If the abnormal line loss type is a power supply side abnormality, calculate the power supply multiple based on the daily power supply of the transformer area, and attribute the fault to the power supply multiple to obtain the power supply side abnormality type.

[0112] In this embodiment, the step of calculating the power supply multiple based on the daily power supply of the transformer area includes:

[0113] in, It is a multiple of the power supply. This represents the daily power supply to the transformer substation during abnormal periods. This represents the daily power supply of the transformer substation during the baseline period.

[0114] This invention transforms complex power supply anomalies into intuitive numerical judgments by calculating power supply multiples. This significantly shortens the response time from anomaly detection to dispatch for verification, providing crucial evidence for rapidly restoring normal operation of distribution areas. The power supply multiple is an intuitive and easily understood physical indicator within the power industry. Its calculation process is transparent, and the meaning of the result is clear (i.e., the proportion of power supply change during the anomaly period relative to the baseline period). This interpretability significantly enhances the credibility of the diagnostic results. Furthermore, as a quantitative and critical feature input, the power supply multiple provides an ideal object for SHAP attribution analysis. The SHAP model can accurately calculate the contribution of the power supply multiple feature to the final "power supply anomaly" diagnostic conclusion, thus quantitatively demonstrating the importance of this evidence to users. This forms a complete logical closed loop from initial judgment (multiple calculation) to final interpretation (SHAP attribution).

[0115] In this embodiment, the fault attribution based on the power supply multiple to obtain the power supply side anomaly type includes: if the power supply multiple is approximately equal to a first power supply threshold, the power supply side anomaly type is an open circuit on the secondary side of the current transformer (TA) or an incorrect multiplier configuration; if the power supply multiple is approximately equal to a second power supply threshold, the power supply side anomaly type is a short circuit in the secondary circuit of the current transformer (TA) or an incorrect multiplier entry; if the power supply multiple is approximately equal to a third power supply threshold, the power supply side anomaly type is a stopped test table or a communication interruption. Wherein, the first power supply threshold is 0.5, the second power supply threshold is 2.0, and the third power supply threshold is 0.

[0116] This invention transforms complex power supply anomaly problems into intuitive numerical judgments by quantitatively analyzing the change ratio of power supply during abnormal periods and baseline periods. The specific advantages are reflected in the following aspects: (1) Efficient and accurate fault location; the power supply multiple is a quantitative indicator that directly reflects the degree of power supply anomaly. Through simple threshold comparison, maintenance personnel can initially lock the fault type within minutes without relying on complex models or a large amount of manual investigation. In this way, the anomaly type can be quickly diagnosed. Traditional methods are easily affected by fluctuations in user-side electricity consumption, while the power supply multiple focuses on the power supply data itself, effectively isolating user-side influences and reducing the misjudgment rate. (2) Enhanced interpretability of diagnostic results; the power supply multiple has a clear physical correlation with common metering faults in the power system (such as TA multiple errors and meter stoppages). Therefore, the multiple result can be combined with SHAP value attribution and a visual report can be generated, enabling front-line personnel to clearly understand the diagnostic basis and improve the credibility of the results. (3) Robustness to adapt to complex scenarios: The power supply multiplier adopts a relative value (abnormal period / base period) rather than an absolute value, which can effectively offset the normal power supply changes caused by seasonal power fluctuations or distributed power supply access, and improve the anti-interference capability. Typical fault scenarios (such as TA fault, multiplier configuration error, communication interruption, etc.) are covered by preset thresholds, and the thresholds can be dynamically optimized according to historical data to avoid the rigidity of a single rule and to be compatible with multiple types of faults.

[0117] S105, such as Figure 5 As shown, SHAP is used to interpret the user-side anomaly type or the power supply-side anomaly type respectively, thereby generating a line loss anomaly diagnosis report, including: S501. Using the user-side anomaly type or power supply-side anomaly type as input features, calculate based on the input features. The input features and This constitutes anomaly analysis combinations.

[0118] Specifically, the The calculation formula is as follows:

[0119] in, for ; A subset of features represents a subset of the entire feature set. Features that exclude the current contribution to be calculated Then, an arbitrary non-empty subset is formed; For the complete set of features; As a characteristic; The total number of features; Total number of features factorial, that is, multiplying by 1 to The product of these factors is used as the normalized denominator in the formula to ensure that the sum of the weights of all possible feature subsets is 1. For feature subset factorial; |S| For feature subset S The number of features contained therein; Features The alliance represents the subset of features in the original set. S Add the features to be evaluated based on the current features. i The new set of features formed thereafter; For the model to have features i The prediction at that time indicates when the model uses a subset of features. The predicted value obtained when used as input; For the model without features i The prediction at that time indicates when the model uses only a subset of features. S (excluding features) i The predicted value obtained when ) is used as input.

[0120] S502. Construct a rule mapping library and extract the business scenarios corresponding to the anomaly analysis combinations from the rule mapping library.

[0121] Specifically, a rule base based on historical cases and expert knowledge is pre-defined to map SHAP value combinations to business language. For example: Rule 1: If The SHAP value is > 0.2 and If the SHAP value is > 0.15, it is mapped to "sudden drop in battery power and mode deviation jointly drive the anomaly determination".

[0122] Rule 2: If the SHAP value of the historical electricity consumption level is negative, it is mapped to "the user's historical electricity consumption is high, but this anomaly is not caused by this".

[0123] S503. Generate a line loss anomaly diagnosis report based on the business scenario.

[0124] Specifically, the abnormal line loss diagnosis report includes: (1) Anomaly summary: User (ID XXX) has been identified as "suspected of electricity theft" with a high confidence level.

[0125] (2) Feature contribution analysis: Use SHAP summary plots (such as bar charts) to display the contribution of each feature ( +0.25, (e.g., +0.20), visually displaying key evidence.

[0126] (3) Business Interpretation: Based on the output of S502, a natural language explanation is generated: "The user's electricity consumption has decreased by 65% ​​and the electricity consumption pattern is seriously deviated, strongly indicating theft of electricity; high historical electricity consumption is a normal attribute and does not affect the abnormal judgment." (4) Verification recommendations: It is suggested that the on-site inspection focus on whether the user's meter box seal and wiring are abnormal, and that a surprise inspection be conducted at night.

[0127] This invention transforms complex model decisions into transparent and actionable business insights through the SHAP value interpretation framework, thereby significantly improving the credibility of diagnostic results and the efficiency of on-site verification, and realizing a closed loop from accurate diagnosis to efficient governance.

[0128] In this embodiment, before generating a line loss anomaly diagnostic report, power grid physical constraints (such as the power balance constraint |ΔP|≤P_threshold) can be introduced. If the constraint is satisfied (|ΔP| ≤ P_threshold), the power data of the current distribution area conforms to physical laws as a whole, the data quality is reliable, and a reliable line loss anomaly diagnostic report can be generated. If the constraint is not satisfied (|ΔP|> P_threshold), the overall power data of the distribution area is significantly unbalanced, which may be due to data acquisition errors, communication interruptions, or undetected major faults. In this case, the input data itself is unreliable, and a reliable line loss anomaly diagnostic report cannot be generated.

[0129] Specifically, power grid physical constraints can be used as constraints when calculating characteristic contributions to ensure that the interpretation results conform to the basic principles of the power system (i.e., satisfy the power grid physical constraints). Among these, power balance constraints... ,in The daily power supply of the transformer substation during abnormal periods, i.e. The power supply measured in the periodic transformer area assessment form; This refers to the daily electricity consumption of the transformer substation during abnormal periods. The total electricity consumption of all users during the period; E_loss_Theoretical This is the theoretical line loss value calculated based on historical data of the transformer area and line parameters.

[0130] In some optional implementations of this embodiment, the line loss anomaly diagnostic report generated in S105 is pushed to relevant business systems (such as marketing business systems and distribution automation systems) or mobile inspection apps. On-site maintenance personnel conduct targeted on-site verification and handling based on the precise location information (such as abnormal user addresses and suspected fault types) and cause explanations (such as SHAP diagrams) provided in the report. The processing results can be fed back to the system to optimize the diagnostic model, thereby achieving intelligent and precise closed-loop management of line loss anomaly control in the transformer area.

[0131] According to embodiments of the present invention, the present invention has the following advantages compared with the prior art: (1) Accurate identification of hidden anomalies: By quantifying the individual processing effect through causal forests, small-scale power drops or users with divergent patterns (such as electricity theft or early metering failures) that are missed by traditional methods are effectively captured, improving recall and precision. Through a hierarchical diagnostic architecture (first determining the direction of anomalies on the power supply / consumption side, and then conducting in-depth analysis) and individual effect assessment using causal forests, anomalies on the power supply side, single-point anomalies on the user side, concurrent anomalies among multiple users, and complex anomalies are effectively distinguished. By independently quantifying the impact on individual users, more accurate isolation and location of fault sources are achieved, providing a basis for precise governance in complex scenarios.

[0132] (2) Enhance the interpretability of diagnosis: Integrate the SHAP value attribution framework to visualize the contribution of key features (such as power change rate and load similarity) to diagnostic decisions, so that maintenance personnel can "understand the reason" and improve the credibility of results and verification efficiency.

[0133] (3) Improve computational efficiency and practicality: A layered processing strategy is adopted (initial fluctuation judgment followed by in-depth analysis) to avoid unnecessary complex calculations; at the same time, the parallelization characteristics of TCN are superior to those of traditional RNN, supporting real-time processing of large-scale data and strong engineering deployment. Through the step-by-step collaboration of causal forest and TCN, while ensuring high accuracy, the computational complexity is significantly reduced, enabling the present invention to meet the needs of rapid analysis of large-scale transformer area data, and has the potential to be applied to production management systems or edge computing devices, promoting the practical and intelligent upgrading of line loss anomaly diagnosis.

[0134] (4) Optimize multi-scenario adaptability: By using volatility threshold and multi-dimensional verification (such as global power matching verification), it can effectively distinguish between power supply side and user side anomalies, and can prompt compound anomalies, reduce misjudgments, and adapt to various transformer substation scenarios such as urban areas, suburbs, and rural areas.

[0135] (5) Support closed-loop management: The diagnostic results can be directly connected to business systems (such as marketing systems and mobile inspection apps) to guide accurate on-site verification, and the model can be optimized through feedback to achieve intelligent closed-loop management of line loss.

[0136] (6) This invention innovatively integrates multi-source data such as power grid topology features, user behavior tags, and time-series fluctuation indicators. By constructing an enhanced input set through feature engineering, it not only improves the input quality of causal forest and TCN models, but also reduces misjudgments by utilizing data complementarity, thereby achieving higher-precision anomaly tracing in complex environments. In this way, the method strengthens its innovation at the data utilization level, exceeding the traditional single power analysis mode.

[0137] (7) A meta-learning mechanism is introduced to dynamically adjust the diagnostic threshold, enabling it to automatically optimize based on the type of transformer area, seasonal factors, or historical data. This adaptive capability improves the robustness and generalizability of the method, reduces the need for manual parameter tuning, and reflects the innovation of intelligent self-learning.

[0138] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the present invention is not limited to the described order of actions, because according to the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to the present invention.

[0139] It should be understood that the various processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein. The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A method for diagnosing line loss anomalies based on power fluctuation analysis, characterized in that, include: Obtain electricity users and electricity consumption data; The electricity consumption data includes: daily electricity consumption of users, user load curves, user tags, user time-series fluctuation indicators, daily power supply of distribution areas, daily electricity consumption of distribution areas, and topological characteristics of distribution areas. The power supply change rate and power consumption change rate are calculated based on the fluctuation of the daily power supply and power consumption of the transformer area, respectively; then, the line loss anomaly type is determined based on the power supply change rate and power consumption change rate, wherein the line loss anomaly type includes user-side anomaly and power supply-side anomaly. If the line loss anomaly type is user-side anomaly, then the electricity users are screened based on the user's daily electricity consumption, user load curve, user tag, user time-series fluctuation index and transformer area topology characteristics, and the user-side anomaly type is obtained based on the screened electricity users. If the abnormal line loss type is a power supply side abnormality, then calculate the power supply multiple based on the daily power supply of the transformer area, and attribute the fault to the cause based on the power supply multiple to obtain the power supply side abnormality type. The user-side anomaly type or the power supply-side anomaly type is interpreted using SHAP, thereby generating a line loss anomaly diagnosis report.

2. The method according to claim 1, characterized in that, The method of determining the type of abnormal line loss based on the power supply change rate and the power consumption change rate includes: If the rate of change in power supply is greater than the abnormal threshold and the rate of change in power consumption is not greater than the abnormal threshold, then the line loss anomaly type is power supply side anomaly. If the rate of change in power supply is not greater than the abnormal threshold and the rate of change in power consumption is greater than the abnormal threshold, then the line loss anomaly type is user-side anomaly.

3. The method according to claim 1, characterized in that, The process involves filtering electricity users based on their daily electricity consumption, load curves, user tags, time-series fluctuation indicators, and transformer area topology characteristics. Based on the filtered electricity users, user-side anomaly types are identified, including: A causal forest model is constructed, and the splitting rewards of transformer area topology features, user tags and user time-series fluctuation indicators are calculated by the mean square error splitting method. The causal forest model is trained based on the three splitting rewards. Then, the daily electricity consumption of users is input into the trained causal forest model to screen for electricity anomalies and obtain the first abnormal user set. The first abnormal user set is filtered for abnormal electricity consumption patterns to obtain the second abnormal user set; Traverse the second abnormal user set and calculate the power consumption matching degree of the current abnormal user through global power consumption matching verification; delete users whose power consumption matching degree is greater than the matching degree threshold to obtain the abnormal user set; obtain the user-side abnormal type of the power consumption user based on the abnormal user set and the second abnormal user set.

4. The method according to claim 3, characterized in that, The step involves inputting users' daily electricity consumption into a trained causal forest model for electricity anomaly screening to obtain a first set of anomalous users, including: Iterate through the daily electricity consumption of each user, input the daily electricity consumption of each user into the trained causal forest model, and output the net impact of each user's electricity consumption. Users whose net impact on electricity consumption is greater than the effect threshold are designated as the first set of abnormal users.

5. The method according to claim 3, characterized in that, The step of filtering the first abnormal user set for abnormal electricity consumption patterns to obtain a second abnormal user set includes: Extract the baseline period daily load curve and the abnormal period daily load curve of each user in the first abnormal user set from the user load curve, and perform feature extraction on the two curves to obtain the baseline feature vector and abnormal feature vector of each user. The baseline feature vector and anomaly feature vector of each user are input into the TCN model, and the baseline weighted feature vector and anomaly weighted feature vector of each user are output. Calculate the cosine similarity of each user's weighted feature vector based on the baseline weighted feature vector and the abnormal weighted feature vector; users whose weighted feature vector cosine similarity is less than the cosine similarity threshold are identified as the second abnormal user set; The formula for calculating the weighted feature vector cosine similarity is as follows: in, Cosine similarity of weighted feature vectors; This is an anomaly-weighted feature vector; The baseline weighted eigenvector.

6. The method according to claim 5, characterized in that, The TCN model includes: The multi-branch parallel convolution module is used to extract multi-dimensional features from the feature vectors, obtain hourly short-term fluctuation features, daily medium-term fluctuation features, and weekly long-term fluctuation features, and calculate multi-dimensional feature vectors. The power consumption mode attention module is used to calculate feature weights based on multi-dimensional feature vectors; The weighting module is used to multiply the multidimensional feature vector and feature weights element by element to obtain a weighted feature vector. The formula for calculating the multidimensional feature vector is as follows: The formula for calculating the feature weights is as follows: The formula for calculating the weighted feature vector is: in, It is a multidimensional feature vector; It exhibits short-term fluctuation characteristics at the hourly level; This exhibits characteristics of daily-level medium-term fluctuations. It exhibits long-term fluctuation characteristics at the weekly level; For feature weights; The first learning parameter; This is the second learning parameter; These are weighted eigenvectors.

7. The method according to claim 1, characterized in that, After obtaining the user-side anomaly type, the process also includes using a meta-learner to score the filtered electricity users, verifying the user-side anomaly type based on the scoring results, and using the verified user-side anomaly type as the final user-side anomaly type. The process of using a meta-learner to score the selected electricity users includes: in, The user-side comprehensive anomaly score; Weights for causal effects; For the first Net impact on electricity consumption per user; For time-series pattern weights; Cosine similarity of weighted feature vectors; As scene feature weights; This is a set of abnormal users.

8. The method according to claim 1, characterized in that, The calculation of the power supply multiple based on the daily power supply of the transformer area includes: in, It is a multiple of the power supply. This represents the daily power supply to the transformer substation during abnormal periods. This represents the daily power supply of the transformer substation during the baseline period.

9. The method according to claim 1, characterized in that, The fault attribution based on the power supply multiple, to obtain the power supply side anomaly type, includes: If the power supply multiple is approximately equal to the first power supply threshold, the abnormality type on the power supply side is an open circuit on the secondary side of the current transformer or an incorrect multiplier configuration. If the power supply multiple is approximately equal to the second power supply threshold, the abnormality type on the power supply side is a short circuit in the secondary circuit of the current transformer or an error in the multiple entry. If the power supply multiple is approximately equal to the third power supply threshold, then the abnormality type on the power supply side is either the assessment table stopping or communication interruption.

10. The method according to claim 1, characterized in that, The step of interpreting the user-side anomaly type or the power supply-side anomaly type using SHAP to generate a line loss anomaly diagnosis report includes: The user-side anomaly type or power supply-side anomaly type is used as input features to calculate... The input features and This constitutes anomaly analysis combinations; Construct a rule mapping library, and extract the business scenarios corresponding to the anomaly analysis combinations from the rule mapping library; Generate a line loss anomaly diagnosis report based on the described business scenario; The The calculation formula is as follows: in, for ; A subset of features; For the complete set of features; As a characteristic; The total number of features; Total number of features factorial; For feature subset factorial; Features The alliance; For the model to have features i Predictions at that time; For the model without features i Predictions at that time.

Citation Information

Cited By

  • Intelligent line loss diagnosis method and system based on multi-source data fusion analysis

    CN122150738A

  • A method and system for intelligent diagnosis of line loss based on multi-source data fusion analysis

    CN122150738B