Power grid line loss anomaly diagnosis method based on knowledge graph and causal reasoning

By constructing a power grid knowledge graph and a causal reasoning model, the problem of the lack of causal mechanisms in the diagnosis of abnormal power grid line losses was solved, enabling efficient and accurate location of abnormal line losses and root cause analysis, and improving the transparency of power grid operation and maintenance and the efficiency of auxiliary decision-making.

CN120873503BActive Publication Date: 2025-12-30STATE GRID GANSU ELECTRIC POWER RESEARCH INSTITUTE
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511389933.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-26
Publication Date
2025-12-30
Estimated Expiration
2045-09-26

AI Technical Summary

Technical Problem

Existing methods for diagnosing abnormal power grid line losses lack the ability to model causal mechanisms, making it difficult to effectively locate root causes. They also suffer from low efficiency in knowledge utilization and updating, and the diagnostic results lack interpretability, failing to meet the real-time, flexibility, and accuracy requirements of complex power grid environments.

Method used

A power grid knowledge graph is constructed, and combined with a causal reasoning model, historical power grid operation data is collected, standardized preprocessing is performed, and a power grid knowledge graph and causal graph are established. Causal discovery algorithms are used to mine causal relationships, calculate line loss anomaly scores, and perform causal reasoning to locate the root cause of line loss anomalies.

Benefits of technology

It improves the interpretability and accuracy of diagnostics, supports continuous knowledge updates, provides intuitive information to assist decision-making, reduces false alarm and missed alarm rates, and enhances the transparency and efficiency of power grid operation and maintenance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120873503B_ABST
    Figure CN120873503B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of smart grids, in particular to a power grid line loss anomaly diagnosis method based on a knowledge graph and causal reasoning, which comprises the following steps: collecting historical operation data of a power grid, obtaining a standardized data vector after standardizing and preprocessing the historical operation data, and composing a historical operation data set; constructing a power grid knowledge graph based on the historical operation data set, determining nodes and edges of the power grid knowledge graph, and representing each relationship as a triple based on the nodes and edges; performing causal relationship mining on the power grid knowledge graph by using a causal discovery algorithm, determining a causal direction in combination with prior knowledge of a power system, and obtaining a power grid causal graph; when monitoring that a line loss anomaly score is greater than a dynamic anomaly diagnosis threshold, performing causal reasoning based on the power grid causal graph, calculating causal contribution degrees of each potential influencing factor to the line loss anomaly, and thereby locating a root cause of the line loss anomaly. The method provides intuitive and scientific auxiliary decision-making information for power grid operation and maintenance personnel.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of this application relate to the field of smart grid technology, and in particular to a method for diagnosing abnormal power grid line losses based on knowledge graphs and causal reasoning. Background Technology

[0002] With the continuous growth of electricity demand, the scale and complexity of power grid operations have significantly increased, and line losses generated during power transmission have attracted increasing attention. Line losses not only directly affect the operating efficiency and economic benefits of the power grid, but also reflect potential faults in electrical equipment. Therefore, accurate detection and anomaly diagnosis of line losses are of great significance.

[0003] Currently, the monitoring and diagnosis of power grid line losses largely rely on empirical rule-based statistical analysis methods or big data-based machine learning prediction methods. While empirical rule-based statistical analysis methods are simple to implement, they struggle to cope with the diversity and dynamism of power grid operating environments, potentially leading to missed detections or misjudgments. Although big data-based machine learning prediction methods can handle large-scale data, they only detect anomalies at the correlation level, lacking the ability to reveal underlying causal relationships. This results in predictive results that lack interpretability, leaving maintenance personnel unable to clearly identify the root cause.

[0004] In recent years, some research teams have applied expert systems and knowledge base-based diagnostic methods to line loss diagnosis. However, these methods are difficult to update rules and have limited reasoning capabilities, making it difficult to meet the demands for real-time performance, flexibility, and accuracy in complex power grid environments.

[0005] In summary, current proposed methods for diagnosing power grid line loss anomalies have three main shortcomings. First, they lack the ability to model the causal mechanisms behind line loss anomalies, making effective root cause identification difficult. Second, their knowledge utilization and updating efficiency is low, failing to dynamically adapt to changes in power grid equipment and operating conditions. Third, the diagnostic results lack interpretability, failing to provide clear decision-making basis for power grid dispatching and maintenance. Summary of the Invention

[0006] To address the aforementioned technical issues, embodiments of this application propose a power grid line loss anomaly diagnosis method based on knowledge graphs and causal reasoning. This method constructs a power grid knowledge graph, structurally representing equipment relationships, operating states, and potential fault modes. Then, based on a causal reasoning model and combined with real-time monitoring data, it performs source tracing analysis on abnormal line losses, thereby uncovering potential causal links. Finally, it outputs the anomaly source and its causal explanation, providing power grid operation and maintenance personnel with intuitive auxiliary decision-making information, improving the efficiency and scientific rigor of auxiliary decision-making.

[0007] To achieve the above objectives, embodiments of this application propose a power grid line loss anomaly diagnosis method based on knowledge graphs and causal reasoning. The method includes: collecting historical operating data of the power grid, including input power, output power, three-phase voltage, three-phase current, load power factor, and environmental parameters for each line; performing standardized preprocessing on the historical operating data to obtain standardized data vectors, which are then used to form a historical operating dataset; constructing a power grid knowledge graph based on the historical operating dataset, using distribution transformers, lines, switches, and loads as nodes in the power grid knowledge graph; establishing edges in the power grid knowledge graph based on power topology relationships, thereby representing each relationship as a triple based on nodes and edges; using a causal discovery algorithm to mine causal relationships in the power grid knowledge graph, combining prior knowledge of the power system to determine the causal direction, and obtaining a power grid causal graph; calculating the current line loss anomaly score, determining whether the current line loss anomaly score is greater than the current dynamic anomaly diagnosis threshold; if the current line loss anomaly score is greater than the current dynamic anomaly diagnosis threshold, then performing causal reasoning based on the power grid causal graph, calculating the causal contribution of each potential influencing factor to the line loss anomaly, and locating the root cause of the line loss anomaly based on the causal contribution of each potential influencing factor to the line loss anomaly.

