Method, device and electronic equipment for generating single-line diagram

By extracting key points from the topology of the power line and calculating the outer frame area of ​​the layout instance, the problem of low drawing utilization in automatic drawing of single-line diagrams is solved, and the generated single-line diagrams are more compact and practical.

CN114092601BActive Publication Date: 2024-10-01HANGZHOU HARMONY TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111440404.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-30
Publication Date
2024-10-01
Estimated Expiration
2041-11-30

AI Technical Summary

Technical Problem

There are a lot of blanks in the automatically drawn single-line diagrams, and the drawing utilization rate is low, resulting in practical problems.

Method used

Extract the key points of the main path and secondary path from the topology of the power line, calculate the outer frame area of ​​multiple layout instances based on these key points and remaining nodes, and select the layout instance with the smallest outer frame area for orthogonal layout processing Generate one-line diagram.

Benefits of technology

The utilization rate of drawings is improved, the single-line diagram generated is more compact, and the problems of blank drawings and low utilization rate are solved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114092601B_ABST
    Figure CN114092601B_ABST
Patent Text Reader

Abstract

The present invention provides a method, device and electronic device for generating a single-line diagram, wherein, after obtaining the topological structure of a power line, a first key point corresponding to a main path and a second key point corresponding to a secondary path are extracted from the topological structure, and the outer frame areas corresponding to multiple layout instances are calculated based on the first key point, the second key point and the remaining nodes in the topological structure, and a target layout instance is determined from the multiple layout instances based on the outer frame area. Finally, the target layout instance is orthogonalized and processed to generate a single-line diagram. The present application can extract the key points of the topological structure that affect the layout from the topological structure of the power line, and generate a compact single-line diagram based on the key points, thereby greatly improving the utilization rate of the drawing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of power grids, and in particular to a method, device and electronic equipment for generating a single-line diagram. Background Art

[0002] In the era of manual drawing of single-line diagrams, various business needs were taken into consideration, such as the utilization rate of drawings, the readability of drawings, and the consistency between drawings and geographical locations. In recent years, products that automatically draw single-line diagrams have begun to appear. On the one hand, these products have greatly improved the drawing speed, but on the other hand, the quality of the drawings is not as good as that of manually drawn drawings.

[0003] At present, one problem with automatically drawn drawings is that there are a lot of blank spaces in the drawings, and the utilization rate of the drawings is low, which leads to problems in practicality. Summary of the invention

[0004] In view of this, the purpose of the present invention is to provide a method, device and electronic device for generating a single-line diagram, which can extract the key points of the topological structure that affect the layout from the topological structure of the power line, generate a compact single-line diagram based on the key points, and greatly improve the utilization rate of the drawing.

[0005] In a first aspect, an embodiment of the present invention provides a method for generating a single-line diagram, wherein the method includes: obtaining a topological structure of a power line; wherein the topological structure is composed of a plurality of nodes having topological connections; extracting a first key point corresponding to a primary path and a second key point corresponding to a secondary path from the topological structure; calculating an outer frame area corresponding to a plurality of layout instances based on the first key point, the second key point and the remaining nodes in the topological structure; wherein the remaining nodes are nodes in the topological structure other than the first key point and the second key point; determining a target layout instance from a plurality of layout instances based on the outer frame area; and performing orthogonal layout processing on the target layout instance to generate a single-line diagram.

[0006] In combination with the first aspect, an embodiment of the invention provides a first possible implementation method of the first aspect, wherein the step of extracting the first key point corresponding to the main path and the second key point corresponding to the secondary path from the topological structure includes: marking the main path nodes included in the main path; determining multiple first node sets from the topological structure based on the marked main path nodes; wherein each first node set includes multiple interconnected nodes, and multiple nodes are not marked as main path nodes; determining a first upstream path based on the multiple first node sets; extracting a preset number of first key points from the first upstream path; extracting a preset number of second key points from the topological structure based on the first key points and the main path nodes.

[0007] In combination with the first possible implementation of the first aspect, an embodiment of the present invention provides a second possible implementation of the first aspect, wherein the step of determining a first upstream path based on multiple first node sets includes: obtaining the number of nodes and the sum of areas corresponding to each first node set; determining the first node set with the largest number of nodes and the largest sum of areas as the target first node set; obtaining the path length from each node in the target first node set to the root node; selecting the first target node corresponding to the longest path length and the second target node corresponding to the shortest path length; and tracing back the first target node to the second target node to obtain the first upstream path.

