Layout method, device and equipment of flowchart and storage medium

By automatically filtering and laying out valid nodes in the flowchart, and utilizing layering and spacing information, the problem of high layout difficulty caused by a large number of flowchart nodes is solved, achieving a more efficient flowchart layout.

CN115756435BActive Publication Date: 2026-03-31AGRICULTURAL BANK OF CHINA
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-29
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

In existing technologies, when the number of flowchart nodes is large, the layout becomes difficult, leading to low efficiency.

Method used

By acquiring node and edge information from the flowchart, valid nodes are filtered out, and automatic layout is performed using layer and spacing information, reducing manual operations.

Benefits of technology

It improves the efficiency of flowchart layout, reduces the number of steps to manually drag nodes, and enhances the accuracy and efficiency of layout.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115756435B_ABST
    Figure CN115756435B_ABST
Patent Text Reader

Abstract

The application provides a layout method, device and equipment of a flowchart and a storage medium. It relates to the technical field of Internet. The method comprises the following steps: obtaining data information of a flowchart to be laid out, the data information comprising node information of multiple nodes and edge information of multiple edges; selecting a first node set from the multiple nodes based on the node information of the multiple nodes and the edge information of the multiple edges, the first node set comprising multiple effective nodes; determining layout information of the multiple effective nodes, the layout information comprising hierarchical information and spacing information of the multiple effective nodes; and laying out the multiple effective nodes based on the hierarchical information and the spacing information of the multiple effective nodes to complete the layout of the flowchart. When the flowchart is laid out, only the node information of the multiple nodes and the edge information of the multiple edges need to be obtained, and manual dragging of the flowchart nodes is not required, thereby improving the layout efficiency of the flowchart.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of Internet technology, and in particular to a flowchart layout method, apparatus, device and storage medium. Background Technology

[0002] With the development of internet technology, low-code visual programming is being used more and more in the software development process. When developing software using low-code visual programming, flowcharts need to be laid out to implement the software's business logic.

[0003] In existing technologies, business developers manually drag and drop flowchart nodes to achieve the logical layout of the flowchart. First, multiple functional business components corresponding to the software are identified. Then, these functional business components are mapped to multiple flowchart nodes. Finally, business developers manually drag and drop the flowchart nodes to complete the logical layout of the flowchart.

[0004] However, the inventors have found that the existing technology has at least the following technical problems: when there are many flowchart nodes, multiple nodes may visually overlap, which increases the difficulty of flowchart layout. Therefore, the efficiency of business developers manually laying out flowcharts is low. Summary of the Invention

[0005] This application provides a flowchart layout method, apparatus, device, and storage medium that can improve the layout efficiency of flowcharts.

[0006] Firstly, this application provides a flowchart layout method, including:

[0007] Obtain the data information of the flowchart to be laid out, the data information including node information of multiple nodes and edge information of multiple edges;

[0008] Based on the node information of the plurality of nodes and the edge information of the plurality of edges, a first node set is selected from the plurality of nodes. The first node set includes a plurality of valid nodes, wherein each valid node is a node connected to at least one other node.

[0009] Determine the layout information of the plurality of valid nodes, wherein the layout information includes the layer information and spacing information of the plurality of valid nodes;

[0010] Based on the hierarchical and spacing information of the multiple valid nodes, the multiple valid nodes are laid out to complete the layout of the flowchart.

[0011] In one possible design, selecting a first node set from the plurality of nodes based on the node information of the plurality of nodes and the edge information of the plurality of edges includes:

[0012] Based on the node information of the multiple nodes and the edge information of the multiple edges, a depth-first traversal is performed starting from the initial node to obtain multiple connection paths;

[0013] Select multiple valid nodes located on the multiple connection paths from the multiple nodes to obtain the first node set.

[0014] In one possible design, the node information includes node identifier and port identifier, and the edge information includes edge identifier, node identifier and port identifier at the edge input end, and node identifier and port identifier at the edge output end.

[0015] Based on the node information of the multiple nodes and the edge information of the multiple edges, a depth-first traversal is performed starting from the initial node to obtain multiple connection paths, including:

[0016] Based on the node identifier and port identifier of the initial node, the edge identifier of the plurality of edges, and the node identifier and port identifier of the edge input end, select a plurality of first target edges that are connected to the initial node from the plurality of edges;

[0017] For each first target edge, the first node connected to the first target edge is determined based on the node identifier and port identifier of the edge output end of the first target edge;

[0018] Continue to determine at least one second target edge connected to the first node until the second node connected to the second target edge is the end node, thus obtaining multiple connection paths corresponding to the multiple first target edges.