[0008] To achieve the above objectives, embodiments of this application also propose a power grid line loss anomaly diagnosis system based on knowledge graphs and causal reasoning. The system includes: a historical data acquisition and preprocessing module, used to acquire historical operating data of the power grid, including input power, output power, three-phase voltage, three-phase current, load power factor, and environmental parameters of each line; after standardizing and preprocessing the historical operating data, a standardized data vector is obtained, forming a historical operating dataset; and a power grid knowledge graph construction module, used to construct a power grid knowledge graph based on the historical operating dataset, using distribution transformers, lines, switches, and loads as nodes in the power grid knowledge graph, and establishing a knowledge graph based on power topology relationships. The system comprises: an edge graph of the power grid knowledge graph, which represents each relationship as a triple based on nodes and edges; a causal relationship mining module, which uses a causal discovery algorithm to mine causal relationships in the power grid knowledge graph, and combines prior knowledge of the power system to determine the causal direction, thus obtaining a power grid causal graph; a calculation module, which calculates the current line loss anomaly score and the current dynamic anomaly diagnosis threshold; and a location module, which, when the current line loss anomaly score is greater than the current dynamic anomaly diagnosis threshold, performs causal reasoning based on the power grid causal graph, calculates the causal contribution of each potential influencing factor to the line loss anomaly, and locates the root cause of the line loss anomaly based on the causal contribution of each potential influencing factor.

[0009] To achieve the above objectives, embodiments of this application also propose an electronic device, including a processor and a memory, wherein the memory stores instructions executable by the processor, and the processor is configured to execute the instructions such that the electronic device can implement the above-described method for diagnosing abnormal power grid line losses based on knowledge graphs and causal reasoning.

[0010] To achieve the above objectives, embodiments of this application also propose a computer-readable storage medium storing a computer program that, when executed by a processor, enables a power grid line loss anomaly diagnosis method based on knowledge graphs and causal reasoning as described above.

[0011] Optionally, historical operating data of the power grid may be collected, including:

[0012] Historical power grid operation data is collected based on a preset time granularity. Historical power grid operating data collected at all times includes input power. Output power Three-phase voltage Three-phase current Load power factor and including temperature and humidity Environmental parameters, including;

[0013] After standardizing and preprocessing the historical operational data, a standardized data vector is obtained, including:

[0014] Align the timestamps of historical operational data collected at the same time but from different sources;

[0015] For missing data points, linear interpolation or moving average methods can be used for interpolation;

[0016] Based on 3 The principle is to remove outliers, that is, delete 3. Values ​​outside the specified range; historical operating data follows a normal distribution. This represents the standard deviation of historical operating data of the power grid;

[0017] The historical operational data that has been aligned in time, interpolated, and had outlier removed is normalized to obtain a standardized data vector. .

[0018] Optionally, a power grid knowledge graph is constructed based on historical operational datasets, including:

[0019] The equipment in the power grid is extracted, and basic electrical components, including distribution transformers, lines, switches, and loads, are used as nodes in the power grid knowledge graph.

[0020] Based on the power topology, edges of a power grid knowledge graph, including connections, power supply, and dependencies, are established to represent the physical connections and logical dependencies between basic electrical components.

[0021] Based on historical operational datasets, attributes are added to each node of the power grid knowledge graph, including rated current, geographical location, and operation and maintenance status.

[0022] Each relation is represented as a triple based on nodes and edges, and a power grid knowledge graph is formed based on all triples. , , For a set of nodes, Let be the set of edges. It is a collection of attributes.

[0023] Optionally, a causal discovery algorithm is used to mine causal relationships in the power grid knowledge graph, and the causal direction is determined by combining prior knowledge of the power system to obtain a power grid causal graph, including:

[0024] For power grid knowledge graph Define a set of variables , , Represents the three-phase voltage variable. Represents the three-phase current variable. Represents the load factor variable. This represents the variable of temperature rise in the conductor. Represents the power loss variable. Represents the line loss rate variable;

[0025] Based on power grid knowledge graph and variable set Initialize a completely undirected graph In a completely undirected graph In this context, all variables are connected in pairs;

[0026] Iterate through all variable pairs, for each variable pair Using causal discovery algorithms, we can test under different conditions. and Are they independent, and under any circumstances? and If all elements are independent, then delete the completely undirected graph. In and Otherwise, preserve the completely undirected graph. In and The connection between them; where, , , and Representing the sets of variables respectively The first in The first variable and the second One variable;

[0027] After traversing all the variable pairs, a sparse undirected graph is obtained. ;

[0028] Based on prior knowledge of power systems, determine sparse undirected graphs. By analyzing the causal directions in the graph, a directed acyclic graph (DAG) is obtained as the final causal graph of the power grid. .

[0029] Optionally, the current line loss anomaly score is calculated using the following formula:

[0030] ;

[0031] ;

[0032] ;

[0033] in, express The abnormal score of line loss at any given time. , , For the preset dimension weights, express Actual line loss rate at any given time. express Theoretical line loss rate at time t. express Physical constraint residuals at time step Indicates power loss. express The total harmonic distortion of voltage at time t. Indicates the effective value of the fundamental voltage. Indicates the first The effective value of the harmonic voltage of the first harmonic;

[0034] The current dynamic anomaly diagnosis threshold is calculated using the following formula:

[0035] ;

