Electric energy tracing method based on network topology sorting algorithm

By constructing a hybrid energy topology map and combining it with power flow analysis, and using a network topology sorting algorithm, the problem of tracing the power components in the hybrid energy system was solved, the accurate calculation and traceability of the power components were achieved, the transparency and credibility of clean energy data were improved, and innovation in clean energy business was promoted.

CN120723942APending Publication Date: 2025-09-30STATE GRID QINGHAI ELECTRIC POWER COMPANY +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510869503.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-26
Publication Date
2025-09-30

AI Technical Summary

Technical Problem

Existing technologies make it difficult to efficiently and accurately trace the energy components such as wind power, photovoltaic power, hydropower and thermal power in power lines. In particular, the complexity and variability of real-time data in hybrid energy systems make data collection and analysis difficult.

Method used

The network topology sorting algorithm is used to construct a hybrid energy topology map. Combined with the power flow analysis technology, accurate calculation and traceability of power components are achieved through data collection and topological sorting.

Benefits of technology

It achieves accurate calculation and traceability of electric energy components, supports energy scheduling optimization, improves the transparency and credibility of clean energy data, promotes clean energy business innovation, and provides technical support for achieving the "dual carbon" goal.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure BDA0005469498830000041
    Figure BDA0005469498830000041
  • Figure BDA0005469498830000101
    Figure BDA0005469498830000101
  • Figure BDA0005469498830000131
    Figure BDA0005469498830000131
Patent Text Reader

Abstract

An electric energy tracing method based on a network topology sorting algorithm relates to the technical field of smart power grids, and comprises the steps of collecting data, constructing a power grid topology directed graph by using an adjacency list, carrying out topology sorting, executing topology sorting according to a power grid topology graph, and carrying out electric energy component accurate accounting and tracing derivation by using an algorithm. The method has the beneficial effects that the hybrid energy topological graph is constructed, accurate calculation of electric energy components and accurate analysis of electric energy traceability are realized by utilizing an electric energy flow analysis technology and combining real-time operation data, synchronous planning, synchronous construction and synchronous commissioning of a matched power grid project and a new energy project are met, and the reliability of the system is improved. And favorable green electricity strategy requirements are created for large-scale new energy development and grid-connected consumption.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of smart grids, and in particular to an electric energy source tracing method based on a network topology sorting algorithm. Background Art

[0002] Power companies' supporting grid projects are planned, constructed, and commissioned simultaneously with new energy projects. The green electricity strategy requires creating favorable conditions for large-scale renewable energy development and grid integration, maximizing the consumption of clean, low-carbon electricity. The current power grid is a hybrid energy system, interwoven with wind, photovoltaic, and thermal power. Grid operation is dynamic, with power generation output, load demand, and line status fluctuating in real time. To understand the proportion of wind, photovoltaic, hydropower, and thermal power in power lines, power supply companies and users often need to integrate data from multiple sources, including power generation companies, grid companies, and users, and perform traceability calculations based on unified rules. Due to the complexity, variability, and complexity of this massive amount of real-time data, efficient methods for collecting, organizing, and analyzing it are urgently needed to achieve traceability of electricity. Summary of the Invention

[0003] In order to overcome the shortcomings of the existing technology, the present invention proposes an electric energy tracing method based on a network topology sorting algorithm, constructs a hybrid energy topology map, utilizes electric energy flow analysis technology and combines it with real-time operation data to achieve accurate calculation of electric energy components and accurate analysis of electric energy tracing, and meet the green electricity strategy requirements of synchronous planning, construction and commissioning of supporting power grid projects and new energy projects, creating favorable conditions for large-scale new energy development and grid connection and consumption.

[0004] The present invention provides an electric energy source tracing method based on a network topology sorting algorithm, comprising the following steps:

[0005] Step 1: Data collection, including collecting plant and station archive data, line archive data, user archive data, and instantaneous operation data;

[0006] Step 2: Use the adjacency list to construct a directed graph of the power grid topology and perform topological sorting;