[0019] In one possible design, determining the layout information of the plurality of valid nodes includes:

[0020] Based on the node information of the multiple valid nodes and the edge information of the multiple edges, a breadth-first traversal is performed starting from the initial node to obtain the hierarchical information of the multiple valid nodes.

[0021] For each pair of adjacent valid nodes in each layer, determine the number of valid child nodes connected to each valid node, where each valid child node is a valid node in the layer below the valid node.

[0022] The spacing information between two adjacent valid nodes is determined based on the number of valid child nodes connected to each valid node.

[0023] In one possible design, the edge information includes edge identifiers, node identifiers and port identifiers at the edge input end, and node identifiers and port identifiers at the edge output end. The method further includes:

[0024] For each edge, based on the edge identifier, the node identifier and port identifier of the edge input end, and the node identifier and port identifier of the edge output end, determine the first valid node connected to the edge input end and the second valid node connected to the edge output end;

[0025] Based on the node information of the first valid node and the node information of the second valid node, the validity information corresponding to the edge is determined, and the validity information is used to indicate whether the edge is valid.

[0026] In one possible design, the node information includes a node identifier, an input port identifier, an output port identifier, the input data format corresponding to the input port identifier, and the output data format corresponding to the output port identifier.

[0027] The step of determining the validity information corresponding to the edge based on the node information of the first valid node and the node information of the second valid node includes:

[0028] Determine the output data format corresponding to the first target port on the first valid node and the input data format corresponding to the second target port on the second valid node, wherein the first target port is the port connected to the input end of the edge and the second target port is the port connected to the output end of the edge;

[0029] If the input data format is the same as the output data format, the edge is determined to be a valid edge; if the input data format is different from the output data format, the edge is determined to be an invalid edge.

[0030] One possible design also includes:

[0031] For each valid node, obtain the configuration information of the valid node, the configuration information including at least one basic configuration;

[0032] If at least one basic configuration is empty, or if the data format corresponding to at least one basic configuration is incorrect, then the valid node is determined to be an abnormal node.

[0033] In one possible design, the following further applies: if the plurality of nodes are empty, the flowchart data information is determined to be abnormal; or, if the plurality of edges are empty, the flowchart data information is determined to be abnormal; or, if there is no start node among the plurality of nodes, the flowchart data information is determined to be abnormal; or, if there is no end node among the plurality of nodes, the flowchart data information is determined to be abnormal.

[0034] In one possible design, the method further includes: selecting multiple invalid nodes from the plurality of nodes that are not on the plurality of connection paths to obtain a second node set.

[0035] In one possible design, before determining the layout information of the plurality of valid nodes, the method further includes: determining loop nodes among the plurality of valid nodes, the loop node including a loop edge connected to a higher-level valid node; deleting the loop edge, and establishing replica node information corresponding to the loop node.

[0036] Secondly, this application provides a flowchart layout apparatus, comprising:

[0037] The acquisition module acquires data information of the flowchart to be laid out, including node information of multiple nodes and edge information of multiple edges;

[0038] The first determining module is used to select a first node set from the plurality of nodes based on the node information of the plurality of nodes and the edge information of the plurality of edges. The first node set includes a plurality of valid nodes, and the valid nodes are nodes connected to at least one other node.

[0039] The second determining module is used to determine the layout information of the plurality of valid nodes, wherein the layout information includes the layering information and spacing information of the plurality of valid nodes;

[0040] The layout module is used to lay out the multiple valid nodes based on their hierarchical and spacing information to complete the layout of the flowchart.

[0041] Thirdly, the present invention provides an electronic device, comprising: at least one processor and a memory;

[0042] The memory stores computer-executed instructions;

[0043] The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the layout method of the flowchart as described in the first aspect above.

[0044] Fourthly, the present invention provides a computer storage medium storing computer execution instructions, wherein when a processor executes the computer execution instructions, the layout method of the flowchart described in the first aspect above is implemented.

[0045] Fifthly, this application also provides a computer program product comprising a computer program stored in a computer-readable storage medium, wherein at least one processor can read the computer program from the computer-readable storage medium, and when the at least one processor executes the computer program, it implements the layout method of the flowchart as described in the first aspect above.

[0046] The flowchart layout method, apparatus, device, and storage medium provided in this application first select valid nodes from multiple nodes using node information and edge information. Then, based on the layering and spacing information of the valid nodes, the valid nodes are laid out to complete the flowchart layout. Therefore, this application only needs to obtain node information and edge information when laying out a flowchart, eliminating the need for manually dragging flowchart nodes, reducing manual steps, and thus improving the efficiency of flowchart layout. Attached Figure Description