[0036] ;

[0037] ;

[0038] in, express Dynamic anomaly diagnosis threshold at any given time. This represents the initial dynamic anomaly diagnosis threshold. and The preset working condition weights, express Load rate at any given time express Environmental deviation at any given time Indicates the initial temperature. This indicates the initial humidity.

[0039] Optionally, causal reasoning is performed based on the power grid causal diagram to calculate the causal contribution of each potential influencing factor to the abnormal line loss. The root cause of the abnormal line loss is then located based on the causal contribution of each potential influencing factor, including:

[0040] In the power grid cause-effect diagram, all controllable causal events are identified as potential influencing factors, abnormal line loss is identified as an outcome event, and all potential confounding factors are listed.

[0041] The intervention causal effect of each potential influencing factor on the outcome event is calculated using the following formula, which is taken as the causal contribution of each potential influencing factor to the abnormal line loss:

[0042] ;

[0043] in, Indicates the first The first controllable cause event, i.e., the first... There are [number] potential influencing factors, and the total number of potential influencing factors is [number]. , It is an integer greater than 1. , This indicates a result event, namely, abnormal line loss. Indicates the first One potential confounding factor, This represents the total number of potential confounding factors. It is an integer greater than 1. express The probability of occurrence Indicates that in a given and Under the premise The probability of occurrence express Interference, express right The intervention causal effect, i.e. right causal contribution;

[0044] The causal contribution of each potential influencing factor to the abnormal line loss was ranked from largest to smallest, and the potential influencing factor with the largest causal contribution was identified as the root cause of the abnormal line loss.

[0045] Alternatively, rank the causal contributions that are ranked highest. Each potential influencing factor is identified as a candidate cause of abnormal line loss, and the root cause probability of each candidate cause is given according to the magnitude of its causal contribution.

[0046] Optionally, after identifying the root cause of the abnormal line loss, the following may also be included:

[0047] A diagnostic report is automatically generated and displayed graphically. The report includes: alarm time, actual line loss rate, relevant electrical quantities, and causal link description.

[0048] Based on the diagnostic report, maintenance recommendations are retrieved from the power grid knowledge graph, and a maintenance recommendation report is generated.

[0049] The present application proposes a method for diagnosing abnormal power grid line losses based on knowledge graphs and causal reasoning, which has at least the following beneficial effects.

[0050] First, it offers strong interpretability. Based on knowledge graphs and causal reasoning mechanisms, this application can clearly identify the causal links that lead to abnormal line losses, enabling maintenance personnel to clearly understand the logical basis of the diagnostic results and make more targeted maintenance. This overcomes the shortcomings of traditional black-box models that only provide detection results without explaining the causes, making power maintenance more transparent and operable.

[0051] Second, it effectively improves diagnostic accuracy. By combining structured knowledge graphs and causal reasoning mechanisms, this application can more accurately depict the intrinsic relationships between various devices and operating states in the power system. In practical applications, even if there are certain degrees of missing or noisy data, the system can rely on the established knowledge graph to complete and correct it, thereby effectively reducing the false alarm rate and the missed alarm rate.

[0052] Third, it supports the continuous updating and evolution of knowledge. This application collects historical operation data of the power grid based on a preset time granularity, enabling the power grid knowledge graph to be continuously expanded, corrected, and evolved according to the updates of power grid equipment and changes in the operating environment. Through automated data collection and knowledge extraction, new operation and maintenance experience and operating modes are added in a timely manner, thereby ensuring that the diagnostic methods remain accurate and up-to-date in the long term.

[0053] Fourth, it provides power grid operation and maintenance personnel with intuitive and scientific auxiliary decision-making information. This application can visualize the root causes of anomalies and their causal paths, making the diagnostic results intuitive, reducing the understanding cost for personnel, and enabling diagnostic information to be directly transformed into operation and maintenance action plans, effectively improving the efficiency of auxiliary decision-making. Attached Figure Description

[0054] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies of this application will be briefly introduced below. Obviously, the following drawings are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. The drawings described herein are only used to explain this application and are not intended to limit this application.

[0055] Figure 1 This is a flowchart of a power grid line loss anomaly diagnosis method based on knowledge graph and causal reasoning provided in one embodiment of this application;

[0056] Figure 2 This is a schematic diagram of the power grid knowledge graph construction process provided in one embodiment of this application;

[0057] Figure 3 This is an abstract schematic diagram of a causal relationship provided in one embodiment of this application;

[0058] Figure 4 This is a schematic diagram of an abnormality diagnosis and root cause localization process provided in one embodiment of this application;

[0059] Figure 5 This is a comparison chart of experimental results provided in one embodiment of this application;

[0060] Figure 6 This is a schematic diagram of the diagnostic results of a typical case provided in one embodiment of this application;

[0061] Figure 7 This is a schematic diagram of the structure of a power grid line loss anomaly diagnosis system based on knowledge graph and causal reasoning provided in another embodiment of this application;

[0062] Figure 8 This is a schematic diagram of the structure of an electronic device provided in another embodiment of this application. Detailed Implementation

[0063] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the various embodiments of this application will be described in detail below with reference to the accompanying drawings. Those skilled in the art will understand that many technical details have been presented in the embodiments of this application to facilitate better understanding. However, the technical solutions claimed in this application can be implemented even without these technical details and various variations and modifications based on the following embodiments. The division of the following embodiments is for ease of description and should not constitute any limitation on the specific implementation of this application. The following embodiments can be combined with and referenced by each other without contradiction.

[0064] One embodiment of this application proposes a method for diagnosing abnormal power grid line losses based on knowledge graphs and causal reasoning, applied to electronic devices. The electronic device can be a terminal or a server; this embodiment and subsequent embodiments will use a server as an example. The implementation details of the method for diagnosing abnormal power grid line losses based on knowledge graphs and causal reasoning proposed in this embodiment are described below. These details are provided for ease of understanding and are not essential for implementing this solution.