[0007] Step three: Based on the grid topology, perform topological sorting and use algorithms to accurately calculate and trace the power components.

[0008] The plant archive data is a data entity that describes the basic information of the plant and station, and is a typical input data. The basic attributes of the plant archive data include: plant ID, plant type, region, and plant name.

[0009] The aforementioned line archive data is also essential data describing a line and is a typical form of input data. It describes basic line information and the relationships between the line and its substations, as well as between the line and its measuring points. It is considered essential line archive data. It includes the line's region of origin, line ID, starting and ending substation ID, and associated measuring point IDs.

[0010] In order to support the evaluation of special user groups such as green computing centers, the user profile data mentioned above needs to collect the profile data of some users. The user profile data can be described with reference to the user entity model. The user profile data is used to describe the user's basic profile information, the relationship between the user and the plant, and the user's status information. Specifically, the user profile data includes the basic information of the plant to which the user belongs, the user's basic profile (user name, user type, industry category, industry subcategory, region, city), the user's voltage level, and the current user's operating status.

[0011] The method of using an adjacency list to construct a directed graph of the power grid topology is as follows: using the power plant as the vertex and the lines with the flow direction as the directed edge to construct the directed graph of the power grid topology, and using the structure of the adjacency list to realize the storage of the topology graph.

[0012] Among them, the type of terminal plant (i.e. power plant, including wind farms, thermal power plants, hydropower plants, photovoltaic stations, etc.) determines the energy proportion of the entire power grid.

[0013] For the case of multiple lines between two adjacent plants and stations, the OOD concept is adopted in the design for each directed edge, and its starting plant and terminal plant are used as member attributes of the object.

[0014] The data structure of the power grid topology directed graph uses object-oriented technology to design a complete power grid topology data structure. Considering the completeness of the topological relationship description, a nested object structure is used to describe the power grid. The power grid topology data structure includes the power grid topology object data structure, the plant object data structure, and the line object data structure.

[0015] The grid topology object data structure adopts the OOD concept to design the grid topology, wherein the grid topology object nests the plant object and the line object, and provides external graph object preservation and recovery services, topology relationship error identification and automatic repair services, plant energy traceability analysis services, plant energy composition calculation services, and plant power supply and receiving line analysis services.

[0016] The plant object data structure is designed using the OOD concept, and nests the data structure of the line object, providing plant energy supply analysis services, plant energy receiving analysis services, and plant energy traceability line analysis services.

[0017] The data structure of the line object adopts the OOD concept to design the data model of the line. The line object members and attributes include: the starting plant meter and operating value, the terminal plant meter and operating value, and the end user of the line; it provides external power composition analysis services of the line, energy traceability analysis services of the line, and computing power analysis services for end users.

[0018] The topological sorting mentioned above refers to topological sorting of the power grid diagram.

[0019] A topological sort is an algorithm that orders the vertices of a directed acyclic graph so that for every directed edge (u, v), vertex u appears before vertex v in the sort. This sorting method ensures that there are no cycles in the graph, as cycles would make it impossible to determine a clear linear order. Topological sorting is usually implemented based on the in-degree of a vertex in the graph (the number of edges pointing to that vertex).

[0020] The basic steps of the topological sorting algorithm are:

[0021] Step 1: Calculate the in-degree. First, we need to count the in-degree of each vertex in the graph. This can be achieved by traversing each edge of the graph and incrementing the in-degree of the end point of each edge (the vertex it points to).

[0022] Step 2: Enqueue the vertices with in-degree 0 and add all vertices with in-degree 0 to a queue. These vertices have no predecessor nodes, so they will be at the beginning of the sequence in the topological sort.

[0023] Step 3: Dequeue and update the in-degree. Take the vertices from the queue one by one and add them to the topologically sorted sequence. Then, update the in-degree of all successor nodes of the vertex. If the in-degree of a successor node becomes 0, add it to the queue.

[0024] The fourth step is to check whether all vertices have been output. If all vertices have been output, the topological sorting is completed successfully.

