A method and system for equipment topology layout based on power dispatch system ledger

By optimizing the topology layout of equipment in the power dispatching system using graph convolutional neural networks and genetic algorithms, the problems of inflexible topology graph generation and chaotic layout in existing technologies are solved, thereby improving the accuracy and readability of connections between equipment.

CN120316945BActive Publication Date: 2025-10-31STATE GRID SHANGHAI MUNICIPAL ELECTRIC POWER CO
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510803692.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-17
Publication Date
2025-10-31
Estimated Expiration
2045-06-17

AI Technical Summary

Technical Problem

In existing power dispatch systems, the methods for generating topology maps lack flexibility and timeliness. Manual management is time-consuming, labor-intensive, and prone to errors, especially when there are many devices, resulting in problems such as chaotic layout or overlapping wiring harnesses.

Method used

A graph convolutional neural network is used to improve the topological relationships between devices. Combined with clustering and coordinate optimization models, a genetic algorithm is used to adjust the device coordinates, and the topological graph layout is optimized through a multi-objective constraint loss function.

Benefits of technology

It effectively reduces the crossing of connection lines between devices, improves the readability and layout quality of the topology diagram, and enhances the accuracy and efficiency of power system equipment distribution display.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120316945B_ABST
    Figure CN120316945B_ABST
Patent Text Reader

Abstract

This invention relates to a method and system for equipment topology layout based on a power dispatch system ledger, belonging to the field of data processing technology. It solves the problems of chaotic node positions and intersecting connections that easily occur in the topology layout of existing power dispatch equipment. The method includes: using a graph convolutional neural network to improve the topological relationships between equipment in the power dispatch system ledger; obtaining the equipment to be laid out and its topological relationships and placing them into a candidate equipment set; clustering the candidate equipment set and initializing the coordinates of each candidate equipment based on the clustering results; optimizing the initial coordinates of each candidate equipment using a coordinate optimization model to obtain the optimized coordinates of each candidate equipment; checking whether the optimized coordinates of each candidate equipment meet the topology layout conditions; if so, rendering and generating a topology map; otherwise, using a genetic algorithm to readjust the optimized coordinates of the candidate equipment that does not meet the topology layout conditions before rendering and generating a topology map. This improves the quality of equipment topology layout.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to a method and system for equipment topology layout based on power dispatch system ledgers. Background Technology

[0002] In power system operation, the regional dispatch automation system, as a critical information management system, is responsible for monitoring the grid's operational status, managing equipment records, and providing crucial support for dispatch decisions. However, with the increasing scale and complexity of power systems, generating topology maps remains a significant challenge in the daily operation of the regional dispatch automation system.

[0003] Currently, two common methods are fixed topology diagrams and manually generated topology diagrams. The fixed topology diagram method embeds the power dispatching equipment at each node into the program; if the connections between the equipment nodes change, the program needs to be modified to adapt to the new scenario. The manually generated topology diagram method largely relies on manually inputting equipment information, manually drawing connection relationships, and manually adjusting the layout of graphical elements.

[0004] Fixed topology diagram methods require developer collaboration and lack flexibility and timeliness; manually generating topology diagrams is time-consuming, labor-intensive, and prone to errors, especially in large-scale power systems where manual management and maintenance of topology diagrams becomes particularly difficult. To improve efficiency, some have begun to attempt to automate topology diagram generation through rule engines or templates. However, due to the complexity and dynamic changes of power systems, these methods still cannot guarantee the display quality of the topology diagram, the accuracy and real-time nature of the connections between device nodes, and the problems of chaotic layout or overlapping wiring harnesses are particularly prominent when there are numerous power dispatching devices. Summary of the Invention

[0005] Based on the above analysis, the present invention aims to provide a method and system for equipment topology layout based on the power dispatch system ledger, in order to solve the problem that the topology layout of existing power dispatch equipment is prone to node location confusion and connection intersection.

[0006] On one hand, embodiments of the present invention provide a method for equipment topology layout based on power dispatch system ledgers, including the following steps:

[0007] Using graph convolutional neural networks to improve the topological relationships between equipment in the power dispatch system ledger;

[0008] Obtain the devices to be laid out and their topological relationships and put them into a candidate device set; cluster the candidate device set and initialize the coordinates of each candidate device according to the clustering results;

[0009] The initial coordinates of each candidate device are optimized using a coordinate optimization model to obtain the optimized coordinates of each candidate device. The coordinate optimization model is obtained by improving the graph attention network and introducing a loss function with multi-objective constraints.

[0010] Check whether the optimized coordinates of each candidate device meet the topology layout conditions. If they do, render and generate a topology map. Otherwise, use a genetic algorithm to adjust the optimized coordinates of the candidate devices that do not meet the topology layout conditions again, and then render and generate a topology map.

[0011] Based on the above method, a further improvement is made to the optimized coordinates of candidate devices that do not meet the topology layout conditions using a genetic algorithm, including:

[0012] Candidate devices that do not meet the topology layout conditions in the candidate device set are designated as nodes to be moved, while other devices in the candidate device set are designated as fixed nodes. All nodes to be moved are treated as individuals, and the coordinates of all nodes to be moved are initialized and encoded into vectors as the chromosomes of the individuals. An initial population is constructed according to a preset population size, and each initial population is iteratively genetically optimized based on the fitness function until the termination condition is met. Then, the individual with the smallest fitness value in the population is selected as the optimal individual.

