A line-end-point-based main distribution network power system topology through calculation method and device
Patent Information
- Application Number
- CN202610908389.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-23
- Publication Date
- 2026-10-23
AI Technical Summary
当需要确定某一组场站的完整同步范围时,无法自动计算通过线路关联的对端场站,只能依赖人工配置,工作量大且容易遗漏
[0042](1)自动化程度高。通过线路端点联合采集和表号前缀自动识别,无需人工配置线路类型和对端场站映射关系,从种子场站出发即可自动计算完整的同步场站范围。
Smart Images

Figure CN122969092A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of power system technology, specifically relating to a method and apparatus for calculating the topology of a main and distribution power system based on line endpoints. Background Technology
[0002] With the continuous expansion of the power system and the advancement of new power system construction, the dispatch model management of the main grid (transmission network, typically covering voltage levels of 220kV and above) and distribution network (distribution network, typically covering voltage levels of 10kV and below) faces increasingly severe challenges. In existing power dispatch automation systems, the model data of the main grid and distribution network are usually modeled and managed independently.
[0003] Currently, the data model for transmission equipment on the main grid side adopts the 12XX coding system. The core data objects of the main grid transmission line topology are AC lines (ACLine, table 1201), AC segments (ACLineSeg, table 1202), T-nodes (TNode, table 1203), T-connected lines (TLine, table 1204), and DC lines (DCLine, table 1206). Line endpoints, as virtual objects (AC line endpoint ACLineEnd, table 1210; DC line endpoint DCLineEnd, table 1211; T-connected line endpoint TLineEnd, table 1212), bridge the logical connections between line equipment and their respective substations. Substation containers include power plants (Plant, table 0111), substations (Substation, table 0112), and converter stations (ConverSubstation, table 0113). T-nodes also exist as abstract containers (table 0419), serving as intermediate nodes for topology branches.
[0004] The main grid's transmission equipment data model adopts the 12XX coding system. The core data objects of the main grid transmission line topology are AC lines (ACLine, table 1201), AC segments (ACLineSeg, table 1202), T-nodes (TNode, table 1203), T-connected lines (TLine, table 1204), and DC lines (DCLine, table 1206). Line endpoints, as virtual objects (AC line endpoint ACLineEnd, table 1210; DC line endpoint DCLineEnd, table 1211; T-connected line endpoint TLineEnd, table 1212), bridge the logical connections between line equipment and their respective substations. Substation containers include power plants (Plant, table 0111), substations (Substation, table 0112), and converter stations (ConverSubstation, table 0113). T-nodes also exist as abstract containers (table 0419), serving as intermediate nodes for topology branches.
[0005] However, the relevant technical solutions have the following shortcomings:
[0006] (1) The main network and distribution network models are independent of each other and lack a unified topology connection calculation mechanism. When it is necessary to determine the complete synchronization range of a certain group of stations, it is impossible to automatically calculate the peer stations connected by the lines. It can only rely on manual configuration, which is labor-intensive and prone to omissions.
[0007] (2) For multi-terminal topologies such as T-connected lines, existing methods cannot automatically handle the cascading relationships of T nodes. T-connected lines are connected to the trunk AC lines through T nodes, forming complex topologies such as typical T-connections, π-connections, and even multi-level cascading. Traditional methods are difficult to recursively expand and fully calculate all associated stations.
[0008] (3) Different types of lines (AC lines, DC lines, T-connected lines) have different topological characteristics. Existing methods lack a unified line type identification and differentiated processing strategy, resulting in inaccurate or incomplete derivation of end stations.
[0009] (4) When the power grid model changes, the scope of the substation needs to be manually reconfigured. There is a lack of incremental update and dynamic refresh mechanism, resulting in high maintenance costs. Summary of the Invention
[0010] Objective: In view of at least one of the above technical problems, this application provides a method and apparatus for calculating the topology connection of the main and distribution power systems based on the endpoints of the line. Starting from a set of given seed stations, the method automatically and completely calculates the range of all synchronous stations, including the opposite station, based on the topological association relationship of the power system line endpoints. In particular, it can handle the complex multi-end topology structure of T-connected lines and realize the topology connection between the main network and the distribution network.
[0011] The technical solution adopted in this application is as follows:
[0012] Firstly, this application provides a method for calculating the topology connectivity of a main and distribution power system based on line endpoints, including:
[0013] Step S1: Obtain all line endpoint information associated with the seed site set. Each line endpoint information includes a line identifier and a site identifier.
[0014] Step S2: Based on the first four characters of the line identifier in the line endpoint information, automatically identify the line type as AC line, DC line or T-connection line, and classify them into AC line set, DC line set and T-connection line set;
[0015] Step S3: Query the attribute table of each AC line and DC line respectively to obtain the starting station identifier and the ending station identifier. Use the "exclude this side + exclude T node" strategy to calculate the peer station and add it to the peer station set.
[0016] Step S4: For each T-connection line, execute a three-level recursive expansion algorithm to calculate the peer station and add it to the peer station set.
[0017] In some embodiments, based on the first four characters of the line identifier in the line endpoint information, the line type is automatically identified as an AC line, DC line, or T-connection line, and classified into AC line set, DC line set, and T-connection line set, including:
[0018] Lines identified by the prefix "1201" are AC lines, those starting with "1206" are DC lines, and those starting with "1204" are T-connected lines. Lines of the same type are grouped into AC line set, DC line set, and T-connected line set respectively.
[0019] In some embodiments, the strategy of "excluding this side + excluding T-nodes" is used to calculate the peer site, including:
[0020] The determination of the remote terminal station follows a triple filtering rule:
[0021] (1) The station sign is not empty;
[0022] (2) Station signs do not begin with "0419";
[0023] (3) The site identifier is not in the seed site set;
[0024] Stations that simultaneously meet conditions (1)-(3) are identified as peer stations and added to the peer station set.
[0025] In some embodiments, for each T-connection line, a three-level recursive expansion algorithm is executed to calculate the peer station and add it to the peer station set, including:
[0026] First layer: Query the T-connection line attribute table, and check the start node identifier and end node identifier of each T-connection line. Nodes starting with "0419" are identified as T nodes and merged into the T node set.
[0027] Second layer: Query the T-node container table, obtain the trunk AC line identifier associated with each T-node through the line identifier of the T-node, and obtain the set of trunk lines associated with the T-node;
[0028] The third layer: Calculate the intersection of the set of trunk lines associated with node T and the set of AC lines. Subtract the intersection from the set of trunk lines associated with node T to obtain the extended AC lines. Query the attribute table for the extended AC lines to obtain the starting station identifier and the ending station identifier. Use the strategy of "excluding this side + excluding T nodes" to calculate the counterpart station and add it to the counterpart station set.
[0029] Furthermore, the method also includes: Step S5: If there is an extended AC line, dynamically supplement the station range according to the extended AC line.
[0030] In some embodiments, dynamically supplementing the site range based on extended AC lines includes:
[0031] Step S51: Query the T-node container table, obtain the identifier of each T-node through the line identifier, query the T-connection line attribute table according to the T-node identifier to obtain the start node identifier and end node identifier of the T-connection line, identify the nodes starting with "0419" as T-nodes, merge them into the T-node set, and use the "exclude this side + exclude T-nodes" strategy to calculate the peer station and add it to the peer station set.
[0032] Step S52: If a new T node is found, obtain the new T node associated line. For the new T node associated line, return to iterative execution of steps S51 to S52 until no new T node is found for the new T node associated line. The iteration stops, and the final set of peer stations is output. The complete station range = seed station set ∪ peer station set is obtained.
[0033] In some embodiments, obtaining all line endpoint information associated with the seed site set includes:
[0034] Using the seed site set as input, the system performs a joint query of the AC line endpoint table, DC line endpoint table, and T-connection line endpoint table to obtain all associated line endpoint information at once.
[0035] Secondly, this application provides a topology computing device for main and distribution power systems based on line endpoints, including a processor and a storage medium;
[0036] The storage medium is used to store instructions;
[0037] The processor is configured to operate according to the instructions to execute the method described in accordance with the first aspect.
[0038] Thirdly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in the first aspect.
[0039] Fourthly, this application provides a computer device including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method described in the first aspect.
[0040] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the method described in the first aspect.
[0041] Beneficial effects: The method and apparatus for calculating the topology of the main and distribution power systems based on line endpoints provided in this application have the following advantages:
[0042] (1) High degree of automation. Through joint acquisition of line endpoints and automatic identification of table number prefix, there is no need to manually configure the line type and the mapping relationship of the peer station. The complete range of synchronization stations can be automatically calculated starting from the seed station.
[0043] (2) Good topological integrity. Through the three-level recursive expansion algorithm of T nodes and the bidirectional node traversal strategy, it can automatically handle various complex topological forms such as typical T-connections, π-connections, and multi-level cascades, ensuring that no related stations are missed.
[0044] (3) Unified processing of main and distribution network models. Based on the unified query mechanism of line endpoints, it supports AC lines, DC lines and T-connected lines of the main network, and can also be extended to the topology calculation of distribution network feeders to realize the unified connection of main and distribution network topology.
[0045] (4) Supports incremental updates. The station scope supports incremental loading and dynamic refresh at the single-station level. When the power grid model changes, there is no need to recalculate the entire data, which significantly reduces maintenance costs.
[0046] (5) High computational efficiency. AC / DC lines adopt direct table lookup derivation with O(1) complexity, and T-connection lines adopt efficient nested SQL to realize atomic execution of multi-level queries, supporting paginated parallel processing of large-scale station sets, meeting the second-level processing requirements of tens of thousands of lines. Attached Figure Description
[0047] Figure 1 This is a flowchart illustrating a method for calculating the topology of a main and distribution power system based on line endpoints according to an embodiment of this application.
[0048] Figure 2 This is a schematic diagram of the system framework according to an embodiment of this application. Detailed Implementation
[0049] The present application will be further described below with reference to the accompanying drawings and embodiments. The following embodiments are only used to more clearly illustrate the technical solutions of the present application, and should not be used to limit the scope of protection of the present application.
[0050] In the description of this application, "several" means one or more, "multiple" means two or more, "greater than," "less than," and "exceeding" are understood to exclude the stated number, while "above," "below," and "within" are understood to include the stated number. The use of "first" and "second" in the description is merely for distinguishing technical features and should not be construed as indicating or implying relative importance, or implicitly indicating the number of indicated technical features, or implicitly indicating the order of the indicated technical features.
[0051] In the description of this application, the terms "one embodiment," "some embodiments," "illustrative embodiment," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0052] The term "and / or" simply describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. Additionally, the character " / " generally indicates that the preceding and following related objects have an "or" relationship.
[0053] Example 1: This example provides a method for calculating the topology of the main distribution network power system based on the endpoints of the lines, such as... Figure 1 As shown, it includes:
[0054] Step S1: Obtain all line endpoint information associated with the seed site set. Each line endpoint information includes a line identifier and a site identifier.
[0055] Step S2: Based on the first four characters of the line identifier in the line endpoint information, automatically identify the line type as AC line, DC line or T-connection line, and classify them into AC line set, DC line set and T-connection line set;
[0056] Step S3: Query the attribute table of each AC line and DC line respectively to obtain the starting station identifier and the ending station identifier. Use the "exclude this side + exclude T node" strategy to calculate the peer station and add it to the peer station set.
[0057] Step S4: For each T-connection line, execute a three-level recursive expansion algorithm to calculate the peer station and add it to the peer station set.
[0058] Step S5: If there are extended AC lines, dynamically supplement the station range according to the extended AC lines.
[0059] Each step is described in detail below.
[0060] Step S1: Obtain all line endpoint information associated with the seed site set. Each line endpoint information includes a line identifier (LINE_ID) and a site identifier (ST_ID).
[0061] In some embodiments, step S1 specifically includes: taking the seed site set as input, performing a joint query on the AC line endpoint table (SG_DEV_ACLINEEND_B), the DC line endpoint table (SG_DEV_DCLINEEND_B), and the T-connection line endpoint table (SG_DEV_TLINEEND_B) to obtain all associated line endpoint information at once. Specifically, a UNION query statement is executed, with the filtering condition being that the site identifier (ST_ID) of the line endpoint belongs to the seed site set. The output is the local line endpoint set, where each endpoint record contains a line identifier (LINE_ID) and a site identifier (ST_ID). When the number of seed sites is large, a paginated parallel processing strategy is adopted to query the site set in batches and then merge the results.
[0062] Step S2: Based on the first four characters of the line identifier in the line endpoint information, automatically identify the line type as AC line, DC line or T-connection line, and classify them into AC line set, DC line set and T-connection line set.
[0063] In some embodiments, in step S2, line identifiers (LINE_ID) starting with "1201" are identified as AC lines (ACLine), those starting with "1206" are identified as DC lines (DCLine), and those starting with "1204" are identified as T-connected lines (TLine). The identifiers of the same type of line are respectively grouped into AC line set, DC line set and T-connected line set.
[0064] Step S3: Query the attribute tables (SG_DEV_ACLINE_B and SG_DEV_DCLINE_B) for each AC line and DC line respectively, obtain the starting station identifier (START_ST_ID) and the ending station identifier (END_ST_ID), calculate the peer station using the "exclude this side + exclude T node" strategy, and add it to the peer station set.
[0065] In this embodiment, for AC and DC lines in a point-to-point topology, their line attribute tables (SG_DEV_ACLINE_B and SG_DEV_DCLINE_B) are queried to obtain the starting station identifier (START_ST_ID) and ending station identifier (END_ST_ID) for each line. For the two endpoint stations of each line, a "excluding local" strategy is used to calculate the peer station: station identifiers belonging to the seed station set are excluded, as are identifiers starting with the T node prefix "0419" (because T nodes are not stations), and the remaining ones are the peer stations. All peer station identifiers are then merged into the peer station set.
[0066] In some embodiments, in step S3, the determination of the peer station follows a triple filtering rule: (1) the station identifier is not empty; (2) the station identifier does not start with "0419" (excluding T nodes); (3) the station identifier is not in the seed station set (excluding local stations); the station identifier that meets all the above conditions is the peer station and is added to the peer station set toStationSet.
[0067] Step S4: For each T-connection line, execute a three-level recursive expansion algorithm to calculate the peer station and add it to the peer station set.
[0068] In some embodiments, the three-level recursive expansion algorithm specifically includes:
[0069] Step S41: First Layer—T-connection to T-node: Query the T-connection line attribute table (SG_DEV_TLINE_B), and simultaneously check the start node identifier (START_NODE_ID) and end node identifier (END_NODE_ID) of each T-connection line. Nodes starting with the T-node prefix "0419" are identified as T-nodes and added to the T-node set. A UNION query is used to process both the start and end points simultaneously, ensuring that asymmetrical T-connection structures (one end connecting to the station, the other end connecting to a T-node) are not missed.
[0070] Step S42: Second layer — T node to trunk line: Query the T node container table (SG_CON_TNODE_B), obtain the trunk AC line identifier associated with each T node through the line identifier (LINE_ID) of the T node, and obtain the trunk line set associated with the T node (ACLine1).
[0071] Step S43: Third Layer—Line Set Merging and Reverse Station Calculation: Calculate the intersection of the trunk line set associated with node T and the AC line set, and subtract the intersection from the trunk line set associated with node T to obtain the extended AC line; query the attribute table for the extended AC line to obtain the starting station identifier (START_ST_ID) and the ending station identifier (END_ST_ID), and calculate the reverse station using the same "exclude this side + exclude T node" strategy as in step S3, and add it to the reverse station set.
[0072] In some embodiments, the method further includes: Step S5: If an extended AC line exists, dynamically supplement the site range according to the extended AC line, specifically including:
[0073] Step S51: Query the T-node container table (SG_CON_TNODE_B), obtain the identifier TNODE_ID of each T-node through the line identifier (LINE_ID), query the T-connection line attribute table (SG_DEV_TLINE_B) according to the T-node identifier TNODE_ID to obtain the start node identifier (START_NODE_ID) and end node identifier (END_NODE_ID) of the T-connection line, identify the nodes that start with the T-node prefix "0419" as T-nodes, merge them into the T-node set, and use the same "exclude this side + exclude T-nodes" strategy as in step S3 to calculate the peer station and supplement it into the peer station set;
[0074] Step S52: If a new T node is found, obtain the new T node associated line. For the new T node associated line, return to iterative execution of steps S51 to S52 until no new T node is found for the new T node associated line. The iteration stops and the final set of peer stations is output, resulting in the complete station range = seed station set ∪ peer station set.
[0075] It should be noted that if there is no extended AC line, step S5 is not required, and the set of remote stations obtained in step S4 can be directly used as the final set of remote stations.
[0076] In some embodiments, the entire site range is stored in a cache for subsequent data filtering and model synchronization.
[0077] This application supports the following three typical T-connection topologies:
[0078] Form 1 (Typical T-connection): A T-connection branch off from a point on a main AC line via a T-node, forming a three-terminal structure. The T-node connects the main line and the branch line, and can be fully expanded through three levels of recursion.
[0079] Form 2 (π-connection / Double T-connection): A main line branches into two T-connection lines at the same T-node, each leading to a different station, forming a four-terminal structure. The bidirectional node traversal mechanism of this application can simultaneously discover the opposite stations of the two T-connection lines.
[0080] Type 3 (Multi-level Cascaded T-connection): Multiple T-nodes are cascaded and connected to form a complex multi-terminal network. This application ensures the complete unfolding of the cascaded relationship by iteratively merging the line set and recalculating the T-nodes.
[0081] Application Example: The topology connectivity calculation method of this application is applied to the model synchronization module of a power dispatch automation system. For example... Figure 2 As shown, the overall system architecture consists of three layers: the data source layer, the computing engine layer, and the cache service layer.
[0082] The data source layer is responsible for managing power system model data, including the substation container table (SG_CON_SUBSTATION_B, SG_CON_PLANT_B, SG_CON_CONVERSUBSTATION_B), line equipment table (SG_DEV_ACLINE_B, SG_DEV_DCLINE_B, SG_DEV_TLINE_B), line endpoint table (SG_DEV_ACLINEEND_B, SG_DEV_DCLINEEND_B, SG_DEV_TLINEEND_B), and T-node container table (SG_CON_TNODE_B) on the main grid side, as well as the feeder table (SG_CON_FEEDERLINE_B), distribution network topology table (SG_CON_DPWRGRID_R_TOPO), and distribution network node table (SG_CON_DPWRGRID_P_NODE) on the distribution network side.
[0083] The computation engine layer is the core module of this application, realizing topology connectivity calculations starting from the seed site. The computation engine includes five sub-modules: a line endpoint collector, a line type classifier, a peer site deducer, a T-node recursive expander, and a site range supplementer.
[0084] The caching service layer is responsible for storing computation results, including site cache, line cache, T-node cache, and peer site cache, and supports incremental updates and dynamic refreshes.
[0085] According to the "Structured Design Specification for General Data Objects in Power Dispatch", the core data objects and their coding system on the main grid side are shown in the table below:
[0086]
[0087] In this model, line endpoints (ACLineEnd, DCLineEnd, TLineEnd) are virtual objects that do not correspond to physical equipment entities. Instead, they act as logical bridges between line equipment and their respective stations in the data model. Each line endpoint is associated with its station via a station identifier (ST_ID) and with its line via a line identifier (LINE_ID). T-nodes (TNode, table number 0419) exist both as equipment objects (table number 1203) and as topology abstract containers, and are associated with their respective trunk AC lines via the LINE_ID field.
[0088] According to the "Distribution Network Dispatch Model Specification", the distribution network side adopts the 17XX coding system, and the core data objects are shown in the table below:
[0089]
[0090] The distribution network feeder table (SG_CON_FEEDERLINE_B) is a key data object connecting the main distribution network model. Its starting substation field (START_ST_ID) references the main grid substation table (SG_CON_SUBSTATION_B), enabling upward tracing of the distribution network feeder to the main grid substation. Simultaneously, its grid-related field (GRID_ID) references the main grid container table (SG_CON_PWRGRID_B), establishing a hierarchical affiliation.
[0091] The distribution network topology table (SG_CON_DPWRGRID_R_TOPO) uses two foreign keys, the first-end node number (FIRST_NODE_ID) and the last-end node number (SECOND_NODE_ID), to reference the distribution network node table. It describes the topology connections in a "line endpoint pair" manner, consistent with the design philosophy of the main network's line endpoints. The ID encoding rule for distribution network nodes is "feeder ID (18 bits) + 4-bit sequence number," enabling nodes to inherently carry information about their associated feeder.
[0092] The boundary connection of the main distribution network model is achieved through the following three-layer relationship:
[0093] The first level (station level): The starting substation field (START_ST_ID) of the distribution network feeder directly references the substation ID in the main grid substation table, establishing the physical association between each distribution network feeder and its superior main grid substation.
[0094] The second layer (power grid level): The power grid field (GRID_ID) of the distribution network feeder references the main power grid container table, which establishes the distribution network model's position in the power system hierarchy.
[0095] The third layer (equipment level): the boundary equipment of the distribution network reuses the main network graphic model, and the equipment of the same type as the main network in the distribution network adopts the main network graphic element style to achieve visual uniformity.
[0096] In the topology connectivity calculation of this application, after obtaining the identifier of the upstream substation through the START_ST_ID field of the distribution network feeder, the substation can be included as a seed station in the topology connectivity calculation process on the main grid side, thereby achieving complete topology connectivity between the main and distribution networks. Conversely, starting from the main grid substation, it is also possible to trace down to the associated distribution network feeder and all the distribution network equipment it contains.
[0097] Specific implementation of step S1 – Joint acquisition of multi-source line endpoints:
[0098] Taking the seed site set stIds = {A, B, C} as an example, execute the following join query:
[0099] SELECT ID, LINE_ID, ST_ID FROM SG_DEV_ACLINEEND_B WHERE ST_ID IN ('A','B','C') UNION
[0100] SELECT ID, LINE_ID, ST_ID FROM SG_DEV_DCLINEEND_B WHERE ST_ID IN ('A','B','C') UNION
[0101] SELECT ID, LINE_ID, ST_ID FROM SG_DEV_TLINEEND_B WHERE ST_ID IN ('A','B','C')
[0102] This query merges three types of line endpoint information into a unified result set. When the number of seed stations exceeds the database IN clause limit, a pagination parallel processing strategy is adopted: the seed station set is paginated according to a fixed batch size (e.g., 1000), each page initiates a query independently, and the query results are merged through an asynchronous parallel mechanism.
[0103] Specific implementation of step S2 – Automatic identification of line type:
[0104] From the set of line endpoint information obtained in step S1, the information is automatically categorized based on the first four characters of the LINE_ID:
[0105] The AC line set acLineSet = all line identifiers in lineendMap whose LINE_ID starts with "1201";
[0106] The DC line set dcLineSet = all line identifiers in lineendMap whose LINE_ID starts with "1206";
[0107] The T-connection line set tLineSet = all line identifiers in lineendMap whose LINE_ID starts with "1204".
[0108] This classification method utilizes the fixed correspondence between equipment type and table number prefix in the power system standard coding system, without requiring additional configuration tables or mapping logic.
[0109] Specific implementation of step S3 – derivation of the AC / DC line at the other end:
[0110] Taking an AC line as an example, query the line attribute table to obtain the origin and destination stations:
[0111] SELECT ID, START_ST_ID, END_ST_ID FROM SG_DEV_ACLINE_B WHERE ID IN(acLineSet)
[0112] For each line in the query results, its START_ST_ID and END_ST_ID represent the station identifiers at both ends of the line, respectively. The determination of the peer station follows a triple filtering rule: (1) the station identifier is not empty; (2) the station identifier does not start with "0419" (excluding T nodes); (3) the station identifier is not in the seed station set (excluding local stations). The station identifier that meets all the above conditions is the peer station and is added to the peer station set toStationSet.
[0113] The handling method for DC lines is exactly the same as that for AC lines.
[0114] Specific implementation of step S4 – recursive expansion of T-connection lines:
[0115] The topology of a T-connection line differs from the simple point-to-point pattern of AC / DC lines, requiring three levels of recursive calculation. The following explanation uses a typical T-connection topology as an example:
[0116] Suppose that station A is connected to station B via trunk AC line ACLine1, and at some point on ACLine1 there exists a node TNode1, which is connected to station C via a T-connector line TLine1. The seed station is {A}, and the goal is to automatically discover the peer stations B and C.
[0117] First-level query (connection T to node T):
[0118] SELECT START_NODE_ID AS NODE_ID FROM SG_DEV_TLINE_B WHERE ID IN(tLineSet) AND START_NODE_ID LIKE '0419%' UNION SELECT END_NODE_ID AS NODE_IDFROM SG_DEV_TLINE_B WHERE ID IN (tLineSet) AND END_NODE_ID LIKE '0419%'
[0119] This query checks both the start and end node identifiers of the T-connection, identifying all nodes starting with "0419" as T nodes and adding them to the T node set. A UNION query is used instead of just checking one end because the topology of a T-connection may be asymmetrical—one end may directly connect to a station, while the other end connects to a T node.
[0120] Second-level query (from node T to the backbone):
[0121] SELECT LINE_ID FROM SG_CON_TNODE_B WHERE ID IN (set of nodes T)
[0122] This query retrieves the backbone AC line identifier for each T node using the LINE_ID field of the T node container table. In this embodiment, the LINE_ID of TNode1 is ACLine1.
[0123] The third layer of processing (line merging and peer calculation): Calculate the intersection of the set of trunk lines associated with node T and the set of AC lines. Subtract the intersection from the set of trunk lines associated with node T to obtain the extended AC lines. For the extended AC lines, query their attribute table to obtain the starting station identifier (START_ST_ID) and the ending station identifier (END_ST_ID). Use the same "exclude this side + exclude T nodes" strategy as in step S3 to calculate the peer stations and add them to the peer station set.
[0124] Specific implementation of step S5 – Dynamic supplementation of site scope:
[0125] After step S4 is completed, the following situation may occur: the trunk line associated with node T is not in the line set directly queried through the line endpoint in step S1, that is, there is an extended AC line. In this case, it is necessary to dynamically supplement the station range for each extended AC line and execute step S5. If there is no extended AC line, step S5 is not required, and the complete station range = seed station set ∪ peer station set is directly output.
[0126] Step S5 specifically includes:
[0127] Step S51: Query the T-node container table (SG_CON_TNODE_B), obtain the identifier TNODE_ID of each T-node through the line identifier (LINE_ID), query the T-connection line attribute table (SG_DEV_TLINE_B) according to the T-node identifier TNODE_ID to obtain the start node identifier (START_NODE_ID) and end node identifier (END_NODE_ID) of the T-connection line, identify the nodes that start with the T-node prefix "0419" as T-nodes, merge them into the T-node set, and use the same "exclude this side + exclude T-nodes" strategy as in step S3 to calculate the peer station and supplement it into the peer station set;
[0128] Step S52: If a new T node is found, obtain the new T node associated line. For the new T node associated line, return to iterative execution of steps S51 to S52 until no new T node is found for the new T node associated line. The iteration stops and the final set of peer stations is output, resulting in the complete station range = seed station set ∪ peer station set.
[0129] Furthermore, in some embodiments, this application supports incremental updates when the power grid model changes (such as the construction of new substations, line upgrades, equipment decommissioning, etc.):
[0130] (1) Adding a new station: When a new station meets the synchronization conditions (such as voltage level, region, etc.) and there is no record of the station in the current cache, the above topology connection calculation is performed with the station as the seed, and the newly added station and its associated peer station are added to the cache.
[0131] (2) Remove station: When the original station no longer meets the synchronization conditions (such as return, transfer of jurisdiction, etc.) and the station record exists in the current cache, remove the station and the peer station associated only with the station from the cache.
[0132] (3) Cascading refresh: After the incremental update is completed, the associated pruning rules are automatically refreshed, and the upper-level module is notified whether the associated cache (such as line cache, T-node cache, etc.) needs to be refreshed through the returned change flag.
[0133] On the distribution network side, the topology connectivity calculation in this application can be extended to the following scenarios:
[0134] (1) Delineation of distribution network scope based on feeder: Starting from START_ST_ID in the distribution network feeder table, obtain the main grid substations upwards and trace all distribution network equipment (feeder sections, substation rooms, circuit breakers, load switches, etc.) included in the feeder downwards through FEEDER_ID.
[0135] (2) Calculation of the connection based on the distribution network topology table: Using FIRST_NODE_ID and SECOND_NODE_ID in the SG_CON_DPWRGRID_R_TOPO table, the topological relationship within the distribution network is calculated in a manner similar to the endpoints of the main network lines.
[0136] (3) Joint topology calculation of main and distribution networks: The main network substation is used as the boundary node. At the same time, the line endpoint connection calculation is performed on the main network side and the feeder topology tracing is performed on the distribution network side to form a complete topology view across the main and distribution networks.
[0137] Example 2: Based on Example 1, this example provides a topology computing device for main and distribution power systems based on line endpoints, including a processor and a storage medium;
[0138] The storage medium is used to store instructions;
[0139] The processor is configured to operate according to the instructions to execute the method according to Embodiment 1.
[0140] Example 3: Based on Example 1, this example provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in Example 1.
[0141] Example 4: Based on Example 1, this example provides a computer device, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the method described in Example 1.
[0142] Example 5: Based on Example 1, this example provides a computer program product, including a computer program that, when executed by a processor, implements the method described in Example 1.
[0143] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0144] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, as well as combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0145] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0146] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0147] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A method for calculating the topology connectivity of a main and distribution power system based on line endpoints, characterized in that, include: Step S1: Obtain all line endpoint information associated with the seed site set. Each line endpoint information includes a line identifier and a site identifier. Step S2: Based on the first four characters of the line identifier in the line endpoint information, automatically identify the line type as AC line, DC line or T-connection line, and classify them into AC line set, DC line set and T-connection line set; Step S3: Query the attribute table of each AC line and DC line respectively to obtain the starting station identifier and the ending station identifier. Use the "exclude this side + exclude T node" strategy to calculate the peer station and add it to the peer station set. Step S4: For each T-connection line, execute a three-level recursive expansion algorithm to calculate the peer station and add it to the peer station set.
2. The method according to claim 1, characterized in that, Based on the first four characters of the line identifier in the line endpoint information, the system automatically identifies the line type as AC line, DC line, or T-connection line, and categorizes them into AC line set, DC line set, and T-connection line set, including: Lines identified by the prefix "1201" are AC lines, those starting with "1206" are DC lines, and those starting with "1204" are T-connected lines. Lines of the same type are grouped into AC line set, DC line set, and T-connected line set respectively.
3. The method according to claim 1, characterized in that, The strategy of "excluding this side + excluding T-nodes" is used to calculate the counterpart station, including: The determination of the remote terminal station follows a triple filtering rule: (1) The station sign is not empty; (2) Station signs do not begin with "0419"; (3) The site identifier is not in the seed site set; Stations that simultaneously meet conditions (1)-(3) are identified as peer stations and added to the peer station set.
4. The method according to claim 1, characterized in that, For each T-connection line, a three-level recursive expansion algorithm is executed to calculate the peer station and add it to the peer station set, including: First layer: Query the T-connection line attribute table, and check the start node identifier and end node identifier of each T-connection line. Nodes starting with "0419" are identified as T nodes and merged into the T node set. Second layer: Query the T-node container table, obtain the trunk AC line identifier associated with each T-node through the line identifier of the T-node, and obtain the set of trunk lines associated with the T-node; The third layer: Calculate the intersection of the set of trunk lines associated with node T and the set of AC lines. Subtract the intersection from the set of trunk lines associated with node T to obtain the extended AC lines. Query the attribute table for the extended AC lines to obtain the starting station identifier and the ending station identifier. Use the "exclude this side + exclude T nodes" strategy to calculate the counterpart station and add it to the counterpart station set.
5. The method according to claim 4, characterized in that, It also includes: Step S5: If there is an extended AC line, dynamically supplement the station range according to the extended AC line.
6. The method according to claim 5, characterized in that, The station area will be dynamically expanded based on the extended AC lines, including: Step S51: Query the T-node container table, obtain the identifier of each T-node through the line identifier, query the T-connection line attribute table according to the T-node identifier to obtain the start node identifier and end node identifier of the T-connection line, identify the nodes starting with "0419" as T-nodes, merge them into the T-node set, and use the "exclude this side + exclude T-nodes" strategy to calculate the peer station and add it to the peer station set. Step S52: If a new T node is found, obtain the new T node associated line. For the new T node associated line, return to iterative execution of steps S51 to S52 until no new T node is found for the new T node associated line. The iteration stops, and the final set of peer stations is output. The complete station range = seed station set ∪ peer station set is obtained.
7. The method according to claim 1, characterized in that, Retrieve all line endpoint information associated with the seed site set, including: Using the seed site set as input, the system performs a joint query of the AC line endpoint table, DC line endpoint table, and T-connection line endpoint table to obtain all associated line endpoint information at once.
8. A topology calculation device for a main and distribution power system based on line endpoints, characterized in that, Including processor and storage media; The storage medium is used to store instructions; The processor is configured to operate according to the instructions to perform the method according to any one of claims 1 to 7.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method according to any one of claims 1 to 7.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the method according to any one of claims 1 to 7.
11. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method according to any one of claims 1 to 7.