[0025] The algorithm process for accurate calculation of electric energy components and electric energy source tracing is as follows:

[0026] (1) Based on the power grid topology, perform topological sorting and extract the plant station S in the sequence;

[0027] (2) For S, assuming it has energy W to supply power to the outside, then the energy proportion on each power supply branch is the same and has the same energy structure as energy W;

[0028] (3) Based on the outgoing line of S, obtain the neighboring plant K of S. Assume that K has different energy sources W1 and W2 that are fully mixed at node K and then sent out. Then the energy of the outgoing line W3 is composed of W1 and W2, and the proportion of W1 is W1 / (W1+W2), and the proportion of W2 is W2 / (W1+W2). Similarly, assume that K has N energy inputs W1...W composed of multiple energy sources. n Mix at a certain node and then pass through line X1...X m For external output, we have X1...X m The energy structure of each line is the same. If a certain form of energy (such as photovoltaic) is in W1...W n The proportions of S1...S n , then there are lines X1...X m The proportion of this energy is:

[0029]

[0030] (4) For any unbranched transmission line L of S, the energy structure and energy proportion at both ends are the same.

[0031] (5) Finally, for any power station in the grid topology, once the energy proportions of all input lines to that node are determined, the energy proportions of all output lines can be determined. The energy proportions of the output lines of that node are the input energy proportions of the same lines at the next level node. For the terminal power station, during the period of external power supply, its energy structure is determined to be 100% of this type of energy.

[0032] (6) The terminal power supply points are regarded as leaf nodes of the power grid topology. After determining the energy proportion of these power supply points and registering the energy proportion of the output lines, these nodes are deleted from the topology map. In this way, some of the lower-level power receiving nodes become new leaf nodes. This process is repeated recursively until the energy proportion of all power stations is completely determined.

[0033] Glossary:

[0034] Hybrid energy system: specifically refers to an electric power network supplied by multiple energy sources such as wind power, photovoltaic power, hydropower, and thermal power. Among them, wind power comes from power generation companies that convert wind power into electricity, photovoltaic power comes from power generation companies that convert solar energy into electricity, hydropower comes from power generation companies that convert water energy into electricity, and thermal power comes from power generation companies that convert heat energy generated by the combustion of solid and liquid fuels such as coal, oil, and natural gas into electricity. It generally refers specifically to coal-fired power generation.

[0035] Grid topology: This abstraction represents a grid's power plants, substations, converter stations, user stations, and lines as connected symbols, enabling various analyses and calculations. The power plants, substations, converter stations, and user stations in a grid topology are called nodes.

[0036] Grid flow analysis: Grid flow refers to the steady-state distribution of voltage and power at each node in the grid topology. Grid flow analysis is the analytical process of determining the grid flow.

[0037] Energy composition ratio: refers to the percentage of wind power, photovoltaic power, hydropower and thermal power in the electricity consumed by users, also often referred to as energy ratio.

[0038] Energy traceability: Trace the power consumed by users in a certain period of time from which power generation companies supply the electricity, and the percentage and value of electricity contributed by each power generation company in the consumed electricity.

[0039] The beneficial effects of the present invention are as follows: the present invention relies on the basic information architecture of the power grid company, integrates the power plant, power grid transmission and distribution, and end-user power consumption data of the entire network, studies the power grid topology sorting algorithm through data collection, model calculation, data analysis and other methods, performs power flow analysis on the entire network, takes the power delivered by each power source point as the starting point and gradually traces back along the flow direction, calculates the power component according to the topological sequence, calculates the power contribution value of each feeder line power source, calculates the power consumption structure of various types of clean energy through statistical integration, and realizes the power source tracing and inference of the plant station. It provides a working basis for the later development of models and algorithms suitable for electric-carbon coupling analysis, promotes the green and low-carbon labeling management of computing power centers, and realizes the maximization of clean energy and low-carbon power consumption.