[0013] Based on the further improvement of the above method, the fitness function is obtained by calculating the number of node overlaps and the number of edge intersections and then summing them by weight; the number of node overlaps is obtained by calculating the number of overlaps between the nodes to be moved and the sum of the number of overlaps between each node to be moved and the fixed nodes within its node identification range; the number of edge intersections is obtained by calculating the number of edge intersections between the nodes to be moved and the sum of the number of edge intersections between the nodes to be moved and the fixed nodes within its edge identification range.

[0014] Based on the further improvement of the above method, the coordinates of each candidate device are initialized according to the clustering results, including:

[0015] The angle of each category's region is obtained based on the number of devices, the number of edges, and the longest path length in the clustering results.

[0016] Based on the perspective of each region, the regions are divided clockwise or counterclockwise from the center point of the topology map display interface, and the vertices of each region boundary are calculated.

[0017] The coordinates of each candidate device are initialized based on the number of devices of each type and the vertices of each region boundary.

[0018] Further improvements to the above method, based on the number of devices, the number of edges, and the longest path length of each cluster, are used to obtain the angle of the region where each cluster is located. This is achieved by normalizing the number of devices, the number of edges, and the longest path length of each cluster, then weighting and summing them to obtain the spatial weight of each cluster, and finally obtaining the angle based on the ratio of the spatial weight of each cluster to the total spatial weight.

[0019] Based on the further improvement of the above method, the coordinate optimization model sequentially includes an input encoding layer, multiple graph attention layers, and a coordinate decoding layer. The input encoding layer converts the initial coordinates of the input nodes into high-dimensional embedding vectors, encodes edges according to the adjacency matrix of the input nodes, and passes them to multiple graph attention layers. The multiple graph attention layers propagate topological information, and the output of each layer is used by the next layer to update the hidden state of the nodes. The coordinate decoding layer maps the hidden state of the nodes into coordinate adjustment quantities through a multilayer perceptron, and outputs the final optimized coordinates by performing residual connections with the initial coordinates of the input.

[0020] Based on the further improvement of the above method, the loss function of multi-objective constraints in the coordinate optimization model is obtained by calculating the node distance loss, node overlap loss, edge intersection loss and region constraint loss and then performing a weighted summation.

[0021] Based on a further improvement to the above method, the edge crossing loss is used to penalize any two intersecting edges belonging to the same class, and is calculated using the following formula:

[0022] ,

[0023] in, Indicates the edge crossing loss. This represents the k-th cluster generated by clustering. and express In the diagram, two edges, t and u, represent edges. and edge The intersection parameters are obtained by solving the edge. and edge The parameterized equations are obtained when Time indicates edge and edge cross, This represents the sigmoid function. Represents the smoothing coefficient. .

[0024] Based on a further improvement to the above method, the region constraint loss is used to penalize nodes that exceed the region of their class, and is calculated using the following formula:

[0025] ,

[0026] in, Indicates the area constraint loss. This represents the k-th cluster generated by clustering. This represents the sum of probabilities that the horizontal ray emitted from node i to the right intersects with all boundaries of the region containing its class.

[0027] On the other hand, embodiments of the present invention provide a device topology layout system based on power dispatch system ledgers, including:

[0028] The topology prediction module is used to improve the topological relationships between devices in the power dispatch system ledger using graph convolutional neural networks.

[0029] The device extraction module is used to obtain the devices to be laid out and their topological relationships and put them into a candidate device set; the candidate device set is clustered and the coordinates of each candidate device are initialized according to the clustering results;

[0030] The coordinate optimization module is used to optimize the initial coordinates of each candidate device using a coordinate optimization model to obtain the optimized coordinates of each candidate device. The coordinate optimization model is obtained by improving the graph attention network and introducing a loss function with multi-objective constraints.

[0031] The topology generation module is used to detect whether the optimized coordinates of each candidate device meet the topology layout conditions. If they do, a topology map is generated. Otherwise, a genetic algorithm is used to adjust the optimized coordinates of the candidate devices that do not meet the topology layout conditions before generating a topology map.

[0032] Compared with the prior art, the present invention can achieve at least one of the following beneficial effects:

[0033] 1. By using clustering to dynamically constrain the device layout area, different types of areas are made relatively independent, while similar types of areas are more densely packed. This effectively reduces the problem of crossover between device connections, lowers the overlap rate of the network topology, and better shows the distribution and relative relationships of devices.

[0034] 2. By constructing a coordinate optimization model, we can not only utilize the attention mechanism in graph attention networks to dynamically adjust the relational weights between nodes and more accurately capture the correlation between nodes, but also introduce a loss function with multi-objective constraints to effectively avoid problems such as node overlap and edge intersection, thereby enhancing the readability of the topology graph and making it more widely applicable to complex graph data.

[0035] 3. By using a genetic algorithm to fine-tune the coordinates of devices that do not meet the topology layout conditions, the computational load is significantly reduced, the iteration efficiency of the genetic algorithm is improved, and the layout quality of the topology graph is significantly improved.

