A flow chart analysis method

Through flowchart preprocessing and dependency analysis, a multi-version flowchart of parallel execution is generated, which solves the efficiency problems caused by the serial execution engine, and realizes efficient parallel execution and dynamic dependency management, supporting business development and iteration.

CN116339716BActive Publication Date: 2025-08-19DUXIAOMAN TECH (BEIJING) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310400128.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-13
Publication Date
2025-08-19
Estimated Expiration
2043-04-13

AI Technical Summary

Technical Problem

The existing process engine is based on the BPMN specification, resulting in process nodes being able to execute serially. With the increase of business iteration and nodes, the amount of process execution increases linearly, affecting concurrency performance and batch processing efficiency, especially in scenarios with high effectiveness requirements, which seriously restrict business development.

Method used

Through preprocessing of merge and splitting of flowcharts, multiple versions of the flowchart are generated, and the node dependencies are analyzed using breadth-first traversal and bidirectional linked list structure to realize parallel execution of the process, and dynamically refresh the dependencies on the run end.

Benefits of technology

It improves the efficiency and accuracy of parallel execution of processes, releases human resources to manually maintain dependencies, and supports the development and iteration of data processing business.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116339716B_ABST
    Figure CN116339716B_ABST
Patent Text Reader

Abstract

This invention discloses a flowchart analysis method, comprising the following steps: Step 1: Flowchart preprocessing; Step 2: Process node dependency analysis; and Step 3: Process dynamic refresh. This invention combines static flowchart analysis with dynamic refresh at the runtime end, ensuring the efficiency and accuracy of parallel process execution. Parallel process technology effectively supports the development and iteration of data processing services. Automatic precompilation also completely frees up human resources required to manually maintain dependencies.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, in particular to graphics processing, and more specifically to a flow chart analysis method. Background Art

[0002] During computer program development, flowcharts must be compiled in advance. For large-scale projects, this task requires the use of a process engine. A process is a set of steps by which multiple business objects collaborate to accomplish a task. These business objects can include data input flows, approval flows, decision flows, and result output flows. Existing process engines are mostly based on the BPMN specification, and their process implementation principle is to execute each node in the process sequentially, i.e., execute the process serially.

[0003] Due to its specific execution method, the serial process execution engine results in each node in the process being executed sequentially. As the business develops and iterates, the number of nodes in the process will increase, and the corresponding process execution volume will also increase linearly. This seriously restricts business development in scenarios with high effectiveness requirements. The long transaction characteristics brought by the serial engine also seriously affect the concurrent performance of process execution. In some batch execution scenarios, its concurrency characteristics seriously restrict the efficiency of batch processing of processes. Summary of the Invention

[0004] To this end, the present invention provides a flowchart analysis method that can realize parallel execution of processes, improve the ability of computer systems to execute processes in batches, and improve the efficiency of program execution.

[0005] In order to achieve the purpose of the present invention, the following technical solutions are adopted:

[0006] A flow chart analysis method comprises the following steps:

[0007] Step 1, flow chart preprocessing;

[0008] Step 2: Process node dependency analysis;

[0009] Step 3: Dynamically refresh the process.

[0010] The analysis method, wherein step 1 includes: flow chart merging, and / or flow chart splitting.

[0011] In the analysis method, the flowchart merging includes: merging the main flowchart and the sub-flowcharts into a complete flowchart.

[0012] In the analysis method, the flowchart splitting includes: combining different versions of the main flowchart and sub-flowcharts to form multiple different versions of flowcharts.

[0013] Through the analysis method, after step 1, a flowchart is split into multiple different versions of flowcharts according to versions under different grayscale conditions through static preprocessing, and each split flowchart will generate a corresponding unique ID for identification.

[0014] The analytical method, wherein step 2 comprises:

[0015] Step 2.1, generate a breadth-first traversal sequence table according to the flowchart preprocessed in step 1;

[0016] Step 2.2: Perform dependency analysis on the nodes in the breadth-first traversal data table.

[0017] In the analysis method, step 2 is used to generate a static dependency DAG graph of a bidirectional linked list structure.

[0018] The analysis method, wherein step 2.2 includes dependency analysis of general nodes:

