A method, system, storage medium, and computing device for determining a path between devices
Through grid division and depth priority algorithm, the optimal path between equipment in the intelligent substation is determined, which solves the problem of automatic diagramming of primary system wiring in the intelligent substation, and achieves rapid and accurate generation of inter-device connection lines.
Patent Information
- Application Number
- CN202111170878.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-08
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2041-10-08
AI Technical Summary
In smart substations, it is difficult for the prior art to quickly and accurately complete the graphical work of primary system wiring, especially in terms of automatically generating connection lines between primary devices and meeting the layout requirements of the "Substation Monitoring System Graphic Interface Specification".
By rastering the graphical areas of the system connection, we obtain the global raster array, and obtain the starting point raster and end point raster from the global raster array based on the path start coordinate and the path end coordinate. Then, a local raster array and an adjacency matrix with unused rasters are constructed, and a depth-first algorithm is used to obtain a feasible path set from the starting point raster to the end point raster, and finally the optimal path is determined according to the preset rules.
Automatic connection between primary devices is realized, the calculation amount of depth-first traversal is reduced, the path acquisition efficiency is improved, and the effectiveness of the connection line and the minimum intersection with the existing graphics area is ensured.
Smart Images

Figure CN114037116B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a method, system, storage medium and computing device for determining a path between devices, and belongs to the technical field of automatic mapping of the primary wiring system of a substation. Background Art
[0002] In a smart substation, the SSD describes the electrical topological relationships of the primary system within the substation. These topological relationships include the relationships between primary devices and bays, between primary devices and voltage levels, between bays and voltage levels, and the connection relationships between primary devices.
[0003] The industry technical specification "Technical Specification for the Implementation of the Modeling of the Smart Substation System Specification (SSD)" stipulates the electrical topological structure model of the substation. The industry technical specification "Specification for the Graphical Description of Power Systems" defines the model of power system device primitives. At the same time, the relevant enterprise standard "Specification for the Graphical Interface of the Substation Monitoring System" within the industry defines the layout of the primary system wiring of the substation. These provide a theoretical basis for the automatic mapping of the primary wiring system of the substation.
[0004] During the construction of a substation, if it is desired to quickly and accurately complete the graphical work of the primary system wiring, it is necessary to automatically generate the connection lines between primary devices and meet the layout requirements of the "Specification for the Graphical Interface of the Substation Monitoring System". Therefore, there is an urgent need for a method for determining the path between devices. Summary of the Invention
[0005] The present invention provides a method, system, storage medium and computing device for determining a path between devices, which solves the problems disclosed in the background art.
[0006] In order to solve the above technical problems, the technical solutions adopted by the present invention are as follows:
[0007] A method for determining a path between devices includes:
[0008] Dividing the graphical area of the system connection line into grids to obtain a global grid array;
[0009] According to the used area in the graphical area, obtaining the used grids corresponding to the used area from the global grid array;
[0010] According to the path start coordinate and the path end coordinate, obtaining the start grid corresponding to the path start coordinate and the end grid corresponding to the path end coordinate from the global grid array;
[0011] Obtaining the grids between the start grid and the end grid to construct a local grid array;
[0012] Obtain unused grids from the local grid array according to the local grid array and the used grids, and construct the adjacency matrix of the unused grids;
[0013] According to the starting grid, the ending grid and the adjacency matrix, obtain the set of feasible paths from the starting grid to the ending grid;
[0014] Traverse the set of feasible paths and determine the optimal path according to the preset rules.
[0015] Divide the graphic area of the system connection into grids with equal side lengths to obtain the global grid array.
[0016] Obtain the grids between the starting grid and the ending grid, and construct a local grid array including the starting grid and the ending grid.
[0017] Obtain the grids between the starting grid and the ending grid. The specific process is as follows:
[0018] If the grid meets the following preset conditions, then the grid is the grid between the starting grid and the ending grid;
[0019] Among them, the preset conditions are:
[0020] The abscissa of the upper left corner of the starting grid ≤ the abscissa of the grid ≤ the abscissa of the lower right corner of the ending grid, and the ordinate of the upper left corner of the starting grid ≤ the ordinate of the grid ≤ the ordinate of the lower right corner of the ending grid; the abscissa of the grid is the abscissa of the midpoint of the grid, and the ordinate of the grid is the ordinate of the midpoint of the grid.
[0021] According to the starting grid, the ending grid and the adjacency matrix, use the depth-first algorithm to obtain the set of feasible paths from the starting grid to the ending grid.
[0022] The preset rules are:
[0023] Take the path with the shortest length and the fewest inflection points as the optimal path; among them, the path length is the number of grids passed by the path.
[0024] If the set of feasible paths is an empty set, expand the local grid array, reconstruct the adjacency matrix of the unused grids, and obtain a new set of feasible paths.
[0025] A system for determining the path between devices includes:
[0026] Grid division module: Divide the graphic area of the system connection into grids to obtain the global grid array;
[0027] Used grid acquisition module: According to the used area in the graphic area, obtain the used grids corresponding to the used area from the global grid array;
[0028] Start - end grid acquisition module: According to the path start coordinate and the path end coordinate, obtain the start grid corresponding to the path start coordinate and the end grid corresponding to the path end coordinate from the global grid array;
[0029] Local grid array module: Obtain the grids between the start grid and the end grid, and construct a local grid array;
[0030] Adjacency matrix module: According to the local grid array and the used grids, obtain the unused grids from the local grid array, and construct an adjacency matrix of the unused grids;
[0031] Feasible path set module: According to the start grid, the end grid and the adjacency matrix, obtain the set of feasible paths from the start grid to the end grid;
[0032] Optimal path module: Traverse the set of feasible paths, and determine the optimal path according to the preset rules.
[0033] A computer - readable storage medium storing one or more programs, the one or more programs including instructions which, when executed by a computing device, cause the computing device to execute the method for determining the path between devices.
[0034] A computing device, comprising one or more processors, one or more memories, and one or more programs, wherein the one or more programs are stored in the one or more memories and are configured to be executed by the one or more processors, and the one or more programs include instructions for executing the method for determining the path between devices.
[0035] Advantages achieved by the present invention: 1. The present invention uses the local grid array between the start grid and the end grid to obtain the adjacency matrix, and according to the start grid, the end grid and the adjacency matrix, obtains the optimal path, effectively realizing the automatic connection between devices at one time; 2. The present invention uses the local grid array between the start grid and the end grid to obtain the adjacency matrix, and performs depth - first traversal calculation based on the adjacency matrix, which can effectively reduce the amount of depth - first traversal calculation and improve the path acquisition efficiency; 3. The present invention incorporates the used area into the calculation scope of the entire algorithm. While reducing the scale of the adjacency matrix and improving the calculation efficiency, the calculated path result can ensure the least intersection with the existing graphic area, ensuring the effectiveness of the connection line. Description of the Drawings
[0036] Figure 1 It is a flowchart of the method of the present invention;
[0037] Figure 2 It is the specific process of the method of the present invention;
[0038] Figure 3 It is an example of regional rasterization;
[0039] Figure 4 This is an example of the adjacency matrix corresponding to the local grid array. Specific implementation mode
[0040] The present invention will be further described below with reference to the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and cannot be used to limit the protection scope of the present invention.
[0041] As Figure 1 shown, a method for determining the path between devices includes the following steps:
[0042] Step 1: Divide the graphic area of the system connection into grids to obtain a global grid array;
[0043] Step 2: According to the used area in the graphic area, obtain the used grids corresponding to the used area from the global grid array;
[0044] Step 3: According to the path start coordinate and the path end coordinate, obtain the start grid corresponding to the path start coordinate and the end grid corresponding to the path end coordinate from the global grid array;
[0045] Step 4: Obtain the grids between the start grid and the end grid, and construct a local grid array;
[0046] Step 5: According to the local grid array and the used grids, obtain the unused grids from the local grid array, and construct an adjacency matrix of the unused grids;
[0047] Step 6: According to the start grid, the end grid and the adjacency matrix, obtain the set of feasible paths from the start grid to the end grid;
[0048] Step 7: Traverse the set of feasible paths, and determine the optimal path according to the preset rules.
[0049] The above method uses the local grid array between the start grid and the end grid to obtain the adjacency matrix, and according to the start grid, the end grid and the adjacency matrix, obtains the optimal path, effectively realizing the automatic connection between devices at one time.
[0050] As Figure 2 shown, the present invention first determines the graphic area of the system connection, the used area in the graphic area, the path start coordinate and the path end coordinate.
[0051] The graphic area is a rectangular area, and the area data includes the origin coordinates (0, 0), length, and width of the rectangular area. The used area is the area where the devices have been laid out once or the area that has been occupied. There can be one or more of these areas, generally the size of one grid, and each area is also a rectangular area. The area data includes the coordinates (x, y), length, and width of the rectangular area.
[0052] Divide the graphic area of the system connection into grids with equal side lengths, that is, divide the graphic area into grids with a fixed pixel value as the side length to obtain a global grid array. In the global grid array, each grid has a Used attribute, upper left corner coordinate attribute, lower right corner coordinate attribute, upper adjacent grid attribute, lower adjacent grid attribute, left adjacent grid attribute, and right adjacent grid attribute.
[0053] Based on the upper left corner coordinates, length, and width of the used area, find the grids in all grids of the global grid array whose lower right corner coordinates or upper left corner coordinates are within the used area. These grids are the used grids corresponding to the used area, and the Used attribute of these used grids is true.
[0054] Similarly, in all grids of the global grid array, by comparing the starting coordinates or ending coordinates with the upper left corner coordinates and lower right corner coordinates of the grid, when the upper left corner coordinates of the grid ≤ the coordinates ≤ the lower right corner coordinates of the grid, that is, the grid is the grid corresponding to the coordinates, that is, obtain the starting grid corresponding to the path starting coordinates and the ending grid corresponding to the path ending coordinates from the global grid array.
[0055] After obtaining the starting grid and the ending grid, the grids between the starting grid and the ending grid can be obtained to construct a local grid array containing the starting grid and the ending grid.
[0056] The process of obtaining the grids between the starting grid and the ending grid is as follows:
[0057] If the grid meets the following preset conditions, then the grid is the grid between the starting grid and the ending grid;
[0058] Among them, the preset conditions are:
[0059] The grid with the abscissa of the upper left corner of the starting grid ≤ the abscissa of the grid ≤ the abscissa of the lower right corner of the ending grid, and the ordinate of the upper left corner of the starting grid ≤ the ordinate of the grid ≤ the ordinate of the lower right corner of the ending grid; the abscissa of the grid is the abscissa of the midpoint of the grid, and the ordinate of the grid is the ordinate of the midpoint of the grid.
[0060] Find the grids with the Used attribute being false from the local grid array, that is, obtain the unused grids, and construct the adjacency matrix of the unused grids.
[0061] According to the starting grid, the ending grid, and the adjacency matrix, use the depth-first algorithm to obtain the set of feasible paths from the starting grid to the ending grid.
[0062] The depth-first algorithm goes deep into each possible branch path until it can no longer go deep, and each grid can only be visited once. It specifically includes the following process:
[0063] 1) Access the starting grid;
[0064] 2) Starting from the unused adjacent grids of the starting grid in sequence, perform a depth - first traversal of the adjacency matrix until all the grids in the adjacency matrix that have a path connection with the starting grid are accessed;
[0065] 3) If there are still unaccessed grids in the adjacency matrix at this time, start a new depth - first traversal from an unaccessed grid until all grids in the adjacency matrix have been accessed.
[0066] The set of feasible paths may have multiple paths, where each path is composed of continuously adjacent grids. The number of grids passed by the path is the length of the path. If the central points of any three grids cannot be connected into a straight line, it is an inflection point; according to the preset rules, the optimal path can be obtained from multiple paths, that is, the connection line between devices is obtained.
[0067] The preset rules are: take the path with the shortest length and the fewest inflection points as the optimal path; where the path length is the number of grids passed by the path.
[0068] Of course, the set of feasible paths may be an empty set, then it is necessary to expand the local grid array, reconstruct the adjacency matrix of the unused grids, and obtain a new set of feasible paths.
[0069] Specifically, expanding the local grid array means expanding the local grid array to the left, right, up, down, up and down, left and right, left - up, right - up, left - down, and right - down. It specifically includes the following process:
[0070] S1) Expand the local grid array by 1 column to the left based on the current local grid array, reconstruct the adjacency matrix of the expanded local grid array, that is, return to step 5 to start the calculation again. If the number of paths in the set of feasible paths is 0, then go to S2;
[0071] S2) Expand the local grid array by 1 column to the right based on the current local grid array, reconstruct the adjacency matrix of the expanded local grid array, that is, return to step 5 to start the calculation again. If the number of paths in the set of feasible paths is 0, then go to S3;
[0072] S3) Expand the local grid array by 1 row upward based on the current local grid array, reconstruct the adjacency matrix of the expanded local grid array, that is, return to step 5 to start the calculation again. If the number of paths in the set of feasible paths is 0, then go to S4;
[0073] S4) Expand the local grid array by 1 row downward based on the current local grid array, reconstruct the adjacency matrix of the expanded local grid array, that is, return to step 5 to start the calculation again. If the number of paths in the set of feasible paths is 0, then go to S5;
[0074] S5) Expand the local grid array upward and downward by 1 row based on the current local grid array, reconstruct the adjacency matrix for the expanded local grid array, that is, return to step 5 to start the calculation again. If the number of paths in the set of feasible paths is 0, go to S6;
[0075] S6) Expand the local grid array to the left and right by 1 column each based on the current local grid array, reconstruct the adjacency matrix for the expanded local grid array, that is, return to step 5 to start the calculation again. If the number of paths in the set of feasible paths is 0, go to S7;
[0076] S7) Expand the local grid array to the left and upward by 1 column and 1 row respectively based on the current local grid array, reconstruct the adjacency matrix for the expanded local grid array, that is, return to step 5 to start the calculation again. If the number of paths in the set of feasible paths is 0, go to S8;
[0077] S8) Expand the local grid array to the right and upward by 1 column and 1 row respectively based on the current local grid array, reconstruct the adjacency matrix for the expanded local grid array, that is, return to step 5 to start the calculation again. If the number of paths in the set of feasible paths is 0, go to S9;
[0078] S9) Expand the local grid array to the left and downward by 1 column and 1 row respectively based on the current local grid array, reconstruct the adjacency matrix for the expanded local grid array, that is, return to step 5 to start the calculation again. If the number of paths in the set of feasible paths is 0, go to S10;
[0079] S10) Expand the local grid array to the right and downward by 1 column and 1 row respectively based on the current local grid array, reconstruct the adjacency matrix for the expanded local grid array, that is, return to step 5 to start the calculation again. If the number of paths in the set of feasible paths is 0, go to S1 to start a new round of local grid matrix expansion and calculation.
[0080] The above method uses the local grid array between the starting grid and the ending grid to obtain the adjacency matrix, and performs depth-first traversal priority calculation based on the adjacency matrix, which can effectively reduce the calculation amount of depth-first traversal and improve the path acquisition efficiency; at the same time, the above method incorporates the used area into the calculation scope of the entire algorithm, while reducing the scale of the adjacency matrix and improving the calculation efficiency, the calculated path result can ensure the least intersection with the existing graphic area, ensuring the effectiveness of the connection line.
[0081] The above method reduces the scale of the adjacency matrix by dynamically expanding the grid array, reduces the calculation time of the depth-first algorithm, reduces the crossing of connection lines, and meets the requirement of automatically drawing the connection lines between electrical equipment in the automatic mapping application of the primary system wiring of intelligent substations.
[0082] To further illustrate the above method, as Figure 3 shown, it is the global grid array after grid division, where the side length of the grid is 5 pixels. The used grids, that is, the grids with the Used attribute being true, are grid C, grid D, and grid I. The starting grid is grid A, and the ending grid is grid L. Then all the grids from grid A to grid L form a local grid array, and among them, the unused grids are grid A, B, E, F, G, H, J, K, and L.
[0083] The grids adjacent to grid A are B and J, the grids adjacent to grid B are A and E, the grids adjacent to grid E are B, F, and G, the grids adjacent to grid F are E and H, the grids adjacent to grid G are E and H, the grids adjacent to grid H are F, G, and L, and the grids adjacent to L are H. Based on the above adjacent relationships, an adjacency matrix as Figure 4 shown is constructed.
[0084] Using the depth-first traversal algorithm, the set of feasible paths from the starting grid A to the ending grid L includes path 1: A - B - E - F - H - L and path 2: A - B - E - G - H - L.
[0085] Path 1 passes through 6 grids, so its length is 6. The central points of grids E, G, and H cannot form a straight line, so the number of inflection points is 1; path 2 passes through 6 grids, so its length is 6. The central points of grids B, E, H and grids G, H, L cannot form a straight line, so the number of inflection points is 2. Then, according to the principle of the fewest inflection points and the shortest path, the optimal path is selected. Path 1 is the optimal path from the starting grid A to the ending grid L.
[0086] If Figure 3 the Used attribute of grid H in
[0087] is true, then the set of feasible paths is an empty set. Then expand one column to the right in the local grid area, return to step 5 to reconstruct the new adjacency matrix, and use the depth-first algorithm again to calculate the new adjacency matrix, and the set of feasible paths can be calculated.
[0088] Grid division module: divides the graphic area of the system connection line into grids to obtain a global grid array;
[0089] Used grid acquisition module: according to the used area in the graphic area, obtains the used grids corresponding to the used area from the global grid array;
[0090] Start - end grid acquisition module: According to the path start coordinate and the path end coordinate, obtain the start grid corresponding to the path start coordinate and the end grid corresponding to the path end coordinate from the global grid array;
[0091] Local grid array module: Obtain the grids between the start grid and the end grid, and construct a local grid array;
[0092] Adjacency matrix module: According to the local grid array and the used grids, obtain the unused grids from the local grid array, and construct an adjacency matrix of the unused grids;
[0093] Feasible path set module: According to the start grid, the end grid and the adjacency matrix, obtain the set of feasible paths from the start grid to the end grid;
[0094] Optimal path module: Traverse the set of feasible paths, and determine the optimal path according to the preset rules.
[0095] A computer - readable storage medium storing one or more programs, the one or more programs including instructions that, when executed by a computing device, cause the computing device to perform the method for determining the path between devices.
[0096] A computing device, including one or more processors, one or more memories, and one or more programs, wherein the one or more programs are stored in the one or more memories and configured to be executed by the one or more processors, and the one or more programs include instructions for performing the method for determining the path between devices.
[0097] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention can take the form of an all - hardware embodiment, an all - software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can take the form of a computer program product implemented on one or more computer - usable storage media (including but not limited to disk memories, CD - ROMs, optical memories, etc.) containing computer - usable program code.
[0098] The present invention is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to the embodiments of the present invention. It should be understood that each flow and / or block in the flowchart and / or block diagram can be implemented by computer program instructions, and the combination of the flows and / or blocks in the flowchart and / or block diagram can also be implemented by computer program instructions. These computer program instructions can be provided to the processors of general - purpose computers, special - purpose computers, embedded processors, or other programmable data - processing devices to generate a machine, so that the instructions executed by the processors of the computer or other programmable data - processing devices generate for implementing the processFigure 1 a process or processes and / or blocks Figure 1 means for the functions specified in a block or blocks.
[0099] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means that implement the functions in the process Figure 1 a process or processes and / or blocks Figure 1 specified in a block or blocks.
[0100] These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable apparatus provide steps for implementing the functions in the process Figure 1 a process or processes and / or blocks Figure 1 specified in a block or blocks.
[0101] The above are only embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention are included within the scope of the claims of the present invention pending approval of the application.
Claims
1. A method for determining a path between devices, characterized in that, Including: Performing grid division on the graphic area of the system connection to obtain a global grid array; According to the used area in the graphic area, obtaining the used grids corresponding to the used area from the global grid array; According to the path start coordinate and the path end coordinate, obtaining the start grid corresponding to the path start coordinate and the end grid corresponding to the path end coordinate from the global grid array; Obtaining the grids between the start grid and the end grid to construct a local grid array; According to the local grid array and the used grids, obtaining the unused grids from the local grid array and constructing an adjacency matrix of the unused grids; According to the start grid, the end grid and the adjacency matrix, obtaining the set of feasible paths from the start grid to the end grid; Traversing the set of feasible paths and determining the optimal path according to a preset rule; wherein, the preset rule is to take the path with the shortest length and the fewest inflection points as the optimal path; the path length is the number of grids passed by the path.
2. The method for determining a path between devices according to claim 1, characterized in that, Performing equilateral-side grid division on the graphic area of the system connection to obtain a global grid array.
3. The method for determining a path between devices according to claim 1, characterized in that, Obtaining the grids between the start grid and the end grid and constructing a local grid array including the start grid and the end grid.
4. The method for determining a path between devices according to claim 1 or 3, characterized in that, The process of obtaining the grids between the start grid and the end grid is as follows: If a grid meets the following preset conditions, then the grid is a grid between the start grid and the end grid; Wherein, the preset conditions are: The abscissa of the upper left corner of the start grid ≤ the abscissa of the grid ≤ the abscissa of the lower right corner of the end grid, and the ordinate of the upper left corner of the start grid ≤ the ordinate of the grid ≤ the ordinate of the lower right corner of the end grid; the abscissa of the grid is the abscissa of the midpoint of the grid, and the ordinate of the grid is the ordinate of the midpoint of the grid.
5. The method for determining a path between devices according to claim 1, characterized in that, According to the start grid, the end grid and the adjacency matrix, using the depth-first algorithm to obtain the set of feasible paths from the start grid to the end grid.
6. The method for determining a path between devices according to claim 1, characterized in that, If the set of feasible paths is an empty set, then expand the local grid array, reconstruct the adjacency matrix of the unused grids, and obtain a new set of feasible paths.
7. A system for determining a path between devices, characterized in that, Including: Grid division module: Performing grid division on the graphic area of the system connection to obtain a global grid array; Used grid acquisition module: According to the used area in the graphic area, obtaining the used grids corresponding to the used area from the global grid array; Start and end grid acquisition module: According to the path start coordinate and the path end coordinate, obtaining the start grid corresponding to the path start coordinate and the end grid corresponding to the path end coordinate from the global grid array; Local grid array module: Obtaining the grids between the start grid and the end grid and constructing a local grid array; Adjacency matrix module: According to the local grid array and the used grids, obtaining the unused grids from the local grid array and constructing an adjacency matrix of the unused grids; Feasible path set module: According to the start grid, the end grid and the adjacency matrix, obtaining the set of feasible paths from the start grid to the end grid; Optimal path module: Traversing the set of feasible paths and determining the optimal path according to a preset rule; wherein, the preset rule is to take the path with the shortest length and the fewest inflection points as the optimal path; the path length is the number of grids passed by the path.
8. A computer-readable storage medium storing one or more programs, characterized in that: The one or more programs include instructions that, when executed by a computing device, cause the computing device to perform any of the methods according to claims 1 to 6.
9. A computing device, characterized in that, Comprising: One or more processors, one or more memories, and one or more programs, wherein the one or more programs are stored in the one or more memories and configured to be executed by the one or more processors, and the one or more programs include instructions for performing any of the methods according to claims 1 to 6.
Citation Information
Patent Citations
Intelligent ship collision avoidance path planning method based on heading and navigational speed
CN112363512A
Re-wiring after peeling-off re-wiring after peeling-off
JP1997223742A