[0008] In combination with the first possible implementation of the first aspect, an embodiment of the present invention provides a third possible implementation of the first aspect, wherein the step of extracting a preset number of second key points from the topological structure based on the first key point and the main path node includes: marking the first key point; determining multiple second node sets from the topological structure based on the marked first key point and the marked main path node; wherein each second node set includes multiple nodes that are interconnected, and multiple nodes are not marked as main path nodes and first key points; determining a second upstream path based on multiple second node sets; extracting a second key point from the second upstream path; marking the path nodes in the second upstream path whose distance from the root node is greater than the distance from the second key point to the root node, and marking the second key point; re-executing the steps from determining multiple second node sets from the topological structure to marking the second key points based on the marked path nodes, the second key points, the first key points and the main path nodes, until the number of extracted second key points reaches the preset number.

[0009] In combination with the third possible implementation of the first aspect, an embodiment of the present invention provides a fourth possible implementation of the first aspect, wherein the step of determining a second upstream path based on multiple second node sets includes: obtaining the number of nodes and the sum of areas corresponding to each second node set; determining the second node set with the largest number of nodes and the largest sum of areas as the target second node set; obtaining the path length of each node in the target second node set from the root node; selecting the third target node corresponding to the longest path length and the fourth target node corresponding to the shortest path length; and tracing back the third target node to the fourth target node to obtain the second upstream path.

[0010] In combination with the third possible implementation of the first aspect, an embodiment of the present invention provides a fifth possible implementation of the first aspect, wherein the step of extracting a second key point from the second upstream path includes: taking each node in the second upstream path as a search starting point in turn, searching from the search starting point until a marked node or a low-loop node is searched, and obtaining the number of search nodes corresponding to each node; wherein the low-loop node is a node close to the root node; for each node, calculating the search result corresponding to the node based on the number of search nodes; wherein the search result includes a first result and a second result, the first result being the ratio of the number of search nodes to the total number of nodes in the topological structure, minus the inverse of the total number of preset key points, and the second result being the difference between the number of search nodes and the number of search nodes of the previous node; extracting an extracted node with the smallest first result and the largest second result from the multiple nodes included in the second upstream path; and determining the extracted node as the second key point.

[0011] In combination with the first aspect, an embodiment of the present invention provides a sixth possible implementation of the first aspect, wherein the step of calculating the outer frame area corresponding to multiple layout instances based on the first key point, the second key point and the remaining nodes in the topological structure includes: performing the following steps for the calculation process of the outer frame area corresponding to each layout instance: determining whether the value stored in the counter is equal to the total number of nodes included in the topological structure; if not, increasing the value in the counter by 1, and selecting a candidate node from the first key point, the second key point and the remaining nodes; if the candidate node is not the first key point or the second key point, selecting a candidate node based on the node number of the candidate node; The optimal angle is calculated based on the position information of the candidate node; if the candidate node is the first key point or the second key point, multiple candidate angles are calculated based on the node position information of the candidate node, and each layout instance will select one of the multiple candidate angles as the optimal angle. From the perspective of all layout instances, each of the candidate angles will be obtained; the relative position is determined based on the optimal angle and the position information of the parent node corresponding to the candidate node; until the value stored in the counter is determined to be equal to the total number of nodes included in the topological structure, the relative positions corresponding to the multiple candidate nodes are obtained; based on the relative positions of the multiple candidate nodes and the specified proportional outer frame size, the outer frame area is calculated.

[0012] In combination with the first aspect, an embodiment of the present invention provides a seventh possible implementation of the first aspect, wherein the step of determining a target layout instance from multiple layout instances based on the outer frame area includes: determining the layout instance corresponding to the smallest outer frame area as the target layout instance.

[0013] In a second aspect, an embodiment of the present invention further provides a device for generating a single-line diagram, wherein the device includes: an acquisition module for acquiring a topological structure of a power line; wherein the topological structure is composed of a plurality of nodes having topological connections; an extraction module for extracting a first key point corresponding to a primary path and a second key point corresponding to a secondary path from the topological structure; a calculation module for calculating an outer frame area corresponding to a plurality of layout instances based on the first key point, the second key point and the remaining nodes in the topological structure; wherein the remaining nodes are nodes in the topological structure other than the first key point and the second key point; a determination module for determining a target layout instance from a plurality of layout instances based on the outer frame area; and a processing module for performing orthogonal layout processing on the target layout instance to generate a single-line diagram.

[0014] In a third aspect, an embodiment of the present invention further provides an electronic device, which includes a processor and a memory, the memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement the above method.

[0015] The embodiments of the present invention bring the following beneficial effects:

[0016] The embodiments of the present application provide a method, device and electronic device for generating a single-line diagram, wherein, after obtaining the topological structure of the power line, a first key point corresponding to the main path and a second key point corresponding to the secondary path are extracted from the topological structure, and the outer frame areas corresponding to multiple layout instances are calculated based on the first key point, the second key point and the remaining nodes in the topological structure, and a target layout instance is determined from the multiple layout instances based on the outer frame area. Finally, the target layout instance is orthogonalized and processed to generate a single-line diagram. The present application can extract the key points of the topological structure that affect the layout from the topological structure of the power line, and generate a compact single-line diagram based on the key points, thereby greatly improving the utilization rate of the drawings.

[0017] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description and the drawings.

[0018] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.

[0020] Figure 1 A flowchart of a method for generating a single-line diagram provided by an embodiment of the present invention;

[0021] Figure 2 A flowchart of another method for generating a single-line diagram provided by an embodiment of the present invention;

[0022] Figure 3 A schematic diagram of the structure of a device for generating a single-line diagram provided by an embodiment of the present invention;

[0023] Figure 4 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0024] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0025] A single-line diagram is a system electrical wiring diagram that uses specified graphics or symbols to represent various components in a three-phase AC power system in an equivalent single-line according to their actual connection methods. In the past, single-line diagrams were usually drawn manually, taking into account various business needs, such as the utilization rate of the drawings, the readability of the drawings, and the consistency between the drawings and the geographical location. However, with the emergence of products that automatically draw single-line diagrams in recent years, these products have greatly improved the drawing speed on the one hand, but on the other hand, the quality of the drawings is not as good as that of manually drawn drawings, and there will be practical problems such as a large number of blank spaces in the drawings and low utilization of the drawings.

[0026] Based on this, the embodiments of the present invention provide a method, device and electronic device for generating a single-line diagram, which can extract key points of the topological structure that affect the layout from the topological structure of the power line, generate a compact single-line diagram based on the key points, and greatly improve the utilization rate of the drawing.

[0027] To facilitate understanding of this embodiment, a method for generating a single-line diagram disclosed in an embodiment of the present invention is first introduced in detail.

[0028] The embodiment of the present invention provides a method for generating a single line diagram, such as Figure 1 A flowchart of a method for generating a single-line diagram is shown, the method comprising the following steps:

[0029] Step S102, obtaining the topological structure of the power line;

[0030] Among them, the topological structure is composed of multiple nodes with topological connections;

[0031] Specifically, topology refers to the physical layout features of various transmission media such as network cables, such as physical connections, by borrowing the two most basic graphic elements of geometry, points and lines, to abstractly discuss the methods, forms and geometric shapes of the interconnection between various endpoints in the network system. It can represent the network configuration and mutual connection of network servers, workstations and network devices.

[0032] Step S104, extracting a first key point corresponding to the primary path and a second key point corresponding to the secondary path from the topological structure;

[0033] Specifically, the first key point and the second key point are several nodes selected from the topological structure. Various layouts can be derived using these nodes, so these nodes are called key points, and non-key point nodes are not backtracked during layout. Because key points will be backtracked, this means that processor time will be consumed, so the number of key points is limited by computing resources. In this embodiment, the total number of first key points and second key points taken is 6 as an example. The number of first key points corresponding to the main path selected in the embodiment of the present application is 3, and the number of second key points corresponding to the secondary path is 3, but in actual applications, there is no specific restriction on the number of key points;

[0034] Step S106, calculating outer frame areas corresponding to the plurality of layout instances based on the first key point, the second key point and the remaining nodes in the topological structure;

[0035] Among them, the remaining nodes are the nodes in the topological structure other than the first key point and the second key point; in actual use, the outer frame areas corresponding to multiple layout instances can be calculated as needed based on the first key point, the second key point and the remaining nodes in the topological structure; among them, the number of layout instances can be set according to actual needs, and the number of layout instances is not limited here.

[0036] Step S108, determining a target layout instance from multiple layout instances based on the outer frame area;

[0037] The outer frame area is a measure that directly determines the utilization rate of the drawing. In order to ensure that the drawing can be fully utilized, in this embodiment, the layout instance corresponding to the smallest outer frame area can be selected as the target layout instance to make the structure of the single-line diagram generated by the target layout instance compact.

[0038] Step S110, performing orthogonal layout processing on the target layout instance to generate a single-line diagram.

[0039] Specifically, the target layout instance can be orthogonalized to generate a single-line diagram by the following method: first, starting from the substation outlet point, topologically search for the equipment within the current feeder range, generate a directed graph, obtain all nodes with an out-degree of 0 in the directed graph as the layout starting point, and generate a layout subgraph for each layout starting point. Each layout subgraph corresponds to a node tree. The layout starting point is the root node of the node tree with coordinates (0,0), and the layout unit occupied by the layout starting point is set. All layout subgraphs are traversed, and each layout subgraph is incremented to generate a single-line diagram.