[0065] The specific process of the power grid line loss anomaly diagnosis method based on knowledge graphs and causal reasoning proposed in this embodiment can be described as follows: Figure 1 As shown, it includes:

[0066] Step 11: Collect historical operating data of the power grid, including input power, output power, three-phase voltage, three-phase current, load power factor and environmental parameters of each line. After standardizing and preprocessing the historical operating data, a standardized data vector is obtained and a historical operating dataset is formed.

[0067] In practical implementation, a large amount of historical operation data of the power grid is the foundation for building the power grid knowledge graph. The server needs to collect historical operation data of the power grid, including but not limited to the input power, output power, three-phase voltage, three-phase current, load power factor and environmental parameters of each line. After collection, the historical operation data is standardized and preprocessed to obtain standardized data vectors to form a historical operation dataset.

[0068] In one example, the server collects historical operational data of the power grid based on a preset time granularity (such as 5 minutes or 15 minutes). Historical power grid operating data collected at all times includes input power. Output power Three-phase voltage Three-phase current Load power factor and including temperature and humidity Environmental parameters, including those included.

[0069] In one example, after collecting historical power grid operation data, the server needs to align the timestamps of historical operation data from different sources at the same time. For missing data points, linear interpolation or moving average methods are used for interpolation. Since the historical operation data follows a normal distribution, after interpolation, it is also necessary to perform data averaging based on 3D models. The principle is to remove outliers, that is, delete 3. Values ​​outside the range This represents the standard deviation of historical power grid operating data. Normalization is performed on historical operating data that has been time-aligned, interpolated, and had outlier removed, resulting in a standardized data vector. The standardized data vector at time t is denoted as .

[0070] Step 12: Construct a power grid knowledge graph based on the historical operation dataset. Use distribution transformers, lines, switches, and loads as nodes in the power grid knowledge graph. Establish edges in the power grid knowledge graph based on the power topology relationship, and then represent each relationship as a triple based on the nodes and edges.

[0071] In the specific implementation, after the server obtains the historical operation dataset, it can construct a power grid knowledge graph based on the historical operation dataset. Distribution transformers, lines, switches, and loads are respectively used as nodes in the power grid knowledge graph. Edges of the power grid knowledge graph are established according to the power topology relationship. Thus, each relationship is represented as a triple based on the nodes and edges. All triples together constitute the power grid knowledge graph.

[0072] In one example, the construction process of a power grid knowledge graph can be as follows: Figure 2 As shown, the process begins by extracting equipment from the power grid, using basic electrical components such as distribution transformers, lines, switches, transformers, and loads as nodes in the power grid knowledge graph. Next, based on the power topology, edges are established in the knowledge graph, representing the physical connections and logical dependencies between these basic electrical components. Then, attributes are added to each node in the knowledge graph based on historical operational datasets, including rated current, geographical location, and operational status. Following this, each relationship is represented as a triple (e.g., transformer A connects to line B) based on the nodes and edges. Finally, the power grid knowledge graph is formed based on all the triples. , , For a set of nodes, Let be the set of edges. It is a collection of attributes.

[0073] In one example, using To represent connection relationships, that is, the physical connections between basic electrical components, using... To represent the power supply relationship, that is, the upstream basic electrical components supply power to the downstream basic electrical components, using... This indicates a dependency relationship, where downstream basic electrical components depend on upstream basic electrical components. Previously, it could only be a distribution transformer or a transmission line. The next one can only be a line or a load. and The directions are opposite.

[0074] Step 13: Use the causal discovery algorithm to mine causal relationships in the power grid knowledge graph, combine it with the prior knowledge of the power system to determine the causal direction, and obtain the power grid causal graph.

[0075] In practice, after the server constructs the power grid knowledge graph, it can use the causal discovery algorithm to mine causal relationships in the power grid knowledge graph, combine it with the prior knowledge of the power system to determine the causal direction, and obtain the power grid causal graph.

[0076] In one example, when performing causal relationship mining, it is first necessary to target the power grid knowledge graph. Define a set of variables , ,in, Represents the three-phase voltage variable. Represents the three-phase current variable. Represents the load factor variable. This represents the variable of temperature rise in the conductor. Represents the power loss variable. This represents the line loss rate variable.

[0077] Next, the server needs to be based on the power grid knowledge graph. and variable set Initialize a completely undirected graph In a completely undirected graph In this context, all variables are connected in pairs.

[0078] The server will then iterate through all the variable pairs, for each variable pair... In other words, by using causal discovery algorithms, we can test under different conditions. and Are they independent, and under any circumstances? and If all elements are independent, then delete the completely undirected graph. In and Otherwise, preserve the completely undirected graph. In and The connection between them; where, , , and Representing the sets of variables respectively The first in The first variable and the second One variable.

[0079] After traversing all the variable pairs, a sparse undirected graph can be obtained. Finally, by combining prior knowledge of the power system (such as how changes in current lead to changes in line losses), the sparse undirected graph is determined. By analyzing the causal directions within the graph, a directed acyclic graph is obtained, which serves as the final causal graph of the power grid. .

[0080] In one example Figure 3 Showing This is part of a typical cause-and-effect relationship: load changes lead to increased current, which in turn leads to increased conductor temperature, ultimately resulting in increased line loss.

[0081] Step 14: Calculate the current line loss anomaly score and determine whether the current line loss anomaly score is greater than the current dynamic anomaly diagnosis threshold. If the current line loss anomaly score is greater than the current dynamic anomaly diagnosis threshold, then perform causal reasoning based on the power grid causal graph, calculate the causal contribution of each potential influencing factor to the line loss anomaly, and locate the root cause of the line loss anomaly based on the causal contribution of each potential influencing factor to the line loss anomaly.