[0019] Get the input parameters of the current node and analyze whether the input parameters include the output parameters. If so, select the last node in the coverage table of the current node's output parameters as the dependent node of the current node. For example, the BFS sequence of nodes output by parameter A is N1, N2, and N3. If parameter A is used in the input parameters of any node Nx after node N3, node Nx is considered to be dependent on node N3 under static analysis.

[0020] The analysis method, wherein step 2.2 includes dependency analysis on the gateway node:

[0021] Analyze the conditional statement of the gateway node, parse out the conditional variable, use the conditional variable as the input parameter of the gateway node, and analyze whether it has dependent output parameters. If it has dependent output parameters, directly take the last one in the related node output parameter coverage order list as the dependent node of the gateway node.

[0022] Through the above static analysis method, the corresponding node dependency relationships are generated for each flowchart to be executed, forming a logical dependency DAG graph. At the same time, this dependency DAG graph is represented by a doubly linked list structure. The important structural properties of the doubly linked list structure are as follows:

[0023] Pre: Predetermined node list (node before and after relationships on the physical flow chart)

[0024] Next: Post-node list

[0025] Depend: Dependent node list (i.e. dependent in-degree list)

[0026] DependDetail: Dependency detail object (i.e., dependency details of detail parameters and nodes).

[0027] The analytical method, wherein step 3 comprises:

[0028] Step 3.2: Parallel execution of the process nodes in the flowchart that depend on in-degree 0;

[0029] Step 3.3: After executing a batch of nodes with a dependency in-degree of 0, dynamically refresh and adjust the dependency relationships of the remaining nodes, and repeat step 3.2 until all nodes are executed.

[0030] The reason for refreshing here is actually to refresh the corresponding dependency in-degree list. This includes updating the dependency in-degree list. For example, in the static analysis above, node Nx depends on node N3. If node N3 outputs parameter A after execution, node N3 can be deleted from the Depdend list of node Nx to remove the dependency and refresh its dependency. If node N3 does not actually output parameter A after execution, then we need to find the parameter A coverage list based on the output parameter coverage list of the static analysis, and search for parameter A in the previous node in the list based on the position of node N3. If we find that only node N1 actually outputs parameter A, we need to dynamically refresh the Depend list of node Nx.

[0031] In the analysis method, in step 3.2, if the dependent node does not output the output parameters required by the dependent node according to the preprocessed dependency graph, the node that provides the output parameters is dynamically searched for in the predecessor node of the dependent node, and the dependency relationship of the dependent node is updated.

[0032] The analytical method, wherein step 3 further comprises:

[0033] Step 3.4: When executing the gateway node, the states of the branch nodes that do not meet the conditions are recursively marked as deleted.

[0034] A computer storage medium, wherein the computer-readable storage medium stores a computer program, wherein: when the computer program is executed, the above-mentioned analysis method is implemented. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 Schematic diagram of the analytical method as a flow chart;

[0036] Figure 2 Merge schematic diagrams for flow charts;

[0037] Figure 3 It is a schematic diagram of the splitting of the flow chart;

[0038] Figure 4 This is a flowchart node dependency analysis diagram;

[0039] Figure 5 This is a schematic diagram of the operation process of the operation end;

[0040] Figure 6 This is a schematic diagram of a dynamic refresh example;

[0041] Figure 7 Execute the schematic for the gateway node. DETAILED DESCRIPTION

[0042] The following is combined with Figure 1-7 , the specific embodiments of the present invention are described in detail. The embodiments are exemplary and are only used to explain the present invention, and should not be understood as limiting the present invention. Obviously, the embodiments described in the present invention are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making any creative work shall fall within the scope of protection of the present invention.

[0043] References to "one embodiment" or "some embodiments" in this specification mean that one or more embodiments of the present invention include the specific features, structures, or characteristics described in conjunction with that embodiment. Thus, the terms "including," "comprising," "having," and their variations throughout this specification mean "including but not limited to," unless otherwise specifically stated.

[0044] like Figure 1 As shown in the flowchart of the present invention, the analysis method includes the following steps:

[0045] Step 1, flow chart preprocessing;

[0046] Step 2: Process node dependency analysis;