[0040] A method for generating a single-line diagram provided by an embodiment of the present invention comprises the following steps: after obtaining the topological structure of a power line, extracting a first key point corresponding to a main path and a second key point corresponding to a secondary path from the topological structure, calculating outer frame areas corresponding to a plurality of layout instances based on the first key point, the second key point and the remaining nodes in the topological structure, determining a target layout instance from the plurality of layout instances based on the outer frame area, and finally, performing orthogonal layout processing on the target layout instance to generate a single-line diagram; the present application can extract key points of the topological structure that affect the layout from the topological structure of the power line, and generate a compact single-line diagram based on the key points, thereby greatly improving the utilization rate of the drawings.

[0041] This embodiment provides another method for generating a single-line diagram, which is implemented on the basis of the above embodiment; this embodiment focuses on describing the specific implementation of the method for generating a single-line diagram. Figure 2 A flowchart of another method for generating a single-line diagram is shown, the method comprising the following steps:

[0042] Step S200, obtaining a topological structure of a power line; wherein the topological structure is composed of a plurality of nodes having topological connections;

[0043] Step S202, marking the main path nodes included in the main path;

[0044] Generally, all main path nodes included in the main path can be marked, or some main path nodes can be selected for marking, which is not limited here. In addition, in actual use, Boolean values ​​can be used to mark the above main path nodes.

[0045] Step S204, determining a plurality of first node sets from the topological structure based on the marked main path nodes;

[0046] Each first node set includes multiple nodes that are interconnected, and multiple nodes are not marked as main path nodes. It can be understood that the above multiple first node sets are the divisions of all nodes other than the marked main path nodes. The division here is a concept of discrete mathematics. In simple terms, if the marked main path nodes are deleted from the topology of all topological data, then the remaining nodes must be several isolated sets, and these sets are the determined multiple first node sets.

[0047] According to the above description, the specific process of determining the first node set is: scan all topological connections in the topological structure. If neither of the two connected nodes is marked as a main path node, then record this connection, and derive the interconnected and unmarked nodes based on the recorded connection to form the first node set.

[0048] Step S206: determine a first upstream path based on multiple first node sets.

[0049] The above step S206 can be implemented through steps A1 to A5:

[0050] Step A1, obtaining the number of nodes and the sum of the areas corresponding to each first node set;

[0051] The above-mentioned number of nodes refers to the number of nodes included in the set, and the sum of areas refers to the sum of the areas of each node in the set; the attribute information corresponding to each node in the present application includes width and height, and the area of ​​a node can be obtained by multiplying the width and height of the node. The areas of all nodes in the first node set are added together to obtain the above-mentioned sum of areas.

[0052] Step A2, determining the first node set with the largest number of nodes and the largest area as the target first node set;

[0053] Step A3, obtaining the path length from each node in the target first node set to the root node;

[0054] In this embodiment, the root node refers to a substation. In specific implementation, a certain node in the topology structure may be designated as the root node as required, which is not limited here.

[0055] Step A4, selecting the first target node corresponding to the longest path length and the second target node corresponding to the shortest path length;

[0056] Step A5, tracing back the first target node to the second target node to obtain a first tracing back path;

[0057] The above process is centered on the root node, with the node closest to the root node placed in the first ring, the node second closest to the root node placed in the second ring, and so on, with the node farthest from the root node placed in the outermost ring. Each time when tracing back to the second target node, starting from the first target node, each time a connection node closer to the root node than the first target node is selected, the corresponding second target node can be found.

[0058] Step S208, extracting a preset number of first key points from the first upstream path;

[0059] The preset number here is illustrated by taking the three first key points on the main path selected in the embodiment of the present application as an example. The three selected first key points can divide the upstream path into four sub-paths of equal length as much as possible; specifically, the number of first key points extracted can be set according to actual needs and is not limited here.

[0060] Step S210, extracting a preset number of second key points from the topological structure based on the first key points and the main path nodes;

[0061] In practical applications, the process of extracting a preset number of second key points from the topological structure based on the first key points and the main path nodes can be implemented through steps B1 to B3:

[0062] Step B1, marking the first key point;

[0063] The marking process is the same as the process of marking the main path nodes included in the main path, and will not be repeated here.

[0064] Step B2, determining a plurality of second node sets from the topological structure based on the marked first key points and the marked main path nodes;

[0065] Each second node set includes a plurality of nodes that are interconnected, and the plurality of nodes are not marked as main path nodes and first key points.