[0040] The present invention constructs a hybrid energy topology map, utilizes power flow analysis technology and combines it with real-time operation data to achieve accurate calculation of power components and accurate analysis of power source tracing, meeting the green electricity strategy requirements of synchronous planning, construction and commissioning of supporting power grid projects and new energy projects, and creating favorable conditions for large-scale new energy development and grid connection and consumption.

[0041] This invention enables precise tracing of a customer's energy usage structure. By abstracting the power generation facilities, transmission lines, substations, and user terminals in the power system into nodes and edges, a network topology sorting algorithm performs a hierarchical analysis of power flow paths, clearly describing the entire process from power production to consumption.

[0042] In the hybrid energy topology diagram, a network topology sorting algorithm combines power flow analysis technology with real-time operational data to accurately calculate the proportion and flow of clean energy components, supporting energy scheduling optimization. This provides technical support for the innovative construction of a green electricity traceability model, enabling precise monitoring and traceability of power components for each computing power center, ensuring that their electricity consumption is primarily derived from clean energy. This not only improves the transparency and credibility of clean energy data, but also promotes the deep integration and mining of data across the entire supply chain, helping enterprises optimize their energy consumption structures, promoting clean energy business innovation, and providing technical support for achieving the "dual carbon" goals. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 This is a schematic diagram of the power grid topology of the present invention;

[0044] Figure 2 The data structure of the power grid topology object of the present invention;

[0045] Figure 3 This is the plant object data structure of the present invention;

[0046] Figure 4 The data structure of the circuit object of the present invention;

[0047] Figure 5 The flowchart of the calculation process of the electric energy component analysis of the present invention is as follows;

[0048] Figure 6 This is a flow chart of the electric energy source tracing and calculation process of the present invention;

[0049] Figure 7 A schematic diagram of a directed graph of a power grid topology constructed using an adjacency table in the present invention;

[0050] Figure 8 This is a schematic diagram of the member attributes of the object using the OOD concept in the present invention;

[0051] Figure 9 The present invention provides a topological sorting vertex output sequence diagram for the power grid diagram. DETAILED DESCRIPTION

[0052] In embodiment 1, the present invention provides a method for accurately calculating electric energy components based on a network topology sorting algorithm, comprising the following steps:

[0053] 1. Create a power network topology diagram G;

[0054] 2. Perform topological sorting on G to obtain the traversal sequence of the plant station;

[0055] 3. For terminal plants and substations, the energy components of the outgoing lines are the same as the energy types of the plants and substations, and account for 100%;

[0056] 4. For transitional plants and stations such as substations and converter stations, calculate the energy type ratio of the plant and station based on the incoming line energy;

[0057] 5. Arrange and output the energy composition result table of the plant and the outgoing lines;

[0058] Grid topology sequencing is crucial. Calculating power components based on this topological sequence ensures a reasonable order of terminals, transitions, and finally the terminals. Furthermore, according to the three laws of power transmission, the power components of a power plant are identical to those of its outgoing lines.

[0059] To create the electric energy network topology diagram G, data collection must be carried out first, including plant and station archive data, line archive data, user archive data, and instantaneous operation data.

[0060] The plant archive data is a data entity that describes the basic information of the plant and station, and is a typical input data. The basic attributes of the plant archive data include: plant ID, plant type, region, and plant name.

[0061] The aforementioned line archive data is also essential data describing a line and is a typical form of input data. It describes basic line information and the relationships between the line and its substations, as well as between the line and its measuring points. It is considered essential line archive data. It includes the line's region of origin, line ID, starting and ending substation ID, and associated measuring point IDs.

[0062] In order to support the evaluation of special user groups such as green computing centers, the user profile data mentioned above needs to collect the profile data of some users. The user profile data can be described with reference to the user entity model. The user profile data is used to describe the user's basic profile information, the relationship between the user and the plant, and the user's status information. Specifically, the user profile data includes the basic information of the plant to which the user belongs, the user's basic profile (user name, user type, industry category, industry subcategory, region, city), the user's voltage level, and the current user's operating status.