[0047] Step 3: Dynamically refresh the process.

[0048] For step 1, the flowchart preprocessing includes the following steps:

[0049] Step 1.1, Flowchart merging (such as Figure 2 shown);

[0050] Step 1.2, flowchart split (such as Figure 3 shown)

[0051] Flowcharts can be divided into main flowcharts and sub-flowcharts. When compiling a flowchart, using a method of compiling the main flowchart and sub-flowcharts separately can improve the efficiency of the flowchart compilation, avoid errors, and achieve the maximum reuse of public flowcharts. In serial mode, the process can determine the diagram to be executed in real time during the operation. However, in a parallel context, the main flowchart and sub-flowcharts need to be merged into a complete flowchart in advance to improve the efficiency of the process operation and facilitate subsequent static dependency analysis. For example, in a business automation management system, different customers have different needs. The system needs to provide different product information to the customer based on different customer needs. For example, high-end sedans and ordinary sedans. Based on the customer's choice of different parts (such as imported engines and domestic engines), the system will feedback different functions, warranty years, prices and other information to the customer. In this case, the main flowchart and sub-flowcharts are often involved.

[0052] like Figure 2 As shown, sub-process AB or sub-process CD needs to be executed between node A and node B. Step 1.1 combines the main flow chart and the sub-flow chart into a complete flow chart through pre-compilation, which provides a basis for the dependency analysis in step 2.

[0053] Since the main process and sub-process can be released in phased release, there may be more than two different versions of the main flow chart or sub-flow chart that can be run at the same time. A flow chart includes the main flow chart and sub-flow charts. Therefore, different versions of flow charts are actually a combination of "Cartesian sets". Therefore, we need to synchronously process the combination of "Cartesian sets" during pre-compilation, that is, the flow chart splitting mentioned in step 1.2, such as Figure 3 As shown in the figure, the present invention combines different versions of the main flowchart and sub-flowcharts according to the version to form multiple versions of the flowchart. This process is called flowchart splitting. After the flowchart is split, a unique tag (identifier) ID needs to be generated for each flowchart. The unique tag ID has a one-to-one correspondence with the grayscale rule of the flowchart. That is, under different grayscale rules, a unique fixed version of the flowchart can be located by a single ID.

[0054] Generally speaking, a flowchart includes multiple visual nodes. Each node exists as the smallest unit of the flowchart, and a complete DAG graph (directed acyclic graph) is formed through the front and back connection relationship of each node.

[0055] After the flowchart preprocessing in step 1, the node dependency analysis in step 2 can be performed on each flowchart, and finally a dependency graph in the form of a doubly linked list to be executed by the system is formed. The specific instructions for step 2 are as follows:

[0056] We define node dependency as follows: for two nodes A->B that have a sequence, if the input parameter (input parameter) of node B requires the output parameter (output parameter) of node A, then we consider node B to be dependent on node A. Based on this theory, we first perform a breadth-first traversal on the DAG graph drawn on the business line (or obtained in step 1), and logically sort each node in the flowchart to form a logical sequence relationship between the nodes.

[0057] like Figure 4 As shown, the dependency analysis of the process nodes in the flowchart is described as follows:

[0058] Step 2.1: Generate a breadth-first traversal sequence table based on the pre-processed (merged) flowchart of step 1. The breadth-first traversal sequence table is as follows: ① As shown:

[0059] [start,A,G1,B,C,G2,E,F,D,I,J,end]——Table ①

[0060] In Table ①, G1 and G2 are gateway nodes, and the remaining nodes A, B, C, E, F, D, I, and J are general nodes.

[0061] Step 2.2: Traverse the nodes in the breadth-first traversal data table in order from front to back to perform dependency analysis:

[0062] At the same time, during the traversal process, we need to record the node output parameters and use the output parameters as the key and the node list as the value to form a node output parameter key-value pair list. (For example: Parameter 1: A, B, C; Parameter 2: A, E, F)

[0063] (1) For general nodes:

[0064] Get the input parameters of the current node and analyze whether the input parameters include the output parameter variable. If so, select the last node in the coverage table of the current node's output parameters as the current node's dependent node. That is, traverse all nodes before the current node that provide the output parameter and find the node closest to the current node that outputs the output parameter variable. This node is used as the current node's dependent node. If there are multiple nodes closest to the current node, all of them are the current node's dependent nodes.