[0047] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0048] Figure 1 The flowchart layout method provided for the embodiments of this application Figure 1 ;

[0049] Figure 2 Layout illustration of the flowchart provided for embodiments of this application Figure 1 ;

[0050] Figure 3 The flowchart layout method provided for the embodiments of this application Figure 2 ;

[0051] Figure 4 Layout illustration of the flowchart provided for embodiments of this application Figure 2 ;

[0052] Figure 5 The flowchart layout method provided for the embodiments of this application Figure 3 ;

[0053] Figure 6 Layout illustration of the flowchart provided for embodiments of this application Figure 3 ;

[0054] Figure 7 A schematic diagram of the layout method of the flowchart provided in the embodiments of this application;

[0055] Figure 8 A schematic diagram of the layout device for the flowchart provided in this application embodiment;

[0056] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.

[0057] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0058] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0059] The collection, storage, use, processing, transmission, provision, and disclosure of image data or user data and other information involved in the technical solution of this application all comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0060] In recent years, with the development of internet technology, software applications have become integrated into all aspects of life and work, leading to an explosive growth in software development demand. To meet the demands for timely and reliable software iteration, low-code visual programming is increasingly being used in the software development process. When developing software using low-code visual programming, flowcharts are needed to implement the software's business logic.

[0061] Currently, financial services are diverse and widespread, giving rise to various software systems. Examples include ATMs, smart terminals, online banking, mobile banking, and other related service systems. Using low-code visual coding platforms, developers create business process diagrams, a common development pattern. First, multiple functional business components are identified. Then, these components are mapped to flowchart nodes. Finally, developers manually drag and drop these nodes to complete the logical layout of the flowchart. However, financial services are complex, with a large number of flowchart nodes, often resulting in complex and disorganized flowcharts. Multiple nodes may visually overlap, increasing the difficulty of layout and leading to low efficiency in flowchart design.

[0062] To address the aforementioned technical problems, this application proposes the following technical concept: First, valid nodes are selected from multiple nodes using node information and edge information. Then, based on the layering and spacing information of these valid nodes, the flowchart layout is completed. In this way, when laying out the flowchart, only node information and edge information need to be obtained, eliminating the need for manually dragging flowchart nodes. This reduces manual steps and improves the efficiency of flowchart layout.

[0063] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.

[0064] This application provides a flowchart layout method. The execution subject of the method in this application embodiment can be a computer device. Figure 1 The flowchart layout method provided for the embodiments of this application Figure 1 .like Figure 1 As shown, the layout method of this flowchart includes:

[0065] Step S101: Obtain the data information of the flowchart to be laid out. The data information includes node information of multiple nodes and edge information of multiple edges.

[0066] In this embodiment of the invention, the flowchart to be laid out is located on a canvas, and the computer device can obtain the flowchart's data information from the canvas. The flowchart includes multiple nodes and multiple edges. Each node includes at least one data input port and at least one data output port.

[0067] Optionally, the node information for multiple nodes includes node identifiers, a list of data input ports, a list of data output ports, port identifiers, port data types, and port data.

[0068] For example: Node information is as follows:

[0069]

[0070]

[0071] Optionally, the edge information of multiple edges includes edge identifier, node identifier and port identifier at the edge input end, and node identifier and port identifier at the edge output end.

[0072] It should be noted that an edge is a connection between two nodes, and edge information is the connection information.

[0073] Example: Connection information is as follows:

[0074]

[0075] Step S102: Based on the node information of multiple nodes and the edge information of multiple edges, select a first node set from the multiple nodes. The first node set includes multiple valid nodes.

[0076] In this embodiment of the invention, the multiple nodes include valid nodes and isolated nodes. Valid nodes include a start node, an end node, and nodes connected to both the start and end nodes. Isolated nodes are not connected to other nodes and are not included in the overall flowchart. The business components corresponding to isolated nodes cannot provide relevant functionality in the software project; therefore, isolated nodes are also considered invalid nodes.

[0077] In this step, by using the node information of multiple nodes and the edge information of multiple edges, multiple valid nodes can be filtered out from multiple nodes and combined into the first node set.

[0078] Step S103: Determine the layout information of multiple valid nodes. The layout information includes the layer information and spacing information of multiple valid nodes.

