Swim lane map layout optimization method and device of strong constraint relation data and storage medium

By classifying and position calculations of active nodes and swim lanes, the layout problem of swim lane diagram in the loop situation is solved, and a reasonable layout that is easy to understand is generated.

CN120372054APending Publication Date: 2025-07-25SHAANXI FAST AUTO DRIVE GRP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510351871.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-24
Publication Date
2025-07-25

AI Technical Summary

Technical Problem

The existing lane graph generation method is difficult to meet the layout constraints when multiple active nodes form loops, resulting in unreasonable and difficult to understand.

Method used

Active nodes are divided into independent and non-independent, and swim lanes are divided into independent and ordinary categories. The position information of nodes and swim lanes is calculated through Graphviz, and standardized and sorted. Combined with AntvX6 display, a swim lane diagram that conforms to the strong constraint relationship is generated.

Benefits of technology

The generated swim lane diagram is layout reasonably and meets strict layout constraints, which improves the quality and generation efficiency of swim lane diagrams.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120372054A_ABST
    Figure CN120372054A_ABST
Patent Text Reader

Abstract

The invention discloses a swimming lane map layout optimization method and device of strong constraint relation data and a storage medium, and the method comprises the steps: 1, carrying out the classification and statistics of active nodes based on the upstream and downstream information of the active nodes and swimming lane information; step 2, obtaining position coordinates of each non-independent active node and a common lane; 3, standardizing the positions of all the non-independent active nodes; 4, sorting the positions of the common lanes; step 5, calculating position information of common lanes and non-independent active nodes thereof in the common lane array; 6, calculating the position of an independent active node of the common lane; and 7, calculating the positions of the independent lanes and the independent nodes thereof. According to the method, on the basis of the output of the Graphviz, strict layout constraints of the lane map are tightly combined, the lane map which is reasonable in layout, easy to understand and conforms to the strong constraint relation is generated through optimization processing, and the quality and the generation efficiency of the lane map are effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of data processing, and relates to a method, device and storage medium for optimizing the swimlane diagram layout of strongly constrained relationship data. Background Art

[0002] With the increasing complexity of business processes, the swimlane diagram, as an efficient visualization tool, has been widely used in business process modeling. It clearly shows the responsibilities and interaction relationships of each role in the process by assigning the activities in the process to different roles. When laying out the swimlane diagram, there are the following constraint relationships: Roles are abstracted as swimlanes. A role can be responsible for one or more activities, and all activities participated by the role must be in the same swimlane; To maintain visual clarity and intuitiveness, each swimlane must occupy a separate line and can only appear once in the entire swimlane diagram; An activity can be either an independent activity that exists independently or a non-independent activity associated with an unfixed number of upstream and downstream activities. An activity has at most one role; To ensure the clear presentation of the process logic, the upstream activity of an activity should be in front of it, and the downstream activity should be behind it; To avoid unnecessary intersections of the connections between activities and activities being penetrated by lines, independent activities should be behind non-independent activities.

[0003] Currently, the generation methods of swimlane diagrams are mainly divided into two categories: manual drawing and dynamic automatic layout. The manual drawing method is not only time-consuming and laborious, but also extremely error-prone when dealing with a large number of activity nodes and complex processes, and it is difficult to ensure the aesthetics and consistency of the layout. In the case of multiple activity nodes forming a loop, the existing dynamic automatic layout algorithms have not yet properly solved the problem of activity node layout. Although Graphviz, as an open-source visualization tool, can be widely used in the visualization of various graphic structures, its spatial position constraints are relatively loose, and it is difficult to generate a swimlane diagram that meets specific constraint conditions.

[0004] In summary, there is an urgent need to design a swimlane diagram generation method that can not only meet the layout constraint conditions but also effectively solve the loop problem. Summary of the Invention

[0005] The present invention aims to design a method for optimizing the swimlane diagram layout of strongly constrained relationship data to solve the problem of automatic layout of swimlane diagrams in the case of strong constraint relationships and multiple activity nodes forming a loop.

[0006] In the present invention, the active nodes are divided into two types: independent active nodes and non-independent active nodes. If there is no upstream or downstream relationship between the active node and other active nodes, it is an independent active node. Conversely, it is a non-independent active node. The swimlanes are divided into independent swimlanes and ordinary swimlanes. If all the active nodes in a swimlane are independent active nodes, then the swimlane is an independent swimlane; conversely, it is an ordinary swimlane. In the present invention, the active nodes without swimlane information are processed as being located in an empty swimlane.