[0036] In this invention, the above-described technical solutions can be combined with each other to achieve more preferred combinations. Other features and advantages of this invention will be set forth in the following description, and some advantages may become apparent from the description or be learned by practicing the invention. The objects and other advantages of this invention can be realized and obtained from what is particularly pointed out in the description and drawings. Attached Figure Description

[0037] The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Throughout the drawings, the same reference numerals denote the same parts.

[0038] Figure 1 This is a flowchart of a device topology layout method based on a power dispatch system ledger in Embodiment 1 of the present invention;

[0039] Figure 2 This is a schematic diagram illustrating the division of various regions based on clustering results in Embodiment 1 of the present invention;

[0040] Figure 3 This is a schematic diagram of the equipment topology layout system structure based on the power dispatch system ledger in Embodiment 2 of the present invention. Detailed Implementation

[0041] Preferred embodiments of the present invention will now be described in detail with reference to the accompanying drawings, which form part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not intended to limit the scope of the present invention.

[0042] Example 1

[0043] A specific embodiment of the present invention discloses a method for equipment topology layout based on power dispatch system ledgers, such as... Figure 1 As shown, it includes the following steps:

[0044] S1. Use graph convolutional neural networks to improve the topological relationships between equipment in the power dispatch system ledger.

[0045] It should be noted that the power dispatch system ledger includes: equipment identification, equipment name, equipment type, voltage level, functional category, geographical location, operating status, change time, and connection relationship between equipment. Among them, the connection relationship between equipment includes: upper-level equipment identification, lower-level equipment identification, and connection method between equipment.

[0046] Considering that the connection relationships between equipment in the power dispatch system ledger may contain errors, omissions, or incompleteness, this approach addresses the issue. For example, during data entry, human error might lead to the omission of connection descriptions between newly added equipment and certain historical equipment; or temporary adjustments might be made to connections during actual equipment installation and commissioning; or new equipment might alter power transmission paths. These dynamically changing connection relationships are difficult to update in real time within the ledger. Therefore, relying solely on the "connection relationships between equipment" information in the ledger would result in inaccuracies. Consequently, this embodiment trains a graph convolutional neural network by learning the equipment topology relationships in historical ledger data. The trained graph convolutional neural network then promptly derives the dynamically changing topological connections between equipment in the latest ledger, ensuring that the topology map accurately reflects the real-time status of the power dispatch system.

[0047] It should be noted that the historical records of the power dispatch system are first preprocessed, including: removing duplicate and empty equipment identifiers; standardizing equipment names and types; and converting geographical locations into planar coordinates based on the Earth's radius.

[0048] Furthermore, based on the preprocessed historical ledger, each device is treated as a node, and the connections between devices are treated as edges. A node feature matrix and a node adjacency matrix are constructed as input graph data. The node feature matrix is ​​obtained by converting the features of each node into numerical form, where each row corresponds to the feature vector of a node. The sample adjacency matrix represents the connection relationships between devices; if there is a connection between devices, the corresponding element in the matrix is ​​1, otherwise it is 0.

[0049] Specifically, the feature vector of a node is obtained by concatenating the device name embedding vector, the device's planar position coordinates, and the one-hot encoded device type. For example, the BERT model or the Word2Vec model can be used to obtain the device name embedding vector.

[0050] Graph Convolutional Networks (GCNs) consist of a graph embedding layer, multiple stacked graph convolutional layers, graph pooling layers, and an output layer. Input graph data is fed into the GCN. The graph embedding layer directly maps the feature vectors of nodes and encodes edges based on the node adjacency matrix, allowing subsequent graph convolution operations to utilize the graph's topological information. In each graph convolutional layer, the feature vector of each node is continuously updated by aggregating information from neighboring nodes in the adjacency matrix, capturing broader graph structural features and learning higher-order topological semantics. The graph pooling layer reduces the dimensionality of the updated node feature vectors from the graph convolutional layers through pooling operations, generating a hierarchical representation of the graph for better understanding of its overall structure. Finally, the output layer outputs the probability values ​​of connections between nodes, yielding the derived topological relationships.

[0051] Before training the graph convolutional neural network, binary labels (0 / 1) are used to mark whether there is a connection between node pairs, representing the actual topological relationship. During training, the cross-entropy loss function is used to evaluate the difference between the derived topological relationship and the actual topological relationship. By continuously optimizing the parameters of the graph convolutional neural network to minimize the value of the loss function, the derived topological relationship becomes more accurate and stable. Specifically, the Adam optimizer is used to optimize the network parameters and adjust the weights to minimize the value of the loss function.

[0052] After the graph convolutional neural network is trained, it preprocesses the received power dispatch system ledgers. Based on timestamps or by comparing with historical ledgers, it retrieves the ledger information for newly added equipment, extracts the corresponding feature vectors (with dimensions matching those of the node feature vectors during training), and adds them to the node feature matrix. The newly added equipment is then added to the node adjacency matrix, and initial connections are established based on the connection relationships between the new equipment and other equipment as shown in the ledger information. If no connections exist, they are set to 0. It's understandable that if the ledger information for some historical equipment changes, such as modifying the equipment name or connection relationships, the node feature matrix and node adjacency matrix are updated accordingly.