[0063] Create the electric energy network topology graph G, that is, use the adjacency list to construct the power grid topology directed graph. Specifically, take the power station as the vertex and the line with the flow direction as the directed edge to construct the power grid topology directed graph, and use the adjacency list structure to realize the storage of the topology graph.

[0064] Among them, the type of terminal plant (i.e. power plant, including wind farms, thermal power plants, hydropower plants, photovoltaic stations, etc.) determines the energy proportion of the entire power grid.

[0065] For the case of multiple lines between two adjacent plants and stations, the OOD concept is adopted in the design for each directed edge, and its starting plant and terminal plant are used as member attributes of the object.

[0066] The data structure of the power grid topology directed graph uses object-oriented technology to design a complete power grid topology data structure. Considering the completeness of the topological relationship description, the object nesting structure is used to describe the power grid. The power grid topology data structure includes the power grid topology object data structure, the plant object data structure, and the line object data structure.

[0067] The grid topology object data structure adopts the OOD concept to design the grid topology, wherein the grid topology object nests the plant object and the line object, and provides external graph object preservation and recovery services, topology relationship error identification and automatic repair services, plant energy traceability analysis services, plant energy composition calculation services, and plant power supply and receiving line analysis services.

[0068] The plant object data structure is designed using the OOD concept, and nests the data structure of the line object, providing plant energy supply analysis services, plant energy receiving analysis services, and plant energy traceability line analysis services.

[0069] The data structure of the line object adopts the OOD concept to design the data model of the line. The line object members and attributes include: the starting plant meter and operating value, the terminal plant meter and operating value, and the end user of the line; it provides external power composition analysis services of the line, energy traceability analysis services of the line, and computing power analysis services for end users.

[0070] Perform topological sorting on G to obtain the traversal sequence of the plant, that is, perform topological sorting on the power grid graph. The basic steps of the topological sorting algorithm are:

[0071] Step 1: Calculate the in-degree. First, we need to count the in-degree of each vertex in the graph. This can be achieved by traversing each edge of the graph and incrementing the in-degree of the end point of each edge (the vertex it points to).

[0072] Step 2: Enqueue the vertices with in-degree 0 and add all vertices with in-degree 0 to a queue. These vertices have no predecessor nodes, so they will be at the beginning of the sequence in the topological sort.

[0073] Step 3: Dequeue and update the in-degree. Take the vertices from the queue one by one and add them to the topologically sorted sequence. Then, update the in-degree of all successor nodes of the vertex. If the in-degree of a successor node becomes 0, add it to the queue.

[0074] The fourth step is to check whether all vertices have been output. If all vertices have been output, the topological sorting is completed successfully.

[0075] The algorithm process for accurate calculation of electric energy components is as follows:

[0076] (1) Based on the power grid topology, perform topological sorting and extract the plant station S in the sequence;

[0077] (2) For S, assuming it has energy W to supply power to the outside, then the energy proportion on each power supply branch is the same and has the same energy structure as energy W;

[0078] (3) Based on the outgoing line of S, obtain the neighboring plant K of S. Assume that K has different energy sources W1 and W2 that are fully mixed at node K and then sent out. Then the energy of the outgoing line W3 is composed of W1 and W2, and the proportion of W1 is W1 / (W1+W2), and the proportion of W2 is W2 / (W1+W2). Similarly, assume that K has N energy inputs W1...W composed of multiple energy sources. n Mix at a certain node and then pass through line X1...X m For external output, we have X1...X m The energy structure of each line is the same. If a certain form of energy (such as photovoltaic) is in W1...W n The proportions of S1...S n , then there are lines X1...X m The proportion of this energy is:

[0079]

[0080] (4) For any unbranched transmission line L of S, the energy structure and energy proportion at both ends are the same.

[0081] (5) Finally, for any power station in the grid topology, once the energy proportions of all input lines to that node are determined, the energy proportions of all output lines can be determined. The energy proportions of the output lines of that node are the input energy proportions of the same lines at the next level node. For the terminal power station, during the period of external power supply, its energy structure is determined to be 100% of this type of energy.