[0065] When there are multiple input parameters, for each input parameter, the dependent nodes of the current node are determined separately in the above manner.

[0066] (2) For gateway nodes:

[0067] Analyze the conditional statement of the gateway node, parse out the conditional variable, use the conditional variable as the gateway node input parameter, and analyze whether it has dependent output parameter variables. If there are dependent output parameter variables, directly take the last one in the output parameter coverage order list of the relevant nodes in Table ① as the dependent node of the gateway node, that is, find the node that provides the output parameter variable at the last position in Table ①, and use this node as the dependent node of the gateway node.

[0068] (3) For other nodes:

[0069] The other nodes are, for example, subgraph nodes. For this type of node, the result variables that its input parameters depend on are traversed in turn, and the last node in Table ① is taken as the node that the output parameter variable (result variable) depends on, that is, the node that provides the result variable and is ranked last in Table ① is found, and this node is used as the dependent node of the other node.

[0070] Step 2.3: Add the output parameters of each node in Table ① to the output parameter variable coverage list.

[0071] An example of an output parameter variable (result variable) coverage list is as follows:

[0072] V1:[A,B,E] (result variable V1 covers the list);

[0073] V2:[A,E,J] (result variable V2 coverage list);

[0074] V3:[B,C,F] (result variable V3 covers the list).

[0075] After step 2, the flowchart drawn by the business personnel can finally be re-abstracted into a (static) dependency DAG graph based on a bidirectional linked list structure through the above analysis method, and this graph can be placed in the cache in advance. The execution end can directly load the cache data according to the ID of the graph without repeated analysis and processing.

[0076] like Figure 5 As shown, step 3 can be executed on the running end, and the step 3 includes:

[0077] Step 3.1, execute the grayscale decision tree, determine the flowchart instance to be executed, and obtain the flowchart instance from the cache according to the ID;

[0078] Grayscale rule decision example:

[0079] If(random.nextInt()<90){

[0080] returngraphIdA;

[0081] }else{

[0082] returngraphIdB;

[0083] }

[0084] Step 3.2: Based on the obtained flowchart instance, execute the process nodes with a dependent in-degree of 0 in the flowchart in batches (in parallel) according to the dependent in-degree. If there are no nodes with a dependent in-degree of 0, not deleted, and not executed, the process is considered to have been fully executed, and the execution of step 3 ends.

[0085] Step 3.3: After executing a batch of nodes with a dependency in-degree of 0, dynamically refresh and adjust the dependency relationships of the remaining unexecuted and undeleted nodes, and repeat step 3.2.

[0086] In step 3.2, if the dependent node does not output the parameters required by the dependent node according to the precompiled dependency graph, it is necessary to dynamically search for a suitable input parameter provider node from the predecessor node of the dependent node and update the dependency relationship of the dependent node accordingly, that is, perform dynamic refresh.

[0087] like Figure 6 As shown, a specific example of dynamic refresh is shown. Figure 6 In the flow chart:

[0088] The broad search traversal order is [start, A, B, G1, C, D, E, G2, F, G, end];

[0089] (1) Assume that the variable parameter risCode is the output parameter of nodes A, C, D, and E, then the broad search order output by risCode is [A, C, D, E];

[0090] (2) From Figure 6 As we can see, during the actual operation of the flowchart, for branches C, D, and E, the final process will only select one of the branches. If in the static dependency analysis diagram, we calculate that the input parameter risCode of node G depends on the risCode output by node C, but during the actual parallel execution, the branch selects branch E, that is, the variable risCode is output by node E, then it is necessary to refresh the dependency relationship of node G, that is, update the dependent node of node G from node C to node E;

[0091] (3) After the node is executed, it needs to be refreshed in real time, mainly refreshing two types of content:

[0092] a. Refresh node dependencies: After executing a node, you need to remove this node from the dependency set of all other nodes that depend on it;