[0053] The updated node feature matrix and node adjacency matrix are fed into the trained graph convolutional neural network to obtain the latest topological relationships between devices.

[0054] S2. Obtain the devices to be laid out and their topological relationships and put them into the candidate device set; cluster the candidate device set and initialize the coordinates of each candidate device according to the clustering results.

[0055] Since the power dispatch system contains a variety of power equipment and there are many ways to classify the equipment, such as by voltage level, by function or by region, based on the topological relationship between the equipment obtained in step S1, the equipment to be laid out and its topological relationship can be obtained by inputting keywords or selecting relevant categories and then placed into the candidate equipment set.

[0056] Furthermore, considering that devices in geographically close proximity to power dispatching equipment are more likely to be physically connected, this embodiment uses a clustering algorithm to divide the candidate equipment set into multiple classes based on the planar location coordinates of each device, thus obtaining the devices in each class. Preferably, the HDBSCAN (Hierarchical DBSCAN) algorithm is used to automatically select the optimal neighborhood radius, which is suitable for scenarios with dynamically changing device location distribution.

[0057] Furthermore, the coordinates of each candidate device are initialized based on the clustering results, including:

[0058] ① Obtain the angle of the region where each category is located based on the number of devices, the number of edges, and the longest path length in the clustering results. The longest path length is the number of edges traversed by the longest path.

[0059] Specifically, after normalizing the number of devices, edges, and longest path length for each type, the spatial weights for each type are obtained by weighted summation using the following formula:

[0060] ,

[0061] in, Represents the spatial weight of the k-th class. , and These represent the normalized data for the number of devices, the number of edges, and the longest path length in the k-th class, respectively. , and These represent the weights for the number of devices, the number of edges, and the longest path length, respectively. .

[0062] Then, based on the ratio of the spatial weight of each type to the total spatial weight, the angle of each type's region is obtained using the following formula.

[0063] ,

[0064] in, This represents the angle of the region containing the k-th class.

[0065] ②Based on the perspective of the region where each type is located, divide the region into clockwise or counterclockwise directions using the center point of the topology map display interface, and calculate the vertices of the boundary of each region.

[0066] It should be noted that this embodiment takes into account the situation of cross-class connections, so the regions are divided clockwise or counterclockwise from the center point of the topology map display interface.

[0067] For example, such as Figure 2 As shown, the clustering results in 3 classes. Dividing the data counterclockwise, the angular range of the region containing the first class is... The angular range of the region where the second type is located is The angular range of the region where the third type is located is .

[0068] Furthermore, the length and width of the topology map display interface are obtained. Rays are emitted from the center point of the topology map display interface along the angular direction of the region where each type of area is located, dividing the display interface into multiple regions. The intersection points of each ray with the boundary of the topology map display interface are calculated. The vertices of each region (irregular polygon) are obtained based on the center point, intersection points, and vertices of the display interface.

[0069] For example, Figure 2 The vertices of the three regions are: OEDF, OFAG, and OGBCE.

[0070] When calculating the intersection points of each ray with the boundary of the topology display interface, first calculate the ray emanating from the center point through each vertex of the topology display interface based on the length and width of the topology display interface. Then, calculate the angle range corresponding to the four boundaries in a counterclockwise direction to obtain the boundary where the rays emitted along the angle direction of each type of region intersect, and calculate the intersection point with the corresponding boundary.

[0071] ③ Initialize the coordinates of each candidate device based on the number of devices of each type and the vertices of each region boundary.

[0072] This embodiment uses triangulation to decompose each region into multiple triangles. Triangles are randomly selected based on the area weight of each triangle, and points are generated inside the selected triangles to obtain the coordinates of each candidate device.

[0073] For example, functions from the Earcut library are used to triangulate a polygon.

[0074] S3. The initial coordinates of each candidate device are optimized using the coordinate optimization model to obtain the optimized coordinates of each candidate device. The coordinate optimization model is obtained by improving the graph attention network and introducing a loss function with multi-objective constraints.

[0075] Specifically, the coordinate optimization model consists of an input encoding layer, multiple graph attention layers, and a coordinate decoding layer. The input encoding layer converts the initial coordinates of the input nodes into high-dimensional embedding vectors, encodes edges based on the adjacency matrix of the input nodes, and passes them to multiple graph attention layers. The multiple graph attention layers propagate topological information, with each layer's output used by the next layer to update the hidden states of the nodes. The coordinate decoding layer maps the hidden states of the nodes into coordinate adjustment values ​​using a multilayer perceptron, and outputs the final optimized coordinates by performing residual connections with the initial input coordinates.

[0076] In this embodiment, nodes in the topology graph are represented by circles. To ensure that the optimized nodes maintain a reasonable distance, do not overlap, do not intersect, and do not exceed the area of ​​their respective classes, the coordinate optimization model adopts an unsupervised training method. By adding a corresponding penalty term to the loss function, the optimized coordinates satisfy the layout quality and geometric constraints.