[0007] In this invention, first, the data is preprocessed to count the information of independent and non-independent active nodes in ordinary swimlanes and the information of independent active nodes in independent swimlanes. Then, the non-independent active nodes in ordinary swimlanes are used to calculate the position information of each active node and the swimlane by means of Graphviz, and the position information is standardized. Next, each ordinary swimlane is adjusted to ensure that each ordinary swimlane is an independent row. On this basis, the coordinates of the non-independent nodes in each ordinary swimlane are recalculated. Then, the coordinates of the independent nodes in ordinary swimlanes are calculated, and the independent nodes are appended after the non-independent nodes. Finally, the position of the independent swimlane and the position information of its independent active nodes are calculated to reasonably arrange the positions of the swimlanes and nodes, achieving the goal of optimizing the overall layout. Finally, the position information of the active nodes and swimlanes and the information of the edges are passed to the front end and displayed using AntvX6 to generate a swimlane diagram with a reasonable layout and easy to understand.

[0008] To achieve the above object, the present invention adopts the following technical solutions to solve the problem:

[0009] A method for optimizing the layout of a swimlane diagram of strongly constrained relationship data, specifically including the following steps:

[0010] Step 1, based on the upstream and downstream information and swimlane information of the active nodes, classify and count the active nodes;

[0011] Specifically, the active nodes in the business process are divided into two types: independent active nodes and non-independent active nodes; the swimlanes are divided into independent swimlanes and ordinary swimlanes; the active nodes without swimlane information are processed as being located in an empty swimlane; count the information of independent and non-independent active nodes in ordinary swimlanes and the information of independent active nodes in independent swimlanes;

[0012] Step 2: Organize the information of non - independent activity nodes in all ordinary lanes into a specific class DiagramData containing activity nodes, lanes, and edge attributes, generate a dot file from the specific class DiagramData; call Graphviz to run the dot file to generate a json file containing position information; deserialize the json file into a class, and parse the fields in this class to obtain the position coordinate information of each non - independent activity node and ordinary lane calculated by Graphviz.

[0013] Step 3: Standardize the position information of non - independent activity nodes in all ordinary lanes obtained in Step 2.

[0014] Step 4: Sort the position information of ordinary lanes obtained in Step 2, adjust the positions of ordinary lanes according to the sorting, and save the adjusted ordinary lanes in an ordinary lane array.

[0015] Step 5: Calculate the position information of ordinary lanes and their non - independent activity nodes in the ordinary lane array obtained in Step 4.

[0016] Step 6: Calculate the positions of independent activity nodes in ordinary lanes.

[0017] Step 7: Calculate the ori and depth of independent lanes and the positions of their independent nodes.

[0018] Further, in Step 1, the independent activity node means that there is no upstream - downstream relationship between this activity node and other activity nodes, and the rest of the activity nodes are non - independent activity nodes.

[0019] The independent lane means that all activity nodes in this lane are independent activity nodes, and other lanes are ordinary lanes.

[0020] The information of the activity node includes node id, node name, the id of the node's parent node, and the lane information of the node.

[0021] Further, in Step 3, standardizing the x - coordinate of the activity node means putting the x - coordinates of all non - independent activity nodes in all ordinary lanes obtained in Step 2 into a set, converting it into an array, sorting it in ascending order, and establishing the corresponding relationship between the coordinate position and the array subscript, that is, converting the absolute position into a relative position; putting the y - coordinates of all non - independent activity nodes in all ordinary lanes into a set, converting it into an array, sorting it in descending order, and establishing the corresponding relationship between the coordinate position and the array subscript, that is, converting the y - coordinate from the absolute position into a relative position.

[0022] Further, in Step 4, specifically, first sort in descending order according to the y - coordinate of the position information of the ordinary lane, and then sort in ascending order according to the x - coordinate. This order is the order of each lane from top to bottom.

[0023] Further, step 5 specifically includes the following sub-steps:

[0024] Step 51: Traverse the ordinary lane array obtained in step 4, take the first ordinary lane as the current ordinary lane, use ori to represent the y coordinate of the upper left corner of the ordinary lane, and set the ori of the first ordinary lane to 0;