[0066] Since the marked nodes in the topological structure have changed, the multiple second node sets determined from the topological structure based on the marked main path nodes and the first key points are different from the multiple first node sets. The process of determining the second node set is the same as the process of determining the first node set, so it will not be repeated here.

[0067] Step B3, determining a second upstream path based on multiple second node sets;

[0068] The process of determining the above-mentioned second upstream path is: obtain the number of nodes and the sum of the areas corresponding to each second node set; determine the second node set with the largest number of nodes and the largest sum of the areas as the target second node set; obtain the path length from each node in the target second node set to the root node; select the third target node corresponding to the longest path length and the fourth target node corresponding to the shortest path length; trace the third target node back to the fourth target node to obtain the second upstream path.

[0069] The process of determining the second upstream path is the same as the process of determining the first upstream path, and therefore, it will not be described in detail here.

[0070] Step B4, extracting a second key point from the second upstream path;

[0071] The process of raising the second key point can be achieved through steps C1 to C3:

[0072] Step C1, taking each node in the second upstream path as a search starting point in turn, searching from the search starting point until a marked node or a low-loop node is found, and obtaining the number of search nodes corresponding to each node;

[0073] Among them, the low-ring node is the node close to the root node, and the marked node includes all the above-mentioned marked nodes. During the search process, as long as any one of the marked nodes or the low-ring node is searched, the above-mentioned search process is terminated; when searching, all nodes are centered on the root node, and the node closest to the root node is placed in the first ring, the node second closest to the root node is placed in the second ring, and so on, the node farthest from the root node is placed in the outermost ring. Each search starts from the starting point. When a node with a lower ring than the starting point or a marked node is encountered, the search in the direction of the branch is stopped. Due to the topological connection of the data, other directions will continue to search until there is nothing to search or the search must be terminated through a low-ring node or a marked node; among them, the above-mentioned search nodes do not include low-ring nodes or marked nodes.

[0074] Step C2, for each node, calculating the search result corresponding to the node based on the number of search nodes;

[0075] Among them, the search results include a first result and a second result. The first result is the ratio of the number of search nodes to the total number of nodes in the topological structure, minus the inverse of the total number of preset key points. The second result is the difference between the number of search nodes and the number of search nodes of the previous node.

[0076] Typically, the absolute value of the first result corresponding to each node is stored in the delta array, and the floating-point numbers in the array are discretized; and the second result corresponding to each node is stored in the connect array, and the nodes in the second upstream path are sorted in descending order according to the ascending order of the delta data and the connect array.

[0077] Step C3: extracting an extracted node with the smallest first result and the largest second result from the multiple nodes included in the second upstream path; and determining the extracted node as the second key point.

[0078] The first node on the second upstream path is taken as the second key point, which is the extracted node with the smallest first result and the largest second result.

[0079] Step B5, mark the path nodes in the second upstream path whose distance from the root node is greater than the distance from the second key point to the root node, and mark the second key point; based on the marked path nodes, the second key point, the first key point and the main path node, re-execute the steps of determining multiple second node sets from the topological structure to marking the second key point until the number of extracted second key points reaches a preset number.

[0080] Because only one second key point is determined from the second upstream path on the secondary path each time, in actual use, it is necessary to extract a preset number of second key points from the secondary path. The preset number of second key points is also illustrated by 3 as an example. Therefore, it is necessary to re-determine multiple second node sets based on the marked nodes (path nodes, second key points, first key points and main path nodes), and then obtain a new second upstream path again, and then determine a second key point on the second upstream path, and repeat the execution process of steps B1 to B5 until 3 second key points are found; wherein, the extracted number of first key points and second key points may be the same or different, and is not limited here.

[0081] Step S212, calculating outer frame areas corresponding to a plurality of layout instances based on the first key point, the second key point and the remaining nodes in the topological structure; wherein the remaining nodes are nodes in the topological structure other than the first key point and the second key point;

[0082] The specific implementation process of the above step S212 is: the following steps are performed for the calculation process of the outer frame area corresponding to each layout instance: determine whether the value stored in the counter is equal to the total number of nodes included in the topological structure; if not, increase the value in the counter by 1, and select any candidate node from the first key point, the second key point and the remaining nodes; if the candidate node is not the first key point or the second key point, calculate the optimal angle based on the node position information of the candidate node; if the candidate node is the first key point or the second key point, calculate multiple candidate angles based on the node position information of the candidate node, and each layout instance will select one of the multiple candidate angles as the optimal angle. From the perspective of all layout instances, each of the candidate angles will be taken; determine the relative position based on the optimal angle and the position information of the parent node corresponding to the candidate node; until it is determined that the value stored in the counter is equal to the total number of nodes included in the topological structure, the relative positions corresponding to multiple candidate nodes are obtained; calculate the outer frame area based on the relative positions of multiple candidate nodes and the specified proportional outer frame size.

