Distribution network automatic mapping method and device based on dotted space layout and medium
Through the automatic diagram forming method of distribution network distribution network based on point-shaped space layout, the problem of wrong layout of multiple branches and multi-station buildings in the existing technology is solved, and the automatic diagram forming and connection optimization of distribution network single feeder diagram is realized, satisfying the configuration Business requirements for network scheduling.
Patent Information
- Application Number
- CN202411846363.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-01-10
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing distribution network diagram technology is difficult to effectively deal with the situation of multi-branch and multi-station buildings, resulting in layout errors and the single-feeder diagram that cannot be updated in time, which cannot meet actual business needs.
Using the automatic graphing method of distribution networking based on point-like spatial layout, by building a plane coordinate system, traversing and searching the main line equipment, selecting the layout direction, performing equipment layout and connecting layout, using position expansion and shrinking rules to optimize the equipment layout, and generate the final Graphics file.
The automatic diagram of the distribution network single feeder diagram is realized, ensuring a compact layout, regular connections and beautiful appearance, and meeting the business needs of distribution network scheduling.
Smart Images

Figure CN119294024A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power distribution network, and in particular to a distribution network automatic mapping method, equipment and medium based on point-like spatial layout. Background Art
[0002] There are four types of thematic diagrams for distribution network wiring diagrams, including single-line diagrams, ring network diagrams, station room diagrams and system diagrams. The existing drawing technology is mainly aimed at the drawing of single-line diagrams. The drawing technology mainly uses trunk and branch line methods combined with force-oriented, simulated annealing, heuristic search and other algorithms to layout and position equipment models. Most of the realized graphic layouts adopt horizontal and vertical (four directions: up, down, left and right) layout effects.
[0003] The current mainstream mapping technology based on the topological data of the distribution network is mainly oriented to simple single-line diagrams, and can only present good results when there are not many branches in the single-line diagram and not many station room diagrams on the feeder. If there are more branches and more station rooms, the presentation effect will be relatively poor and cannot meet the actual business needs. The main layout method of the current technology is to generate equipment using the topological connection relationship of the equipment. The algorithm for connecting station rooms is not considered. In addition, the layout direction of the equipment mainly considers only the four directions of up, down, left and right, without considering more directions. When there are multiple branch connection devices on the tower or station room, the layout will be disordered.
[0004] Currently, most of the single-line diagrams that can better meet the dispatching business applications are manually drawn single feeder diagrams. Manually drawn feeder diagrams are more beautiful and users can customize the required content, but the drawing efficiency is low and the feeder diagram cannot be updated in time according to the actual feeder topology model, resulting in the inability to use the latest feeder diagram in time during distribution network dispatching. In addition, the current automatic drawing technology cannot meet the actual business needs well.
[0005] The Chinese patent with authorization announcement number CN109726446B uses a combination of multiple algorithms to perform the initial layout of power plants using a circular algorithm, a multi-condition joint algorithm for equipment layout, and a cost exchange algorithm for line planning. However, this method fails to solve the problem of equipment layout optimization.
[0006] Therefore, an automatic distribution network mapping method, equipment and medium based on point-like spatial layout are proposed. Summary of the invention
[0007] The present invention aims to solve at least one of the technical problems existing in the prior art. To this end, the present invention proposes a distribution network automatic mapping method, device and medium based on point-like spatial layout, which realizes the automatic mapping of a distribution network single feeder diagram to better meet the business needs of distribution network scheduling.
[0008] To achieve the above purpose, a distribution network automatic mapping method based on point-like spatial layout is proposed, which includes the following steps: Step 1: Construct a plane coordinate system on the canvas; Step 2: Traverse and retrieve the devices on the main line of the feeder according to the topological relationship of the devices; Step 3: Select the device layout direction, lay out the devices on the canvas one by one, and move and adjust the laid out devices; Step 4: Connect and lay out the devices that have been laid out on the canvas; Step 5: Layout the name and measurement identification text of the device on the canvas, and generate a final graphic file so that the user can configure the device based on the graphic file; The main line is selected in the following manner: The longest connection relationship is taken as the main line from the starting point of the search; Or: The main line is selected in the following manner: The device weight of each device in the connection relationship is used for calculation. The device with the largest weight is used as the next device of the currently traversed device, forming a branch. Calculate the device weight of each device according to the device weight calculation formula, and finally accumulate the device weights of each branch from the root node of the tree to all leaf nodes. The branch with the largest accumulated device weight value is taken as the main branch. The traversal and retrieval of the equipment on the main line of the feeder comprises the following steps: Collect feeder topology datasets; Set the starting device; generally speaking, the outgoing switch of the main network is the starting device; Find the next device according to the device connection node; it is understandable that the next device can be retrieved and found in the topology data set; If the next device is found, save the next device to the device topology connection set and traverse it recursively; If the next device is not found, the search ends and the device topology connection set is obtained; The order of selecting the layout direction of the device is right, bottom, left, top, bottom left, top left, top right, bottom right. The layout principle is to prioritize layout to the right. When there is a branch, it is selected according to the direction that is not laid out. The method of sequentially laying out the devices on the canvas and moving and adjusting the laid out devices is as follows: Expand or shrink the location of the deployed equipment; The movement rules of the location extension include: Add a new device to the right: Use the minimum X coordinate value minX of the new device to traverse all the laid-out devices in the canvas. If the minimum X coordinate value of the laid-out device is greater than minX, it is marked as needing to be moved to the right. The moving distance is the width of the new device plus the offset in the X-axis direction. Add a new device to the left: Use the maximum X coordinate value of the new device, maxX, to traverse all the laid-out devices in the canvas. If the maximum X coordinate value of the laid-out device is less than maxX, it is marked as needing to be moved to the left. The moving distance is the width of the new device plus the offset in the X-axis direction. Adding a new device upward: Use the maximum Y coordinate value of the new device, maxY, to traverse all the laid-out devices in the canvas. If the maximum Y coordinate value of the laid-out device is less than maxY, it is marked as needing to be moved upward. The moving distance is the height of the new device plus the offset in the Y-axis direction. Adding a new device downward: Use the minimum Y coordinate value minY of the new device to traverse all the laid-out devices in the canvas. If the minimum Y coordinate value of the laid-out device is greater than minY, it is marked as needing to be moved upward. The moving distance is the height of the new device plus the offset in the Y-axis direction. Add a new device to the upper right corner: Combine the right and upward layout algorithms, and use the minimum X coordinate value minX and the maximum Y coordinate maxY of the new device to traverse all the laid out devices in the canvas. If the minimum X coordinate value of the laid out device is greater than minX, it is marked as needing to move to the right, and the maximum Y coordinate value is less than maxY, it is marked as needing to move upward. The distance to move to the right is the width of the new device plus the offset in the X-axis direction, and the distance to move upward is the height of the new device plus the offset in the Y-axis direction. Add a new device to the upper left corner: Combine the left and upward layout algorithms, and use the maximum X coordinate value maxX and the maximum Y coordinate maxY of the new device to traverse all the laid out devices in the canvas. If the maximum X coordinate value of the laid out device is less than maxX, it is marked as needing to move to the left, and the maximum Y coordinate value is less than maxY, it is marked as needing to move upward. The distance to move to the left is the width of the new device plus the offset in the X-axis direction, and the distance to move upward is the height of the new device plus the offset in the Y-axis direction. Add a new device to the lower right corner: Combine the right and downward layout algorithms, and use the minimum X coordinate value minX and the minimum Y coordinate minY of the new device to traverse all the laid out devices in the canvas. If the minimum X coordinate value of the laid out device is greater than minX, it is marked as needing to move to the right, and the minimum Y coordinate value is greater than minY, it is marked as needing to move downward. The distance to the right is the width of the new device plus the offset in the X-axis direction, and the distance to move downward is the height of the new device plus the offset in the Y-axis direction. Add a new device to the lower left corner: Combine the left and downward layout algorithms, and use the maximum X coordinate value maxX and the minimum Y coordinate minY of the new device to traverse all the laid out devices in the canvas. If the maximum X coordinate value of the laid out device is less than maxX, it is marked as needing to move to the left, and the minimum Y coordinate value is greater than minY, it is marked as needing to move downward. The distance to move to the left is the width of the new device plus the offset in the X-axis direction, and the distance to move downward is the height of the new device plus the offset in the Y-axis direction. The position contraction rules include: The contraction starts from the end nodes of each branch of the feeder; When shrinking each device, it is necessary to determine whether the device will be covered after shrinking. If so, the shrinking will be rolled back. The direction of contraction is opposite to the direction of expansion, i.e., a device that expands to the right will contract to the left when contracting; The method of wiring the devices already laid out on the canvas is as follows: If there is no other device between the devices, a straight line is directly connected between the anchor points of the two devices; if there is other device between the devices and the connecting line will pass through the devices, a polyline connection is generated according to the polyline generation logic; There are three relative positions between station building and non-station building equipment: left and right, top and bottom. According to different positions, the wiring layout rules are as follows: Left and right orientation: The non-station room equipment in the left and right orientation is not on the same horizontal or vertical line as the station room exit, so the generated connection line must be a broken line. The connection line will start from the station room exit and move toward the target non-station room equipment anchor point, first going downward and then to the left and right. The non-station room equipment is other equipment excluding the station room. Upper position: The non-station building equipment in the upper position is above the station building exit. Even if they are on the same vertical line, the exit cannot be directly connected to the non-station building equipment anchor point, which will pass through the station building and affect the appearance of the connection layout. You need to connect the line from the exit downward first, and then find the target non-station building equipment anchor point along the edge of the station building; Lower position: When non-station room equipment is arranged in the lower position, the algorithm will automatically calculate so that the non-station room equipment and the station room exit are on the same vertical line, so a straight line can be used to connect with the non-station room equipment in the lower position; The station building exit points are connected to each other. Just like the station building exits are connected to non-station building equipment, there are also layouts in the left, right, top, and bottom directions. The station building connections in each direction are connected using broken lines.
[0009] The polyline generation logic is: Identify whether there is overlap, avoid overlap, and generate polylines; The method of identifying whether there is overlap is: All the laid-out devices on the diagram are considered as rectangular frame points, with the coordinates of the upper left corner and the lower right corner as the minimum and maximum coordinates; Take the coordinates of the beginning and end of the connecting line segment and calculate the intersection with the maximum and minimum coordinates of all devices. If there is an intersection, it means there is overlap; Determine whether there is overlap based on the lines laid out on the diagram. Compare horizontal line segments with horizontal line segments and vertical line segments with vertical line segments. If they are the same, it means that the lines overlap. If there is overlap, the connecting line segment is regenerated. The logic of the regeneration is: according to the overlap calculation logic, the coordinates of the overlapping devices are found, and the overlap starting intersection point is calculated in combination with the direction of the connecting line segment; The method to calculate the overlap starting intersection point is: The line goes horizontally to the right, and the starting intersection is on the left side of the device rectangle; The line goes horizontally to the left, and the starting intersection is on the right side of the device rectangle; The line goes vertically downward, with the starting intersection point at the top of the device rectangle; The connection line goes vertically upward, and the starting intersection is below the device rectangle; After obtaining the starting intersection point, the bending point of the connecting line segment is calculated according to the preset device gap threshold p; Taking the bending point as the starting point of the new connection line segment, continue to generate connection line segments toward the target object according to the connection rules. If there is an obstacle, continue to execute the bypass logic until the target object is found; the target object is the device at the other end of the connection; An electronic device is proposed, comprising: a processor and a memory, wherein the memory stores a computer program that can be called by the processor; The processor executes the above-mentioned method for automatically mapping a distribution network based on a point-like spatial layout by calling a computer program stored in the memory.
[0010] A computer-readable storage medium is provided, on which a rewritable computer program is stored; When the computer program is executed on a computer device, the computer device is enabled to execute the above-mentioned method for automatically drawing a distribution network based on a point-like spatial layout.
[0011] Compared with the prior art, the present invention has the following beneficial effects: The present invention parses and converts the data into model data for drawing according to the model and topology data provided by the source end, and then finds a starting device according to the topological relationship of the model, traverses the topology from the starting device to find the main branch line of the feeder, and then starts to lay out the main branch according to the layout rules, expansion rules and folding rules, and then lays out the sub-branches under the main branch until all devices are laid out, and then shrinks the laid out devices and connections to make the laid out devices as compact as possible and the connections regular and orderly, and finally corrects the margins of the generated feeder diagram so that the entire feeder diagram can be displayed in the center of the canvas. The automatic drawing of the single feeder diagram of the distribution network is realized to better meet the business needs of the distribution network scheduling. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Figure 1 It is a flow chart of the method for automatically mapping a distribution network based on point-like spatial layout in Example 1 of the present invention; Figure 2 This is a data processing flow chart in Example 1 of the present invention; Figure 3 This is a flow chart of device relationship retrieval in Example 1; Figure 4 A schematic diagram of a layout simulation in Example 1; Figure 5 This is a schematic diagram of a mobile device arranged to the right in Example 1; Figure 6 This is a wiring diagram in Example 1; Figure 7 This is an example diagram of the broken line connection in Example 1; Figure 8 This is an example diagram of the straight line connection in Example 1. DETAILED DESCRIPTION
[0013] The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0014] Example 1
[0015] like Figure 1 As shown, the distribution network automatic mapping method based on point-like spatial layout includes the following steps: Step 1: Construct a plane coordinate system on the canvas; Step 2: Traverse and retrieve the devices on the main line of the feeder according to the topological relationship of the devices; Step 3: Select the device layout direction, lay out the devices on the canvas one by one, and move and adjust the laid out devices; Step 4: Connect and lay out the devices that have been laid out on the canvas; Step 5: Layout the name and measurement identification text of the device on the canvas, and generate a final graphic file so that the user can configure the device based on the graphic file; It should be noted that before laying out devices on the canvas, it is generally necessary to prepare device data in advance; The pre-prepared data refers to: In the distribution management business scenario, there are multiple standard formats for the common distribution network model data exchange formats, including: database tables, CIME files, and XML files. The database tables are usually maintained in accordance with the "Distribution Network Dispatching Model Specifications" issued by the State Grid Control Center. The formats of CIME and XML files will be different, and each grid unit will have differences and cannot be completely unified. Therefore, before automatic mapping, the model data must be "normalized" (transferring data of different standard structures to a set of standard structures). The data processing process is as follows: Figure 2 As shown: Source data (model data), including cloud model data, CIME files, XML files and other models. The storage formats of various models are different; Model conversion adapter, responsible for data access, association mapping, conversion, etc. from different data sources, and storing the data into a unified graph model storage interface; Unify the graph model, store the model data output by the conversion adapter into the model library table, which includes: device model library table (one table for each device type), device topology relationship table, etc., and then convert the connection topology relationship between the devices in each feeder into a point-line connection relationship according to the point-line connection relationship required for the graph, and assemble it into a graph model; Specifically, constructing a plane coordinate system on the canvas is constructing a plane rectangular coordinate system of XY axes on the canvas, so as to provide coordinate information for the device on the canvas; Preferably, the main line is selected in the following manner: The longest connection relationship is taken as the main line from the starting point of the search; Specifically, the search starts with the main network equipment as the starting equipment, and the pole tower and station house are used as branch points. Each device is found according to the search rules, and a tree structure model is constructed for all the found devices. Then, the device weight of each device on the feeder (circuit breaker, knife switch, pole tower, station house, etc., the station house is calculated as a common device) is calculated as 1, and finally the device weights of each branch are accumulated (from the root node of the tree to all leaf nodes), and the device with the largest weight is used as the main branch; In another preferred embodiment, the trunk line is selected in the following manner: The device weight of each device in the connection relationship is used for calculation. The device with the largest weight is used as the next device of the currently traversed device, forming a branch. Specifically, a device weight is set for each device. The calculation formula of the device weight is: K=B+J×B1, and the meanings of the parameters are: B is the basic device weight of the device; J is the number of branches connected to it; B1 is the weight value of the branch; Calculate the device weight of each device according to the device weight calculation formula, and finally accumulate the device weights of each branch from the root node of the tree to all leaf nodes. The branch with the largest accumulated device weight value is taken as the main branch. Preferably, the equipment weight setting rules may include: 1) For equipment outside the station house, the basic equipment weight B of single anchor point and double anchor point is 1, and the equipment weight of equipment with more than 2 anchor points is 2; 2) For pole towers and station houses, the comprehensive basic equipment weight B is 1, the B1 value is 1, and J is the actual number of branches; Further, such as Figure 3 As shown in the device relationship retrieval flow chart shown in the figure, the traversal and retrieval of the devices on the main line of the feeder includes the following steps: Collect feeder topology datasets; Set the starting device; generally speaking, the outgoing switch of the main network is the starting device; Find the next device according to the device connection node; it is understandable that the next device can be retrieved and found in the topology data set; If the next device is found, save the next device to the device topology connection set and traverse it recursively; If the next device is not found, the search ends and the device topology connection set is obtained; Furthermore, the layout direction selection order of the device is right, bottom, left, top, bottom left, top left, top right, bottom right, and the layout principle is to prioritize layout to the right, and when there is a branch, it is selected according to the direction that is not laid out; For example, in the scenario where the pole tower on the main branch is connected to the branch, since the main branch is laid out to the right, the equipment has been laid out on both sides of the pole tower, so we can choose from the remaining 6 directions. The schematic diagram of the layout simulation is as follows: Figure 4 As shown, the numbers on the line indicate the order of the direction layout when generating this figure; The station building containers are uniformly arranged with the station building outlet facing downwards. When the equipment is extrapolated to the station building, the layout direction of the station building is also arranged according to the 8 directions of the equipment. It should be noted that during the layout of equipment, if there are many branches, the equipment to be laid out later may cover the equipment that has been laid out earlier. In order to prevent the equipment from covering each other, the laid-out equipment needs to be moved to prevent covering. The rules for moving the equipment are based on the layout direction of the newly added equipment to control the equipment that needs to be moved. Figure 5 As shown in the diagram of the mobile device layout to the right, there are two situations in which the device is moved: one is to prevent the location covered by the device from expanding, and the other is to shrink the location after the move; Therefore, the method of sequentially laying out the devices on the canvas and moving and adjusting the laid out devices is as follows: Expand or shrink the location of the deployed equipment; Specifically, the movement rules of the position extension include: Add a new device to the right: Use the minimum X coordinate value minX of the new device to traverse all the laid-out devices in the canvas. If the minimum X coordinate value of the laid-out device is greater than minX, it is marked as needing to be moved to the right. The moving distance is the width of the new device plus the offset in the X-axis direction. Add a new device to the left: Use the maximum X coordinate value of the new device, maxX, to traverse all the laid-out devices in the canvas. If the maximum X coordinate value of the laid-out device is less than maxX, it is marked as needing to be moved to the left. The moving distance is the width of the new device plus the offset in the X-axis direction. Adding a new device upward: Use the maximum Y coordinate value of the new device, maxY, to traverse all the laid-out devices in the canvas. If the maximum Y coordinate value of the laid-out device is less than maxY, it is marked as needing to be moved upward. The moving distance is the height of the new device plus the offset in the Y-axis direction. Adding a new device downward: Use the minimum Y coordinate value minY of the new device to traverse all the laid-out devices in the canvas. If the minimum Y coordinate value of the laid-out device is greater than minY, it is marked as needing to be moved upward. The moving distance is the height of the new device plus the offset in the Y-axis direction. Add a new device to the upper right corner: Combine the right and upward layout algorithms, and use the minimum X coordinate value minX and the maximum Y coordinate maxY of the new device to traverse all the laid out devices in the canvas. If the minimum X coordinate value of the laid out device is greater than minX, it is marked as needing to move to the right, and the maximum Y coordinate value is less than maxY, it is marked as needing to move upward. The distance to move to the right is the width of the new device plus the offset in the X-axis direction, and the distance to move upward is the height of the new device plus the offset in the Y-axis direction. Add a new device to the upper left corner: Combine the left and upward layout algorithms, and use the maximum X coordinate value maxX and the maximum Y coordinate maxY of the new device to traverse all the laid out devices in the canvas. If the maximum X coordinate value of the laid out device is less than maxX, it is marked as needing to move to the left, and the maximum Y coordinate value is less than maxY, it is marked as needing to move upward. The distance to move to the left is the width of the new device plus the offset in the X-axis direction, and the distance to move upward is the height of the new device plus the offset in the Y-axis direction. Add a new device to the lower right corner: Combine the right and downward layout algorithms, and use the minimum X coordinate value minX and the minimum Y coordinate minY of the new device to traverse all the laid out devices in the canvas. If the minimum X coordinate value of the laid out device is greater than minX, it is marked as needing to move to the right, and the minimum Y coordinate value is greater than minY, it is marked as needing to move downward. The distance to the right is the width of the new device plus the offset in the X-axis direction, and the distance to move downward is the height of the new device plus the offset in the Y-axis direction. Add a new device to the lower left corner: Combine the left and downward layout algorithms, and use the maximum X coordinate value maxX and the minimum Y coordinate minY of the new device to traverse all the laid out devices in the canvas. If the maximum X coordinate value of the laid out device is less than maxX, it is marked as needing to move to the left, and the minimum Y coordinate value is greater than minY, it is marked as needing to move downward. The distance to move to the left is the width of the new device plus the offset in the X-axis direction, and the distance to move downward is the height of the new device plus the offset in the Y-axis direction. The position contraction rules include: The contraction starts from the end nodes of each branch of the feeder; When shrinking each device, it is necessary to determine whether the device will be covered after shrinking. If so, the shrinking will be rolled back. The direction of contraction is opposite to the direction of expansion, i.e., a device that expands to the right will contract to the left when contracting; Equipment connection is to realize the series connection between equipments, and connect the connected equipment anchor points through the connection. The layout of the connection will directly affect the readability and aesthetics of the entire feeder diagram. In order to make the generated feeder diagram practical, it is necessary to formulate relevant algorithm rules for the generation of the connection, and the layout and routing of the connection adopts a heuristic search algorithm; Specifically, the method of connecting and laying out the devices laid out on the canvas is as follows: When connecting two non-station equipment, if there is no other equipment between the two equipment, a straight line is directly connected to the anchor points of the two equipment; if there is other equipment between the equipment and the connecting line will pass through the equipment, a broken line connection is generated according to the broken line generation logic; The station exit point is connected to the equipment. There are many relative positions between the station and non-station equipment, including left, right, top, and bottom. Figure 6 The wiring diagram shown in the figure shows the schematic effect. According to different directions, the wiring layout rules are as follows: Left and right orientation: The non-station room equipment in the left and right orientation is not on the same horizontal or vertical line as the station room exit, so the generated connection line must be a broken line. The connection line will start from the station room exit and move toward the target non-station room equipment anchor point, first going downward and then to the left and right. The non-station room equipment is other equipment excluding the station room. Upper position: The non-station building equipment in the upper position is above the station building exit. Even if they are on the same vertical line, the exit cannot be directly connected to the non-station building equipment anchor point, which will pass through the station building and affect the appearance of the connection layout. You need to connect the line from the exit downward first, and then find the target non-station building equipment anchor point along the edge of the station building; Lower position: When non-station room equipment is arranged in the lower position, the algorithm will automatically calculate so that the non-station room equipment and the station room exit are on the same vertical line, so a straight line can be used to connect with the non-station room equipment in the lower position; The station building exit points are connected to each other. Just like the station building exits are connected to non-station building equipment, there are also layouts in the left, right, top, and bottom directions. The station building connections in each direction are connected using broken lines.
[0016] Specifically, the polyline generation logic is: Identify whether there is overlap, avoid overlap, and generate polylines; The method of identifying whether there is overlap is: All the laid-out devices on the diagram are considered as rectangular frame points, with the coordinates of the upper left corner and the lower right corner as the minimum and maximum coordinates; Take the coordinates of the beginning and end of the connecting line segment and calculate the intersection with the maximum and minimum coordinates of all devices. If there is an intersection, it means there is overlap; Determine whether there is overlap based on the lines laid out on the diagram. Compare horizontal line segments with horizontal line segments and vertical line segments with vertical line segments. If they are the same, it means that the lines overlap. If there is overlap, the connection line segment is regenerated. The logic of the regeneration is: according to the overlap calculation logic, the coordinates of the overlapping devices are found, and the overlap starting intersection is calculated in combination with the direction of the connection line segment. For example, the connection line segment (the first and last end coordinates: (Sx, Sy), (Tx, Ty)) is horizontally laid out to the right and overlaps with the circuit breaker on the diagram (the minimum and maximum coordinates of the circuit breaker rectangle are: (BMinx, BMiny), (BMaxx, BMaxy)); The method to calculate the overlap starting intersection point is: The line goes horizontally to the right, and the starting intersection is on the left side of the device rectangle; The line goes horizontally to the left, and the starting intersection is on the right side of the device rectangle; The line goes vertically downward, with the starting intersection point at the top of the device rectangle; The line goes vertically upward, and the starting intersection is below the device rectangle. According to the rule, the starting intersection of the example is on the left side of the circuit breaker rectangle, and the coordinates are: (BMinx, Ty). After obtaining the starting intersection point, the bending point of the connecting line segment is calculated according to the preset device gap threshold p. For example, the coordinates of the bending point are (BMinx-p, Ty); Taking the bending point as the starting point of the new connection line segment, continue to generate connection line segments toward the target object according to the connection rules. If there is an obstacle, continue to execute the bypass logic until the target object is found; the target object is the device at the other end of the connection; It is understandable that the layout algorithm of the inflection point direction provides two ways of connection: straight line connection and broken line connection, such as Figure 7 The example diagram of the broken line connection shown is a basic inflection point generation rule model diagram. This rule can ensure that it can be connected to the target end point, but the connection is not necessarily optimal. Figure 8 The straight line connection example diagram shown is a layout based on the optimal path, but this layout cannot guarantee the best one in different scenarios. Therefore, the optimal routing layout will be controlled by the number of attempts. If the number of attempts exceeds the limit, the optimal layout will be abandoned.
[0017] In the actual wiring layout process, when wiring can be generated in multiple ways, it is necessary to evaluate the wiring results and use the optimal wiring. The wiring evaluation rules are as follows: The default score for connection is 0; Whether the connection line crosses, if so, minus 1 point according to the number of crosses; Whether the line is bent or not, minus 1 point for each bend; The one with the highest evaluation score is the optimal connection. If the evaluation scores are the same, the actual length of the connection is calculated, and the shorter one is the optimal one.
[0018] Furthermore, the method of laying out the name and measurement identification text of the device on the canvas includes but is not limited to: Optimize the device name. Since the names of some devices are relatively long, in order to make the layout of the device name beautiful, the device name needs to be wrapped, such as wrapping the device name with 5 characters per line; When the device is arranged vertically, 1) if there are less than 3 connection lines associated with the device, the device name and measurement are arranged on the left and right sides of the device element, with the device name on the left and the measurement item identifier on the right; 2) if there are 3 connection lines associated with the device, the device name and measurement are arranged on the side without connection lines; When the device is laid out horizontally, 1) if there are less than 3 connection lines associated with the device, the device name and measurement are laid out on the upper and lower sides of the device graphic element, with the device name on the upper side and the measurement item identifier on the lower side; 2) if there are 3 connection lines associated with the device, the device name and measurement are laid out on the side without connection lines; When there are more than three connection lines associated with a device, the text position coordinates need to be calculated. The text position is within the specified threshold space range of the device primitive (such as within the 50px coordinates around the device). The text content is included in a rectangular frame and the layout position of the rectangular frame is calculated. The rectangular frame cannot intersect with the laid out devices, connection lines, etc. If there is an intersection, the position is adjusted by translation until the best position is found; Furthermore, the method of generating the final graphic file is: After completing the layout of the equipment, connection layout, name and measurement identification text layout on the diagram, you can now generate corresponding files for the equipment and connection objects according to the SVG and CIMG file syntax specifications. After the files are generated, you can directly preview the files.
[0019] Example 2
[0020] After the layout canvas of all devices has been constructed in Example 1, it may still happen that the direction of the trunk line in the above rule is fixed to the right, which will bring a problem. If there are a lot of devices on the trunk line, the width of the entire feeder diagram will be very large. If you need to view the entire diagram, you need to zoom in to a very small scale to see it, but at this time the devices on the feeder line cannot be seen clearly, which cannot meet the requirements of practicality. Therefore, this embodiment is proposed to solve the problem of canvas width optimization; Specifically, a method for optimizing the layout of a canvas folded according to the number of devices is proposed, including: When creating a task to generate graphics, set the number of devices to be displayed in each line of the main branch, such as 20; The routing rule of the fold is: right->left->right, that is, the first row is laid out to the right, the second row is laid out to the left, the third row is laid out to the right, and so on; When traversing the layout of the feeder diagram equipment, determine whether to fold it based on the serial number of the layout equipment. If the serial number exceeds the quantity, fold it. If the turning point is the station building container, the entire station building will be folded down. Because the types of devices in each row are different, and the width and height of each device are different, the overall layout will be uneven. After the main branch line is generated, the position of the devices in each row will be corrected to make the devices on the edge as close to the edge as possible and the devices in the middle evenly distributed; When laying out equipment on a branch, the location of the branch equipment will be controlled according to the equipment location of the main branch, and the layout of the branch equipment will be controlled not to exceed the layout range of the main branch. If it exceeds the range, it will be folded.
[0021] In another preferred embodiment, the present invention further proposes another method for optimizing canvas layout by calculating folding according to canvas width, comprising: When creating a graphics generation task, set the width of the canvas, such as 2000px; The routing rule of the fold is: right->left->right, that is, the first row is laid out to the right, the second row is laid out to the left, the third row is laid out to the right, and so on; When traversing the layout of feeder diagram equipment, calculate the width of the row occupied after each device is laid out. When the new device layout position exceeds the canvas width, fold it and place the device in a new row. If the turning point is the station container, the entire station will be folded down. Because the types of devices in each row are different, and the width and height of each device are different, the overall layout will be uneven. After the main branch line is generated, the position of the devices in each row will be corrected to make the devices on the edge as close to the edge as possible and the devices in the middle evenly distributed; When laying out equipment on a branch, the location of the branch equipment will be controlled according to the equipment location of the main branch, and the layout of the branch equipment will be controlled not to exceed the layout range of the main branch. If it exceeds the range, it will be folded.
[0022] Example 3
[0023] According to another aspect of the present application, an electronic device is provided. The electronic device may include one or more processors and one or more memories. The memories store computer-readable codes, and when the computer-readable codes are executed by one or more processors, the automatic mapping method for distribution networks based on point-like spatial layout as described above may be executed.
[0024] The method or device according to the embodiment of the present application can also be implemented with the help of the architecture of the electronic device described below. The electronic device may include a bus, one or more CPUs, ROM, RAM, a communication port connected to a network, an input / output component, a hard disk, etc. A storage device in the electronic device, such as a ROM or a hard disk, can store the automatic mapping method for distribution network based on point-like spatial layout provided in the present application.
[0025] Furthermore, the electronic device may also include a user interface. Of course, the above architecture is only exemplary, and when implementing different devices, one or more components in the above electronic device may be omitted according to actual needs.
[0026] Example 4
[0027] A computer-readable storage medium according to an embodiment of the present application. Computer-readable instructions are stored on the computer-readable storage medium. When the computer-readable instructions are executed by the processor, the automatic mapping method for distribution network based on point-like spatial layout according to the embodiment of the present application described with reference to the above figures can be executed. The computer-readable storage medium includes, but is not limited to, for example, volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and cache memory (cache), etc. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc.
[0028] In addition, according to the implementation of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the present application provides a non-transitory machine-readable storage medium, the non-transitory machine-readable storage medium stores machine-readable instructions, the machine-readable instructions can be run by a processor to execute instructions corresponding to the method steps provided by the present application, and when the computer program is executed by a central processing unit (CPU), the above functions defined in the method of the present application are executed.
[0029] The methods, apparatuses, and devices of the present application may be implemented in many ways. For example, the methods, apparatuses, and devices of the present application may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above order of steps for the method is for illustration only, and the steps of the method of the present application are not limited to the order specifically described above unless otherwise specified. In addition, in some embodiments, the present application may also be implemented as programs recorded in a recording medium, which include machine-readable instructions for implementing the method according to the present application. Therefore, the present application also covers recording media storing programs for executing the method according to the present application.
[0030] In addition, the parts of the above-mentioned technical solutions provided in the embodiments of the present application that are consistent with the implementation principles of the corresponding technical solutions in the prior art are not described in detail to avoid excessive redundancy.
[0031] The specific implementation modes as described above further describe the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation mode of the present invention and is not intended to limit the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
[0032] The above preset parameters or preset thresholds are all set by technicians in this field according to actual conditions or obtained through large-scale data simulation.
[0033] The above embodiments are only used to illustrate the technical method of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical method of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical method of the present invention.
Claims
1. A distribution network automatic mapping method based on point-like spatial layout, characterized in that: The following steps are involved: Step 1: Construct a plane coordinate system on the canvas; Step 2: Traverse and retrieve the devices on the main line of the feeder according to the topological relationship of the devices; Step 3: Select the device layout direction, lay out the devices on the canvas one by one, and move and adjust the laid out devices; Step 4: Connect and lay out the devices that have been laid out on the canvas; Step 5: Layout the names and measurement identification texts of the devices on the canvas, and generate a final graphic file so that the user can configure the devices based on the graphic file.
2. The method for automatically mapping a distribution network based on point-like spatial layout according to claim 1, characterized in that: The main line is selected in the following manner: The longest connection relationship is taken as the main line from the starting point of the search; or: The device weight of each device in the connection relationship is used for calculation. The device with the largest weight is used as the next device of the currently traversed device, forming a branch. According to the device weight calculation formula, calculate the device weight of each device, and finally accumulate the device weights of each branch from the root node of the tree to all leaf nodes. The branch with the largest accumulated device weight value is taken as the main branch.
3. The method for automatically mapping a distribution network based on point-like spatial layout according to claim 2, characterized in that: The traversal and retrieval of the equipment on the main line of the feeder comprises the following steps: Collect feeder topology datasets; Set the starting device; Search for the next device by device connection node; If the next device is found, save the next device to the device topology connection set and traverse it recursively; If the next device is not found, the search ends and the device topology connection set is obtained.
4. The method for automatically mapping a distribution network based on point-like spatial layout according to claim 3, characterized in that: The order of selecting the layout direction of the device is right, bottom, left, top, bottom left, top left, top right, bottom right. The layout principle is to give priority to layout to the right. When there is a branch, it is selected according to the direction that has not been laid out.
5. The method for automatically mapping a distribution network based on point-like spatial layout according to claim 4, characterized in that: The method of sequentially laying out the devices on the canvas and moving and adjusting the laid out devices is as follows: Expand or shrink the location of the deployed equipment; The movement rules of the location extension include: Add a new device to the right: Use the minimum X coordinate value minX of the new device to traverse all the laid-out devices in the canvas. If the minimum X coordinate value of the laid-out device is greater than minX, it is marked as needing to be moved to the right. The moving distance is the width of the new device plus the offset in the X-axis direction. Add a new device to the left: Use the maximum X coordinate value of the new device, maxX, to traverse all the laid-out devices in the canvas. If the maximum X coordinate value of the laid-out device is less than maxX, it is marked as needing to be moved to the left. The moving distance is the width of the new device plus the offset in the X-axis direction. Adding a new device upward: Use the maximum Y coordinate value of the new device, maxY, to traverse all the laid-out devices in the canvas. If the maximum Y coordinate value of the laid-out device is less than maxY, it is marked as needing to be moved upward. The moving distance is the height of the new device plus the offset in the Y-axis direction. Adding a new device downward: Use the minimum Y coordinate value minY of the new device to traverse all the laid-out devices in the canvas. If the minimum Y coordinate value of the laid-out device is greater than minY, it is marked as needing to be moved upward. The moving distance is the height of the new device plus the offset in the Y-axis direction. Add a new device to the upper right corner: Combine the right and upward layout algorithms, and use the minimum X coordinate value minX and the maximum Y coordinate maxY of the new device to traverse all the laid out devices in the canvas. If the minimum X coordinate value of the laid out device is greater than minX, it is marked as needing to move to the right, and the maximum Y coordinate value is less than maxY, it is marked as needing to move upward. The distance to move to the right is the width of the new device plus the offset in the X-axis direction, and the distance to move upward is the height of the new device plus the offset in the Y-axis direction. Add a new device to the upper left corner: Combine the left and upward layout algorithms, and use the maximum X coordinate value maxX and the maximum Y coordinate maxY of the new device to traverse all the laid out devices in the canvas. If the maximum X coordinate value of the laid out device is less than maxX, it is marked as needing to move to the left, and the maximum Y coordinate value is less than maxY, it is marked as needing to move upward. The distance to move to the left is the width of the new device plus the offset in the X-axis direction, and the distance to move upward is the height of the new device plus the offset in the Y-axis direction. Add a new device to the lower right corner: Combine the right and downward layout algorithms, and use the minimum X coordinate value minX and the minimum Y coordinate minY of the new device to traverse all the laid out devices in the canvas. If the minimum X coordinate value of the laid out device is greater than minX, it is marked as needing to move to the right, and the minimum Y coordinate value is greater than minY, it is marked as needing to move downward. The distance to the right is the width of the new device plus the offset in the X-axis direction, and the distance to move downward is the height of the new device plus the offset in the Y-axis direction. Add a new device to the lower left corner: Combine the left and downward layout algorithms, and use the maximum X coordinate value maxX and the minimum Y coordinate minY of the new device to traverse all the laid out devices in the canvas. If the maximum X coordinate value of the laid out device is less than maxX, it is marked as needing to move to the left, and the minimum Y coordinate value is greater than minY, it is marked as needing to move downward. The distance to move to the left is the width of the new device plus the offset in the X-axis direction, and the distance to move downward is the height of the new device plus the offset in the Y-axis direction.
6. The method for automatically mapping a distribution network based on point-like spatial layout according to claim 5, characterized in that: The position contraction rules include: The contraction starts from the end nodes of each branch of the feeder; When shrinking each device, it is necessary to determine whether the device will be covered after shrinking. If so, the shrinking will be rolled back. The direction of contraction is opposite to the direction of expansion, that is, a device that expands to the right will contract to the left when contracting.
7. The method for automatically mapping a distribution network based on point-like spatial layout according to claim 6, characterized in that: The method of wiring the devices already laid out on the canvas is as follows: If there is no other device between the devices, a straight line is directly connected between the anchor points of the two devices; if there is other device between the devices and the connecting line will pass through the devices, a polyline connection is generated according to the polyline generation logic; There are three relative positions between station building and non-station building equipment: left and right, top and bottom. According to different positions, the wiring layout rules are as follows: Left and right orientation: The non-station room equipment in the left and right orientation is not on the same horizontal or vertical line as the station room exit, so the generated connection line must be a broken line. The connection line will start from the station room exit and move toward the target non-station room equipment anchor point, first going downward and then to the left and right. The non-station room equipment is other equipment excluding the station room. Upper position: The non-station building equipment in the upper position is above the station building exit. Even if they are on the same vertical line, the exit cannot be directly connected to the non-station building equipment anchor point, which will pass through the station building and affect the appearance of the connection layout. You need to connect the line from the exit downward first, and then find the target non-station building equipment anchor point along the edge of the station building; Lower position: When non-station room equipment is arranged in the lower position, the algorithm will automatically calculate so that the non-station room equipment and the station room exit are on the same vertical line, so a straight line can be used to connect with the non-station room equipment in the lower position; The station building exit points are connected to each other. Just like the station building exits are connected to non-station building equipment, there are also layouts in the left, right, top, and bottom directions. The station building connections in each direction are connected using broken lines.
8. The method for automatically mapping a distribution network based on point-like spatial layout according to claim 7, characterized in that: The polyline generation logic is: Identify whether there is overlap, avoid overlap, and generate polylines; The method of identifying whether there is overlap is: All the laid-out devices on the diagram are considered as rectangular frame points, with the coordinates of the upper left corner and the lower right corner as the minimum and maximum coordinates; Take the coordinates of the beginning and end of the connecting line segment and calculate the intersection with the maximum and minimum coordinates of all devices. If there is an intersection, it means there is overlap; Determine whether there is overlap based on the lines laid out on the diagram. Compare horizontal line segments with horizontal line segments and vertical line segments with vertical line segments. If they are the same, it means that the lines overlap. If there is overlap, the connecting line segment is regenerated. The logic of the regeneration is: according to the overlap calculation logic, the coordinates of the overlapping devices are found, and the overlap starting intersection point is calculated in combination with the direction of the connecting line segment; The method to calculate the overlap starting intersection point is: The line goes horizontally to the right, and the starting intersection is on the left side of the device rectangle; The line goes horizontally to the left, and the starting intersection is on the right side of the device rectangle; The line goes vertically downward, with the starting intersection point at the top of the device rectangle; The connection line goes vertically upward, and the starting intersection is below the device rectangle; After obtaining the starting intersection point, the bending point of the connecting line segment is calculated according to the preset device gap threshold p; The bending point is used as the starting point of the new connecting line segment, and the connecting line segment is continuously generated toward the target object according to the connecting line rules. If there is an obstacle, the bypass logic is continuously executed until the target object is found; the target object is the device at the other end of the connecting line.
9. An electronic device, characterized in that: include: A processor and a memory, wherein: The memory stores a computer program that can be called by the processor; The processor executes the distribution network automatic mapping method based on point-like spatial layout as described in any one of claims 1 to 8 in the background by calling the computer program stored in the memory.
10. A computer-readable storage medium, characterized in that: A rewritable computer program is stored thereon; When the computer program is executed on a computer device, the computer device executes the method for automatically drawing a distribution network based on a point-like spatial layout as described in any one of claims 1 to 8 in the background.
Citation Information
Patent Citations
An adaptive power distribution network single-line diagram automatic mapping system
CN109726446B
Automatic generation method used for single line diagram of distribution network and based on topological hierarchy
CN103150425A
Object guidance-based automatic generation method of thematic map of fault site
CN107844620A
Intelligent verification method for updating single line diagram of distribution network automation master station
CN112035589A
Power distribution network looped network diagram generation method and system based on GIS single line diagram
CN115618542A