[0025] Step 52: Count the number of types of y coordinates of non-independent activities in the current ordinary lane (for example: there are three nodes in lane 1, the y coordinate of node A is 1, the y coordinate of node B is 1, and the y coordinate of node c is 3, then the number of types of y coordinates in lane 1 is 2), which is used as the depth depth of the current ordinary lane; use the same method as normalizing the y coordinate in step 3 to calculate the y coordinate of the non-independent activities in the current ordinary lane relative to the current ordinary lane, and then offset it on the ori of the current ordinary lane. Take ori + y as the y coordinate of the non-independent activity node relative to the entire lane graph. The x coordinate of the non-independent activity node directly uses the normalized x coordinate obtained in step 3, and record the maximum value Xmax of the x coordinates of all non-independent activity nodes in the current ordinary lane.

[0026] Step 53: After obtaining the ori and depth of the current ordinary lane, take ori + depth as the starting point of the next ordinary lane, and take the next ordinary lane as the current ordinary lane;

[0027] Step 54: Repeat steps 52 and 53 to calculate the depth and ori of each ordinary lane, as well as the position information of its non-independent activity nodes, and record the maximum value Xmax corresponding to each ordinary lane.

[0028] Further, the specific operation of step 6 is as follows: Traverse the ordinary lanes, and append the independent activity nodes of the ordinary lanes behind the non-independent activity nodes of the ordinary lanes. Specifically, traverse the independent activity nodes of the ordinary lanes, and sequentially set the x coordinate of each independent activity node to Xmax + 1 of the ordinary lane, and the y coordinate to ori + 1 of the ordinary lane. After calculating each independent activity node of the ordinary lane, increment Xmax of the ordinary lane by 1 and update the Xmax attribute of the ordinary lane.

[0029] Further, the specific operations in step 7 are as follows: Traverse the independent lanes, append the independent lanes below the ordinary lanes, and the depth of each independent lane is 1, with the initial value of Xmax being 0. Specifically: the ori of the first independent lane is equal to the ori of the last ordinary lane + depth, and the ori of subsequent independent lanes is the ori of the previous independent lane + the depth of the current independent lane; Traverse the independent activity nodes in the independent lanes, the x coordinate of the independent activity node is equal to the Xmax of the independent lane + 1, and the y coordinate is equal to the ori of the independent lane + 1. For each calculated position of an independent activity node, make Xmax of the independent lane + 1 and update the Xmax value of the independent lane.

[0030] In a second aspect, the present invention also provides a swimlane graph layout optimization system for strongly constrained relationship data, specifically including the following modules:

[0031] The classification and statistics module is used to classify and count the activity nodes based on the upstream and downstream information and lane information of the activity nodes. Specifically, the activity nodes in the business process are divided into two types: independent activity nodes and non-independent activity nodes; the lanes are divided into independent lanes and ordinary lanes; the activity nodes without lane information are processed as being located in an empty lane; count the information of independent activity nodes and non-independent activity nodes in the ordinary lanes, and count the information of independent activity nodes in the independent lanes;

[0032] The position coordinate calculation module is used to organize the information of non-independent activity nodes in all ordinary lanes into a specific class DiagramData containing activity nodes, lanes, and edge attributes, generate a dot file from the specific class DiagramData; call Graphviz to run the dot file to generate a json file containing position information; deserialize the json file into a class, parse the fields in the class, and obtain the position coordinate information of each non-independent activity node and ordinary lane calculated by Graphviz;

[0033] The information standardization module is used to standardize the position information of non-independent activity nodes in all ordinary lanes obtained by the position coordinate calculation module;

[0034] The sorting module is used to sort the position information of the ordinary lanes obtained by the position coordinate calculation module, adjust the positions of the ordinary lanes according to the sorting, and save the adjusted ordinary lanes in the ordinary lane array;

[0035] The ordinary lane and its non-independent activity node position module is used to calculate the position information of the ordinary lanes and their non-independent activity nodes in the ordinary lane array obtained by the sorting module;

[0036] The independent activity node position module of the ordinary lane is used to calculate the positions of the independent activity nodes of the ordinary lane;

[0037] An independent lane position module for calculating the ori and depth of an independent lane and the positions of its independent nodes.

[0038] In a third aspect, the present invention further provides an electronic device, characterized in that the electronic device includes:

[0039] A memory for storing executable instructions;

[0040] A processor, when executing the executable instructions or computer programs stored in the memory, implements the method according to any one of claims 1 to 7.