[0077] Specifically, the loss function L for multi-objective constraints is calculated by determining the node distance loss. Node overlap loss Crossover loss and regional constraint loss The weighted summation is then performed to obtain the formula shown below:

[0078] ,

[0079] in, , , and These represent the weights of node distance loss, node overlap loss, edge intersection loss, and region constraint loss, respectively.

[0080] It should be noted that the node distance loss To encourage nodes at both ends of an edge to maintain a reasonable distance, avoiding distances that are too long or too short, the formula is as follows:

[0081] ,

[0082] Where E represents the set of nodes, and Let represent the coordinates of nodes i and j at the two ends of the edge. This represents the preset ideal distance between nodes. r represents the radius of the node element; This represents the Euclidean distance between node i and node j.

[0083] Node overlap loss The formula used to apply repulsion to nodes and prevent node primitives from overlapping is shown below:

[0084] ,

[0085] in, This represents the smoothing factor, which is a preset positive number to avoid division by zero.

[0086] Edge cross loss This is used to penalize edges that intersect. To improve computational efficiency, it only considers edges between nodes of the same type, approximates the edges using the sigmoid function, and introduces a smoothing coefficient. , The probability of edge intersection is calculated using the following formula:

[0087] ,

[0088] in, This represents the k-th class generated by node clustering. and express In the diagram, two edges, t and u, represent edges. and edge The intersection parameters, when Time indicates edge and edge cross, This represents the sigmoid function, which maps numerical values ​​to the range of 0-1.

[0089] and Used to verify whether the intersection point is inside the edge, when When the product term is large, When the product term is not in the range [0,1], it approaches 0, thus reducing the penalty. and Used to prevent intersections from being too close to the endpoints of edges, when As the product term approaches 0 or 1, the penalty decreases. Therefore, when the intersection of two edges lies on the edge, If the product of these four terms is large, a larger penalty is imposed; when the intersection of two edges is near the endpoints, If the product of these four terms is close to 0 or 1, the penalty is reduced; when two edges have no intersection points... If the product of these four terms is not in the range [0,1], the penalty is reduced.

[0090] For example, forming edges The two nodes are and ,but The parameterized equation is , , ; forming edges The two nodes are and ,but The parameterized equation is , , .side and edge The intersection point generated by the intersection satisfies the parameterized equations of both sides; therefore, when Time indicates edge and edge cross.

[0091] Regional constraint loss This is used to constrain nodes to be within the region of their respective clusters. Since the regions of each cluster are obtained by dividing a rectangular display interface at different central angles, and each region is at most a hexagon, and there is at most only one hexagonal region, the computational complexity of identifying whether a node is within a region by comparing it with each boundary of that region is not too high.

[0092] It should be noted that the traditional ray casting method determines whether a point is inside a polygon by counting the number of intersections between the ray and the polygon's edges. The output is a binary result, not a continuous value. This discrete judgment cannot provide gradient information and cannot be directly used for optimization in the loss function. Therefore, this embodiment uses a differentiable sigmoid function to approximate the traditional ray casting method. A smoothing coefficient is introduced... By controlling the smoothness of the approximation, the result retains both the logic of the traditional ray casting method and differentiability, thus making it usable in the loss function.

[0093] Specifically, for a region boundary, ① the nodes are calculated using the following formula. ordinate At the regional boundary probability within the range :

[0094] ,

[0095] in, and Represents the minimum and maximum ordinate values ​​of a vertex on a boundary of the region. exist Within the range, It should be close to 1, otherwise close to 0.

[0096] ②From node A horizontal ray pointing to the right and the boundary of the region The x-coordinate of the intersection point of the ray and the boundary is calculated using the following formula. :

[0097] ,

[0098] ,

[0099] in, and The boundary of the region containing the k-th class. The coordinates of the two vertices, Indicates the boundary of the region The parameters.

[0100] Furthermore, when When the ray intersects the region boundary within the range [0,1] and the x-coordinate of the intersection point is to the right of the node, the ray intersects the region boundary. The intersection of the ray and the region boundary is calculated using the following formula. Probability of intersection :

[0101] ,

[0102] Among them, if Within the range [0,1] and with the intersection point to the right of the ray, It should be close to 1, otherwise close to 0.

[0103] Therefore, node The probability of intersecting with a region boundary is obtained by... and Multiplying them together yields the result, and then the nodes are calculated using the following formula. The sum of the probabilities of the emitted ray intersecting all boundaries of the region. :

[0104] ,

[0105] in, Represents a node The number of boundaries in the region.

[0106] It should be noted that, based on the principle of the ray casting method, a ray is emitted horizontally to the right from the node. If the number of intersections between the ray and the polygon's edges is odd, the node is inside the region; if the number of intersections is even, the node is outside the region. This embodiment uses the following formula to approximate the determination of whether a node is inside the region, based on the odd / even rule of the ray casting method:

[0107] ,

[0108] If the node is not within the region. If the coordinates are close to 0, a penalty is imposed, prompting the generation of internal coordinates.

[0109] The coordinate optimization model is trained through multiple iterations, and the trained coordinate optimization model is obtained after the training is completed.

[0110] During implementation, the initial coordinates of each device in the candidate device set are used as node features, and the adjacency matrices of each device in the candidate device set are fed into the trained coordinate optimization model to output the optimized coordinates.