[0079] In this embodiment of the invention, multiple valid nodes are connected by multiple edges. Optionally, the valid node connected to the input end of an edge is a first-layer valid node, and the node connected to the output end of an edge is a second-layer valid node. The first-layer valid nodes are at a higher level than the second-layer valid nodes. For example, the first-layer valid nodes are parent nodes, and the second-layer valid nodes are child nodes.

[0080] The hierarchical information of a valid node indicates the level at which it belongs. The spacing information indicates the layout interval between two adjacent valid nodes within the same level.

[0081] like Figure 2 As shown, the layering information for valid node A (the initial node) is layer one, the layering information for valid nodes B and C is layer two, and the layering information for valid nodes D, E, and F is layer three. Spacing information includes the layout spacing between valid nodes B and C, between valid nodes D and E, and between valid nodes E and F.

[0082] Step S104: Based on the hierarchical information and spacing information of multiple valid nodes, the multiple valid nodes are laid out to complete the layout of the flowchart.

[0083] In this embodiment of the invention, based on the hierarchical information and spacing information of multiple effective nodes, multiple effective nodes are sequentially laid out from the initial node to obtain a flowchart corresponding to multiple effective nodes and multiple edges.

[0084] The flowchart layout method provided in this application first selects valid nodes from multiple nodes using node information and edge information. Then, based on the layering and spacing information of these valid nodes, the flowchart layout is completed. Therefore, this application only needs to obtain node information and edge information when laying out the flowchart, eliminating the need for manually dragging flowchart nodes and reducing manual steps, thus improving the efficiency of flowchart layout.

[0085] Figure 3 The flowchart layout method provided for embodiments of the present invention Figure 2 In this embodiment of the invention, in Figure 1 Based on the provided embodiments, the specific implementation method for selecting the first node set from multiple nodes in S102 based on node information of multiple nodes and edge information of multiple edges is described in detail. For example... Figure 3 As shown, the method includes:

[0086] Step S301: Based on the node information of multiple nodes and the edge information of multiple edges, perform a depth-first traversal starting from the initial node to obtain multiple connection paths.

[0087] In this embodiment of the invention, node information includes node identifier and port identifier, and edge information includes edge identifier, node identifier and port identifier of edge input, and node identifier and port identifier of edge output. Optionally, the specific steps for obtaining multiple connection paths through depth-first traversal are as follows: based on the node identifier and port identifier of the initial node, the edge identifiers of multiple edges, and the node identifier and port identifier of edge input, select multiple first target edges connected to the initial node from the multiple edges; for each first target edge, determine the first node connected to the first target edge based on the node identifier and port identifier of the edge output of the first target edge; continue to determine at least one second target edge connected to the first node, until the second node connected to the second target edge is the end node, thus obtaining multiple connection paths corresponding to multiple first target edges.

[0088] For example, such as Figure 4As shown, the initial node is a valid node A, and the multiple first target edges connected to the initial node include first target edge 01 and first target edge 02. For first target edge 01, the first node connected to first target edge 01 is determined to be a valid node B; the first node connected to first target edge 02 is determined to be a valid node C. Further, at least one second target edge connected to valid node B is determined, including second target edge 03 and second target edge 04; at least one second target edge connected to valid node C is determined, including second target edge 05. The second node connected to second target edge 03 is a valid node D, and valid node D is the ending node, resulting in the connection path: ABD. The second node connected to second target edge 04 is a valid node E, and valid node E is the ending node, resulting in the connection path: ABE. The second node connected to second target edge 05 is a valid node F, and valid node F is the ending node, resulting in the connection path: ACF.

[0089] Step S302: Select multiple valid nodes located on multiple connection paths from multiple nodes to obtain the first node set.

[0090] For example, multiple valid nodes located on multiple connection paths include valid node A, valid node B, valid node C, valid node D, valid node E, and valid node F. The resulting first set of nodes is: {valid node A, valid node B, valid node C, valid node D, valid node E, valid node F}.

[0091] In this embodiment of the invention, starting from the starting node, a depth-first traversal is used to facilitate the selection of multiple valid nodes located on multiple connection paths from multiple nodes, thereby improving the efficiency and accuracy of determining valid nodes.

[0092] Figure 5 The flowchart layout method provided for embodiments of the present invention Figure 3 In this embodiment of the invention, in Figure 1 Based on the provided embodiments, the specific implementation method for determining the layout information of multiple valid nodes in S103 is described in detail. For example... Figure 5 As shown, the method includes:

[0093] Step S501: Based on the node information of multiple valid nodes and the edge information of multiple edges, perform a breadth-first traversal starting from the initial node to obtain the hierarchical information of multiple valid nodes.