[0082] (6) The terminal power supply points are regarded as leaf nodes of the power grid topology. After determining the energy proportion of these power supply points and registering the energy proportion of the output lines, these nodes are deleted from the topology map. In this way, some of the lower-level power receiving nodes become new leaf nodes. This process is repeated recursively until the energy proportion of all power stations is completely determined.

[0083] In embodiment 2, the present invention provides an electric energy source tracing method based on a network topology sorting algorithm, comprising the following steps:

[0084] 1. Create the power network topology diagram G

[0085] 2. Perform topological sorting on G to obtain the traversal sequence of the plant station

[0086] 3. For terminal plants or plants without incoming lines, the traceability result is itself, and the traceability ratio is 100%6

[0087] 4. For non-terminal plants or plants with incoming lines, the traceability results are the traceability lists of their neighboring plants. The traceability ratio is allocated based on the operating value ratio of the line.

[0088] 5. Organize and output the traceability result table of the plant and station

[0089] Similarly, traceability calculations must be based on a valid sorting sequence of the grid topology. According to the three laws of power transmission, for a power station, regardless of the complexity of its incoming line and the adjacent power stations, its traceability information is determined by the predecessor power station, and the traceability ratio is determined by the incoming line power. Similarly, for a power station, regardless of the complexity of its outgoing line and the adjacent power stations, its successor power stations are determined by their predecessor power stations, and the traceability ratio is also determined by the incoming line output power.

[0090] To create the electric energy network topology diagram G, data collection must be carried out first, including plant and station archive data, line archive data, user archive data, and instantaneous operation data.

[0091] The plant archive data is a data entity that describes the basic information of the plant and station, and is a typical input data. The basic attributes of the plant archive data include: plant ID, plant type, region, and plant name.

[0092] The aforementioned line archive data is also essential data describing a line and is a typical form of input data. It describes basic line information and the relationships between the line and its substations, as well as between the line and its measuring points. It is considered essential line archive data. It includes the line's region of origin, line ID, starting and ending substation ID, and associated measuring point IDs.

[0093] In order to support the evaluation of special user groups such as green computing centers, the user profile data mentioned above needs to collect the profile data of some users. The user profile data can be described with reference to the user entity model. The user profile data is used to describe the user's basic profile information, the relationship between the user and the plant, and the user's status information. Specifically, the user profile data includes the basic information of the plant to which the user belongs, the user's basic profile (user name, user type, industry category, industry subcategory, region, city), the user's voltage level, and the current user's operating status.

[0094] Create the electric energy network topology graph G, that is, use the adjacency list to construct the power grid topology directed graph. Specifically, take the power station as the vertex and the line with the flow direction as the directed edge to construct the power grid topology directed graph, and use the adjacency list structure to realize the storage of the topology graph.

[0095] Among them, the type of terminal plant (i.e. power plant, including wind farms, thermal power plants, hydropower plants, photovoltaic stations, etc.) determines the energy proportion of the entire power grid.

[0096] For the case of multiple lines between two adjacent plants and stations, the OOD concept is adopted in the design for each directed edge, and its starting plant and terminal plant are used as member attributes of the object.

[0097] The data structure of the power grid topology directed graph uses object-oriented technology to design a complete power grid topology data structure. Considering the completeness of the topological relationship description, the object nesting structure is used to describe the power grid. The power grid topology data structure includes the power grid topology object data structure, the plant object data structure, and the line object data structure.

[0098] The grid topology object data structure adopts the OOD concept to design the grid topology, wherein the grid topology object nests the plant object and the line object, and provides external graph object preservation and recovery services, topology relationship error identification and automatic repair services, plant energy traceability analysis services, plant energy composition calculation services, and plant power supply and receiving line analysis services.

[0099] The plant object data structure is designed using the OOD concept, and nests the data structure of the line object, providing plant energy supply analysis services, plant energy receiving analysis services, and plant energy traceability line analysis services.