[0083] In the topological structure, for the remaining nodes that are not the first key point and the second key point, the directly calculated angle is the optimal angle. The optimal angle can be understood as the optimal relative angle relationship of the node with respect to the root node. For the first key point and the second key point, multiple candidate angles are selected as the optimal angle to generate multiple different layout instances.

[0084] Therefore, the calculation process is explained here based on a single layout instance. The optimal angle should be any one of the multiple candidate angles. And when zoomed in to the whole picture, all candidate angles will be taken as the optimal angle to obtain different layout instances.

[0085] Candidate angles also participate in the backtracking process, so each layout instance will select one of the candidate angles as the optimal angle. From the perspective of all layout instances, each of the candidate angles will be used as the optimal angle to calculate the relative position.

[0086] Further, extended to the global, if the candidate node is a key point of the topological structure, then each candidate angle of the key point is calculated. In the present embodiment of the application, taking the global total of 6 key points as an example, if the first key point is selected, if the key point has 6 angles A, B, C, D, E and F respectively, then the above six angles are calculated separately, and all the candidate angles of the key point will be taken. When the second key point is selected, if the key point also has 6 angles, then the above six angles are also calculated separately, and all the candidate angles of the second key point will be taken. And so on, according to the calculation of all the candidate angles of all six key points, and according to the calculation of the optimal angles of other non-key points, the relative positions of all the global nodes can be determined, thereby achieving a global layout.

[0087] Specifically, the calculation of the outer frame area is a quantitative evaluation indicator of the fullness of the drawing layout. The smaller the outer frame area, the fuller the drawing. For each layout instance, when the value stored in the counter is not equal to the total number of nodes included in the topological structure, it is necessary to first determine the relative position of the candidate node and the parent node. If the value stored in the counter is equal to the total number of nodes included in the topological structure, it indicates that the relative positions of all candidate nodes in the topological structure have been determined, and the equipment work of a layout instance has been completed, and the outer frame area can be calculated.

[0088] The specific calculation of the outer frame area is as follows: In this embodiment, a node is selected to correspond to a rectangle, and the rectangle can just wrap all the involved devices inside, which is referred to as the wrapping rectangle. First, the wrapping rectangle is calculated, and the maximum horizontal coordinate, the minimum horizontal coordinate, the maximum vertical coordinate, and the minimum horizontal coordinate of all nodes need to be calculated. Secondly, the outer frame of the specified ratio of the wrapping rectangle is calculated. This embodiment provides a calculation method, and its specific values ​​are not limited in practical applications. Assuming that the width of the wrapping rectangle is w and the height is h, and assuming that the ratio of the drawing is 16:9, then, here, the calculation method is: if w is greater than or equal to h and w is less than 1.78×h, then w is changed to 1.78×h. If w is greater than 1.78×h, then h is changed to 9×w / 16. Finally, the specified ratio outer frame is moved so that the center point of the specified ratio outer frame overlaps with the center point of the wrapping rectangle.

[0089] Furthermore, after calculating the specified proportion of the outer border of all nodes according to the above method, the rectangle is divided into a 3×3 grid, and the four vertices of the outer border of each node are drawn into the 3×3 grid, and then the vertices of each device involved are drawn into the 3×3 grid, and the area of ​​the convex hull of each node in each grid is calculated, and the sum of the areas of the convex hulls in all grids is calculated, and the outer frame area is calculated using the calculated sum of the areas of the convex hulls and the area of ​​the wrapping rectangle in the specified proportion of the outer frame rectangle.

[0090] S214, determining a target layout instance from the plurality of layout instances based on the outer frame area;

[0091] S216, performing orthogonal layout processing on the target layout instance to generate a single-line diagram.

[0092] The method for generating a single-line diagram provided in the embodiment of the present application can extract key points of the topological structure that affect the layout from the topological structure of the power line, calculate the outer frame areas corresponding to multiple layout instances based on the key points, and select the target layout instance with the smallest outer frame area to generate a compact single-line diagram, thereby greatly improving the utilization rate of the drawing.

[0093] Corresponding to the method for generating a single-line diagram provided in the above-mentioned embodiment, the embodiment of the invention further provides a device for generating a single-line diagram, such as Figure 3 A structural schematic diagram of a device for generating a single-line diagram is shown, the device comprising:

[0094] The acquisition module 301 is used to acquire the topological structure of the power line; wherein the topological structure is composed of a plurality of nodes having topological connections;

[0095] An extraction module 302 is used to extract a first key point corresponding to a primary path and a second key point corresponding to a secondary path from the topological structure;

