A multi-level power grid form model construction method for urban power grids
Patent Information
- Application Number
- CN202611261108.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-19
- Publication Date
- 2026-10-27
AI Technical Summary
[0004]本发明的目的是提供一种面向城市电网的多层级电网形态模型构建方法,针对现有城市电网建模方法模型维度单一、难以同时集成拓扑结构与设备参数及运行状态、缺乏分层差异化建模能力、动态时序特征刻画不足且缺少标准化自动化构建流程的问题,提供了一种三层递进式、多电压等级分层建模、支持时序动态有向化表征的城市电网形态模型构建方法
(1)将城市电网的多层级电网形态模型划分为网络结构层、功能属性层和运行情况层三个层级,依次叠加、逐步具体化;三层之间既相互独立、各自可更新维护,又通过统一的图数据结构实现无缝集成,使得最终模型同时涵盖网架连接关系、设备电气参数和动态运行状态,能够全面支撑后续形态指标体系计算与形态评估分析,解决了现有模型维度单一、信息割裂的问题;
Smart Images

Figure CN122987381A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power system planning and complex network analysis technology, and in particular to a method for constructing a multi-level power grid morphology model for urban power grids. Background Technology
[0002] Urban power grids are critical infrastructure supporting the normal operation of urban economies and societies, undertaking the core function of transmitting and distributing electrical energy from the power source to various end users. With the continuous advancement of urbanization in my country, the scale of urban power grids has expanded continuously, forming a giant and complex network system covering multiple voltage levels from 500kV ultra-high voltage to 380V low voltage, containing tens of thousands of nodes and branches. Simultaneously, driven by the "dual carbon" goals, the large-scale grid connection of new energy power generation, the continuous increase in the penetration rate of distributed power sources, the large-scale integration of new loads such as electric vehicles, and the ever-increasing demands of users for power supply reliability and power quality have made the operational characteristics of urban power grids increasingly complex, placing higher demands on their planning, analysis, and evaluation. Against this backdrop, constructing a digital model that can comprehensively and accurately reflect the morphological characteristics of urban power grids has become an important fundamental issue in the field of power grid planning and operation analysis.
[0003] Existing urban power grid modeling methods generally suffer from the following shortcomings: First, the models are too dimensional, making it difficult to simultaneously integrate information from three levels: topology, electrical parameters, and dynamic operating status. This results in models that cannot fully support subsequent calculations of morphological indicators and comprehensive evaluation and analysis. Second, they lack the ability to model hierarchically differentiated models, failing to model the significant differences in network structure, power supply configuration, and load characteristics at different voltage levels of urban power grids. The simplistic abstract rules are insufficient to accurately reflect the characteristics of each level. Third, they lack sufficient characterization of dynamic time-series features. Existing models are mainly based on static cross-sections, making it difficult to effectively represent changes in power direction and operating status under load fluctuations, and are unsuitable for scenarios requiring time-series analysis. Fourth, they lack standardized and streamlined construction schemes from raw data to analytical models. The import, fusion, and model generation of multi-source heterogeneous data are fragmented, resulting in low automation and hindering modeling efficiency and reusability. Summary of the Invention
[0004] The purpose of this invention is to provide a method for constructing a multi-level power grid morphology model for urban power grids. Addressing the problems of existing urban power grid modeling methods, such as single model dimensions, difficulty in simultaneously integrating topology, equipment parameters, and operating status, lack of hierarchical differentiated modeling capabilities, insufficient dynamic temporal feature characterization, and lack of standardized automated construction processes, this invention provides a three-layer progressive, multi-voltage-level hierarchical modeling method for constructing an urban power grid morphology model that supports time-series dynamic directional representation.
[0005] To achieve the above objectives, this invention provides a method for constructing a multi-level power grid morphology model for urban power grids, comprising the following steps: S1. Obtain the node parameter table and line parameter table from the network architecture ledger of the target city's power grid, extract the physical connection relationship between nodes, and use the physical connection relationship between nodes as edges to obtain the node list and edge list. S2. Construct the network structure layer based on the node list and edge list; S3. Construct a functional attribute layer based on the line parameter table and node parameter table; S4. Based on the network structure layer and functional attribute layer, the actual operating status of the target city's power grid is introduced to construct the operation status layer; S5. The network structure layer, functional attribute layer, and operation status layer are superimposed layer by layer to obtain a multi-level power grid morphology model.
[0006] Preferably, the node parameter table is used to describe the electrical characteristics of the nodes, including node number information, node voltage level, connected power capacity and load demand information; the line parameter table is used to describe the physical characteristics of the edges, including the line number of each edge, starting node number information, ending node number information, equipment type, rated capacity information, impedance parameters and line length information.
[0007] Preferably, the node list includes node number information, and the edge list includes node number information at both ends of the line.
[0008] Preferably, the target city's power grid covers 500kV, 220kV, 110 / 35kV and 10kV.
[0009] Preferably, nodes are divided into three categories: pure power transfer nodes, load nodes, and power generation nodes; load nodes are nodes whose load demand is greater than zero in the node attributes, and power generation nodes are nodes whose power capacity is greater than zero in the node attributes.
[0010] Preferably, the specific process of constructing the network structure layer in S2 is as follows: import the NetworkX library of Python and create a blank undirected graph object; read the node list and batch load all nodes in the list into the graph object. The loaded nodes represent the topological location and are not configured with node attributes; read the edge list. Each physical connection relationship in the edge list is represented by a tuple consisting of two nodes. Batch add all physical connection relationships in the edge list into the graph object to generate an undirected and unweighted edge structure. The edges are used to represent physical electrical connections between nodes without direction distinction; and form an unweighted and undirected graph that carries the topological connection relationship of the power grid as the network structure layer.
[0011] Preferably, the topology in the network structure layer includes: A double-ring network structure for 500kV transmission networks; Radial structures used in 220kV transmission networks, or structures combining ring networks and radial structures; Radial, ring, or chain structures for 110 / 35kV high-voltage distribution networks; Double-ring structure, single-ring structure, single-ring combined with radial structure, double-petal structure, diamond structure or snowflake structure for 10kV medium voltage distribution network.
[0012] Preferably, the specific process of constructing the functional attribute layer in S3 is as follows: The pandas library in Python is used to read the line parameter table in Excel format and store the read data into a DataFrame data structure. Each row corresponds to an edge in the network structure layer and all its physical attributes. Traverse each row of the line parameter table, obtain the start node number information and the end node number information, locate the corresponding edge in the network structure layer, and store the equipment type, rated capacity, impedance parameters and line length information in the current row of data into the attributes of the edge in the form of key-value pairs through the attribute dictionary of the edge. Based on the preset morphological analysis requirements, a key attribute is selected from the stored edge attributes as the graph theory calculation weight of the edge, so that it can be directly called in the graph theory index calculation. The pandas library in Python is used to read the node parameter table in Excel format; each row of the node parameter table is traversed, and the voltage level, connected power capacity and load demand information of each node are stored in the corresponding node attribute in the form of key-value pairs through the node attribute dictionary; Therefore, the unweighted undirected graph is extended into a weighted undirected graph that carries electrical function parameters and graph theory calculation weights, serving as a functional attribute layer.
[0013] Preferably, the specific process for constructing the runtime layer in S4 is as follows: The node voltage levels, power supply capacity, load demand information, and edge impedance parameters and rated capacity information in the weighted undirected graph are exported into a format suitable for AC power flow calculation tools to establish an AC power flow calculation model based on the node admittance matrix. Obtain the typical daily load curve of the target city's power grid, allocate the power of each load node in a time sequence according to the typical daily load curve, and use the AC power flow calculation model to calculate the steady-state power flow of each time section. Extract the active power flow direction and active power magnitude of each edge from the power flow calculation results of each time section, and use the actual transmission direction of active power as the direction of that edge under that time section. Based on a weighted undirected graph, the active power outflow node is taken as the starting point of the directed edge and the active power inflow node is taken as the ending point of the directed edge. The active power value and load rate of each edge at each time section are stored in the attributes of the directed edge, thereby converting the undirected edge into a directed edge. The output, voltage amplitude, and phase angle of each generating node are extracted from the power flow calculation results and stored as dynamic operation information in the attributes of the corresponding node. Therefore, the weighted undirected graph is transformed into a weighted directed graph carrying runtime state information, which serves as the runtime state layer.
[0014] Therefore, the present invention employs the above-mentioned method for constructing a multi-level power grid morphology model for urban power grids, which has the following effective effects: (1) The multi-level power grid morphology model of urban power grid is divided into three levels: network structure layer, functional attribute layer and operation status layer, which are superimposed and gradually specified. The three layers are independent of each other and can be updated and maintained by themselves. They are also seamlessly integrated through a unified graph data structure, so that the final model covers the grid connection relationship, equipment electrical parameters and dynamic operation status. It can fully support the subsequent calculation of morphology index system and morphology evaluation analysis, and solve the problem of single dimension and fragmented information in the existing model. (2) By introducing typical daily load curves to perform steady-state power flow calculations at multiple time sections, the actual transmission direction of active power is used as the direction attribute of the edge, realizing the transformation of unweighted and undirected graphs into weighted and directed graphs, and storing operating information such as power values, load rates, node voltage amplitudes and phase angles into the model attributes simultaneously; the model constructed in this way can support both single-section static analysis and time-series dynamic evolution analysis, providing a data foundation for time-series calculation and trend judgment of morphological indicators; (3) The implementation path of the entire chain, starting from the original data such as the network structure ledger and equipment parameter table, through NetworkX topology modeling, pandas data access, and Matpower power flow calculation, is clearly defined. Each link is based on mature open source tools. The process is clear and highly reusable, which facilitates automated modeling in actual engineering and significantly improves modeling efficiency and operability. (4) The feasibility of the completed model is judged by multiple standards, such as multi-section power flow convergence test, positive correlation verification between active power loss and load demand, and voltage reduction characteristics of nodes at each voltage level. This ensures that the model is reasonable at the electrical and physical level and provides a guarantee for the reliability of subsequent analysis results.
[0015] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0016] Figure 1This is an overall flowchart of a method for constructing a multi-level power grid morphology model for urban power grids according to the present invention. Figure 2 This is a schematic diagram of the structure of a multi-level power grid morphology model according to an embodiment of the present invention; Figure 3 This is a schematic diagram illustrating the construction process of a multi-level power grid morphology model according to an embodiment of the present invention; Figure 4 This is a typical daily load curve according to an embodiment of the present invention; Figure 5 A comparison of 24-hour power loss and load power in a multi-level power grid morphology model according to an embodiment of the present invention; Figure 6 This is a comparison of the lowest voltage at each voltage level node in a multi-level power grid morphology model over 24 hours, as presented in this embodiment of the invention. Detailed Implementation
[0017] The following detailed description of embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0018] Please see Figure 1 A method for constructing a multi-level power grid morphology model for urban power grids includes the following steps: S1. Obtain the node parameter table and line parameter table from the grid structure ledger of the target city's power grid, extract the physical connection relationship between nodes, and use the physical connection relationship between nodes as edges to obtain the node list and edge list.
[0019] The node parameter table describes the electrical characteristics of nodes, including node number, node voltage level, connected power capacity, and load demand. The line parameter table describes the physical characteristics of edges, including the line number, starting node number, ending node number, equipment type (line / transformer), rated capacity (MVA), impedance parameters, and line length. The node list includes node number information, and the edge list includes node number information at both ends of the line. The target city power grid covers 500kV, 220kV, 110 / 35kV, and 10kV. Nodes are divided into three categories: pure power transfer nodes, load nodes, and generation nodes. Load nodes are nodes with a load demand greater than zero in their node attributes, and generation nodes are nodes with a power capacity greater than zero in their node attributes. Nodes include substations, busbars, switchyards / ring mains cabinets, feeder sections / connection points, distribution transformer connection points, and distributed power (PV / energy storage / charging pile) grid connection points. Physical connections include transmission lines, transformer lines, transformer winding connections within the station, busbar sectional / tie switch connections within the station, and connections between feeder trunk lines and branch lines.
[0020] S2. Construct the network structure layer based on the node list and edge list; Import the NetworkX library from Python and create a blank undirected graph object G = nx.Graph(). Read the node list and load all nodes in the list into the graph in batches using the G.add_nodes_from() method. The loaded nodes only represent topological locations and do not configure node attributes. Read the edge list. Each physical connection relationship in the edge list is represented by a tuple consisting of two nodes. Add all physical connections in the edge list into the graph in batches using the G.add_edges_from() method to generate an undirected and unweighted edge structure. Edges are used to represent physical electrical connections between nodes without direction distinction. This forms an unweighted and undirected graph that only carries the topological connection relationships of the power grid as the network structure layer.
[0021] The topology in the network structure layer includes: A double-ring network structure for 500kV transmission networks; Radial structures used in 220kV transmission networks, or structures combining ring networks and radial structures; Radial, ring, or chain structures for 110 / 35kV high-voltage distribution networks; Double-ring structure, single-ring structure, single-ring combined with radial structure, double-petal structure, diamond structure or snowflake structure for 10kV medium voltage distribution network.
[0022] S3. Construct a functional attribute layer based on the line parameter table and node parameter table; This paper uses Python's pandas library to read line parameter tables in Excel format. The `pd.read_excel()` method reads the data and stores it into a DataFrame structure, where each row corresponds to an edge and all its physical attributes in the network structure layer. Each row of the line parameter table is traversed to obtain the start and end node numbers, locating the corresponding edge in the network structure layer. The attribute dictionary for that edge is accessed directly using `G.edges[start_node, end_node]`, storing the equipment type, rated capacity, impedance parameters, and line length information from the current row as key-value pairs in the edge's attributes. Based on pre-defined morphological analysis requirements, a key attribute is selected from the stored edge attributes as the graph theory calculation weight for the edge, allowing direct use in graph theory index calculations. The paper also uses Python's pandas library to read node parameter tables in Excel format. Each row of the node parameter table is traversed, and the voltage level, connected power capacity, and load demand information for each node are stored as key-value pairs in the corresponding node's attributes using the node's attribute dictionary. Therefore, the unweighted undirected graph is extended into a weighted undirected graph that carries electrical function parameters and graph theory calculation weights, serving as a functional attribute layer.
[0023] S4. Based on the network structure layer and functional attribute layer, the actual operating status of the target city's power grid is introduced to construct the operation status layer; The node voltage levels, power capacity, and load demand information, as well as the impedance parameters and rated capacity information of edges in the weighted undirected graph with functional attributes, are exported into a format recognizable by Matlab and Matpower. An AC power flow calculation model based on the node admittance matrix is then established. Typical daily load curves of the target city's power grid are obtained, and the power of each load node is time-series allocated according to these curves. The steady-state power flow at each time segment is calculated using the AC power flow calculation model. The active power flow direction and magnitude of each edge are extracted from the power flow calculation results at each time segment, with the actual transmission direction of active power used as the direction of that edge at that time segment. Based on the weighted undirected graph, active power outflow nodes are used as the starting points of directed edges, and active power inflow nodes are used as the ending points. The active power value and load factor of each edge at each time segment are stored in the attributes of that directed edge, thus converting the undirected edge into a directed edge. The output, voltage amplitude, and phase angle of each generating node are extracted from the power flow calculation results and stored as dynamic operating information in the attributes of the corresponding node. Therefore, the weighted undirected graph is transformed into a weighted directed graph carrying runtime state information, which serves as the runtime state layer.
[0024] S5. The multi-level power grid morphology model includes a structural model and a power flow model. The structural model includes a network structure layer and a functional attribute layer, while the power flow model includes an operational status layer. The structural model includes the grid structure at different voltage levels, source and load arrangements, and inter-layer connections. The power flow model derives the power flow distribution, power transmission direction, and node voltages based on power output, load demand, branch parameters, and operational boundaries.
[0025] For the network structure layer, the actual urban power grid structure is extracted. Based on graph theory, the NetworkX toolkit is used to transform the extracted nodes and edges into an unweighted, undirected complex network model. For the functional attribute layer, the attributes of the edges include functional information such as line / transformer, rated capacity, impedance, and line distance. A key attribute of the line, such as capacity, can be used as a weight based on the analysis requirements. The attributes of the nodes include voltage level, connected power capacity, and load demand.
[0026] For the operational layer, considering load fluctuations under daily urban power grid operation, a power flow model is constructed using Matlab and Matpower. The direction of power transmission under actual operating conditions is used as the direction of the edge at a certain time segment in actual operation, and the power output is used as one of the node information, ultimately forming a weighted and directed complex network model. Through the layer-by-layer superposition of these three networks, a multi-level model based on the actual large-scale urban power grid is finally formed.
[0027] Please see Figure 2-3 The entire model is constructed in three layers, a progressive process of enriching information layer by layer. The bottom layer: the network structure layer, is an unweighted, undirected graph. It's an unweighted, undirected network built based on node and edge data, providing only the pure topological skeleton of the power grid and defining the "node-edge" connection relationships. The middle layer: the functional attribute layer, is a weighted, undirected network built considering the physical attributes of nodes and edges. On top of the skeleton, it adds physical parameters of lines / transformers and node power / load characteristics, and assigns analytical weights to edges, giving the topology an electrophysical meaning. At this point, the graph is still undirected, reflecting the bidirectional possibility of physical connections between devices. The top layer: the operational status layer, is a weighted, directed network considering the power flow distribution under daily operation. It overlays the power flow operation points at specific times onto the physical attribute network, determining the actual direction of power transmission and incorporating dynamic information such as power output and node voltage, transforming the undirected attribute graph into a weighted, directed complex network model.
[0028] To verify the feasibility of the constructed multi-level power grid model, power flow testing was conducted. Typical daily load curves were simulated based on actual large-scale urban power grid load conditions. Please refer to [link / reference]. Figure 4Based on typical daily load curves, steady-state power flow calculations were performed on power grid models with single-station-one-zone and multi-station-multi-zone power supply modes. The obtained power flow results all converged normally. A detailed analysis of the power flow results for the single-station-one-zone power supply mode is now provided.
[0029] The urban power grid constructed includes the load demand power and active power loss within a 24-hour period, as follows: Figure 5 As shown in the figure, it can be seen that active power loss and load fluctuation exhibit a significant positive correlation.
[0030] The minimum voltage amplitude of nodes at different voltage levels is as follows: Figure 6 As shown, the 500kV node voltage remained relatively stable, indicating strong voltage support capacity of the main grid. The minimum voltages of the 220kV, 110kV, and 35kV nodes were generally stable, but still showed some fluctuations with load changes. The minimum voltage of the 10kV node was relatively low and more sensitive to load changes. This result is consistent with the tiered power supply structure of urban power grids, where high-voltage networks mainly undertake large-capacity transmission and voltage support, while medium- and low-voltage distribution networks are closer to the load side and are more significantly affected by load fluctuations, power supply radius, and line impedance, thus making them more prone to becoming weak voltage links.
[0031] Therefore, this invention adopts the aforementioned method for constructing a multi-level grid morphology model for urban power grids. The multi-level grid morphology model is divided into three layers: network structure layer, functional attribute layer, and operational status layer, which are sequentially superimposed and progressively specified. These three layers are independent of each other and can be updated and maintained independently, while seamless integration is achieved through a unified graph data structure. This ensures that the final model simultaneously covers grid connection relationships, equipment electrical parameters, and dynamic operating status, comprehensively supporting subsequent morphology index system calculations and morphology evaluation analysis. This solves the problems of single-dimensionality and fragmented information in existing models. By introducing typical daily load curves for multi-time-section steady-state power flow calculations, and using the actual active power transmission direction as the edge direction attribute, the transformation from an unweighted and undirected graph to a weighted and directed graph is achieved. Furthermore, operational information such as power values, load rates, node voltage amplitudes, and phase angles are synchronously stored in the model attributes. The model constructed in this way supports both single-section static analysis and time-series dynamic evolution analysis, providing a data foundation for time-series calculation and trend judgment of morphological indicators. It clarifies the entire implementation path from raw data such as network structure ledgers and equipment parameter tables, through NetworkX topology modeling, pandas data access, and Matpower power flow calculation. Each step is implemented based on mature open-source tools, with a clear process and strong reusability, facilitating automated modeling in actual engineering and significantly improving modeling efficiency and operability. Through multiple standards such as multi-section power flow convergence verification, positive correlation verification between active power loss and load demand, and voltage level-by-level voltage decrease characteristic discrimination at each voltage level, the feasibility of the constructed model is judged, ensuring its rationality at the electrical and physical level and providing a guarantee for the reliability of subsequent analysis results.
[0032] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the technical solutions of the present invention, and these modifications or equivalent substitutions cannot cause the modified technical solutions to deviate from the spirit and scope of the technical solutions of the present invention.
Claims
1. A method for constructing a multi-level power grid morphology model for urban power grids, characterized in that, Includes the following steps: S1. Obtain the node parameter table and line parameter table from the grid structure ledger of the target city's power grid, extract the physical connection relationship between nodes, and use the physical connection relationship between nodes as edges to obtain the node list and edge list. S2. Construct the network structure layer based on the node list and edge list; S3. Construct a functional attribute layer based on the line parameter table and node parameter table; S4. Based on the network structure layer and functional attribute layer, the actual operating status of the target city's power grid is introduced to construct the operating status layer; S5. The network structure layer, functional attribute layer, and operation status layer are superimposed layer by layer to obtain a multi-level power grid morphology model.
2. The method for constructing a multi-level power grid morphology model for urban power grids according to claim 1, characterized in that: The node parameter table describes the electrical characteristics of the nodes, including node number information, node voltage level, connected power capacity, and load demand information; the line parameter table describes the physical characteristics of the edges, including the line number of each edge, starting node number information, ending node number information, equipment type, rated capacity information, impedance parameters, and line length information.
3. The method for constructing a multi-level power grid morphology model for urban power grids according to claim 2, characterized in that: The node list includes node number information, and the edge list includes node number information at both ends of the line.
4. The method for constructing a multi-level power grid morphology model for urban power grids according to claim 3, characterized in that: The target city's power grid covers 500kV, 220kV, 110 / 35kV and 10kV.
5. The method for constructing a multi-level power grid morphology model for urban power grids according to claim 4, characterized in that: Nodes are divided into three categories: pure power transfer nodes, load nodes, and power generation nodes. Load nodes are nodes whose load demand is greater than zero in the node attributes, and power generation nodes are nodes whose power capacity is greater than zero in the node attributes.
6. The method for constructing a multi-level power grid morphology model for urban power grids according to claim 5, characterized in that, The specific process of constructing the network structure layer in S2 is as follows: Import the NetworkX library of Python to create a blank undirected graph object; read the node list and batch load all nodes in the list into the graph object. The loaded nodes represent the topological location and do not configure node attributes; read the edge list. Each physical connection relationship in the edge list is represented by a tuple consisting of two nodes. Batch add all physical connection relationships in the edge list into the graph object to generate an undirected and unweighted edge structure. The edges are used to represent physical electrical connections between nodes without direction distinction; and form an unweighted and undirected graph that carries the topological connection relationship of the power grid as the network structure layer.
7. The method for constructing a multi-level power grid morphology model for urban power grids according to claim 6, characterized in that, The topology in the network structure layer includes: A double-ring network structure for 500kV transmission networks; Radial structures used in 220kV transmission networks, or structures combining ring networks and radial structures; Radial, ring, or chain structures for 110 / 35kV high-voltage distribution networks; Double-ring structure, single-ring structure, single-ring combined with radial structure, double-petal structure, diamond structure or snowflake structure for 10kV medium voltage distribution network.
8. The method for constructing a multi-level power grid morphology model for urban power grids according to claim 7, characterized in that, The specific process of constructing the functional attribute layer in S3 is as follows: The pandas library in Python is used to read the line parameter table in Excel format and store the read data into a DataFrame data structure. Each row corresponds to an edge in the network structure layer and all its physical attributes. Traverse each row of the line parameter table, obtain the start node number information and the end node number information, locate the corresponding edge in the network structure layer, and store the equipment type, rated capacity, impedance parameters and line length information in the current row of data into the attributes of the edge in the form of key-value pairs through the attribute dictionary of the edge. Based on the preset morphological analysis requirements, a key attribute is selected from the stored edge attributes as the graph theory calculation weight of the edge, so that it can be directly called in the graph theory index calculation. Use Python's pandas library to read node parameter tables in Excel format; Iterate through each row of the node parameter table, and store the voltage level, connected power capacity and load demand information of each node in the corresponding node's attribute in key-value pairs through the node's attribute dictionary. Therefore, the unweighted undirected graph is extended into a weighted undirected graph that carries electrical function parameters and graph theory calculation weights, serving as a functional attribute layer.
9. A method for constructing a multi-level power grid morphology model for urban power grids according to claim 8, characterized in that, The specific process of building the runtime layer in S4 is as follows: The node voltage levels, power supply capacity, load demand information, and edge impedance parameters and rated capacity information in the weighted undirected graph are exported into a format suitable for AC power flow calculation tools to establish an AC power flow calculation model based on the node admittance matrix. Obtain the typical daily load curve of the target city's power grid, allocate the power of each load node in a time sequence according to the typical daily load curve, and use the AC power flow calculation model to calculate the steady-state power flow of each time section. Extract the active power flow direction and active power magnitude of each edge from the power flow calculation results of each time section, and use the actual transmission direction of active power as the direction of that edge under that time section. Based on a weighted undirected graph, the active power outflow node is taken as the starting point of the directed edge and the active power inflow node is taken as the ending point of the directed edge. The active power value and load rate of each edge at each time section are stored in the attributes of the directed edge, thereby converting the undirected edge into a directed edge. The output, voltage amplitude, and phase angle of each generating node are extracted from the power flow calculation results and stored as dynamic operation information in the attributes of the corresponding node. Therefore, the weighted undirected graph is transformed into a weighted directed graph carrying runtime state information, which serves as the runtime state layer.