[0082] In the specific implementation, after obtaining the power grid causality graph, the server needs to calculate the current line loss anomaly score and the current dynamic anomaly diagnosis threshold, and determine whether the current line loss anomaly score is greater than the current dynamic anomaly diagnosis threshold. If the current line loss anomaly score is greater than the current dynamic anomaly diagnosis threshold, causal reasoning is performed based on the power grid causality graph to calculate the causal contribution of each potential influencing factor to the line loss anomaly, and the root cause of the line loss anomaly is located based on the causal contribution of each potential influencing factor to the line loss anomaly. If the current line loss anomaly score is less than or equal to the current dynamic anomaly diagnosis threshold, normal operation continues.

[0083] In one example, the current line loss anomaly score is calculated using the following formula:

[0084] ;

[0085] ;

[0086] ;

[0087] in, express The abnormal score of line loss at any given time. , , For the preset dimension weights, express Actual line loss rate at any given time. express Theoretical line loss rate at time t. express Physical constraint residuals at time step Indicates power loss. express The total harmonic distortion of voltage at time t. Indicates the effective value of the fundamental voltage. Indicates the first The effective value of the first harmonic voltage The usual value is 49.

[0088] Under normal circumstances, , , Set them to 0.7, 0.2, and 0.1 respectively.

[0089] In one example, the current dynamic anomaly diagnosis threshold is calculated using the following formula:

[0090] ;

[0091] ;

[0092] ;

[0093] in, express Dynamic anomaly diagnosis threshold at any given time. This represents the initial dynamic anomaly diagnosis threshold. and The preset working condition weights, express Load rate at any given time express Environmental deviation at any given time Indicates the initial temperature. This indicates the initial humidity.

[0094] Under normal circumstances, and Set them to 0.3 and 0.2 respectively.

[0095] In one example, the abnormality diagnosis and root cause localization process can be as follows: Figure 4 As shown, the server identifies all controllable causal events as potential influencing factors in the power grid cause-effect graph, identifies abnormal line loss as a result event, and lists all potential confounding factors.

[0096] Next, the intervention causal effect of each potential influencing factor on the outcome event is calculated using the following formula, which serves as the causal contribution of each potential influencing factor to the abnormal line loss:

[0097] ;

[0098] in, Indicates the first The first controllable cause event, i.e., the first... There are [number] potential influencing factors, and the total number of potential influencing factors is [number]. , It is an integer greater than 1. , This indicates a result event, namely, abnormal line loss. Indicates the first One potential confounding factor, This represents the total number of potential confounding factors. It is an integer greater than 1. express The probability of occurrence Indicates that in a given and Under the premise The probability of occurrence express Interference, express right The intervention causal effect, i.e. right The causal contribution.

[0099] Subsequently, the causal contribution of each potential influencing factor to the abnormal line loss was ranked from largest to smallest. The potential influencing factor with the largest causal contribution was identified as the root cause of the abnormal line loss, or the factor with the highest causal contribution was identified as the root cause of the abnormal line loss. indivual( Generally, 3) potential influencing factors are selected as candidate causes of abnormal line loss, and the root cause probability of each candidate cause is given according to the magnitude of its causal contribution. For example, load imbalance (45%), increased joint resistance (30%), and voltage fluctuation (15%).

[0100] In one example, after locating the root cause of abnormal line loss, the server can automatically generate a diagnostic report and display it graphically. The report includes: alarm time, actual line loss rate, relevant electrical quantities, and causal link descriptions. Subsequently, based on the diagnostic report, maintenance suggestions are retrieved from the power grid knowledge graph, and a maintenance suggestion report is generated, such as "balance load distribution," "inspect line joints," and "perform voltage compensation," providing decision support for on-site operations and maintenance.

[0101] The proposed method for diagnosing abnormal power grid line losses based on knowledge graphs and causal reasoning has at least the following beneficial effects.

[0102] First, it offers strong interpretability. This embodiment, based on knowledge graphs and causal reasoning mechanisms, can clearly identify the causal links that lead to abnormal line losses. This allows maintenance personnel to clearly understand the logical basis of the diagnostic results and make more targeted maintenance. It overcomes the shortcomings of traditional black-box models that only provide detection results without explaining the causes, making power maintenance more transparent and operable.

[0103] Secondly, it effectively improves diagnostic accuracy. By combining structured knowledge graphs and causal reasoning mechanisms, this embodiment can more accurately depict the intrinsic relationships between various devices and operating states in the power system. In practical applications, even if there are certain degrees of missing or noisy data, the system can rely on the established knowledge graph to complete and correct it, thereby effectively reducing the false alarm rate and the missed alarm rate.

[0104] Third, it supports continuous updating and evolution of knowledge. This embodiment collects historical operation data of the power grid based on a preset time granularity, enabling the power grid knowledge graph to be continuously expanded, corrected, and evolved according to the updates of power grid equipment and changes in the operating environment. Through automated data collection and knowledge extraction, new operation and maintenance experience and operating modes are added in a timely manner, thereby ensuring that the diagnostic methods remain accurate and up-to-date in the long term.

[0105] Fourth, it provides intuitive and scientific auxiliary decision-making information for power grid operation and maintenance personnel. This embodiment can visualize the root causes of anomalies and their causal paths, making the diagnostic results intuitive, reducing the understanding cost for personnel, and enabling diagnostic information to be directly transformed into operation and maintenance action plans, effectively improving the efficiency of auxiliary decision-making.

[0106] The steps described above are for clarity only. In implementation, they can be combined into one step, or some steps can be broken down into multiple steps, as long as they involve the same logical relationship, they are all within the scope of protection of this application. Adding insignificant modifications or introducing insignificant designs to the algorithm or process, without changing the core design of the algorithm and process, are also within the scope of protection of this application.