[0096] A calculation module 303 is used to calculate the outer frame areas corresponding to the plurality of layout instances based on the first key point, the second key point and the remaining nodes in the topological structure; wherein the remaining nodes are nodes in the topological structure other than the first key point and the second key point;

[0097] A determination module 304, configured to determine a target layout instance from a plurality of layout instances based on an outer frame area;

[0098] Processing module 305 is used to perform orthogonal layout processing on the target layout instance to generate a single-line diagram. The embodiment of the present application provides a device for generating a single-line diagram, wherein, after obtaining the topological structure of the power line, a first key point corresponding to the main path and a second key point corresponding to the secondary path are extracted from the topological structure, and the outer frame areas corresponding to multiple layout instances are calculated based on the first key point, the second key point and the remaining nodes in the topological structure, and the target layout instance is determined from the multiple layout instances based on the outer frame area. Finally, the target layout instance is orthogonalized and processed to generate a single-line diagram; the present application can extract the key points of the topological structure that affect the layout from the topological structure of the power line, and generate a compact single-line diagram based on the key points, which greatly improves the utilization rate of the drawings.

[0099] The embodiment of the present invention further provides an electronic device, see Figure 4 A structural schematic diagram of an electronic device is shown, the electronic device includes a processor 60 and a memory 61, the memory 61 stores machine executable instructions that can be executed by the processor 60, and the processor 60 executes the machine executable instructions to implement the above-mentioned method for generating a single item graph.

[0100] Further, Figure 4 The electronic device shown further includes a bus 62 and a communication interface 63 , and the processor 60 , the communication interface 63 and the memory 61 are connected via the bus 62 .

[0101] Among them, the memory 61 may include a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 63 (which can be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. can be used. The bus 62 can be an ISA (Industrial Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Enhanced Industry Standard Architecture) bus, etc. The above-mentioned bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0102] The processor 60 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 60. The above processor 60 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in the embodiments of the present invention can be directly embodied as a hardware decoding processor to be executed, or the hardware and software modules in the decoding processor can be executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 61 , and the processor 60 reads the information in the memory 61 and completes the steps of the method of the above embodiment in combination with its hardware.

[0103] An embodiment of the present invention further provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the above method.

[0104] The computer program product of the method, device, electronic device and system for generating a single-line diagram provided in the embodiments of the present invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the method in the previous method embodiment. The specific implementation can be found in the method embodiment, which will not be repeated here.

[0105] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0106] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0107] Finally, it should be noted that the above embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above embodiments, those skilled in the art should understand that any person skilled in the art can still modify the technical solutions recorded in the above embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A method for generating a single-line diagram, characterized in that: The method comprises: Acquire a topological structure of a power line; wherein the topological structure is composed of a plurality of nodes having topological connections; Extracting a first key point corresponding to a primary path and a second key point corresponding to a secondary path from the topological structure; Calculating outer frame areas corresponding to a plurality of layout instances based on the first key point, the second key point, and the remaining nodes in the topological structure; wherein the remaining nodes are nodes in the topological structure other than the first key point and the second key point; Determine a target layout instance from the plurality of layout instances based on the outer frame area; Performing orthogonal layout processing on the target layout instance to generate a single-line diagram; The step of calculating the outer frame areas corresponding to the plurality of layout instances based on the first key point, the second key point and the remaining nodes in the topological structure includes: The following steps are performed for the calculation process of the outer frame area corresponding to each layout instance: Determining whether the value stored in the counter is equal to the total number of points included in the topological structure; If not, increase the value in the counter by 1, and select any candidate node from the first key point, the second key point and the remaining nodes; If the candidate node is not the first key point or the second key point, calculating the optimal angle based on the node position information of the candidate node; If the candidate node is the first key point or the second key point, multiple candidate angles are calculated based on the node position information of the candidate node, and each layout instance selects one of the multiple candidate angles as the optimal angle. From the perspective of all layout instances, each of the candidate angles will be obtained; Determine the relative position based on the optimal angle and the position information of the parent node corresponding to the candidate node; Until it is determined that the value stored in the counter is equal to the total number of nodes included in the topological structure, the relative positions corresponding to the plurality of candidate nodes are obtained; Based on the relative positions of the plurality of candidate nodes and the specified proportional outer frame size, the outer frame area is calculated.

2. The method according to claim 1, characterized in that: The step of extracting a first key point corresponding to a primary path and a second key point corresponding to a secondary path from the topological structure comprises: Marking the main path nodes included in the main path; Determining a plurality of first node sets from the topological structure based on the marked main path nodes; wherein each of the first node sets includes a plurality of nodes that are interconnected, and a plurality of nodes are not marked as the main path nodes; Determine a first upstream path based on the plurality of first node sets; Extracting a preset number of first key points from the first upstream path; A preset number of second key points are extracted from the topological structure based on the first key points and the main path nodes.