[0111] S4. Check whether the optimized coordinates of each candidate device meet the topology layout conditions. If they do, render and generate a topology map. Otherwise, use a genetic algorithm to adjust the optimized coordinates of the candidate devices that do not meet the topology layout conditions again, and then render and generate a topology map.

[0112] It should be noted that candidate devices that do not meet the topology layout conditions include: candidate devices with overlapping nodes and candidate devices with intersecting edges. Among them, node overlap is defined as the Euclidean distance between nodes being less than the primitive diameter; edge intersection is determined by identifying that the two endpoints of one edge are on opposite sides of another edge using the vector cross product method.

[0113] To improve detection efficiency, this embodiment primarily detects whether edges between different classes intersect. Specifically, based on the topological relationships and clustering results of candidate devices, edges existing between different classes are identified as edges to be detected. The method then identifies whether the edges to be detected intersect with edges within the edge identification range. The edge identification range is a union region formed by using preset radii and the two endpoints of the edge to be detected as centers.

[0114] Furthermore, when there are candidate devices that do not meet the topology layout conditions, this step takes the devices that meet the topology layout conditions as fixed nodes, fixes the coordinates of the fixed nodes, and takes the candidate devices that do not meet the topology layout conditions as nodes to be moved. Only the coordinates of the nodes to be moved are adjusted again. Moreover, distance constraints and region constraints are no longer considered when optimizing.

[0115] Specifically, all nodes to be moved are treated as individuals. The coordinates of all nodes to be moved are initialized and encoded as vectors as the chromosomes of the individuals. Coordinates are randomly generated for each node to be moved to ensure that each node to be moved does not overlap with other nodes to be moved or fixed nodes, and does not exceed the range of the topology display interface. Each individual is constructed and an initial population is formed according to the preset population size.

[0116] Furthermore, each initial population is iteratively genetically optimized based on the fitness function until the termination condition is met, at which point the individual with the smallest fitness value in the population is selected as the optimal individual. The genetic optimization of each generation of each initial population includes: selecting two individuals as parents based on the crossover probability, performing crossover to generate offspring, selecting individuals based on the mutation probability to generate offspring through mutation, merging the parents and offspring, calculating the fitness value of each individual, and selecting the next generation of the initial population through a strategy combining roulette wheel selection and random selection.

[0117] The fitness function is used to evaluate the quality of an individual. It is obtained by calculating the number of overlapping nodes and the number of intersections, and then summing them with weights, as shown in the following formula:

[0118] ,

[0119] in, Represents the fitness function. Indicates the number of overlapping nodes. Indicates the number of edge intersections. and These represent the weights of the node overlap penalty and the edge intersection penalty, respectively.

[0120] It should be noted that, to improve computational efficiency, when calculating the number of overlapping nodes, it is not necessary to calculate the overlap of all nodes (the node to be moved and the fixed node). Instead, the calculation is based on the sum of the overlap between the nodes to be moved and the overlap between each node to be moved and the fixed node within its node identification range. The node identification range of each node to be moved is a region centered on the node to be moved, based on a preset radius.

[0121] Similarly, when calculating the number of edge intersections, it is not necessary to calculate the number of intersections of all edges. Instead, the number of edge intersections between the nodes to be moved and the sum of the number of edge intersections between the node to be moved and the fixed nodes within its edge recognition range are calculated. The edge recognition range of each edge in the node to be moved is a union region formed with the nodes at both ends of the edge as the center, based on a preset radius.

[0122] The union region is formed by floating the coordinates of the nodes at both ends of the edge up and down according to the preset change value.

[0123] Finally, by combining the deep learning layout optimization in step S3 and the genetic algorithm fine-tuning in step S4, a topology graph that satisfies the topology layout conditions is obtained. This not only improves the operability and user experience of the topology graph but also ensures the efficiency and accuracy of the graphical representation.

[0124] For example, the topology map can be generated by rendering using the D3.js library or the Echarts tool in the topology map display interface.

[0125] Preferably, a cloud-based rendering platform is built to enhance the efficiency and quality of topology graph generation and optimization. Specifically, the cloud-based rendering platform uses a distributed computing architecture and a load balancing strategy to distribute tasks across different computing nodes for parallel processing. This parallel processing significantly improves processing efficiency and shortens generation and optimization time.

[0126] Specifically, when multiple users view the topology map of the devices to be laid out and their topological relationships, each device is treated as a separate task, with the task status initially set to "in execution." Each task is assigned to different computing nodes for coordinate calculation and optimization, the final calculated coordinates and edges are saved, and the task status is updated to "completed." When a user clicks to view a completed task, the front-end interface renders and generates a topology map based on the saved coordinates and connection relationships of the devices to be laid out.

[0127] Preferably, different colors can be used to represent the equipment when rendering equipment elements according to the operating status of the equipment in the power dispatch system ledger, so as to intuitively and in real time reflect the status information of the power system equipment; when the equipment node is selected by mouse, the detailed information of the equipment is displayed.