[0100] The data structure of the line object adopts the OOD concept to design the data model of the line. The line object members and attributes include: the starting plant meter and operating value, the terminal plant meter and operating value, and the end user of the line; it provides external power composition analysis services of the line, energy traceability analysis services of the line, and computing power analysis services for end users.

[0101] Perform topological sorting on G to obtain the traversal sequence of the plant, that is, perform topological sorting on the power grid graph. The basic steps of the topological sorting algorithm are:

[0102] Step 1: Calculate the in-degree. First, we need to count the in-degree of each vertex in the graph. This can be achieved by traversing each edge of the graph and incrementing the in-degree of the end point of each edge (the vertex it points to).

[0103] Step 2: Enqueue the vertices with in-degree 0 and add all vertices with in-degree 0 to a queue. These vertices have no predecessor nodes, so they will be at the beginning of the sequence in the topological sort.

[0104] Step 3: Dequeue and update the in-degree. Take the vertices from the queue one by one and add them to the topologically sorted sequence. Then, update the in-degree of all successor nodes of the vertex. If the in-degree of a successor node becomes 0, add it to the queue.

[0105] The fourth step is to check whether all vertices have been output. If all vertices have been output, the topological sorting is completed successfully.

[0106] The algorithm process of electric energy tracing is as follows:

[0107] (1) Based on the power grid topology, perform topological sorting and extract the plant station S in the sequence;

[0108] (2) For S, assuming it has energy W to supply power to the outside, then the energy proportion on each power supply branch is the same and has the same energy structure as energy W;

[0109] (3) Based on the outgoing line of S, obtain the neighboring plant K of S. Assume that K has different energy sources W1 and W2 that are fully mixed at node K and then sent out. Then the energy of the outgoing line W3 is composed of W1 and W2, and the proportion of W1 is W1 / (W1+W2), and the proportion of W2 is W2 / (W1+W2). Similarly, assume that K has N energy inputs W1...W composed of multiple energy sources. n Mix at a certain node and then pass through line X1...X m For external output, we have X1...X m The energy structure of each line is the same. If a certain form of energy (such as photovoltaic) is in W1...W n The proportions of S1...S n , then there are lines X1...X m The proportion of this energy is:

[0110]

[0111] (4) For any unbranched transmission line L of S, the energy structure and energy proportion at both ends are the same.

[0112] (5) Finally, for any power station in the grid topology, once the energy proportions of all input lines to that node are determined, the energy proportions of all output lines can be determined. The energy proportions of the output lines of that node are the input energy proportions of the same lines at the next level node. For the terminal power station, during the period of external power supply, its energy structure is determined to be 100% of this type of energy.

[0113] (6) The terminal power supply points are regarded as leaf nodes of the power grid topology. After determining the energy proportion of these power supply points and registering the energy proportion of the output lines, these nodes are deleted from the topology map. In this way, some of the lower-level power receiving nodes become new leaf nodes. This process is repeated recursively until the energy proportion of all power stations is completely determined.

Claims

1. A method for tracing the source of electric energy based on a network topology sorting algorithm, characterized by: The following steps are involved: Step 1: Data collection: collecting plant and station archive data, line archive data, user archive data, and instantaneous operation data; Step 2: Use the adjacency list to construct a directed graph of the power grid topology and perform topological sorting; Step 3: Based on the grid topology, perform topological sorting and use algorithms to accurately calculate and trace the power components.

2. The method for tracing the source of electric energy based on a network topology sorting algorithm according to claim 1, characterized in that: The described method of using an adjacency list to construct a directed graph of the power grid topology is as follows: taking the plant as the vertex and the lines with the flow direction as the directed edges, a directed graph of the power grid topology is constructed, and the structure of the adjacency list is used to store the topology graph; for the case of multiple lines between two adjacent plants, the OOD concept is adopted in the design for each directed edge, and its starting plant and end plant are used as member attributes of the object.