[0107] In one embodiment, to verify the effectiveness of the proposed method for diagnosing abnormal power grid line losses based on knowledge graphs and causal reasoning (hereinafter referred to as "this method"), we conducted a simulation experiment, the details of which are described below.

[0108] 1) Experimental data.

[0109] The dataset used in this experiment comes from the SCADA system and electricity consumption information collection system of two real distribution substations in a city in my country. The data collection period is from January 1, 2023 to December 31, 2024, a total of 24 months. The data collection frequency is once every 15 minutes, forming a high-density time series dataset containing approximately 70,000 time points.

[0110] The main data fields include: electrical quantity data, total active power, total reactive power, three-phase voltage and three-phase current of the transformer area; topology data, including the connection relationship and static parameters (such as rated capacity, line length, material, etc.) of basic electrical components such as transformers, lines, switches, and capacitors; and operation and maintenance records, including manually recorded events such as equipment failures, electricity theft, and line modifications, used to verify the diagnostic results.

[0111] The dataset was divided into a training set and a test set in an 8:2 ratio. The training set was used to build the knowledge graph and learn the causal reasoning model, while the test set was used to evaluate the diagnostic performance of the causal reasoning model.

[0112] 2) Experimental environment.

[0113] The experimental hardware environment consisted of an Intel Xeon Gold 6248R CPU (24 cores), 128GB of RAM, and an NVIDIA Tesla V100 GPU (32GB of video memory).

[0114] The experimental software environment uses CentOS 7.9 as the server operating system and Python 3.8 as the implementation language.

[0115] During development, several core frameworks and libraries were relied upon. The model was built using PyTorch version 1.11, the processing of graph structures such as power grid topology used NetworkX version 2.6, the storage and query functions of the knowledge graph were provided by Neo4j database version 4.3, and the discovery of causal relationships was implemented through Causal-learn library version 0.1.2.

[0116] 3) Comparison method.

[0117] On the test set, this method is compared with the following two baseline methods.

[0118] Isolation Forest is a classic, label-free statistical anomaly detection algorithm. This method can only determine whether an anomaly has occurred, but cannot provide the cause.

[0119] The LSTM prediction model uses LSTM to predict the theoretical line loss rate and identifies anomalies by the residual between the actual and predicted values. This method can correlate time-series features, but lacks explicit causal explanations.

[0120] 4) Experimental results and evaluation.

[0121] The evaluation system for this simulation experiment will assess the results from two dimensions: "diagnostic accuracy" and "root cause localization precision." The experimental results are as follows: Figure 5 As shown in Table 1, Figure 6 This provides a detailed description of the diagnostic results for a typical case.

[0122] Table 1: Comparison of Simulation Experiment Results

[0123]

[0124] As can be seen from the data in Table 1, this method significantly outperforms the other two baseline methods in all key metrics, demonstrating its superior performance in identifying line loss anomalies.

[0125] Another embodiment of this application proposes a power grid line loss anomaly diagnosis system based on knowledge graphs and causal reasoning. The details of the power grid line loss anomaly diagnosis system based on knowledge graphs and causal reasoning proposed in this embodiment are described in detail below. The following content is only for the convenience of understanding and is not necessary for implementing this example.

[0126] The specific structure of the power grid line loss anomaly diagnosis system based on knowledge graphs and causal reasoning proposed in this embodiment can be as follows: Figure 7 As shown, it includes: historical data acquisition and preprocessing module 21, power grid knowledge graph construction module 22, causal relationship mining module 23, calculation module 24, and positioning module 25.

[0127] The historical data acquisition and preprocessing module 21 is used to acquire historical operating data of the power grid, including the input power, output power, three-phase voltage, three-phase current, load power factor and environmental parameters of each line. After standardizing and preprocessing the historical operating data, a standardized data vector is obtained and a historical operating dataset is formed.

[0128] The power grid knowledge graph construction module 22 is used to construct a power grid knowledge graph based on historical operation datasets. It uses distribution transformers, lines, switches, and loads as nodes of the power grid knowledge graph and establishes edges of the power grid knowledge graph based on power topology relationships. Thus, each relationship is represented as a triple based on nodes and edges.

[0129] The causal relationship mining module 23 is used to mine causal relationships in the power grid knowledge graph using the causal discovery algorithm, and to determine the causal direction by combining the prior knowledge of the power system, so as to obtain the power grid causal graph.

[0130] The calculation module 24 is used to calculate the current line loss anomaly score and the current dynamic anomaly diagnosis threshold.

[0131] The positioning module 25 is used to perform causal reasoning based on the power grid causal graph when the current line loss anomaly score is greater than the current dynamic anomaly diagnosis threshold, calculate the causal contribution of each potential influencing factor to the line loss anomaly, and locate the root cause of the line loss anomaly based on the causal contribution of each potential influencing factor to the line loss anomaly.

[0132] It is not difficult to see that this embodiment is a system embodiment corresponding to the above method embodiments, and this embodiment can be implemented in conjunction with the above method embodiments. The relevant technical details and technical effects mentioned in the above method embodiments are still valid in this embodiment, and will not be repeated here to reduce repetition. Accordingly, the relevant technical details mentioned in this embodiment can also be applied to the above method embodiments.

[0133] It is worth mentioning that all modules and units involved in this embodiment are logical modules. In practical applications, a logical unit can be a physical unit, a part of a physical unit, or a combination of multiple physical units. Furthermore, to highlight the innovative aspects of this application, this embodiment does not introduce units that are not closely related to solving the technical problems proposed in this application; however, this does not mean that other units do not exist in this embodiment.

