Test process arrangement method and system based on hierarchical control domain
By using a test process orchestration method based on hierarchical control domains, a hierarchical flowchart is generated, which solves the problem of chaotic logical structure in traditional test systems and simplifies the flowchart and improves readability.
Patent Information
- Application Number
- CN202511747464.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-26
- Publication Date
- 2025-12-26
- Estimated Expiration
- 2045-11-26
AI Technical Summary
Traditional automated testing systems struggle to clearly display the logical structure when dealing with complex testing processes, resulting in chaotic and difficult-to-maintain process diagrams, and making it difficult to trace the cause of errors when anomalies occur.
A test process orchestration method based on hierarchical control domains is adopted. The control domains are generated in a hierarchical recursive structure through control nodes, and the nodes are regionalized using bounding boxes to generate a hierarchical process orchestration diagram. The flowchart is simplified by combining an automatic layout algorithm.
The structure of the flowchart has been simplified, making it easier to understand and maintain. The number of connecting lines has been reduced, the clarity and readability of the test logic have been improved, and the complexity of flowchart editing has been reduced.
Smart Images

Figure CN121210328A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of automation testing technology, in particular, to a test flow arrangement method and system based on hierarchical control domains, an electronic device and a computer readable storage medium. BACKGROUND
[0002] With the increasingly wide application of satellite navigation technology, it has penetrated into the fields of consumer electronics, automobiles, aerospace and military equipment, etc., while promoting the development of the industry, it also puts forward higher and more accurate requirements for the quality evaluation of navigation products. With the increase of test items, the extension of the cycle and the frequent changes in demand, the traditional automatic test system is difficult to respond quickly, and the design complexity is rising. Therefore, in order to improve the research and development efficiency, a node type flow arrangement system is usually introduced into the automatic test system.
[0003] However, the existing node type flow arrangement system is based on a flat node-connection line mesh model. When the test flow involves conditional branches, parallel branches and nested loops, the nodes and connection lines are intertwined to form a mesh structure that is difficult to trace, resulting in key business logic and small branches being stacked together, making it difficult to clearly display the test logic structure, making the flow arrangement diagram difficult to read and maintain. Moreover, the position of the node is arbitrary, the connection line is arbitrary, there is no constraint, resulting in the connection line being intertwined, making it difficult for the human eye to trace the starting point and ending point of the logic, leading to visual confusion, especially very complex business processes will lead to an increase in nodes, a large number of connection lines, and a very complex connection relationship and data reference relationship between nodes, which will further lead to difficulty in understanding and maintaining the flow arrangement diagram. In addition, during the running of the test system, it is difficult to analyze and locate the data and flow. After the test fails, it is difficult to quickly trace which node, which parameter and which data caused the final error. SUMMARY
[0004] The present application provides a test flow arrangement method and system based on hierarchical control domains, an electronic device and a computer readable storage medium, which simplifies the overall structure and makes the test flow logic more clear, making the flow arrangement diagram easier to understand and maintain.
[0005] According to one aspect of the present application, a test flow arrangement method based on hierarchical control domains is provided, comprising the following contents: The test logic of the test flow drags a plurality of components from the built-in components and the preset component library to the canvas to form a plurality of flow nodes and generate connection lines between different flow nodes, wherein the flow nodes include ordinary nodes and control nodes, the number of input ports and output ports of the ordinary nodes is at most one, and the number of input ports of the control nodes is at most one and the number of output ports is at least one. generating control domains in a hierarchical recursive structure based on the control nodes, wherein a control domain refers to a set of all nodes directly or indirectly connected to the output port of a control node, and the number of input ports and the number of output ports of the control domain are both one; generating a bounding box based on the area range of the control domain to enclose all nodes within each control domain, and generating a hierarchical flowchart.
[0006] Further, the process of generating control domains in a hierarchical recursive structure based on control nodes includes the following: Starting from the control node, the subsequent flow nodes connected to its output port are accessed according to the breadth-first principle. If the subsequent flow node is a normal node, it is directly attributed to the control domain of the control node. If the subsequent flow node is a control node, a new sub-control domain is generated, and the flow nodes contained in the sub-control domain are determined according to the recursive principle, and the sub-control domain is attributed to the control domain of the control node. Then the subsequent flow nodes connected to the output port of the sub-control domain are continuously accessed, and the process is repeated until there is no accessible position of the subsequent flow node, thereby generating control domains in a hierarchical recursive structure.
[0007] Further, the process of generating a bounding box based on the area range of the control domain includes the following: An empty parent coordinate list is created, and all flow nodes in the control domain are traversed according to the breadth-first principle. If the flow node is a normal node, the four corner coordinates of the graph shown by the flow node are directly put into the parent coordinate list. If the flow node is a control node, the sub-coordinate list of its sub-control domain is recursively calculated, the convex hull of the sub-coordinate list is calculated, and the polygon corresponding to the convex hull of the sub-coordinate list is the bounding box shape of the sub-control domain. The sub-coordinate list is added to the parent coordinate list. After the traversal is completed, the convex hull of the parent coordinate list is calculated, and the polygon corresponding to the convex hull of the parent coordinate list is the bounding box shape of the parent control domain.
[0008] Further, a data area is set in each control domain, and the life cycle and accessible range of the data area are limited to all nodes in the control domain and its sub-control domain.
[0009] Further, after generating the flowchart, the following content is included: Automatically typesetting and laying out the flowchart.
[0010] Further, the process of automatically typesetting and laying out the flowchart includes the following: First, set the horizontal and vertical intervals of the layout layout, then, obtain the subsequent traversal list of the process arrangement diagram, for all process nodes of the subsequent traversal list, take the output port position of the parent node or the input port position of the current node as the coordinate origin, calculate the relative coordinates and collision regions, after completing the subsequent traversal calculation of all process nodes, realize the automatic layout of the process arrangement diagram.
[0011] Further, after generating the process arrangement diagram, the following contents are further included: Set the thumbnail level of the process arrangement diagram, if the level of a bounding box is greater than the thumbnail level, it is displayed as a thumbnail, otherwise it is displayed in detail.
[0012] In addition, the application also provides a test process arrangement system based on hierarchical control domain, comprising: The process node generation module is used for dragging a plurality of components from the built-in components and the preset component library to the canvas based on the test logic of the test process, forming a plurality of process nodes and generating connection lines between different process nodes, wherein the process node includes a normal node and a control node, the number of input ports and the number of output ports of the normal node are at most one, and the number of input ports of the control node is at most one and the number of output ports is at least one. The control domain generation module is used for generating a control domain in a hierarchical recursive structure based on the control node, wherein the control domain refers to a set of all nodes directly or indirectly connected to the output port of the control node, and the number of input ports and the number of output ports of the control domain are both one. The bounding box generation module is used for generating a bounding box based on the area range of the control domain to enclose all nodes in each control domain, and generating a hierarchical structure of the process arrangement diagram.
[0013] In addition, the application also provides an electronic device comprising a processor and a memory, the memory stores a computer program, the processor calls the computer program stored in the memory to execute the steps of the method as described above.
[0014] In addition, the application also provides a computer readable storage medium for storing a computer program for arranging a test process based on a hierarchical control domain, the computer program executes the steps of the method as described above when running on a computer.
[0015] The application has the following beneficial effects: The test flow arrangement method based on the hierarchical control domain of the application introduces complex branch, loop, parallel, event and other control flows by setting control nodes, generates control domains in a hierarchical recursive structure based on the control nodes, and generates bounding boxes based on the area range of the control domains, so that the overall flow arrangement graph presents a simple sequential structure, one node or bounding box after another, while the inside of each bounding box presents a tree branch structure, which can accurately and clearly represent complex control flows such as branch, loop, parallel, event and the like, and makes all control flows in one control domain flow out from the output port of the bounding box, so that the subsequent nodes only need to be connected to the output port of the bounding box by a connection line, greatly reducing the number of connection lines in the flow arrangement graph, simplifying the overall structure, and making the test flow logic clearer, so that the flow arrangement graph is easier to understand and maintain.
[0016] In addition, the test flow arrangement system based on the hierarchical control domain of the application also has the above advantages.
[0017] In addition to the above described objects, features and advantages, the application has other objects, features and advantages. The application will be further described below with reference to the drawings. BRIEF DESCRIPTION OF DRAWINGS
[0018] The accompanying drawings, which form a part of the present application, are intended to provide further understanding of the application and are incorporated herein for a purpose of explanations of the application. The schematic embodiments of the application and their descriptions are used to explain the application, and do not constitute an improper limitation on the application. In the drawings: Figure 1 is a flow diagram of the test flow arrangement method based on the hierarchical control domain of the preferred embodiment of the application; Figure 2 is a schematic diagram of the bounding box generated in the preferred embodiment of the application; Figure 3 is another flow diagram of the test flow arrangement method based on the hierarchical control domain of the preferred embodiment of the application; Figure 4 is still another flow diagram of the test flow arrangement method based on the hierarchical control domain of the preferred embodiment of the application; Figure 5 is yet another flow diagram of the test flow arrangement method based on the hierarchical control domain of the preferred embodiment of the application; Figure 6 is a module structure schematic diagram of the test flow arrangement system based on the hierarchical control domain of another embodiment of the application. DETAILED DESCRIPTION
[0019] It should be noted that the embodiments in the application and the features in the embodiments can be combined with each other without conflict. The application will be described in detail below with reference to the drawings and in combination with the embodiments.
[0020] Referring to Figure 1 The preferred embodiment of the present application provides a test flow arrangement method based on hierarchical control domains, including the following contents: Step S1: Based on the test logic of the test flow, a plurality of components are dragged from the built-in components and the preset component library to the canvas to form a plurality of flow nodes and generate connection lines between different flow nodes, wherein the flow nodes include ordinary nodes and control nodes, the number of input ports and the number of output ports of the ordinary nodes are each at most one, and the number of input ports of the control nodes is at most one and the number of output ports is at least one; Step S2: Based on the control nodes, control domains in a hierarchical recursive structure are generated, wherein the control domain refers to a set of all nodes directly or indirectly connected to the output port of the control node, and the number of input ports and the number of output ports of the control domain are each one; Step S3: Based on the area range of the control domain, a bounding box is generated to enclose all nodes within each control domain, and a hierarchical structure flow arrangement diagram is generated.
[0021] It can be understood that the test flow arrangement method based on hierarchical control domains of the embodiment facilitates the introduction of complex branch, loop, parallel, event, etc. control flow by setting the control node, and generates the control domain in a hierarchical recursive structure based on the control node, and generates the bounding box based on the area range of the control domain, so that the overall flow arrangement diagram presents a simple sequential structure, one node after another or a bounding box, while the inside of each bounding box presents a tree branch structure, which can accurately and clearly represent the complex control flow of branch, loop, parallel, event, etc. and make all control flows in one control domain flow out from the output port of the bounding box, and the subsequent nodes only need to be connected to the output port of the bounding box with a connection line, which greatly reduces the number of connection lines in the flow arrangement diagram, not only simplifies the overall structure, but also makes the test flow logic more clear, so that the flow arrangement diagram is easier to understand and maintain.
[0022] The components include built-in components and custom components. The built-in components are built by code and can be extended, and the demand thereof is determined by the business supported by the system. The custom components are composed of a component name, input parameter definition, return value type, and flow arrangement diagram of the component. A plurality of custom components constitute a preset component library. The components can be called in the flow arrangement diagram. The components provide a quick and flexible way to extend the system function. Based on the built-in components and the preset component library, all test items in the test flow can be quickly built through the flow arrangement diagram. For example, the components include business processing components (such as a positioning accuracy calculation component, a sensitivity calculation component, and the like), device components (such as a device control component, a device event component, and the like), display components (a data display component, a chart component, and the like), and the like. Therefore, in the step S1, a plurality of components can be dragged from the built-in components and the preset component library to the canvas according to the test logic of the test flow, a plurality of flow nodes are formed, and a connection line between different flow nodes is generated. In addition, when the flow nodes are formed, the input parameters required by the components need to be set in the node setting parameters, and a data item for saving the return result of the component is set. The node setting parameters can be displayed and edited. The number of parameters and the data type of each parameter will change according to the type of the node. The flow nodes have input ports and output ports. The number of input ports is at most one, and the number of output ports is not less than one. Some special flow nodes have no input ports or output ports, for example, the sequence start node has no input port, and the result return node has no output port. When there are more than one output ports, a port identifier will be displayed on each output port to distinguish them. The above characteristics are determined by the attributes of the components. The output port of one node can be connected to the input port of another node by a connection line. It is specified that at most one connection line can be connected to each port, and the connection lines cannot be connected into a ring. The node connected to the input port of the current node is defined as the predecessor node (also referred to as the parent node) of the current node, and the node connected to the output port of the current node is defined as the successor node (also referred to as the child node) of the current node.
[0023] Wherein, there is at least one sequence start node in a process orchestration diagram, the node set connected by a sequence start node forms a sequence, wherein one sequence is identified as the main sequence as the execution entry of the process orchestration diagram, and the rest of the sequences are identified as sub-sequences and can be repeatedly called. The node setting parameters of the sequence start node include sequence name, input parameter list, sequence return result type, etc. When the process orchestration diagram starts to execute, a control flow is generated, the control flow enters the sequence start node of the main sequence and executes, when a node execution is completed, the control flow flows out along the output port of the node, flows into the subsequent node through the connecting line, and the control flow reaches the subsequent node, executes the node, and until the control flow cannot continue to flow, then the control flow execution is completed, if all control flows of the main sequence are executed, the process orchestration diagram is run completely.
[0024] Among them, the flow nodes are divided into two categories of common nodes and control nodes, the number of input ports and the number of output ports of the common nodes are at most one, the number of input ports of the control nodes is at most one and the number of output ports is at least one, for the common nodes, after the control flow enters the node and is executed, the control flow will unconditionally flow out from the output port and execute the subsequent node, and for the control nodes, after the control flow enters the node and is executed, the control flow will selectively flow out from some output ports according to the node execution result, for example, the conditional branching node has two output ports, one output port represents the execution exit when the condition is true, and the other output port represents the execution exit when the condition is not true. The common nodes mainly include expression nodes, device control nodes, sub-sequence calling nodes, component calling nodes, display nodes, result returning nodes, etc., which can be extended as needed, and the control nodes mainly include branching nodes, loop nodes, parallel nodes, event nodes, etc., which can be extended as needed. It can be understood that when the branching node is executed, the branching condition is first judged, and then the control flow flows to the output port selected by the branching condition, which is mainly used to simulate if, if-else, switch statements, etc.; when the loop node is executed, the loop condition is first judged, if the condition is not true, the loop is exited, if the condition is true, the loop is executed, at this time the control flow flows to the output port of the loop node and continues to execute the subsequent node, until there is no subsequent executable node, then the control flow automatically returns to the loop node, repeats the above process until the condition is not true; the parallel node can set the number of parallel branches, the number of branches determines the number of output ports, when the parallel node is executed, the control flow will be divided into multiple, each control flow respectively flows to each output port of the parallel node, and the subsequent nodes are executed in parallel; the event node has an event occurrence output port and an event timeout output port, which can set the event name and timeout interval of the node, when the event node is executed, the event will be waited for, if the waiting time exceeds the timeout interval, the control flow flows to the event timeout output port, if the event occurs within the timeout interval, the control flow flows to the event occurrence output port and saves the data generated by the event for the use of the subsequent node, the occurrence of the event can be triggered by the outside, for example, the device receives the data protocol, or it can be actively triggered by the corresponding node (for example, based on the event-driven architecture).
[0025] In addition, in the step S2, the control domain in a hierarchical recursive structure is generated based on the control node, the control domain of the control node is defined as a set of all nodes directly or indirectly connected to the output port of the control node, the control node is the start node of the control domain, the control domain of the control node is automatically calculated and determined by the connection relationship between the nodes, the control domain has an input port, the input port of the control domain is combined with the input port of the start node (i.e. the control node) of the control domain, the control domain has an output port, the control flow after the execution of the control domain flows out from the output port, the node connected to the input port of the control domain is the predecessor node (i.e. the parent node) of the current control domain, and the node connected to the output port of the control domain is the successor node (i.e. the child node) of the current control domain. In addition, all the process nodes in the process arrangement diagram can constitute a global control domain, and each sequence can constitute a sequence control domain.
[0026] It can be understood that, by setting the control node in the process arrangement diagram, the application facilitates the introduction of complex branch, loop, parallel, event and other control processes, so that the complex control processes can be presented in the control domain generation step in a region, which can effectively avoid the formation of a "spider web" mesh structure due to incorrect connection of the nodes, and is conducive to clearly displaying the logical structure of the test process.
[0027] The process of generating the control domain in a hierarchical recursive structure based on the control node includes the following contents: Starting from the control node, the subsequent process nodes connected to the output port thereof are accessed according to the breadth-first principle, if the subsequent process node is a normal node, the subsequent process node is directly attributed to the control domain of the control node, if the subsequent process node is a control node, a new child control domain is generated, the process nodes contained in the child control domain are judged according to the recursive principle, the child control domain is attributed to the control domain of the control node, and then the subsequent process nodes connected to the output port of the child control domain are continuously accessed, and the process is repeated until there is no accessible position of the subsequent process node, so as to generate the control domain in a hierarchical recursive structure.
[0028] It can be understood that the control domain of the control node can be automatically calculated and generated according to the connection relationship of the node during the node arrangement process without human operation. The generated control domain is a hierarchical recursive structure, that is, the control domain also includes other control domains. The outermost control domain is the parent control domain, and the level is 1. The control domain inside is the child control domain, and the level of the child control domain is increased by 1 based on the level of the parent control domain. Thus, a hierarchical recursive structure of at least two levels can be formed, and a hierarchical nested display effect can be formed. The complex control flow such as branch, loop, parallel, and event can be accurately and clearly represented. In addition, in other embodiments of the application, a user can edit and generate a custom control domain according to the user's intention. For example, a group of logically cohesive adjacent nodes are set as a custom control domain. The custom control domain can be modified and deleted.
[0029] Optionally, a data area is arranged in each control domain. The life cycle and accessible range of the data area are limited in all nodes in the control domain and the child control domains thereof. Other nodes cannot access the data area. The data availability is ensured, and the data security is guaranteed. The data area can include multiple data items. Each data item includes a data name, a data type, and an initial value. In addition, during the process of editing the flow arrangement diagram, the data area of the control domain in which the selected node is located can be displayed, and the editing function of the data area is provided, such as adding a data item, deleting a data item, and modifying a data item. The operation is very convenient.
[0030] In addition, in the step S3, a bounding box is generated according to the region range of each control domain to enclose all nodes in each control domain. The shape of the bounding box is a rectangle, a polygon, or other shapes. The input port of the control domain can be displayed at the front end of the bounding box, and the output port of the control domain can be displayed at the end of the bounding box. The bounding box can display the region range of the control domain, so that the user can intuitively understand the control domain. After the bounding boxes of all control domains are generated, the hierarchical flow arrangement diagram is generated.
[0031] The process of generating the bounding box based on the region range of the control domain includes the following contents: An empty parent coordinate list is created, all flow nodes in the control domain are traversed according to the breadth-first principle, if the flow node is a normal node, the four corner coordinates of the graph shown by the flow node are directly put into the parent coordinate list, wherein the flow node is usually displayed in a rectangle, a rhombus or other quadrilateral in the canvas, and the application preferably adopts a rectangle, if the flow node is a control node, the child coordinate list of the child control domain is recursively calculated, the convex hull of the child coordinate list is calculated, the polygon corresponding to the convex hull of the child coordinate list is the bounding box shape of the child control domain, and the child coordinate list of the child control domain is added to the parent coordinate list, which is repeatedly repeated until all corner coordinates of the flow nodes in the control domain are put into the parent coordinate list, and then the convex hull of the parent coordinate list is calculated, and the polygon corresponding to the convex hull of the parent coordinate list is the bounding box shape of the parent control domain. After the shape of the bounding box is obtained, the bounding box shape is visually displayed in the canvas, for example, the boundary and internal filling color of the bounding box shape are displayed, so that the area governed by the control domain is clear, forming a kind of hierarchical bounding box nesting effect. Optionally, for the nodes connected in front and back, when dragged close to each other, they are automatically aligned and aggregated into a node block, which can further reduce the number of connection lines in the graph. It can be understood that the bounding box generated in an embodiment of the application is as shown in Figure 2
[0032] In addition, in other embodiments of the application, the shape of the bounding box can be further processed as needed, converted into a rectangular bounding box or a bounding box of other shapes, such as simplified into an axis-aligned bounding box. In addition, the bounding boxes of the global control domain and the sequence control domain can also be calculated, but in order to clearly show the jurisdiction areas of different control domains, the bounding boxes of the global control domain and the sequence control domain can not be displayed.
[0033] In addition, with the actions of flow arrangement in the canvas, the system automatically updates the affected control domains and the bounding boxes corresponding to the control domains, for example, node addition, deletion, position movement, connection / disconnection of connection lines, etc., which can cause changes in the control domains and the bounding boxes. In addition, the bounding boxes can also be picked up, moved, etc., when the bounding boxes move, all nodes in the bounding boxes and subsequent nodes of the bounding boxes are synchronously cascaded to move. In addition, when the bounding boxes are nested, the internal bounding boxes are displayed at a higher level than the external bounding boxes, so as to avoid visual occlusion and picking occlusion. In addition, when a node in the bounding box or the bounding box is clicked, all available data in the current control domain can be automatically displayed, so as to quickly set the node parameters, and if the node parameters are not set correctly during the editing process, for example, the node parameter configuration is incorrect, the data item used does not exist, etc., the canvas is prominently displayed.
[0034] It can be understood that the present application hides the complex logic of conditions, branches, loops, parallelism, etc. in the abstract bounding box by controlling the nesting of domains and bounding boxes, so that the top-level flowchart structure becomes simple, clear and easy to understand, completely solves the problem of "spider web" confusion, greatly simplifies the structure of the flowchart, and makes the flow arrangement diagram present a simple sequential structure as a whole, and the internal structure of each bounding box presents a tree-like branch structure, which can accurately and clearly represent the complex control flow of branches, loops, parallelism, events, etc. And make all control flows in a control domain flow out from the output port of the bounding box, and the subsequent nodes only need to be connected to the output port of the bounding box with a connection line, which reduces a large number of connection lines, greatly simplifies the flow writing, greatly improves the readability and maintainability of the test logic, and significantly reduces the cognitive load and operation complexity of the flow editing.
[0035] Optionally, as shown in Figure 3 The hierarchical control domain-based test flow arrangement method further includes the following after generating the flow arrangement diagram: Step S4: automatically layout the flow arrangement diagram.
[0036] The process of automatically layout the flow arrangement diagram includes the following: First, set the horizontal and vertical intervals of the layout, then get the subsequent traversal list of the flow arrangement diagram, and for all flow nodes in the subsequent traversal list, take the output port position of the parent node or the input port position of the current node as the coordinate origin, calculate the relative coordinates and collision area, and complete the subsequent traversal calculation of all flow nodes. After all flow nodes, the automatic layout of the flow arrangement diagram is realized.
[0037] It can be understood that when operating nodes and connection lines, the layout state of the flow arrangement diagram will inevitably change. The currently commonly used layout method is for the user to manually drag the position of each node, but this manual layout method may need the user to frequently adjust the position of the node to ensure that there is no collision and overall aesthetics, especially when the test flow is complex, which greatly increases the workload of flow editing. In addition, although the existing tree structure layout algorithm can realize automatic layout, it is only suitable for tree structure. Since there are control domains, bounding boxes and other elements in the present application, the traditional tree structure layout algorithm is no longer applicable. Therefore, the present application proposes a new automatic layout algorithm.
[0038] Specifically, first, set the horizontal interval Δx and the vertical interval Δy of the layout layout, the specific value of Δx and Δy can be set according to actual needs. Then, the subsequent traversal list of the process arrangement diagram is obtained, wherein the subsequent traversal is a commonly used traversal manner, therefore, the specific obtaining process of the subsequent traversal list is not described here. It can be understood that in the present application, the horizontal right direction is the positive direction of the x axis, and the vertical upward direction is the positive direction of the y axis. Of course, in other embodiments, the positive direction of the x axis and the positive direction of the y axis can be adjusted according to actual needs.
[0039] Then, for all the flow nodes in the subsequent traversal list, taking the output port position of its parent node as the coordinate origin, the relative coordinates and collision areas thereof are calculated. For example, for a certain flow node, if the parent node of the current node is a normal node or a control field, the relative coordinates of the current node are (0, -Ay), that is, the current node is moved one vertical interval downward in the vertical direction, if the parent node of the current node is a control node, the relative coordinates of the current node are (to be determined, -Ay), that is, the relative coordinates of the current node in the horizontal direction are to be determined and will be determined when the parent node is processed; if the current node is a control node, the x-axis coordinates of the current node are determined according to the relative positions of all the child nodes of the current node in the x-axis, specifically: first, the relative coordinates of the first child node of the current node are set to (0, -Ay), then the relative coordinates of the second child node are set to be consistent with those of the first child node, it is detected whether the collision areas of the first and second child nodes overlap, if they overlap, the x-axis coordinates of the second node are moved rightward by Dx, that is, updated to (Dx, -Ay), this process is repeatedly performed until the collision areas of the two child nodes do not overlap; the third child node and the second child node are processed in the same way, after the movement of all the child nodes in the x-axis direction is completed, the x-axis coordinates of all the child nodes are translated as a whole so that the middle positions of all the child nodes are aligned with the center of the current node (i.e. the parent node) in the vertical direction. After the subsequent traversal loop calculation is completed, the relative coordinates of all the flow nodes can be obtained. In the process of traversal, the collision areas of the flow nodes are also calculated, wherein, for the collision area of each flow node, if the current node is the start node of a control field (i.e. a control node), the collision area of the current node is the merged area of the collision areas of all the child nodes (i.e. the flow nodes directly connected with the output port of the control node), the collision areas of the child nodes of the control field (i.e. the flow nodes directly connected with the output port of the control field) and the collision area of the current node, if the current node is a normal node, the collision area of the current node is the merged area of the collision areas of the child nodes and the collision area of the current node, wherein, the collision area of each flow node itself is a rectangle, a convex polygon or other shape, which can be set to the same shape according to the shape of the bounding box, and the invention preferably sets it to a rectangle. It can be understood that after the relative coordinates and collision areas of all the flow nodes are calculated, the automatic layout of the process arrangement diagram is completed, because the nodes cannot overlap with each other, only the nodes on the left and right can overlap, the collision area of the node represents the union set of the bounding boxes of the node and all the subsequent nodes, and through the overlap detection and calculation of the collision areas between the child nodes of the control node, it is ensured that the nodes on the left and right will not overlap; then, the pre-order traversal is performed from the sequence start node, and the absolute coordinates of all the nodes can be recursively obtained by adding the relative coordinates of the nodes to the absolute coordinates of their parent nodes, and the absolute coordinates of the sequence start node can be determined by the user dragging on the canvas.
[0040] It can be understood that the automatic layout algorithm of the present application can automatically complete the positioning and layout calculation of all elements on the canvas, without manual adjustment of the position, greatly reducing the workload of process editing, and can ensure that no collision interference occurs between nodes, improving the overall aesthetics of the process arrangement diagram.
[0041] Optionally, if a node is changed (including addition, deletion or modification), the layout needs to be updated, and the updating process is: removing the nodes before the changed node from the subsequent traversal list, and then performing subsequent traversal calculation on the remaining nodes in the subsequent traversal list, so that only the affected nodes need to be updated, without updating all nodes, reducing the calculation amount.
[0042] Optionally, as shown in Figure 4 The test process arrangement method based on hierarchical control domains further includes the following after generating the process arrangement diagram: Step S5: Set the thumbnail level of the process arrangement diagram, if the level of a bounding box is greater than the thumbnail level, it is displayed as a thumbnail, otherwise it is displayed in detail.
[0043] Specifically, to further improve the visual hierarchy of the process arrangement diagram and provide display mode control of the bounding box, the display mode can be divided into detailed display and thumbnail display. When the thumbnail level of the process arrangement diagram is set, if the level of the bounding box is greater than the thumbnail level, it is displayed as a thumbnail. When the thumbnail is displayed, the internal nodes and child bounding boxes of the control domain are no longer displayed, at this time the control domain is simplified as a node, otherwise it is displayed in detail. In addition, when the display mode is switched, the size of the bounding box will change, the system will update the visual effects of the nodes, connection lines, bounding boxes and other elements in real time, and automatically update the layout, keeping the relative positions of the elements unchanged.
[0044] Optionally, the present application can also provide a semi-automatic layout mode, that is, the position of the node is determined by manual dragging. During the dragging process of the node, the system will automatically calculate all subsequent affected nodes and control domains of the currently dragged node, so that they are synchronized with the overall movement of the currently dragged node.
[0045] Optionally, as shown in Figure 5 The test process arrangement method based on hierarchical control domains further includes the following after generating the process arrangement diagram: Step S6: Generate a phase diagram based on the process arrangement diagram.
[0046] Specifically, a stage attribute can be configured for a node in the process orchestration diagram, the stage attribute can set information such as a name of a stage and an estimated time consumption, the estimated time consumption is a constant or a numerical expression, and the stage attribute node is generally selected as a key path node in the test process. If the stage attribute node is a start node of a control domain, the control domain also has the stage attribute. After the stage attribute node is set, the main sequence of the process orchestration diagram is copied as it is to form a to-be-processed diagram, the to-be-processed diagram is traversed based on a depth-first principle, in the traversal process, non-stage attribute nodes are put into a to-be-processed node sequence, after the traversal is completed, the to-be-processed node sequence is reversed, and then a node is taken out from the sequence one by one to be processed as follows: if the current node is not a start node of a control domain, the current node is deleted from the to-be-processed diagram, and a connection line is generated between a predecessor node and a successor node of the current node; if the current node is a start node of a control domain, the current node and a corresponding bounding box are deleted, and then it is judged whether there is a stage attribute node in the control domain; if not, a connection line is generated between a predecessor node and a successor node of the control domain; if there is a stage attribute node in the control domain, the stage attribute node in the control domain is connected to the predecessor node of the current node. When the to-be-processed node sequence is processed through traversal, the to-be-processed diagram is simplified into a stage diagram, the stage diagram is a simplified version of the process orchestration diagram and is a skeleton structure of the test process, and the stage diagram and the process orchestration diagram support bidirectional linkage operation. In addition, after the stage diagram is generated, the automatic layout algorithm described above can be used to automatically layout the stage diagram.
[0047] It can be understood that, by setting a stage attribute for a key path node of a test process in a process orchestration diagram, the stage attribute node can be automatically extracted from a complex process orchestration diagram, a simplified stage diagram can be automatically generated, a clear process skeleton view is provided for a user, and running time consumption estimation and progress monitoring can be performed.
[0048] In addition, after the process orchestration diagram is generated, a test plan can be created for testing, the test plan being composed of multiple test items, the test items storing the name of the process orchestration diagram and input parameters for calling the process orchestration diagram. In a test running state, the test items in the test plan are run in a loop, and views such as a test result view, a process running view, a stage running view, a timeline view, and a device data view can be provided in the running. The running process of the process orchestration diagram is as follows: starting from a main sequence control domain, input parameters of the main sequence are first transmitted, a control flow is created, a start node of the main sequence is executed, then the control flow flows into a subsequent node for execution, when the executed node is a normal node, the node is directly executed, when the executed node is a start node of a control domain, the control domain is executed, after the control domain is executed, a subsequent node pointed to by an output port of the control domain is executed, the process is repeated until there is no subsequent node, the sequence is executed completely, and corresponding result data is returned; wherein, the execution process of the control domain is as follows: when the control flow flows into the control domain, an instance of a corresponding data item is created according to a data area of the control domain, the control flow first enters a start node of the control domain, then the control flow flows in the control domain according to node rules and connection lines, until the control flow cannot continue to flow into a subsequent node, which means that the control flow is executed completely, when all control flows in the control domain are executed completely, the control flow flows out of a bounding box output node, and the instance of the corresponding data item is destroyed, at this time, the control domain is executed completely. For example, in the process orchestration diagram in an embodiment, the working state and parameters of a controlled device are first set through a device control component, data reported by the device is then collected through a device event component, process data is calculated in real time through a business processing component, the process data is displayed through a display component, finally, all the process data is evaluated to obtain a final test result, whether the current test item passes the test and performance data are set through a result setting component; all the data is updated in real time on the test result view in the form of text, data, and various visual charts.
[0049] Among them, the test result view is to display real-time test data and test results in the form of text, data, and various visual charts, and the process is driven by the display component and result setting component in the flow. The flow running view is to display the state changes generated by running in the read-only mode of the flow arrangement diagram. The currently executing node / bounding box is highlighted in real time. The executed node / bounding box is displayed in different colors according to the execution result (success, warning, or error). The display execution path leaves a visual tail, and a bright light flow or animation is used to show how the execution process is walked step by step, especially in branches and loops. The path chosen is displayed. The data items and data item values in the control domain that have been run and are currently running can be viewed. For the node with execution exception, the exception information details can also be viewed. The stage running view is to get the estimated running time of each stage node in the stage diagram by calculating the time-consuming expression. Then, the estimated total time-consuming of the test item running is obtained by accumulating the time-consuming of all nodes in the stage diagram. According to the state of the stage attribute node: executed, executing, and not executed, different colors are displayed. The running time-consuming is displayed on the executed stage attribute node. The running execution time and the estimated remaining time-consuming are displayed on the stage attribute node that is being executed. The estimated time-consuming is displayed on the stage attribute node that has not been executed. These states and flow running are updated synchronously, and the overall progress percentage, the executed time, and the estimated remaining time-consuming of the entire test item are updated in real time. The device data view is to display the device control instructions and device transceiving data in the form of logs. Each data contains time, device name, and related data.The timeline view is a global timeline view, which is a horizontal Gantt chart, the horizontal X axis is time, which is counted from the start of the process execution, and a linear scale is adopted, and zoom and pan interactions are provided, and the vertical Y axis is composed of multiple horizontal Gantt bars, a vertical timeline representing the current time is displayed in the view, and the vertical timeline advances with time, and the display state of all Gantt bars is updated in real time as time advances, each Gantt bar represents an entity, and the state and activity of the entity are displayed at the corresponding time coordinate in the Gantt bar, and the displayed Gantt bars mainly include stage Gantt bars and device instruction Gantt bars; wherein in the stage Gantt bar, the region composed of the start execution time and the end execution time of each stage is displayed with color identification, and at the same time, the stage name, time consumption and other information are displayed in the region, and clicking on the region can highlight the stage attribute node in the stage running view, at the same time, if there is warning, error or other information in the running of the process diagram, a prominent icon is displayed at the corresponding time position of the stage Gantt bar, and if the icon is clicked, the abnormal information details are displayed, and the other views are positioned in linkage; in addition, for each device controlled by a test item, a device instruction Gantt bar (such as a spectrum analyzer, a navigation signal simulator, a navigation receiver, etc.) is generated, in the device instruction Gantt bar, when data of the device is received or a control instruction is sent to the device, a transceiving identifier is displayed at the time position of the event, and different colors are displayed according to normal or abnormal, and when the identifier is clicked, the instruction or data details are displayed, and the other views are positioned in linkage, when a control instruction (sending) and its corresponding response data (receiving) are connected, a request-response association line is drawn from the instruction identifier to the data identifier, and the length of the line directly represents the device response delay, and the receiving data identifier without the connection line represents the data actively reported by the device (such as heartbeat packet, alarm), which is irrelevant to any specific instruction. In addition, the timeline view has a time cursor, that is, a vertical dashed line that can be dragged, which is used for time positioning, and can produce a bidirectional linkage effect with the process running view, the stage running view and the device data view, so that the other views synchronously highlight and position the elements at the currently displayed time, for example, when the time cursor is dragged in the timeline view, the node corresponding to the cursor time is identified on the process running view, the stage corresponding to the cursor time is identified in the stage running view, and the data corresponding to the cursor time is identified in the device data view. This linkage mechanism combines the time dimension and the hierarchical dimension of process execution, and converts an originally abstract running state into a concrete, interactive and analyzable visualized information, greatly enhances the observability and debuggability of the system, and perfectly associates the time abnormality with the spatial position and the logical context, so that the fault positioning can be shortened from the hour level to the second level.
[0050] Optionally, a debugging mode can also be set during the test running process, the execution of the current flow can be paused and resumed, and step over, step into (entering a node or a bounding box), step out, running to a cursor, and conditional breakpoint functions can be provided, when running or pausing, the user can view and monitor the value of the data item in real time through hovering, and can dynamically adjust the value of the data item to realize interactive debugging. In addition, when the test item is running, the relevant necessary data can be collected and stored into a file or a database to form a test record to support the playback mode of the test item. When the test item is played back, the test record is loaded into the playback mode, and according to the data and the time stamp in the test record, the display of the related view is driven in time sequence. At this time, consistent visual display effect and interactive effect with real-time running can be obtained. In the playback mode, additional functions can be set, such as pause time driving and time fast / slow degree setting, the time line can also be dragged to view the state at a specific time, and the data area snapshot in the flow arrangement diagram view is supported. When the test fails, the user can not only view the final state, but also can slide the time axis to retreat to any step like using a time machine to observe the evolution of data and logic state. This is a macroscopic debugging experience that cannot be achieved by traditional breakpoint debugging.
[0051] It can be understood that the application can realize real-time and synchronous visualization of running state, time consumption, data flow and device interaction in multiple dimensions such as flow running view, stage view, time line view and device data view, and introduces a time cursor bidirectional linkage mechanism to enable linkage positioning of the above views. In addition, in the playback mode, the user is allowed to perform nonlinear backtracking debugging based on the recorded time stamp data, and the historical state evolution can be observed intuitively, so as to deeply integrate the static flow design diagram and the dynamic running history data.
[0052] In addition, as shown in Figure 6 Another embodiment of the application also provides a test flow arrangement system based on a hierarchical control domain, which preferably adopts the test flow arrangement method based on a hierarchical control domain as described above, and includes: A flow node generation module is configured to drag a plurality of components from built-in components and a preset component library to a canvas based on the test logic of the test flow, form a plurality of flow nodes, and generate connection lines between different flow nodes. The flow nodes include ordinary nodes and control nodes. The number of input ports and the number of output ports of the ordinary nodes are each at most one. The number of input ports of the control nodes is at most one, and the number of output ports is at least one. A control domain generation module is configured to generate a control domain in a hierarchical recursive structure based on the control nodes. The control domain refers to a collection of all nodes directly or indirectly connected to the output ports of the control nodes. The number of input ports and the number of output ports of the control domain are each one. The bounding box generation module is configured to generate a bounding box based on the region range of the control domain to enclose all nodes within each control domain, and generate a hierarchical flow arrangement diagram.
[0053] It can be understood that the test flow arrangement system based on the hierarchical control domain in the embodiment can introduce complex branch, loop, parallel, event and other control processes by setting the control node, generate the control domain in a hierarchical recursive structure based on the control node, and generate the bounding box based on the region range of the control domain, so that the flow arrangement diagram as a whole presents a simple sequential structure, one node after another or a bounding box, and the inside of each bounding box presents a tree branch structure, which can accurately and clearly represent the complex control processes such as branch, loop, parallel and event, and make all control flows in one control domain flow out from the output port of the bounding box, so that the subsequent nodes only need to be connected to the output port of the bounding box by a connection line, greatly reducing the number of connection lines in the flow arrangement diagram, simplifying the overall structure, and making the test flow logic clearer, so that the flow arrangement diagram is easier to understand and maintain.
[0054] In addition, another embodiment of the present application further provides an electronic device including a processor and a memory, wherein the memory stores a computer program, and the processor is configured to execute the steps of the method by calling the computer program stored in the memory.
[0055] In addition, another embodiment of the present application further provides a computer readable storage medium for storing a computer program for arranging test flow based on hierarchical control domain, wherein the computer program is configured to execute the steps of the method when running on a computer.
[0056] The computer readable storage medium can be a machine-readable storage medium, including but not limited to diskette, floppy disk, hard disk, global positioning system, read-only memory, random access memory, erasable programmable read-only memory, electrically erasable programmable read-only memory, flash memory, compact disc read-only memory, tape, cassette, cassette tape, magnetic tape, punch cards, paper tape, any other physical medium with patterns of holes, any other medium that can be used to store information suitable for use with a computer, or any suitable combination of the foregoing. The computer program product can also be a transmission medium that carries or communicates program code in the form of instructions or data arranged to be transferred, used, or processed by a machine, such as a computer, a processor, or an embedded processor, for example. The transmission medium can be any medium that can be used to provide propagation of information, including but not limited to electronic, electromagnetic, optical, or any other suitable propagation medium. The transmission medium can take the form of a propagating wave, including but not limited to acoustic, microwave, infrared, radio, or optical propagation. The transmission medium can also take the form of signals on a bus, or wires, circuitry, or any suitable combination of the foregoing.
[0057] Those skilled in the art will appreciate that embodiments of the present application can be devised for a method, a system, or a computer program product. Accordingly, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application can take the form of a computer program product on one or more computer readable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage memory etc.) embodying computer readable program code thereon. The routine can be implemented in any programming language, such as object-oriented programming languages like Java and JavaScript.
[0058] The present application is described in reference to the flowchart illustrations and / or block diagrams according to the embodiments of the application. It is understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart illustrations and / or block diagrams. Figure 1 The means for carrying out the functions specified in the flowchart illustrations and / or block diagrams can be embodied in one or more of the following: Figure 1 The means for carrying out the functions specified in the flowchart illustrations and / or block diagrams can be embodied in one or more of the following:
[0059] These computer program instructions can 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 instructions which implement the flow Figure 1 one or more flowcharts and / or blocks Figure 1 one or more flowcharts and / or blocks
[0060] These computer program instructions can 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 such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flow Figure 1 one or more flowcharts and / or blocks Figure 1 one or more flowcharts and / or blocks
[0061] Although preferred embodiments of the application have been described, those skilled in the art will recognize that additional modifications and variations can be made thereto without departing from the spirit and scope of the application. It is therefore intended that the appended claims cover all such modifications and variations as fall within the true scope of the application.
[0062] Obviously, numerous modifications and variations of the present application are possible in light of the above teachings. It is therefore to be understood that within the scope of the appended claims and their equivalents, the application can be practiced otherwise than as specifically described.
[0063] The above description is only preferred embodiments of the present application, not intended to limit the present application. The present application can be variously changed and modified by those skilled in the art without departing from the spirit and scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the scope of the present application.
Claims
1. A test flow orchestration method based on hierarchical control domain, characterized in that, The test logic based on the test flow drags multiple components from the built-in components and the preset component library to the canvas to form multiple flow nodes and generate connection lines between different flow nodes, wherein the flow nodes include normal nodes and control nodes, the number of input ports and the number of output ports of the normal nodes are at most one, and the number of input ports of the control nodes is at most one and the number of output ports is at least one; The control domain in a hierarchical recursive structure is generated based on the control nodes, wherein the control domain refers to the set of all nodes directly or indirectly connected to the output port of the control node, and the number of input ports and the number of output ports of the control domain are both one; A bounding box is generated based on the area range of the control domain to enclose all nodes in each control domain, and a hierarchical flow orchestration diagram is generated. The process of generating the control domain in a hierarchical recursive structure based on the control nodes includes the following steps:
2. The hierarchical control domain based test flow orchestration method of claim 1, wherein, Starting from the control node, the subsequent flow nodes connected to its output port are accessed according to the breadth-first principle, if the subsequent flow node is a normal node, the subsequent flow node is directly attributed to the control domain of the control node, if the subsequent flow node is a control node, a new sub-control domain is generated, and the flow nodes contained in the sub-control domain are judged according to the recursive principle, and the sub-control domain is attributed to the control domain of the control node, then the subsequent flow nodes connected to the output port of the sub-control domain are continuously accessed, and the process is repeated until there is no accessible position of the subsequent flow node, thereby generating the control domain in a hierarchical recursive structure. The process of generating the bounding box based on the area range of the control domain includes the following steps:
3. The hierarchical control domain based test flow orchestration method of claim 1, wherein, An empty parent coordinate list is created, and all flow nodes in the control domain are traversed according to the breadth-first principle, if the flow node is a normal node, the four corner coordinates of the graphic shown by the flow node are directly put into the parent coordinate list, if the flow node is a control node, the sub-coordinate list of the sub-control domain is recursively calculated, the convex hull of the sub-coordinate list is calculated, the polygon corresponding to the convex hull of the sub-coordinate list is the bounding box shape of the sub-control domain, and the sub-coordinate list is added to the parent coordinate list, after the traversal is completed, the convex hull of the parent coordinate list is calculated, and the polygon corresponding to the convex hull of the parent coordinate list is the bounding box shape of the parent control domain. A data area is set in each control domain, and the life cycle and accessible range of the data area are limited to all nodes in the control domain and its sub-control domain.
4. The hierarchical control domain based test flow orchestration method of claim 1, wherein, After generating the flow orchestration diagram, the following steps are included:
5. The hierarchical control domain based test flow orchestration method of claim 1, wherein, The flow orchestration diagram is automatically laid out. The process of automatically laying out the flow orchestration diagram includes the following steps:
6. The hierarchical control domain based test flow orchestration method of claim 5, wherein, The horizontal and vertical intervals of the layout are set, then the subsequent traversal list of the flow orchestration diagram is obtained, for all flow nodes in the subsequent traversal list, the relative coordinates and collision areas are calculated with the output port position of the parent node or the input port position of the current node as the coordinate origin, after the subsequent traversal calculation of all flow nodes is completed, the automatic layout of the flow orchestration diagram is realized. After generating the flow orchestration diagram, the following steps are included:
7. The hierarchical control domain based test flow orchestration method of claim 1, wherein, A thumbnail level of the flow orchestration diagram is set. If the level of a bounding box is greater than the thumbnail level, the bounding box is displayed in a thumbnail manner; otherwise, the bounding box is displayed in a detailed manner.
8. A test flow orchestration system based on hierarchical control domains, characterized in that, The method comprises the following steps: The flow node generation module is configured to drag a plurality of components from the built-in components and the preset component library to the canvas based on the test logic of the test flow, form a plurality of flow nodes, and generate connection lines between different flow nodes, wherein the flow nodes include ordinary nodes and control nodes, the number of input ports and the number of output ports of the ordinary nodes are each at most one, the number of input ports of the control nodes is at most one, and the number of output ports is at least one; The control domain generation module is configured to generate a control domain in a hierarchical recursive structure based on the control nodes, wherein the control domain refers to a set of all nodes directly or indirectly connected to the output ports of the control nodes, and the number of input ports and the number of output ports of the control domain are each one; The bounding box generation module is configured to generate a bounding box based on the area range of the control domain to enclose all nodes in each control domain, and generate a hierarchical flow orchestration diagram.
9. An electronic device, comprising: The computer program is stored in the memory and is configured to be executed by the processor to perform the steps of the method according to any one of claims 1-7.
10. A computer readable storage medium for storing a computer program for test flow orchestration based on hierarchical control domains, characterized in that, The computer program is stored in the memory and is configured to be executed by the processor to perform the steps of the method according to any one of claims 1-7.
Citation Information
Patent Citations
Process visualization design method based on code-free interaction
CN118939252A
Intelligent agent arrangement method and device, storage medium and terminal equipment
CN119536596A
Visual control method for simulation test process
CN119862686A
Modular volume rendering using visual programming
US20080136817A1
Visual programming control apparatus, programming-controlled device and control method therefor, computer-readable storage medium, and programming control system
US20210208852A1
