An Automatic Sorting Method and System for Electric Power Control Components
By establishing a directed forest of power control elements and generating numbers, the problem of inaccurate sorting of power control elements in the prior art is solved, and the correctness of system control logic actions and automatic sorting efficiency are improved.
Patent Information
- Application Number
- CN202111425461.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-27
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2041-11-27
AI Technical Summary
The prior art cannot accurately sort power control components, resulting in incorrect system control logic operations and low automatic sorting efficiency.
By obtaining all control elements information in the model, establishing a directed connection relationship between control elements, forming a directed graph forest of control elements, and performing traversal from multiple boundary points until branch points are encountered, generating numbers and adjusting to ensure the correctness of the logical actions of control elements.
In the absence of manual intervention, the simulation control component logic operation accuracy is achieved, and the automatic sorting efficiency is improved, multiple traversals of nodes are avoided, and the sorting complexity is O(n).
Smart Images

Figure CN114117698B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power system control, and particularly to an automatic sorting method and system for power control components. Background Art
[0002] The power system model is very complex, including both a primary system model and a complex control system model. The primary system model reflects the electrical connections between power system devices and has no directionality. The secondary system is a control system that controls primary devices, and the control logic has directionality. When performing power system simulation, it is necessary to sort the control system according to the connection relationship between secondary devices to ensure the correctness of the control logic action of the secondary system. Summary of the Invention
[0003] The purpose of the present invention is to provide an automatic sorting method and system for power control components, aiming to solve the problem in the prior art that power control components cannot be accurately sorted, to ensure the correctness of the control logic action of the system, and to improve the efficiency of automatic sorting.
[0004] To achieve the above technical purpose, the present invention provides an automatic sorting method for power control components, and the method includes the following operations:
[0005] Obtain all control component information in the model to form a control component set;
[0006] According to the control component set, based on the topological connection relationship, establish a directed connection relationship between control components, and identify whether a control component is a boundary node according to the node type of the component to form a forest of directed graphs of control components;
[0007] Obtain a directed graph from the forest of directed graphs, start traversing from multiple boundary points until a branch point is encountered, and add the path where the branch point is located to the queue of paths to be traversed;
[0008] Traverse a single component in the queue of paths to be traversed until the component has been traversed or is a leaf node, generate numbers for each node, and if the expected number of a node that has been traversed on the current path is greater than the existing number, perform number adjustment.
[0009] Preferably, the step of identifying whether a control component is a boundary node according to the node type of the component specifically judges according to whether the component is of an in-node or out-node type.
[0010] Preferably, the number adjustment is specifically as follows:
[0011] Obtain all paths of the current branch point and judge whether multiple loops are formed;
[0012] If it is a multi - loop, determine whether there is nesting of large and small loops, and sort all relevant paths according to the size of the formed loops;
[0013] Find the current node among all paths, traverse in reverse order and perform corrections until the loop starting point;
[0014] If the current node is not the end point of the path, the encoding of the subsequent nodes is also adjusted accordingly.
[0015] Preferably, each node in the directed graph is traversed only once, and the algorithm complexity is O(n).
[0016] The present invention also provides an automatic sorting system for power control components, and the system includes:
[0017] A control component acquisition module, used to acquire all control component information in the model to form a control component set;
[0018] A directed graph construction module, used to establish a directed connection relationship between control components according to the control component set based on the topological connection relationship, and identify whether the control component is a boundary node according to the node type of the component to form a directed graph forest of control components;
[0019] A path acquisition module, used to obtain a directed graph from the directed graph forest, start traversing from multiple boundary points until a branch point is encountered, and add the path where the branch point is located to the queue of paths to be traversed;
[0020] A single - component traversal module, used to traverse a single component in the queue of paths to be traversed until the component has been traversed or is a leaf node, generate numbers for each node, and if the expected number of a node that has been traversed on the current path is greater than the existing number, perform number adjustment.
[0021] Preferably, the node type of the component is an in - node or an out - node type.
[0022] Preferably, each node in the directed graph is traversed only once, and the algorithm complexity is O(n).
[0023] The effects provided in the summary of the invention are only the effects of the embodiments, rather than all the effects of the invention. One of the above - mentioned technical solutions has the following advantages or beneficial effects:
[0024] Compared with the prior art, the present invention can automatically identify the control components in the simulation system, sort the control components according to the topological connection relationship, and ensure the accuracy of the logical actions of the simulation control components without manual intervention. During the sorting process, a topological connection directed graph with control components as nodes is formed, and the sorting complexity is O(n), avoiding multiple traversals of nodes and improving the efficiency of automatic sorting. Brief Description of the Drawings
[0025] Figure 1 A directed graph of the connection relationship of a control system provided in an embodiment of the present invention;
[0026] Figure 2 A directed connection graph with multiple feedback loops of a control system provided in an embodiment of the present invention;
[0027] Figure 3 A flowchart for automatically sorting control elements provided in an embodiment of the present invention;
[0028] Figure 4 A flowchart for traversing a single node provided in an embodiment of the present invention. Detailed implementation manners
[0029] In order to clearly illustrate the technical features of the present solution, the present invention will be described in detail below through specific implementation manners and in conjunction with its accompanying drawings. The following disclosure provides many different embodiments or examples for implementing different structures of the present invention. To simplify the disclosure of the present invention, the components and settings of specific examples are described below. In addition, the present invention may repeat reference numerals and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed. It should be noted that the components illustrated in the drawings are not necessarily drawn to scale. The present invention omits the description of well-known components and processing technologies and processes to avoid unnecessarily limiting the present invention.
[0030] The following will describe in detail a method and system for automatically sorting power control elements provided in an embodiment of the present invention in conjunction with the accompanying drawings.
[0031] An embodiment of the present invention discloses a method for automatically sorting power control elements, and the method includes the following operations:
[0032] Obtain all control element information in the model to form a control element set;
[0033] According to the control element set, based on the topological connection relationship, establish a directed connection relationship between the control elements, and according to the node type of the elements, identify whether the control element is a boundary node to form a forest of control element directed graphs;
[0034] Obtain a directed graph from the forest of directed graphs, start traversing from multiple boundary points until a branch point is encountered, and add the path where the branch point is located to the queue of paths to be traversed;
[0035] Traverse a single element in the queue of paths to be traversed until the element has been traversed or is a leaf node, generate numbers for each node, and if the expected number of a node that has been traversed on the current path is greater than the existing number, perform number adjustment.
[0036] Figure 1 Shows a typical control system connection relationship, where A is the entry point of the directed graph, indicating that the sorting starts from this node as the numbering starting point. The loop formed by G, I, and H becomes the feedback loop, and G is the starting point of the feedback loop.
[0037] The technical characteristics of the automatic sorting of the control system are as follows:
[0038] Numbering starts from the entry point;
[0039] Node numbering principle for linear connections (referring to control elements that transmit signals in one direction and have no feedback loop on their transmission path): If all the nodes connected to the input end of a node have been numbered, then this node can be numbered, and the number is greater than the numbers of all input nodes;
[0040] Feedback loop identification: When a path forms a loop, the coincidence point of the loop is the starting point of the feedback loop. For example, Figure 1 G in, identify the complete feedback loop according to the signal direction from the starting point of the feedback loop. For example, Figure 1 G, I, and H in;
[0041] Feedback loop numbering: The numbering principle within a single feedback loop is the same as that for linear connections. The numbering principle for multiple feedback loops is to number the large loop first and then the small loop. For example, Figure 2 As shown, number feedback loop 1 first and then feedback loop 2.
[0042] During the automatic sorting process of the control system, first obtain the model, identify the control elements, and form a set of control elements.
[0043] Establish a directed connection relationship between the elements according to the topological connection relationship between the control elements, and initially identify whether an element is a boundary node according to the types of the input node and output node of the element, form a set of boundary points of the current directed graph, and thus form a forest of directed graphs of control elements.
[0044] Traverse the forest of directed graphs to generate numbers for each node.
[0045] Obtain the directed graph from the forest, start path traversal from multiple boundary points of the directed graph until a branch point is encountered, that is, there are multiple outputs, and pause here. The function of pausing is to ensure that the numbers of the cross-branch points on the multi-path traversal paths are the same.
[0046] Traverse a single component until the component has been traversed or it is a leaf node. When encountering a node that has been traversed, if the expected number on the current path is greater than the current existing number, the number needs to be adjusted. Specifically: Obtain all paths of the current branch point and determine whether multiple loops are formed; if there are multiple loops, determine whether there are nested large and small loops, and sort all relevant paths according to the size of the formed loops; find the current node among all paths, traverse in reverse order and perform corrections until the starting point of the loop; if the current node is not the end point of the path, the subsequent node encoding is also adjusted accordingly. After all relevant paths are re-encoded, the encoding requirements of the size feedback loop can be met.
[0047] As Figure 3 shown, first obtain the model, identify the control components, and form a set of control components. According to the topological connection relationship of the control components, form a connected directed graph forest. Obtain the directed graph from the directed graph forest, and traverse sequentially from the entrance boundary point until a node with an out-degree greater than 1 is encountered or the traversal of the directed graph ends. If the out-degree is greater than 1, put this path into the path queue to be traversed. Obtain the path from the path queue to be traversed and continue the traversal, obtain the node from the list of nodes to be traversed and continue the traversal of the current path. After the traversal of the current path is completed, put it into the path set until the automatic sorting of all directed graphs in the directed graph forest ends.
[0048] As Figure 4 shown, when traversing a single node, obtain the node from the list of nodes to be traversed and perform the traversal. When the node has not been traversed, generate the expected serial number of the current node according to the serial number of the previous node on the current traversal path, and append the current node to the current path. If the out-degree of the node is 0, put the current path into the path set, and the traversal of the current path is completed. If the out-degree of the node is greater than 1, record the current node as a branch node, and put all the next nodes into the list of nodes to be traversed on the path. If the node has been traversed, determine whether the encoding of the previous node + 1 is greater than the existing encoding. If it is greater than the current encoding, find all the paths where the node is located in the path set, and determine whether the paths have generated multiple loops. When multiple loops are generated, all paths need to be excluded according to the loop size, find the position of the current node in the path, traverse in reverse order and perform serial number correction, and correct in sequence according to the expected value. If the current node in the path is the last one, end the traversal, otherwise adjust the serial numbers of the subsequent nodes.
[0049] Using the above automatic sorting algorithm, each node in the directed graph is traversed only once, and the algorithm complexity is O(n).
[0050] The embodiment of the present invention can automatically identify the control components in the simulation system, sort the control components according to the topological connection relationship, and ensure the accuracy of the logical actions of the simulation control components without manual intervention. During the sorting process, a topological connection directed graph with control components as nodes is formed, and the sorting complexity is O(n), avoiding multiple traversals of nodes and improving the efficiency of automatic sorting.
[0051] An embodiment of the present invention also discloses an automatic sorting system for power control components, and the system includes:
[0052] A control component acquisition module, configured to acquire all control component information in the model to form a control component set;
[0053] A directed graph construction module, configured to establish a directed connection relationship between control components according to the topological connection relationship based on the control component set, and identify whether a control component is a boundary node according to the node type of the component to form a directed graph forest of control components;
[0054] A path acquisition module, configured to obtain a directed graph from the directed graph forest, perform traversal starting from multiple boundary points until a branch point is encountered, and add the path where the branch point is located to the queue of paths to be traversed;
[0055] A single-component traversal module, configured to traverse a single component in the queue of paths to be traversed until the component has been traversed or is a leaf node, generate numbers for each node, and if the expected number of a node that has been traversed on the current path is greater than the existing number, perform number adjustment.
[0056] During the automatic sorting process of the control system, first obtain the model, identify the control components, and form a control component set.
[0057] Establish a directed connection relationship between components according to the topological connection relationship between control components, and initially identify whether a component is a boundary node according to the in-node and out-node types of the component to form a boundary point set of the current directed graph, thereby forming a directed graph forest of control components.
[0058] Traverse the directed graph forest and generate numbers for each node.
[0059] Obtain a directed graph from the forest, perform path traversal starting from multiple boundary points of the directed graph until a branch point is encountered, that is, there are multiple outputs, and pause here. The function of pausing is to ensure that the numbers of the cross-branch points on the multi-path traversal paths are consistent.
[0060] Traverse a single component until the component has been traversed or is a leaf node. When encountering a node that has been traversed, if the expected number on the current path is greater than the current existing number, the number needs to be adjusted. Specifically: obtain all paths of the current branch point, and judge whether multiple loops are formed; if multiple loops are formed, judge whether there is nesting of large and small loops, and sort all relevant paths according to the size of the formed loops; find the current node in all paths, and perform correction by traversing in reverse order until the starting point of the loop; if the current node is not the end point of the path, the subsequent node encoding is also adjusted accordingly. When all relevant paths are re-encoded, the coding requirements of the size feedback loop can be met.
[0061] The above are only the preferred 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 principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. An automatic sorting method for power control components, characterized in that, The method includes the following operations: Obtain all control element information in the model to form a control element set; According to the control element set and based on the topological connection relationship, establish a directed connection relationship between control elements, and identify whether a control element is a boundary node according to the node type of the element, forming a control element directed graph forest; Obtain a directed graph from the directed graph forest, start traversing from multiple boundary points until a branch point is encountered, and add the path where the branch point is located to the path queue to be traversed; Traverse a single element in the path queue to be traversed until the element has been traversed or is a leaf node, generate numbers for each node, and if the expected number of a node that has been traversed on the current path is greater than the existing number, perform number adjustment; The specific number adjustment is as follows: Obtain all paths of the current branch point and determine whether multiple loops are formed; If it is a multiple loop, determine whether there is nesting of large and small loops, and sort all relevant paths according to the size of the formed loops; Find the current node in all paths, traverse and correct in reverse order until the loop starting point; If the current node is not the end point of the path, the subsequent node encoding is also adjusted accordingly.
2. The automatic sorting method for power control components according to claim 1, characterized in that, The identification of whether a control element is a boundary node according to the node type of the element is specifically determined according to whether the element is an input node or an output node type.
3. The automatic sorting method for power control components according to claim 1, characterized in that, Each node in the directed graph is traversed only once, and the algorithm complexity is O(n).
4. An automatic sorting system for power control components, characterized in that, The system includes: A control element acquisition module for obtaining all control element information in the model to form a control element set; A directed graph construction module for establishing a directed connection relationship between control elements according to the control element set and based on the topological connection relationship, and identifying whether a control element is a boundary node according to the node type of the element, forming a control element directed graph forest; A path acquisition module for obtaining a directed graph from the directed graph forest, starting traversing from multiple boundary points until a branch point is encountered, and adding the path where the branch point is located to the path queue to be traversed; A single element traversal module for traversing a single element in the path queue to be traversed until the element has been traversed or is a leaf node, generating numbers for each node, and if the expected number of a node that has been traversed on the current path is greater than the existing number, perform number adjustment: obtain all paths of the current branch point and determine whether multiple loops are formed; if it is a multiple loop, determine whether there is nesting of large and small loops, and sort all relevant paths according to the size of the formed loops; find the current node in all paths, traverse and correct in reverse order until the loop starting point; if the current node is not the end point of the path, the subsequent node encoding is also adjusted accordingly.
5. The automatic sorting system for power control components according to claim 4, characterized in that, The node type of the element is an input node or an output node type.
6. The automatic sorting system for power control components according to claim 4, characterized in that, Each node in the directed graph is traversed only once, and the algorithm complexity is O(n).
Citation Information
Patent Citations
Adjusting system for setting component serial number and method thereof
TWI273460B