[0134] Another embodiment of this application provides an electronic device, such as Figure 8 As shown, it includes a processor 31 and a memory 32. The memory 32 stores instructions that the processor 31 can execute. When the processor 31 is configured to execute the instructions, the electronic device can realize a power grid line loss anomaly diagnosis method based on knowledge graph and causal reasoning as described in the above method embodiment.

[0135] The memory and processor are connected via a bus, which includes any number of interconnecting buses and bridges, connecting various circuits of one or more processors and the memory. The bus can also connect various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and will not be described further herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be a single component or multiple components, such as multiple receivers and transmitters, providing a unit for communicating with various other devices over a transmission medium. Data processed by the processor is transmitted over the wireless medium via an antenna, which further receives data and transmits it to the processor.

[0136] The processor manages the bus and general processing, and also provides various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. Memory is used to store data used by the processor during operation.

[0137] Another embodiment of this application proposes a computer-readable storage medium storing a computer program that, when executed by a processor, can implement a power grid line loss anomaly diagnosis method based on knowledge graphs and causal reasoning as described in the above method embodiments.

[0138] That is, those skilled in the art will understand that all or part of the steps in the above method embodiments can be implemented by a program instructing related hardware. The program is stored in a storage medium and includes several instructions to cause a device (such as a microcontroller, chip, etc.) or processor to execute all or part of the steps of the method described in the method embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory, random access memory, magnetic disks, or optical disks.

[0139] Those skilled in the art will understand that the above embodiments are specific implementations of this application, and in practical applications, various changes can be made in form and detail without departing from the spirit and scope of this application. For those skilled in the art, several improvements and modifications can be made without departing from the principles of this application, and these improvements and modifications are also considered to be within the scope of protection of this application.

Claims

1. A power grid line loss anomaly diagnosis method based on a knowledge graph and causal reasoning, characterized in that, The method comprises: Collecting historical operation data of the power grid, including input power, output power, three-phase voltage, three-phase current, load power factor and environmental parameters of each line, and obtaining a standardized data vector after standardizing and preprocessing the historical operation data, and forming a historical operation data set; Based on the historical operation data set, a power grid knowledge graph is constructed, the distribution transformer, the line, the switch and the load are taken as nodes of the power grid knowledge graph, the edges of the power grid knowledge graph are established according to the power topology relationship, so that each relationship is represented as a triple based on the nodes and edges; A causal relationship mining is performed on the power grid knowledge graph by using a causal discovery algorithm, and a causal direction is determined in combination with prior knowledge of the power system to obtain a power grid causal graph; A current line loss abnormal score is calculated, and it is judged whether the current line loss abnormal score is greater than a current dynamic abnormality diagnosis threshold value, if the current line loss abnormal score is greater than the current dynamic abnormality diagnosis threshold value, a causal reasoning is performed based on the power grid causal graph, a causal contribution degree of each potential influencing factor to the line loss abnormality is calculated, and a root cause of the line loss abnormality is located according to the causal contribution degree of each potential influencing factor to the line loss abnormality; The current line loss abnormal score is calculated by the following formula: ; ; ; wherein, represents the line loss abnormal score at the moment, , , is a preset dimension weight, represents the actual line loss rate at the moment, represents the theoretical line loss rate at the moment, represents the physical constraint residual at the moment, represents the loss power, represents the voltage total harmonic distortion rate at the moment, represents the fundamental voltage effective value, represents the harmonic voltage effective value of the th order, represents the input power at the moment, represents the output power at the moment; The current dynamic abnormality diagnosis threshold value is calculated by the following formula: ; ; ; wherein, represents a dynamic abnormality diagnosis threshold value at a time point, represents an initial dynamic abnormality diagnosis threshold value, and is a preset operating condition weight, represents a load rate at a time point, represents an environmental deviation degree at a time point, represents an initial temperature, represents an initial humidity.

2. The power grid line loss anomaly diagnosis method based on a knowledge graph and causal reasoning according to claim 1, characterized in that, Collecting historical operation data of the power grid, including: Based on the preset time granularity, historical operation data of the power grid is collected, and The historical operation data of the power grid collected at the moment includes input power , output power , three-phase voltage , three-phase current , load power factor , and environmental parameters including temperature and humidity . After standardizing and preprocessing the historical operation data, a standardized data vector is obtained, including: Aligning the time stamps of the historical operation data collected at the same time but from different sources; For the missing data points, linear interpolation or moving average method is used for interpolation; Based on 3 Principle of outlier rejection, i.e. deletion of values outside the range of 3 standard deviations; wherein the historical operating data is subject to a normal distribution, denotes the standard deviation of the historical operating data of the power grid. normalizing the historical run data that is complete time aligned, complete interpolated and complete outlier removed to obtain a normalized data vector .

3. The power grid line loss anomaly diagnosis method based on a knowledge graph and causal reasoning according to claim 2, characterized in that, Based on the historical operation data set, a power grid knowledge graph is constructed, including: Extracting the devices in the power grid, taking the basic electrical elements including the distribution transformer, the line, the switch and the load as the nodes of the power grid knowledge graph; According to the power topology relationship, the edges of the power grid knowledge graph including connection, power supply and dependence are established to represent the physical connection and logical dependence between the basic electrical elements; Based on the historical operation data set, attributes are added to each node of the power grid knowledge graph, including rated current, geographical location and operation and maintenance state; Each relationship is represented as a triple based on nodes and edges, and a power grid knowledge graph is formed based on all triples , , is a node set, is an edge set, is an attribute set.