[0041] In a fourth aspect, the present invention provides a computer-readable storage medium storing executable instructions or computer programs, and when the executable instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.

[0042] Compared with the prior art, the present invention has the following technical effects:

[0043] In summary, the method of the present invention is based on the output of Graphviz, closely combines the strict layout constraints of the lane diagram, and through optimization processing, generates a lane diagram with reasonable layout and easy to understand that conforms to strong constraint relationships, effectively improving the quality and generation efficiency of the lane diagram. Description of the Drawings

[0044] Figure 1 It is a flowchart of the lane diagram layout optimization method for strong constraint relationship data of the present invention;

[0045] Figure 2 It is a lane diagram calculated by Graphviz;

[0046] Figure 3 It is the lane diagram optimized by the method of the present invention.

[0047] The present invention will be further explained and illustrated below in conjunction with the drawings and specific embodiments. Specific Embodiments

[0048] As Figure 1 shown, the lane diagram layout optimization method for strong constraint relationship data given by the present invention specifically includes the following steps:

[0049] Step 1, classify and count the active nodes based on the upstream and downstream information and lane information of the active nodes.

[0050] Specifically, the activity nodes in the business process are divided into two types: independent activity nodes and non-independent activity nodes. Among them, an independent activity node means that there is no upstream or downstream relationship between this activity node and other activity nodes, and the remaining activity nodes are non-independent activity nodes; the swimlanes are divided into independent swimlanes and ordinary swimlanes. Among them, an independent swimlane means that all the activity nodes in this swimlane are independent activity nodes, and the other swimlanes are ordinary swimlanes. The activity nodes without swimlane information are processed as being located in an empty swimlane.

[0051] Statistical information of independent activity nodes and non-independent activity nodes in ordinary swimlanes, and statistical information of independent activity nodes in independent swimlanes. The information of activity nodes includes node id, node name, the id of the parent node of the node, and the swimlane information of the node.

[0052] Step 2: Organize the information of non-independent activity nodes in all ordinary swimlanes into a specific class DiagramData containing activity nodes, swimlanes, and edge attributes, and generate a dot file from the specific class DiagramData; call Graphviz to run the dot file to generate a json file containing position information; deserialize the json file into a class and parse the fields in this class to obtain the position coordinate information of each non-independent activity node and ordinary swimlane calculated by Graphviz.

[0053] Specifically, the dot file defines that the shapes of activity nodes and swimlanes are boxes, and the position coordinate information calculated by Graphviz contains the coordinate information of the four vertices of each activity node and ordinary swimlane. Since the size of the activity node is determined by the size defined by the user, and the size of the ordinary swimlane is determined by the number of activity nodes in the ordinary swimlane and the size of the activity nodes, therefore, it is not necessary to count the complete four-vertex coordinate information, and only the position coordinate information of the upper left corner of the non-independent activity node and the ordinary swimlane needs to be counted to obtain the relative positions of the non-independent activity node and the ordinary swimlane calculated by Graphviz.

[0054] Step 3: Standardize the position information of non-independent activity nodes in all ordinary swimlanes obtained in Step 2.

[0055] Specifically, standardizing the x coordinate of the activity node means putting the x coordinates of all non-independent activity nodes in all ordinary swimlanes obtained in Step 2 into a set, converting it into an array, and sorting it in ascending order to establish the corresponding relationship between the coordinate position and the array subscript, that is, converting the absolute position into a relative position; since in Graphviz, the y coordinate is upward, which is opposite to the coordinate in AntvX6, therefore, putting the y coordinates of all non-independent activity nodes in all ordinary swimlanes into a set, converting it into an array, and sorting it in descending order to establish the corresponding relationship between the coordinate position and the array subscript, that is, converting the y coordinate from the absolute position into a relative position.

[0056] Step 4: Sort the position information of the ordinary lanes obtained in Step 2, adjust the positions of the ordinary lanes according to the sorting, and save the adjusted ordinary lanes in the ordinary lane array.

[0057] Specifically, first sort in descending order according to the y-coordinate of the position information of the ordinary lanes, and then sort in ascending order according to the x-coordinate. This order is the order of each lane from top to bottom.

[0058] Since there is a situation where two lanes are in the same row in the lane results generated by Graphviz, such sorting can not only ensure that each lane occupies an independent row, but also retain the relative position relationship of the nodes calculated by Graphviz, and can minimize the cross connections between active nodes to the greatest extent.