[0094] In this embodiment of the invention, the hierarchical information of the initial node is determined as the first layer, the hierarchical information of at least one first node connected to the initial node is determined as the second layer, the hierarchical information of at least one second node connected to each first node is determined as the third layer, until the second node is the end node. If the second node is not the end node, at least one third node connected to each second node is determined until the third node is the end node, and the hierarchical information of the third node is determined as the fourth layer.

[0095] For example, such as Figure 6 As shown, the hierarchical information of the initial node A is determined to be the first layer. The hierarchical information of the first nodes B and C connected to the initial node A is determined to be the second layer. The hierarchical information of the second nodes D and E connected to the first node B, and the second node F connected to the first node C, is determined to be the third layer. The second nodes E and F are the end nodes. If the second node D is not the end node, then the hierarchical information of the third node G connected to the second node D is determined to be the fourth layer, until the third node G is the end node.

[0096] Step S502: For two adjacent valid nodes in each layer, determine the number of valid child nodes connected to each valid node. Valid child nodes are valid nodes in the next layer below the valid node.

[0097] For example, such as Figure 6 As shown, the number of valid child nodes connected to valid node B is 2, and the number of valid child nodes connected to valid node C is 1.

[0098] Step S503: Determine the spacing information between two adjacent valid nodes based on the number of valid child nodes connected to each valid node.

[0099] In this embodiment of the invention, the distance between two adjacent valid nodes in each layer is positively correlated with the total number of valid child nodes. Optionally, the computer stores the correspondence between distance and the total number of valid child nodes. Accordingly, this step is as follows: based on the number of valid child nodes connected to each valid node, determine the total number of valid child nodes corresponding to two adjacent valid nodes; based on the correspondence between distance and the total number of valid child nodes, determine the distance between two valid nodes.

[0100] In other embodiments, a valid child node may also connect to multiple child nodes. Optionally, the distance between two adjacent valid nodes in each layer is related to the distance between multiple valid child nodes.

[0101] For example, the distance between two adjacent valid nodes can be the sum of the distances between multiple valid child nodes. For instance, the multiple valid child nodes corresponding to valid nodes B and C are: valid nodes D, E, and F. The distance between valid nodes B and C is the sum of the distances between valid nodes D and E, and the distances between valid nodes E and F.

[0102] It should be noted that before determining valid nodes, the validity of the data information in the obtained flowchart can be verified first. For example... Figure 7 As shown, if multiple nodes are empty, the flowchart's data is considered abnormal; or, if multiple edges are empty, the flowchart's data is considered abnormal; or, if multiple nodes have no start node, the flowchart's data is considered abnormal; or, if multiple nodes have no end node, the flowchart's data is considered abnormal. If the data is abnormal, subsequent steps will not be executed.

[0103] In this embodiment of the invention, see further details. Figure 7 Before determining the layout information of multiple valid nodes, the validity of the edges can be verified first.

[0104] The edge information includes an edge identifier, the node identifier and port identifier at the edge input, and the node identifier and port identifier at the edge output. Optionally, the validity of the edge is verified by the data type of the port. Accordingly, the steps for verifying the validity of an edge are as follows: For each edge, based on the edge identifier, the node identifier and port identifier at the edge input, and the node identifier and port identifier at the edge output, determine the first valid node connected to the edge's input and the second valid node connected to the edge's output; based on the node information of the first and second valid nodes, determine the corresponding validity information of the edge, which indicates whether the edge is valid.

[0105] Optionally, the node information includes a node identifier, an input port identifier, an output port identifier, the input data format corresponding to the input port identifier, and the output data format corresponding to the output port identifier. Accordingly, based on the node information of the first valid node and the node information of the second valid node, the validity information corresponding to the edge is determined, including: determining the output data format corresponding to the first target port on the first valid node and the input data format corresponding to the second target port on the second valid node, where the first target port is the port connected to the input end of the edge, and the second target port is the port connected to the output end of the edge; if the input data format and the output data format are the same, the edge is determined to be a valid edge; if the input data format and the output data format are different, the edge is determined to be an invalid edge.

[0106] For example, the output data format corresponding to the first target port on the first valid node is: user name; the input data format corresponding to the second target port on the second valid node is: user age. In this case, since the input data format and the output data format are different, the edge is determined to be an invalid edge.

[0107] In this embodiment of the invention, the validity of each edge is verified by the input data format and the output data format, so as to avoid abnormal edges in the flowchart and thus improve the accuracy of the flowchart layout.