3. The method for tracing the source of electric energy based on a network topology sorting algorithm according to claim 2, characterized in that: The data structure of the power grid topology directed graph adopts object-oriented technology to design a complete data structure of the power grid topology graph; considering the integrity of the topological relationship description, an object nested structure is used to describe the power grid; the data structure of the power grid topology graph includes the power grid topology graph object data structure, the plant station object data structure, and the line object data structure.

4. The method for tracing the source of electric energy based on a network topology sorting algorithm according to claim 3, characterized in that: The grid topology object data structure adopts the OOD concept to design the grid topology, wherein the grid topology object nests the plant object and the line object, and provides external graph object preservation and recovery services, topology relationship error identification and automatic repair services, plant energy traceability analysis services, plant energy composition calculation services, and plant power supply and receiving line analysis services.

5. The method for tracing the source of electric energy based on a network topology sorting algorithm according to claim 4, characterized in that: The plant object data structure is designed using the OOD concept, and nests the data structure of the line object, providing plant energy supply analysis services, plant energy receiving analysis services, and plant energy traceability line analysis services.

6. The method for tracing the source of electric energy based on a network topology sorting algorithm according to claim 5, characterized in that: The data structure of the line object adopts the OOD concept to design the data model of the line. The line object members and attributes include: the starting plant meter and operating value, the terminal plant meter and operating value, and the end user of the line; it provides external power composition analysis services of the line, energy traceability analysis services of the line, and computing power analysis services for end users.

7. The method for tracing the source of electric energy based on a network topology sorting algorithm according to claim 6, characterized in that: The topological sorting mentioned above refers to topological sorting of the power grid graph; the basic steps of the topological sorting algorithm are: The first step is to calculate the in-degree. First, we need to count the in-degree of each vertex in the graph. This is achieved by traversing each edge of the graph and incrementing the in-degree of the end point of each edge (the vertex it points to). The second step is to queue the vertices with in-degree 0. All vertices with in-degree 0 are added to a queue. These vertices have no predecessor nodes, so they will be at the beginning of the sequence in the topological sort. The third step is to dequeue and update the in-degree. Take the vertices from the queue one by one and add them to the topologically sorted sequence. Then, update the in-degree of all successor nodes of the vertex. If the in-degree of a successor node becomes 0, add it to the queue. The fourth step is to check whether all vertices have been output. If all vertices have been output, the topological sorting is completed successfully.

8. The method for tracing the source of electric energy based on a network topology sorting algorithm according to claim 7, characterized in that: The algorithm process for accurate calculation of electric energy components and electric energy source tracing is as follows: (1) Based on the power grid topology, perform topological sorting and extract the plant station S in the sequence; (2) For S, assuming it has energy W to supply power to the outside, then the energy proportion on each power supply branch is the same and has the same energy structure as energy W; (3) Based on the outgoing line of S, obtain the neighboring plant K of S. Assume that K has different energy sources W1 and W2 that are fully mixed at node K and then sent out. Then the energy of the outgoing line W3 is composed of W1 and W2, and the proportion of W1 is W1 / (W1+W2), and the proportion of W2 is W2 / (W1+W2). Similarly, assume that K has N energy inputs W1...W composed of multiple energy sources. n Mix at a certain node and then pass through line X1...X m For external output, we have X1...X m The energy structure of each line is the same. If a certain form of energy (such as photovoltaic) is in W1...W n The proportions of S1...S n , then there are lines X1...X m The proportion of this energy is: (4) For any unbranched transmission line L of S, the energy structure and energy proportion at both ends are the same; (5) Finally, for any power station in the power grid topology, as long as the energy proportion of all input lines of the node is determined, the energy proportion of all output lines can be determined. The energy proportion of the output line of the node is the input energy proportion of the same line of the next-level node; for the terminal power station, during the external power supply period, its energy structure is determined to be 100% of this type of energy; (6) The terminal power supply points are regarded as leaf nodes of the power grid topology. After determining the energy proportion of these power supply points and registering the energy proportion of the output lines, these nodes are deleted from the topology map. In this way, some of the lower-level power receiving nodes become new leaf nodes. This process is repeated recursively until the energy proportion of all power stations is completely determined.