[0059] Step 5: Calculate the position information of the ordinary lanes and their non-independent active nodes in the ordinary lane array obtained in Step 4. Specifically, it includes the following sub-steps:

[0060] Step 51: Traverse the ordinary lane array obtained in Step 4, take the first ordinary lane as the current ordinary lane, use ori to represent the y-coordinate of the upper left corner of the ordinary lane, and set the ori of the first ordinary lane to 0;

[0061] Step 52: Count the number of types of y-coordinates of non-independent activities in the current ordinary lane (for example: there are three nodes in lane 1, the y-coordinate of node A is 1, the y-coordinate of node B is 1, and the y-coordinate of node c is 3, then the number of types of y-coordinates in lane 1 is 2), which is used as the depth depth of the current ordinary lane; use the same method as standardizing the y-coordinate in Step 3 to calculate the y-coordinate of the non-independent activity in the current ordinary lane relative to the current ordinary lane (that is, convert the y-coordinate from the absolute position to the relative position), and then offset it on the ori of the current ordinary lane, and use ori + y as the y-coordinate of the non-independent activity node relative to the entire lane graph. The x-coordinate of the non-independent activity node directly uses the standardized x-coordinate obtained in Step 3, and record the maximum value Xmax of the x-coordinates of all non-independent activity nodes in the current ordinary lane.

[0062] Step 53: After obtaining the ori and depth of the current ordinary lane, use ori + depth as the starting point of the next ordinary lane, and take the next ordinary lane as the current ordinary lane;

[0063] Step 54: Repeat Steps 52 and 53 to calculate the depth and ori of each ordinary lane, as well as the position information of its non-independent activity nodes, and record the maximum value Xmax corresponding to each ordinary lane.

[0064] Step 6: Calculate the positions of the independent activity nodes in the ordinary swimlanes.

[0065] The specific operations are as follows: Traverse the ordinary swimlanes, and append the independent activity nodes of the ordinary swimlanes behind the non-independent activity nodes of the corresponding ordinary swimlanes. Specifically, traverse the independent activity nodes of the ordinary swimlane, and set the x-coordinate of each independent activity node to Xmax + 1 of the ordinary swimlane in sequence, and the y-coordinate to ori + 1 of the ordinary swimlane. After calculating each independent activity node of the ordinary swimlane, increment Xmax of the ordinary swimlane by 1 and update the Xmax attribute of the ordinary swimlane.

[0066] Step 7: Calculate the ori and depth of the independent swimlanes and the positions of their independent nodes.

[0067] The specific operations are as follows: Traverse the independent swimlanes, append the independent swimlanes below the ordinary swimlanes, and the depth of each independent swimlane is 1, and the initial value of Xmax is 0. Specifically, the ori of the first independent swimlane is equal to ori + depth of the last ordinary swimlane, and the ori of the subsequent independent swimlanes is ori of the previous independent swimlane + depth of the current independent swimlane (fixed at 1). Traverse the independent activity nodes in the independent swimlanes. The x-coordinate of the independent activity node is equal to Xmax + 1 of the independent swimlane, and the y-coordinate is equal to ori + 1 of the independent swimlane. After calculating the position of each independent activity node, increment Xmax of the independent swimlane by 1 and update the Xmax value of the independent swimlane.

[0068] Embodiment

[0069] To verify the feasibility and effectiveness of the present invention, the following embodiments are given.

[0070] It is known that there is information on five activity nodes. The upstream node of activity node A is C, and the swimlane information is Swinlane1; the upstream node of activity node B is A, and the swimlane information is Swinlane2; the upstream node of activity node C is B, and the swimlane information is Swinlane3; activity node D has no upstream and swimlane information; activity node E has no upstream information, and the swimlane information is Swinlane2.

[0071] (1) The obtained ordinary swimlanes are Swinlane1, Swinlane2, and Swinlane3, and the independent swimlane is an empty swimlane. Swimlane Swinlane1 has a non-independent activity node A, swimlane Swinlane2 has non-independent activity nodes B and an independent activity node E, swimlane Swinlane3 has a non-independent activity node C, and the empty swimlane has an independent activity node D.