3. The method according to claim 2, characterized in that The step of determining a first upstream path based on the plurality of first node sets includes: Obtain the number and area sum of nodes corresponding to each of the first node sets; Determine the first node set with the largest number of nodes and the largest area as the target first node set; Obtaining the path length from each node in the target first node set to the root node; Select the first target node corresponding to the longest path length and the second target node corresponding to the shortest path length; The first target node is traced back to the second target node to obtain a first upstream path.

4. The method according to claim 2, characterized in that: The step of extracting a preset number of second key points from the topological structure based on the first key points and the main path nodes comprises: Marking the first key point; Determine a plurality of second node sets from the topological structure based on the marked first key point and the marked main path node; wherein each of the second node sets includes a plurality of nodes that are interconnected, and a plurality of nodes are not marked as the main path node and the first key point; Determine a second upstream path based on the plurality of second node sets; Extracting a second key point from the second upstream path; Mark the path nodes in the second upstream path whose distance from the root node is greater than the distance from the second key point to the root node, and mark the second key point; Based on the marked path nodes, the second key points, the first key points and the main path nodes, the steps of determining multiple second node sets from the topological structure to marking the second key points are re-executed until the number of the extracted second key points reaches a preset number.

5. The method according to claim 4, characterized in that The step of determining a second upstream path based on the plurality of second node sets includes: Obtain the number and area sum of nodes corresponding to each of the second node sets; Determine the second node set with the largest number of nodes and the largest area as the target second node set; Obtaining the path length from each node in the target second node set to the root node; Select the third target node corresponding to the longest path length and the fourth target node corresponding to the shortest path length; The third target node is traced back to the fourth target node to obtain a second upstream path.

6. The method according to claim 4, characterized in that The step of extracting a second key point from the second upstream path includes: Taking each node in the second upstream path as a search starting point in turn, starting the search from the search starting point until a marked node or a low-loop node is found, and obtaining the number of search nodes corresponding to each node; wherein the low-loop node is a node close to the root node; For each of the nodes, a search result corresponding to the node is calculated based on the number of searched nodes; wherein the search result includes a first result and a second result, the first result being a calculation result of the ratio of the number of searched nodes to the total number of nodes in the topological structure minus the reciprocal of the total number of preset key points, and the second result being a calculation result of the difference between the number of searched nodes and the number of searched nodes of the previous node; Extracting a node with the smallest first result and the largest second result from a plurality of nodes included in the second upstream path; The extracted node is determined as a second key point.

7. The method according to claim 1, characterized in that The step of determining a target layout instance from the plurality of layout instances based on the outer frame area comprises: The layout instance corresponding to the smallest outer frame area is determined as the target layout instance.

8. A device for generating a single line diagram, characterized in that: The device comprises: An acquisition module, used to acquire a topological structure of a power line; wherein the topological structure is composed of a plurality of nodes having topological connections; An extraction module, used to extract a first key point corresponding to a primary path and a second key point corresponding to a secondary path from the topological structure; A calculation module, used to calculate the outer frame areas corresponding to multiple layout instances based on the first key point, the second key point and the remaining nodes in the topological structure; wherein the remaining nodes are nodes in the topological structure other than the first key point and the second key point; A determination module, configured to determine a target layout instance from the plurality of layout instances based on the outer frame area; A processing module, used for performing orthogonal layout processing on the target layout instance to generate a single-line diagram; The calculation module is further used to perform the following steps for the calculation process of the outer frame area corresponding to each layout instance: Determining whether the value stored in the counter is equal to the total number of points included in the topological structure; If not, increase the value in the counter by 1, and select any candidate node from the first key point, the second key point and the remaining nodes; If the candidate node is not the first key point or the second key point, calculating the optimal angle based on the node position information of the candidate node; If the candidate node is the first key point or the second key point, multiple candidate angles are calculated based on the node position information of the candidate node, and each layout instance selects one of the multiple candidate angles as the optimal angle. From the perspective of all layout instances, each of the candidate angles will be obtained; Determine the relative position based on the optimal angle and the position information of the parent node corresponding to the candidate node; Until it is determined that the value stored in the counter is equal to the total number of nodes included in the topological structure, the relative positions corresponding to the plurality of candidate nodes are obtained; Based on the relative positions of the plurality of candidate nodes and the specified proportional outer frame size, the outer frame area is calculated.

9. An electronic device, characterized in that: The invention comprises a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the method according to any one of claims 1 to 7.