[0128] Users can drag and drop to adjust the positions of various devices in the topology diagram on the front-end interface. Preferably, a role-based permission matrix is ​​constructed to ensure the security and confidentiality of the topology diagram data. Based on the roles and permissions of different users, the user's access, viewing, modification, and deletion of the topology diagram are restricted.

[0129] For example, the administrator grants editing and deletion permissions to the topology map, while ordinary users can only view the topology map.

[0130] By integrating a cloud-based rendering platform to store and manage topology maps, this system not only efficiently processes and stores generated topology maps but also provides robust access control, ensuring the integrity, security, and efficient access and use of the topology map data. It offers comprehensive support for the generation, optimization, and management of power system topology maps.

[0131] Compared with existing technologies, this embodiment provides a device topology layout method based on power dispatch system ledgers. By dynamically constraining device layout areas through clustering, different types of areas become relatively independent, while similar types of areas are denser. This effectively reduces the problem of inter-device connection line intersections, lowers the network topology overlap rate, and better displays the distribution and relative relationships of devices. By constructing a coordinate optimization model, it utilizes the attention mechanism in graph attention networks to dynamically adjust the relationship weights between nodes, more accurately capturing the correlation between nodes. It also introduces a multi-objective constraint loss function, effectively avoiding problems such as node overlap and edge intersections, enhancing the readability of the topology graph and making it more widely applicable to complex graph data. Finally, it uses a genetic algorithm to fine-tune the coordinates of devices that do not meet the topology layout conditions, significantly reducing computational load, improving the iteration efficiency of the genetic algorithm, and significantly improving the layout quality of the topology graph.

[0132] Example 2

[0133] Another embodiment of the present invention discloses an equipment topology layout system based on a power dispatch system ledger, thereby implementing the equipment topology layout method based on a power dispatch system ledger in Embodiment 1. The specific implementation of each module is described in the corresponding description in Embodiment 1. Figure 3 As shown, the system includes:

[0134] Topology prediction module 101 is used to improve the topological relationships between devices in the power dispatch system ledger using graph convolutional neural networks;

[0135] The device extraction module 102 is used to obtain the devices to be laid out and their topological relationships and put them into a candidate device set; to cluster the candidate device set and initialize the coordinates of each candidate device according to the clustering results;

[0136] The coordinate optimization module 103 is used to optimize the initial coordinates of each candidate device using the coordinate optimization model to obtain the optimized coordinates of each candidate device; the coordinate optimization model is obtained by improving the graph attention network and introducing a loss function with multi-objective constraints;

[0137] The topology generation module 104 is used to detect whether the optimized coordinates of each candidate device meet the topology layout conditions. If they do, a topology map is generated. Otherwise, a genetic algorithm is used to adjust the optimized coordinates of the candidate devices that do not meet the topology layout conditions, and then a topology map is generated.

[0138] Since the equipment topology layout system based on the power dispatch system ledger in this embodiment and the aforementioned equipment topology layout method based on the power dispatch system ledger can be mutually referenced, this description is redundant and will not be repeated here. Because this system embodiment shares the same principle as the above method embodiment, it also possesses the corresponding technical effects of the above method embodiment.

[0139] Those skilled in the art will understand that all or part of the processes of the methods described in the above embodiments can be implemented by a computer program instructing related hardware, and the program can be stored in a computer-readable storage medium. The computer-readable storage medium may be a disk, optical disk, read-only memory, or random access memory, etc.

[0140] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for equipment topology layout based on power dispatch system ledgers, characterized in that, Includes the following steps: Using graph convolutional neural networks to improve the topological relationships between equipment in the power dispatch system ledger; Obtain the devices to be laid out and their topological relationships and put them into a candidate device set; cluster the candidate device set and initialize the coordinates of each candidate device according to the clustering results; The initial coordinates of each candidate device are optimized using a coordinate optimization model to obtain the optimized coordinates of each candidate device. The coordinate optimization model is obtained by improving the graph attention network and introducing a loss function with multi-objective constraints. It is used to ensure that nodes maintain a reasonable distance, nodes do not overlap, lines between nodes do not intersect, and each node does not exceed the area of ​​its class. Check whether the optimized coordinates of each candidate device meet the topology layout conditions. If they do, then render and generate a topology map. Otherwise, a genetic algorithm is used to adjust the optimized coordinates of candidate devices that do not meet the topology layout conditions, and then a topology map is generated. The candidate devices that do not meet the topology layout conditions include: candidate devices with overlapping nodes and candidate devices with intersecting edges; the genetic algorithm performs iterative genetic optimization based on the fitness function until the termination condition is met, and then selects the individual with the smallest fitness value in the population as the optimal individual; the fitness function is used to evaluate the quality of the individual, and is obtained by calculating the number of overlapping nodes and the number of intersecting edges and then summing them by weight.

2. The equipment topology layout method based on the power dispatch system ledger according to claim 1, characterized in that, The step of using a genetic algorithm to further adjust the optimized coordinates of candidate devices that do not meet the topology layout conditions includes: Candidate devices that do not meet the topology layout conditions in the candidate device set are designated as nodes to be moved, while other devices in the candidate device set are designated as fixed nodes. All nodes to be moved are treated as individuals, and the coordinates of all nodes to be moved are initialized and encoded into vectors as the chromosomes of the individuals. An initial population is constructed according to a preset population size, and each initial population is iteratively genetically optimized based on the fitness function until the termination condition is met. Then, the individual with the smallest fitness value in the population is selected as the optimal individual.