[0072] (2) Generate a dot file for the non - independent activity node information of the ordinary swimlane and run Graphviz. The node attributes of DiagramData are A, B, and C; the edge attributes are (A, B), (B, C), (C, A); the swimlane information is that Swinlane1 has node A, Swinlane2 has node B, and Swinlane3 has node C. Generate a dot file with this information, call the dot file using Graphviz, and generate a json file containing position information. The parsed node position information is A(16, 16), B(106, 39), C(196, 16), and the parsed swimlane position information is Swinlane1(8, 8), Swinlane2(98, 31), Swinlane3(188, 8).

[0073] (3) Normalize the position information of the non - independent activity nodes in the ordinary swimlane. When the x - coordinates of the non - independent activity nodes are placed in a set and converted to an array and sorted in ascending order, it is [16, 106, 196]. After establishing the correspondence between the x - coordinate positions and the array sub - scripts, the original x - coordinate is 16 and the new x - coordinate is 1; the original x - coordinate is 106 and the new x - coordinate is 2; the original x - coordinate is 196 and the new x - coordinate is 3. When the y - coordinates of the non - independent activity nodes are placed in a set and converted to an array and sorted in descending order, it is [39, 16]. After establishing the correspondence between the y - coordinate positions and the array sub - scripts, the original y - coordinate is 39 and the new y - coordinate is 1; the original y - coordinate is 16 and the new x - coordinate is 2. The normalized node position information is A(1, 2), B(2, 1), C(3, 2);

[0074] (4) Adjust the positions of the ordinary swimlanes. First, sort the position information of the ordinary swimlanes. First, sort in reverse order according to the y - coordinate, and then sort in ascending order according to the x - coordinate. This order is the order of each swimlane from top to bottom. The sorted order of the swimlanes is Swinlane2, Swinlane1, and Swinlane3.

[0075] (5) Calculate the position information of ordinary swimlanes and their non-independent activity nodes. Traverse the sorted array of ordinary swimlanes. The starting point ori of the first swimlane Swinlane2 is 0, and the number of types of y-coordinates of the non-independent activities in this swimlane is 1. So the depth of Swinlane2 is 1. Traverse the list of non-independent activities in Swinlane2, and standardize the y-coordinates of the non-independent activities. That is, first put all the y-coordinates in a set, convert them to an array and sort them in ascending order, then establish the correspondence between the original coordinates and the array subscripts. The y-coordinate of node B after standardization is 1. The calculated y-coordinate is relative to the coordinates of the swimlane where it is located. To obtain the coordinates relative to the entire swimlane graph, the calculated y-coordinate needs to be added with the ori of the swimlane. The coordinates of B are obtained as (2, 1). The starting point of the second swimlane Swinlane1 is the ori + depth of the first swimlane, so ori is 1. The number of types of y-coordinates of the non-independent activities in this swimlane is 1. So the depth of Swinlane1 is 1. Traverse the list of non-independent activities in Swinlane1, and standardize the y-coordinates of the non-independent activities. The y-coordinate of node A after standardization is 1. The calculated y-coordinate is relative to the coordinates of the swimlane where it is located. To obtain the coordinates relative to the entire graph, the calculated y-coordinate needs to be added with the ori of the swimlane. The coordinates of node A are obtained as (1, 2). Similarly, the ori of Swinlane3 can be calculated as 2, the depth is 1, and the coordinates of node C are (3, 3). During the calculation process, count the maximum x-coordinate Xmax of each swimlane. The Xmax of Swinlane1 is 1, the Xmax of Swinlane2 is 2, and the Xmax of Swinlane3 is 3.

[0076] (6) Traverse the independent nodes of the ordinary swimlanes, and append the independent nodes of the swimlanes behind the non-independent nodes. The x-coordinate of the first independent node of the swimlane takes Xmax + 1, and the y-value takes ori + 1. The x-coordinate of the second node is the x-coordinate of the first independent node + 1, and the y-value takes ori + 1. Calculate the position information of the independent nodes in each swimlane in turn. Swinlane2 has an independent node E. The Xmax of Swinlane2 is 2, and the starting point ori of Swinlane2 is 0. So the coordinates of E are (1, 3).

[0077] (7) Calculate the ori and depth of the independent lanes and append the independent lanes below the normal lanes. In this example, the independent lanes are empty lanes. Obtain the maximum ori and depth in the normal lanes. ori + depth is the ori of the first independent lane, and the depth of all independent lanes is 1. It can be calculated that the ori of the empty lane is 3 and the depth is 1. In the independent lanes, Xmax = 0, the independent activity x coordinate is Xmax + 1, and the y coordinate is ori + 1. Traverse the activities in the independent lanes and calculate the x coordinate of each activity in turn. The coordinates of node D can be obtained as (1, 4).