[0093] b. Refresh variable dependencies: Fill the variables output by the executed node into other nodes that depend on the variables of this node in sequence; at the same time, if this node does not output the variables required by other nodes, it is necessary to continue searching forward from this node in its breadth-first traversal order, and refresh the node closest to this node that provides the unoutput variable and replace it with the dependent node of other nodes.

[0094] Step 3.4: In particular, when executing the gateway node, the states of the branch nodes that do not meet the conditions need to be recursively marked as deleted.

[0095] The execution logic of step 3.4 is as follows Figure 7 As shown in the figure: a branch that was not executed when the gateway node was executed is selected, and according to the dependency relationship obtained in step 2, all nodes on the branch that are directly or indirectly dependent on the gateway node are searched from front to back, and then the dependent nodes on the branch of the found nodes are deleted from back to front; for another branch that was not executed when the gateway node was executed, the above steps are repeated until all unexecuted branches have been executed.

[0096] Embodiments of the present invention also provide a computer-readable storage medium. The methods described in the above embodiments can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. If implemented in software, the functions of the methods can be stored as one or more instructions or codes on a computer-readable medium or transmitted on a computer-readable medium. In the context of the present invention, a machine-readable medium can be a tangible medium that can contain or store a program for use by an instruction execution system, device, or apparatus, or for use in conjunction with an instruction execution system, device, or apparatus. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of machine-readable storage media can include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0097] This invention combines static flowchart analysis with dynamic refresh on the runtime side, ensuring the efficiency and accuracy of parallel process execution. Parallel process technology effectively supports the development and iteration of data processing services. Automatic precompilation also completely frees up human resources required to manually maintain dependencies.

[0098] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention in any form. Although the present invention has been disclosed as above in terms of preferred embodiments, they are not intended to limit the present invention. Any person skilled in the art can make some changes or modifications to equivalent embodiments using the technical contents disclosed above without departing from the scope of the technical solution of the present invention. However, any brief modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention are still within the scope of the technical solution of the present invention.

Claims

1. A flow chart analysis method, characterized in that The following steps are involved: Step 1, flow chart preprocessing; Step 2: Process node dependency analysis; Step 3: Dynamic refresh of the process; Wherein, step 3 includes: Step 3.1, execute the grayscale decision tree, determine the flowchart instance to be executed, and obtain the flowchart instance from the cache according to the ID; Step 3.2: Based on the obtained flowchart instance, execute the process nodes with a dependent in-degree of 0 in the flowchart in parallel according to the dependent in-degree. If there are no nodes with a dependent in-degree of 0, not deleted, and not executed, the process is considered to have been fully executed, and the execution of step 3 ends. Step 3.3: After executing a batch of nodes with a dependency in-degree of 0, dynamically refresh and adjust the dependency relationships of the remaining unexecuted and undeleted nodes, and repeat step 3.

2. Step 3.4: When executing the gateway node, recursively mark the states of the branch nodes that do not meet the conditions as deleted. In step 3.4, select a branch that was not executed when executing the gateway node. According to the dependency relationship obtained in step 2, search from front to back for all nodes on the branch that directly or indirectly depend on the gateway node. Then, delete the dependent nodes on the branch of the found nodes from back to front. Repeat the above steps for another branch that was not executed when executing the gateway node until all unexecuted branches have been executed.

2. The analysis method according to claim 1, characterized in that The step 1 includes: merging flow charts.

3. The analysis method according to claim 2, characterized in that Flowchart merging includes: merging the main flow chart and sub-flow chart into a complete flow chart.

4. The analysis method according to claim 1, characterized in that Step 2 includes: Step 2.1: Generate the breadth-first traversal order based on the flowchart preprocessed in step 1 surface; Step 2.2: Perform dependency analysis on the nodes in the breadth-first traversal data table.

5. The analysis method according to claim 1, characterized in that Step 2 is used to generate a static dependency DAG graph with a doubly linked list structure.

6. The analysis method according to claim 5, characterized in that Step 2.2 includes dependency analysis of general nodes.

7. The analysis method according to claim 5, characterized in that Step 2.2 includes dependency analysis on the gateway node.

8. A computer storage medium storing a computer program, wherein: When the computer program is executed, the analysis method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Task execution method and device, equipment and storage medium

    CN113342500A