3. The equipment topology layout method based on the power dispatch system ledger according to claim 2, characterized in that, The fitness function is obtained by calculating the number of node overlaps and the number of edge intersections and then summing them by weight; the number of node overlaps is obtained by calculating the number of overlaps between the nodes to be moved and the sum of the number of overlaps between each node to be moved and the fixed nodes within its node identification range; the number of edge intersections is obtained by calculating the number of edge intersections between the nodes to be moved and the sum of the number of edge intersections between the nodes to be moved and the fixed nodes within its edge identification range.

4. The equipment topology layout method based on the power dispatch system ledger according to claim 1, characterized in that, The initialization of the coordinates of each candidate device based on the clustering results includes: The angle of each category's region is obtained based on the number of devices, the number of edges, and the longest path length in the clustering results. Based on the perspective of each region, the regions are divided clockwise or counterclockwise from the center point of the topology map display interface, and the vertices of each region boundary are calculated. The coordinates of each candidate device are initialized based on the number of devices of each type and the vertices of each region boundary.

5. The equipment topology layout method based on the power dispatch system ledger according to claim 4, characterized in that, The method of obtaining the angle of the region where each type of cluster is located based on the number of devices, the number of edges, and the longest path length of each type in the clustering results is to obtain the spatial weight of each type by normalizing the number of devices, the number of edges, and the longest path length of each type, and then obtaining the angle based on the ratio of the spatial weight of each type to the total spatial weight.

6. The equipment topology layout method based on the power dispatch system ledger according to claim 1, characterized in that, The coordinate optimization model sequentially includes an input encoding layer, multiple graph attention layers, and a coordinate decoding layer. The input encoding layer converts the initial coordinates of the input nodes into high-dimensional embedding vectors, encodes edges based on the adjacency matrix of the input nodes, and passes them to the multiple graph attention layers. The multiple graph attention layers propagate topological information, with each layer outputting its own data for use by the next layer to update the hidden state of the nodes. The coordinate decoding layer maps the hidden state of nodes to coordinate adjustment quantities through a multilayer perceptron, and outputs the final optimized coordinates by performing a residual connection with the input initial coordinates.

7. The equipment topology layout method based on the power dispatch system ledger according to claim 1 or 6, characterized in that, The loss function for multi-objective constraints in the coordinate optimization model is obtained by calculating the node distance loss, node overlap loss, edge intersection loss, and region constraint loss and then summing them by weight.

8. The equipment topology layout method based on the power dispatch system ledger according to claim 7, characterized in that, The edge crossing loss is used to penalize any two crossing edges belonging to the same class, and is calculated using the following formula: , in, Indicates the edge crossing loss. This represents the k-th cluster generated by clustering. and express In the diagram, two edges, t and u, represent edges. and edge The intersection parameters are obtained by solving the edge. and edge The parameterized equations are obtained when Time indicates edge and edge cross, This represents the sigmoid function. Represents the smoothing coefficient. .

9. The equipment topology layout method based on the power dispatch system ledger according to claim 7, characterized in that, The region constraint loss is used to penalize nodes that exceed the region of their class, and is calculated using the following formula: , in, Indicates the area constraint loss. This represents the k-th cluster generated by clustering. This represents the sum of probabilities that the horizontal ray emitted from node i to the right intersects with all boundaries of the region containing its class.

10. A device topology layout system based on power dispatch system ledgers, characterized in that, include: The topology prediction module is used to improve the topological relationships between devices in the power dispatch system ledger using graph convolutional neural networks. The device extraction module is used to obtain the devices to be laid out and their topological relationships and put them into a candidate device set; the candidate device set is clustered and the coordinates of each candidate device are initialized according to the clustering results; The coordinate optimization module is used to optimize the initial coordinates of each candidate device using the coordinate optimization model to obtain the optimized coordinates of each candidate device. The coordinate optimization model is obtained by improving the graph attention network and introducing a loss function with multi-objective constraints. It is used to ensure that nodes maintain a reasonable distance, nodes do not overlap, lines between nodes do not intersect, and each node does not exceed the area of ​​its class. The topology generation module is used to detect whether the optimized coordinates of each candidate device meet the topology layout conditions. If they do, a topology map is rendered and generated. Otherwise, a genetic algorithm is used to adjust the optimized coordinates of candidate devices that do not meet the topology layout conditions, and then a topology map is generated. The candidate devices that do not meet the topology layout conditions include: candidate devices with overlapping nodes and candidate devices with intersecting edges; the genetic algorithm performs iterative genetic optimization based on the fitness function until the termination condition is met, and then selects the individual with the smallest fitness value in the population as the optimal individual; the fitness function is used to evaluate the quality of the individual, and is obtained by calculating the number of overlapping nodes and the number of intersecting edges and then summing them by weight.

Citation Information

Patent Citations

  • Power distribution network graph automatic generation method

    CN116070388A

  • Topological graph drawing method and device of equipment connection relation and storage medium

    CN116597046A