[0078] Transmit the calculated position information to the front end for display based on antvX6. The result generated using Graphviz is as Figure 2 shown, and the result obtained using the method of the present invention is shown as Figure 3 shown. It can be seen that the method proposed by the present invention is based on the output of Graphviz and closely combines the strict layout constraints of the lane diagram. It not only solves the problem of the layout of active nodes when nodes form loops, but also makes each lane occupy a separate line, and the independent nodes are located behind the non-independent nodes, making the spatial layout of the generated lane diagram more reasonable and easier to understand.

Claims

1. A method for optimizing the swimlane diagram layout of strongly constrained relational data, characterized in that, Specifically, the following steps are included: Step 1: Classify and count the activity nodes based on the upstream and downstream information and lane information of the activity nodes; Specifically, the activity nodes in the business process are divided into two types: independent activity nodes and non-independent activity nodes; the lanes are divided into independent lanes and ordinary lanes; the activity nodes without lane information are processed as being located in an empty lane; Count the information of the independent activity nodes and non-independent activity nodes in the ordinary lanes, and count the information of the independent activity nodes in the independent lanes; Step 2: Organize the information of all non-independent activity nodes in the ordinary lanes into a specific class DiagramData containing activity nodes, lanes, and edge attributes, and generate a dot file from the specific class DiagramData; call Graphviz to run the dot file to generate a json file containing position information; Deserialize the json file into a class, parse the fields in the class to obtain the position coordinate information of each non-independent activity node and ordinary lane calculated by Graphviz; Step 3: Standardize the position information of all non-independent activity nodes in the ordinary lanes obtained in Step 2; Step 4: Sort the position information of the ordinary lanes obtained in Step 2, adjust the positions of the ordinary lanes according to the sorting, and save the adjusted ordinary lanes in an ordinary lane array; Step 5: Calculate the position information of the ordinary lanes and their non-independent activity nodes in the ordinary lane array obtained in Step 4; Step 6: Calculate the position of the independent activity nodes in the ordinary lanes; Step 7: Calculate the ori and depth of the independent lanes and the positions of their independent nodes.

2. The swimlane diagram layout optimization method for strongly constrained relationship data according to claim 1, wherein In Step 1, the independent activity node refers to an activity node that has no upstream and downstream relationship with other activity nodes, and the remaining activity nodes other than this are non-independent activity nodes; The independent lane refers to a lane in which all activity nodes are independent activity nodes, and other lanes other than this are ordinary lanes; The information of the activity node includes the node id, node name, id of the parent node of the node, and lane information of the node.

3. The swimlane diagram layout optimization method for strongly constrained relationship data according to claim 3, characterized in that, In Step 3, standardizing the x coordinate of the activity node means putting the x coordinates of all non-independent activity nodes in all ordinary lanes obtained in Step 2 into a set, converting them into an array, sorting them in ascending order, and establishing the corresponding relationship between the coordinate position and the array subscript, that is, converting the absolute position into a relative position; putting the y coordinates of all non-independent activity nodes in all ordinary lanes into a set, converting them into an array, and sorting them in descending order, and establishing the corresponding relationship between the coordinate position and the array subscript, that is, converting the y coordinate from the absolute position into a relative position.

4. The swimlane diagram layout optimization method for strongly constrained relationship data according to claim 4, characterized in that, In Step 4, specifically, first sort in descending order according to the y coordinate of the position information of the ordinary lanes, and then sort in ascending order according to the x coordinate, and this order is the order of each lane from top to bottom.