[0108] In some embodiments, see continue to see Figure 7 Before determining the layout information of multiple valid nodes, the validity of the configuration information of each valid node can be verified first. Accordingly, the steps for verifying the configuration information are as follows: for each valid node, obtain the configuration information of the valid node, which includes at least one basic configuration; if at least one basic configuration is empty, or the data format corresponding to at least one basic configuration is incorrect, then the valid node is determined to be an abnormal node. For example, the basic configuration is a required field in the configuration information.

[0109] In this embodiment of the invention, each valid node is verified by the configuration information of the valid nodes to avoid abnormal nodes in the flowchart, thereby further improving the accuracy of the flowchart layout.

[0110] In some embodiments, see continue to see Figure 7 Before determining the layout information of multiple valid nodes, it is necessary to first identify the loop nodes among them. A loop node includes a loop edge connected to a higher-level valid node. The output port information corresponding to this loop edge is deleted, and a replica node information is created for the loop node. The node information of the loop node is then updated to match the replica node information. Note that the replica node information is not connected to any loop edge, meaning the loop is broken. This avoids the possibility of the breadth-first traversal becoming indefinite and entering a dead loop during the process of determining the layout information of multiple valid nodes using breadth-first traversal.

[0111] It should be noted that the purpose of creating replica information is to facilitate the determination of the layout information of multiple valid nodes through breadth-first traversal. The initial node information of the loop node is the actual node information. Therefore, when updating the node information of the loop node to the replica node information, the initial node information of the loop node is retained so that the initial node information can be retrieved again.

[0112] In this embodiment of the invention, the edges of the loop node are deleted by updating the node information of the loop node to the end node, so as to ensure that the layout information of multiple valid nodes can be determined by breadth-first traversal.

[0113] It should be noted that, please continue to refer to Figure 7 In addition to filtering valid nodes from multiple nodes, the method also includes: selecting multiple invalid nodes that are not on multiple connection paths from the multiple nodes to obtain a second node set, and displaying the exception information corresponding to the invalid nodes. Here, invalid nodes can be isolated nodes. The exception information can be: isolated node M is an invalid node.

[0114] Figure 8 This is a schematic diagram of the layout device for a flowchart provided in an embodiment of this application. For example... Figure 8 As shown, the layout device of the flowchart includes: an acquisition module 801, a first determination module 802, a second determination module 803, and a layout module 804.

[0115] The acquisition module 801 is used to acquire data information of the flowchart to be laid out, including node information of multiple nodes and edge information of multiple edges.

[0116] The first determining module 802 is used to select a first node set from multiple nodes based on node information of multiple nodes and edge information of multiple edges. The first node set includes multiple valid nodes.

[0117] The second determining module 803 is used to determine the layout information of multiple valid nodes, including the layering information and spacing information of the multiple valid nodes.

[0118] The layout module 804 is used to lay out multiple valid nodes based on their hierarchical and spacing information to complete the layout of the flowchart.

[0119] In one possible design, the first determining module 802 selects a first set of nodes from multiple nodes based on the node information of multiple nodes and the edge information of multiple edges. Specifically, it includes: performing a depth-first traversal starting from the initial node based on the node information of multiple nodes and the edge information of multiple edges to obtain multiple connection paths; and selecting multiple valid nodes located on the multiple connection paths from the multiple nodes to obtain the first set of nodes.

[0120] In one possible design, node information includes node identifier and port identifier, and edge information includes edge identifier, node identifier and port identifier at the edge input end, and node identifier and port identifier at the edge output end. The first determining module 802 performs a depth-first traversal starting from the initial node based on the node information of multiple nodes and the edge information of multiple edges to obtain multiple connection paths. Specifically, this includes: selecting multiple first target edges connected to the initial node from multiple edges based on the node identifier and port identifier of the initial node, the edge identifiers of multiple edges, and the node identifier and port identifier at the edge input end; for each first target edge, determining the first node connected to the first target edge based on the node identifier and port identifier at the edge output end of the first target edge; continuing to determine at least one second target edge connected to the first node until the second node connected to the second target edge is the ending node, thus obtaining multiple connection paths corresponding to multiple first target edges.

[0121] In one possible design, the second determining module 803 determines the layout information of multiple valid nodes, specifically including: based on the node information of multiple valid nodes and the edge information of multiple edges, performing a breadth-first traversal starting from the initial node to obtain the layer information of multiple valid nodes; for two adjacent valid nodes in each layer, determining the number of valid child nodes connected to each valid node, where a valid child node is a valid node in the next layer of the valid node; and based on the number of valid child nodes connected to each valid node, determining the spacing information between two adjacent valid nodes.