4. The power grid line loss anomaly diagnosis method based on a knowledge graph and causal reasoning according to claim 3, characterized in that, A causal relationship mining is performed on the power grid knowledge graph by using a causal discovery algorithm, and a causal direction is determined in combination with prior knowledge of the power system to obtain a power grid causal graph, including: For power grid knowledge graph , define a variable set , , represent three-phase voltage variables, represent three-phase current variables, represent load rate variables, represent conductor temperature rise variables, represent line loss power variables, represent line loss rate variables; Knowledge graph based on power grid and a set of variables , initialize a complete undirected graph , in the complete undirected graph , all variables are connected to each other; traversing all variable pairs, for variable pair , using the causal discovery algorithm, testing whether is independent of under different conditions, if is independent of under any condition, deleting the connection between and in the complete undirected graph , otherwise, keeping the connection between and in the complete undirected graph ; wherein , , and represent the th variable and the th variable in the variable set , respectively; After traversing all variable pairs, a sparse undirected graph is obtained ; Based on prior knowledge of power systems, determine sparse undirected graphs. By analyzing the causal directions in the graph, a directed acyclic graph (DAG) is obtained as the final causal graph of the power grid. .

5. The power grid line loss anomaly diagnosis method based on a knowledge graph and causal reasoning according to claim 1, characterized in that, Based on the power grid causal graph, a causal reasoning is performed, a causal contribution degree of each potential influencing factor to the line loss abnormality is calculated, and a root cause of the line loss abnormality is located according to the causal contribution degree of each potential influencing factor to the line loss abnormality, including: In the power grid causal graph, all controllable cause events are determined as potential influencing factors, the line loss abnormality is taken as a result event, and all potential confounding factors are listed; The intervention causal effect of each potential influencing factor on the result event is calculated by the following formula, as the causal contribution degree of each potential influencing factor to the line loss abnormality: ; wherein, represents the controllable cause event, i.e. the potential influencing factor, the total number of potential influencing factors being , is an integer greater than 1, , represents the result event, i.e. the line loss anomaly, represents the potential confounder, represents the total number of potential confounders, is an integer greater than 1, represents the probability of occurrence, represents the probability of occurrence given and , represents the probability of occurrence given represents the intervention, represents the intervention causal effect on , i.e. the causal contribution of to ; The causal contribution degrees of each potential influencing factor to the line loss abnormality are sorted from large to small, and the potential influencing factor with the largest causal contribution degree is located as the root cause of the line loss abnormality; Or, the top-ranking causal contribution The potential influencing factor is positioned as a candidate cause of the line loss anomaly, and the root cause probability of each candidate cause is given according to the size of the causal contribution.

6. The power grid line loss anomaly diagnosis method based on a knowledge graph and causal reasoning according to any one of claims 1 to 5, characterized in that, After locating the root cause of the line loss abnormality, it also includes: An automatic diagnosis report is generated and displayed in a graphical manner, including alarm time, actual line loss rate, related electrical quantities and causal link description; According to the diagnosis report, maintenance suggestions are called from the power grid knowledge graph, and a maintenance suggestion report is generated.

7. A power grid line loss anomaly diagnosis system based on a knowledge graph and causal reasoning, characterized in that, The system comprises: A historical data acquisition and preprocessing module is configured to acquire historical operation data of the power grid, including input power, output power, three-phase voltage, three-phase current, load power factor and environmental parameters of each line, and to obtain a standardized data vector after standardizing and preprocessing the historical operation data, and to form a historical operation data set; A power grid knowledge graph construction module is configured to construct a power grid knowledge graph based on the historical operation data set, to take distribution transformers, lines, switches and loads as nodes of the power grid knowledge graph, to establish edges of the power grid knowledge graph according to power topological relations, and to represent each relationship as a triple based on the nodes and edges; A causal relationship mining module is configured to mine causal relationships of the power grid knowledge graph by using a causal discovery algorithm, to determine a causal direction in combination with prior knowledge of the power system, and to obtain a power grid causal graph; A calculation module is configured to calculate a current line loss anomaly score and a current dynamic anomaly diagnosis threshold; A positioning module is configured to perform causal reasoning based on the power grid causal graph when the current line loss anomaly score is greater than the current dynamic anomaly diagnosis threshold, to calculate causal contribution degrees of each potential influencing factor to the line loss anomaly, and to locate a root cause of the line loss anomaly according to the causal contribution degrees of each potential influencing factor to the line loss anomaly; the current line loss anomaly score is calculated by the following formula: ; ; ; wherein, represents the line loss abnormal score at the moment, , , is a preset dimension weight, represents the actual line loss rate at the moment, represents the theoretical line loss rate at the moment, represents the physical constraint residual at the moment, represents the loss power, represents the voltage total harmonic distortion rate at the moment, represents the fundamental voltage effective value, represents the harmonic voltage effective value of the th, represents the input power at the moment, represents the output power at the moment; The current dynamic anomaly diagnosis threshold is calculated by the following formula: ; ; ; wherein, represents a dynamic abnormality diagnosis threshold value at a time point, represents an initial dynamic abnormality diagnosis threshold value, and is a preset operating condition weight, represents a load rate at a time point, represents an environmental deviation degree at a time point, represents an initial temperature, represents an initial humidity.

8. An electronic device, comprising: It comprises: A processor and a memory, wherein the memory stores instructions executable by the processor, and the processor is configured to execute the instructions so that the electronic device can implement the power grid line loss anomaly diagnosis method based on the knowledge graph and the causal reasoning according to any one of claims 1 to 6.

9. A computer readable storage medium storing a computer program, characterized in that, The computer program is executed by the processor, and the power grid line loss anomaly diagnosis method based on the knowledge graph and the causal reasoning according to any one of claims 1 to 6 can be implemented.

Citation Information

Patent Citations

  • Synchronous line loss intelligent diagnosis and analysis system and method based on electric power knowledge graph

    CN120337111A

  • Power equipment anomaly detection method and system based on multi-modal AI

    CN120429788A