5. The swimlane diagram layout optimization method for strongly constrained relationship data according to claim 5, characterized in that Step 5 specifically includes the following sub-steps: Step 51: Traverse the ordinary lane array obtained in Step 4, take the first ordinary lane as the current ordinary lane, use ori to represent the y coordinate of the upper left corner of the ordinary lane, and set the ori of the first ordinary lane to 0; Step 52: Count the number of types of the y - coordinates of non - independent activities in the current ordinary lane (for example: there are three nodes in Lane 1, the y - coordinate of Node A is 1, the y - coordinate of Node B is 1, and the y - coordinate of Node C is 3, then the number of types of y - coordinates in Lane 1 is 2), which is used as the depth depth of the current ordinary lane; use the same method as normalizing the y - coordinate in Step 3 to calculate the y - coordinate of the non - independent activities in the current ordinary lane relative to the current ordinary lane, and then offset it on the ori of the current ordinary lane. Take ori + y as the y - coordinate of the non - independent activity node relative to the entire lane graph. The x - coordinate of the non - independent activity node directly uses the normalized x - coordinate obtained in Step 3, and record the maximum value Xmax of the x - coordinates of all non - independent activity nodes in the current ordinary lane. Step 53: After obtaining the ori and depth of the current ordinary lane, take ori + depth as the starting point of the next ordinary lane, and use the next ordinary lane as the current ordinary lane. Step 54: Repeat Steps 52 and 53 to calculate the depth and ori of each ordinary lane, as well as the position information of its non - independent activity nodes, and record the maximum value Xmax corresponding to each ordinary lane.

6. The swimlane diagram layout optimization method for strongly constrained relationship data according to claim 6, wherein, The specific operations of Step 6 are as follows: Traverse the ordinary lanes, and append the independent activity nodes of the ordinary lane behind the non - independent activity nodes of the ordinary lane. Specifically, traverse the independent activity nodes of the ordinary lane, and sequentially set the x - coordinate of each independent activity node to Xmax + 1 of the ordinary lane, and the y - coordinate to ori + 1 of the ordinary lane. After calculating each independent activity node of the ordinary lane, increment Xmax of the ordinary lane by 1 and update the Xmax attribute of the ordinary lane.

7. The swimlane diagram layout optimization method for strongly constrained relationship data according to claim 7, characterized in that The specific operations of Step 7 are as follows: Traverse the independent lanes, and append the independent lanes below the ordinary lanes, and the depth of each independent lane is 1, and the initial value of Xmax is 0; specifically: the ori of the first independent lane is equal to ori + depth of the last ordinary lane, and the ori of the subsequent independent lanes is ori of the previous independent lane+depth of the current independent lane; traverse the independent activity nodes in the independent lane, the x - coordinate of the independent activity node is equal to Xmax + 1 of the independent lane, and the y - coordinate is equal to ori + 1 of the independent lane. After calculating the position of each independent activity node, increment Xmax of the independent lane by 1 and update the Xmax value of the independent lane.

8. A swimlane diagram layout optimization system for strongly constrained relational data, characterized in that, Specifically, it includes the following modules: The classification and statistics module is used to classify and count the activity nodes based on the upstream and downstream information and lane information of the activity nodes; specifically, the activity nodes in the business process are divided into two types: independent activity nodes and non - independent activity nodes; the lanes are divided into independent lanes and ordinary lanes; the activity nodes without lane information are processed as being located in an empty lane. Statistical information of the independent activity nodes and non - independent activity nodes in the ordinary lanes, and statistical information of the independent activity nodes in the independent lanes. A position coordinate calculation module, which is used to organize the information of non-independent activity nodes in all ordinary lanes into a specific class DiagramData containing activity nodes, lanes, and edge attributes, generate a dot file from the specific class DiagramData; call Graphviz to run the dot file to generate a json file containing position information; Deserialize the json file into a class, parse the fields in the class to obtain the position coordinate information of each non-independent activity node and ordinary lane calculated by Graphviz; An information standardization module, which is used to standardize the position information of non-independent activity nodes in all ordinary lanes obtained by the position coordinate calculation module; A sorting module, which is used to sort the position information of ordinary lanes obtained by the position coordinate calculation module, adjust the positions of ordinary lanes according to the sorting, and save the adjusted ordinary lanes in an ordinary lane array; An ordinary lane and its non-independent activity node position module, which is used to calculate the position information of ordinary lanes and their non-independent activity nodes in the ordinary lane array obtained by the sorting module; An independent activity node position module for ordinary lanes, which is used to calculate the positions of independent activity nodes of ordinary lanes; An independent lane position module, which is used to calculate the ori and depth of independent lanes and the positions of their independent nodes.

9. An electronic device, characterized in that, The electronic device includes: A memory, which is used to store executable instructions; A processor, which is used to implement the method according to any one of claims 1 to 7 when executing the executable instructions or computer programs stored in the memory.

10. A computer-readable storage medium storing executable instructions or a computer program, characterized in that, The executable instructions, when executed by the processor, implement the method according to any one of claims 1 to 7.