[0122] In one possible design, the edge information includes an edge identifier, node identifiers and port identifiers at the edge input end, and node identifiers and port identifiers at the edge output end. The device further includes a third determining module. This third determining module is used, for each edge, to determine, based on the edge identifier, node identifiers and port identifiers at the edge input end, and node identifiers and port identifiers at the edge output end, a first valid node connected to the edge's input end and a second valid node connected to the edge's output end; and based on the node information of the first valid node and the node information of the second valid node, to determine the validity information corresponding to the edge, whereby the validity information indicates whether the edge is valid.

[0123] In one possible design, node information includes node identifier, input port identifier, output port identifier, input data format corresponding to the input port identifier, and output data format corresponding to the output port identifier. The third determining module determines the validity information corresponding to the edge based on the node information of the first valid node and the node information of the second valid node. Specifically, it determines the output data format corresponding to the first target port on the first valid node and the input data format corresponding to the second target port on the second valid node. The first target port is the port connected to the input end of the edge, and the second target port is the port connected to the output end of the edge. If the input data format and the output data format are the same, the edge is determined to be a valid edge; if the input data format and the output data format are different, the edge is determined to be an invalid edge.

[0124] In one possible design, the device further includes a fourth determining module. This fourth determining module is used to obtain configuration information for each valid node, the configuration information including at least one basic configuration; if at least one basic configuration is empty, or the data format corresponding to at least one basic configuration is incorrect, then the valid node is determined to be an abnormal node.

[0125] The flowchart layout device provided in this application embodiment can be used to execute the technical solution of the flowchart layout method in the above embodiment. Its implementation principle and technical effect are similar, and will not be described again here.

[0126] It should be noted that the division of the various modules in the above device is merely a logical functional division. In actual implementation, they can be fully or partially integrated into a single physical entity, or they can be physically separated. Furthermore, these modules can be implemented entirely in software via processing element calls; they can be fully implemented in hardware; or some modules can be implemented by processing element calls to software, while others are implemented in hardware. For example, the acquisition module 801 can be a separate processing element, or it can be integrated into a chip in the above device. Alternatively, it can be stored as program code in the memory of the above device, and its functions can be called and executed by a processing element. The implementation of other modules is similar. Moreover, these modules can be fully or partially integrated together, or they can be implemented independently. The processing element here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each of the above modules can be completed through integrated logic circuits in the hardware of the processor element or through software instructions.

[0127] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 9 As shown, the electronic device may include: a transceiver 901, a processor 902, and a memory 903.

[0128] Processor 902 executes computer execution instructions stored in memory, causing processor 902 to perform the scheme in the above embodiments. Processor 902 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0129] The memory 903 is connected to the processor 902 via the system bus and completes communication between them. The memory 903 is used to store computer program instructions.

[0130] Transceiver 901 can be used to obtain the task to be run and its configuration information.

[0131] The system bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The system bus can be divided into address bus, data bus, control bus, etc. For ease of representation, only one thick line is used in the diagram, but this does not indicate that there is only one bus or one type of bus. Transceivers are used to enable communication between database access devices and other computers (e.g., clients, read-write libraries, and read-only libraries). Memory may include random access memory (RAM) and may also include non-volatile memory.

[0132] The electronic device provided in this application embodiment can be the computer device described in the above embodiments.

[0133] This application also provides a chip for executing instructions, which is used to execute the layout method of the flowchart in the above embodiments.

[0134] This application also provides a computer-readable storage medium storing computer instructions that, when executed on a computer, cause the computer to perform the layout method of the flowchart described above.

[0135] This application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium, and when the at least one processor executes the computer program, it can implement the technical solution of the flowchart layout method in the above embodiments.

[0136] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.

[0137] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.

Claims

1. A method of laying out a flowchart, characterized by, The method comprises: obtaining data information of a flowchart to be laid out, the data information comprising node information of a plurality of nodes and edge information of a plurality of edges; selecting a first node set from the plurality of nodes based on the node information of the plurality of nodes and the edge information of the plurality of edges, the first node set comprising a plurality of effective nodes; determining layout information of the plurality of effective nodes, the layout information comprising hierarchical information and spacing information of the plurality of effective nodes; laying out the plurality of effective nodes based on the hierarchical information and the spacing information of the plurality of effective nodes to complete the layout of the flowchart; the edge information comprises edge identification, node identification and port identification of an edge input end, and node identification and port identification of an edge output end; the node information comprises node identification, input port identification, output port identification, input data format corresponding to the input port identification, and output data format corresponding to the output port identification; the method further comprises: for each edge, determining a first effective node connected to an input end of the edge and a second effective node connected to an output end of the edge based on the edge identification of the edge, the node identification and the port identification of the edge input end, and the node identification and the port identification of the edge output end; determining output data format corresponding to a first target port on the first effective node and input data format corresponding to a second target port on the second effective node, the first target port being a port connected to the input end of the edge, and the second target port being a port connected to the output end of the edge; if the input data format is the same as the output data format, determining that the edge is an effective edge, and if the input data format is different from the output data format, determining that the edge is an ineffective edge.

2. The method of claim 1, wherein, the selecting of the first node set from the plurality of nodes based on the node information of the plurality of nodes and the edge information of the plurality of edges comprises: performing depth-first traversal starting from an initial node based on the node information of the plurality of nodes and the edge information of the plurality of edges to obtain a plurality of connection paths; selecting a plurality of effective nodes located on the plurality of connection paths from the plurality of nodes to obtain the first node set.

3. The method of claim 2, wherein, the node information comprises node identification and port identification, and the edge information comprises edge identification, node identification and port identification of an edge input end, and node identification and port identification of an edge output end; the performing of the depth-first traversal starting from the initial node based on the node information of the plurality of nodes and the edge information of the plurality of edges to obtain a plurality of connection paths comprises: selecting a plurality of first target edges connected to the initial node from the plurality of edges according to the node identification and the port identification of the initial node, the edge identification of the plurality of edges, and the node identification and the port identification of the edge input end; for each first target edge, determining a first node connected to the first target edge based on the node identification and the port identification of the edge output end of the first target edge; continuing to determine at least one second target edge connected to the first node until a second node connected to the second target edge is an end node to obtain a plurality of connection paths corresponding to the plurality of first target edges.

4. The method of claim 1, wherein, The determining the layout information of the plurality of effective nodes comprises: Based on the node information of the plurality of effective nodes and the edge information of the plurality of edges, breadth-first traversal is performed starting from an initial node to obtain hierarchical information of the plurality of effective nodes; For two adjacent effective nodes in each layer, the number of effective child nodes connected to each effective node is determined, the effective child node being an effective node in the next layer of the effective node; Based on the number of effective child nodes connected to each effective node, spacing information of the two adjacent effective nodes is determined.

5. The method according to any one of claims 1 to 4, characterized in that, Further comprising: For each effective node, configuration information of the each effective node is obtained, the configuration information comprising at least one basic configuration; If the at least one basic configuration is empty or the data format corresponding to the at least one basic configuration is incorrect, the effective node is determined to be an abnormal node.

6. An apparatus for laying out a flowchart, characterized by Comprise: An acquisition module, which acquires data information of a flowchart to be laid out, the data information comprising node information of a plurality of nodes and edge information of a plurality of edges; A first determination module, which is configured to select a first node set from the plurality of nodes based on the node information of the plurality of nodes and the edge information of the plurality of edges, the first node set comprising a plurality of effective nodes, the effective node being a node connected to at least one other node; A second determination module, which is configured to determine layout information of the plurality of effective nodes, the layout information comprising hierarchical information and spacing information of the plurality of effective nodes; A layout module, which is configured to perform layout on the plurality of effective nodes based on the hierarchical information and the spacing information of the plurality of effective nodes to complete the layout of the flowchart; The edge information comprises edge identification, node identification and port identification of an edge input end, and node identification and port identification of an edge output end; The node information comprises node identification, input port identification, output identification, input data format corresponding to the input port identification, and output data format corresponding to the output port identification; The apparatus further comprises a third determination module, which is configured to: For each edge, based on the edge identification of the edge, the node identification and the port identification of the edge input end, and the node identification and the port identification of the edge output end, determine a first effective node connected to an input end of the edge and a second effective node connected to an output end of the edge; Determine an output data format corresponding to a first target port on the first effective node and an input data format corresponding to a second target port on the second effective node, the first target port being a port connected to the input end of the edge, and the second target port being a port connected to the output end of the edge; If the input data format is the same as the output data format, the edge is determined to be a valid edge, and if the input data format is different from the output data format, the edge is determined to be an invalid edge.

7. An electronic device, comprising: Comprise: A processor, and a memory connected in communication with the processor; The memory stores computer execution instructions; The processor executes the computer execution instructions stored in the memory to implement the method according to any one of claims 1-5.

8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer-executable instructions, which, when executed by a processor, implement the method according to any one of claims 1-5.

Citation Information

Patent Citations

  • Graph drawing method and device, electronic equipment and storage medium

    CN114998473A