Process engine hierarchical management system and method
By dividing the main process into multiple sub-processes and utilizing state stacks and graph structure storage mechanisms, the execution order problem of traditional process engines in complex scenarios is solved, enabling hierarchical management of processes and efficient utilization of resources, thereby improving system stability and throughput.
Patent Information
- Application Number
- CN202510853487.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-24
- Publication Date
- 2025-11-21
AI Technical Summary
Traditional workflow engines struggle to achieve hierarchical management and mandatory sequential control in complex scenarios, and their weak ability to resolve node connection relationships leads to incorrect execution order and wasted resources.
The main process is divided into multiple sub-processes such as initialization, running, and stopping. The state of the sub-processes is recorded through the internal state stack of the process engine, and a graph structure storage mechanism is used to generate node connection records to ensure dynamic path resolution of execution order and efficient resource management.
It enables layered decomposition and refined control of complex business processes, avoiding resource waste, improving the overall throughput and stability of the system, and ensuring the correctness of process logic and the accuracy of execution sequence.
Smart Images

Figure CN120996539A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of process engine technology, and more specifically, to a layered management system and method for process engines. Background Technology
[0002] In fields such as industrial automation and business process management, process engines serve as core control tools, undertaking crucial functions such as task scheduling, status monitoring, and process execution. Traditional process engines often use linear or tree-like structures for process definition, controlling the process flow through preset scripts or fixed rules. This approach has the following limitations:
[0003] First, the sequential control lacks flexibility. In existing technologies, the execution order of process nodes often relies on static configuration, making it difficult to adapt to the dynamic adjustment needs of complex scenarios. Second, the node connection and path resolution capabilities are weak. Traditional process engines rely heavily on hard-coded or simple dependency tables when handling node connections, lacking the ability to dynamically identify and resolve upstream and downstream relationships between nodes. When the process involves branching or looping logic, problems such as chaotic node jumps and incorrect execution order can easily occur, making it difficult to guarantee the correctness and integrity of the process logic.
[0004] In summary, how to achieve hierarchical management and mandatory sequential control of processes, and optimize node connection mechanisms to avoid logical errors, has become an urgent problem to be solved in the current process engine technology field.
[0005] Patent document CN111178833A (application number: 201911346827.7) discloses a dynamic sub-process implementation method based on a workflow engine, relating to the field of computer system platform technology. It addresses the problem that existing open-source workflow engine components cannot dynamically load sub-processes based on business data during process node operation, and that the system returns to the main process only after the sub-process has finished running, resulting in low system processing capacity. This invention addresses the issue that when there are multiple nodes in the main process, and each node has sub-processes, it needs to be translated into a BPMN static file. Loading the component all at once is very time-consuming. If we calculate based on a standard of 10 main process nodes, each with sub-processes, and each sub-process having 5 nodes, the loading time is in the seconds range. However, this invention loads the main process nodes initially, and then dynamically loads the sub-processes during execution, making synchronous actions asynchronous. The loading time is in the milliseconds range, thus improving the system's processing capacity. Summary of the Invention
[0006] In view of the shortcomings of the prior art, the purpose of this invention is to provide a hierarchical management method and system for process engines.
[0007] A hierarchical management method for a process engine provided by the present invention includes:
[0008] Step S1: Obtain the configured main process, wherein the main process includes multiple sub-processes; the multiple sub-processes include an initialization sub-process, a running sub-process, and a stopping sub-process in the order of execution; the running sub-process includes several branches, each branch corresponding to a different execution path; the stopping sub-process includes 2 branches, including: stopping the running under normal completion conditions and stopping the running under abnormal completion conditions;
[0009] Step S2: Record the execution status of each sub-process based on the process engine, and drive the process to run according to the execution order of the main process based on the execution status of the sub-process recorded by the process engine.
[0010] Preferably, step S2 includes: maintaining a state stack inside the process engine, the state stack being used to record the execution status of each sub-process; the execution status includes: not started, in progress, and completed.
[0011] Preferably, step S2 includes:
[0012] Step S2.1: When the execution status of the initialization subprocess is completed, clear the execution context of the initialization subprocess and release the occupied computing resources;
[0013] Step S2.2: According to the execution order of the main process, when the process engine detects that the initial subprocess status is completed and the running subprocess status is not started, the activation condition for running the subprocess is obtained.
[0014] Step S2.3: Trigger the execution of the sub-process based on the activation conditions of the running sub-process.
[0015] Preferably, step S2.3 includes: the process engine creating an execution context from the starting work node of the running sub-process, loading the parameters and resources required by the node, and triggering the running sub-process.
[0016] Preferably, step S2.3 includes: when the user connects the start node and the state change node on the canvas, generating a connection record based on the graph structure storage mechanism; and assigning the unique identifier of the state change node to the sourceNodeld field of the start node to clarify the upstream source of the start node;
[0017] During the process execution phase, the process engine performs dynamic path parsing based on the graph structure, locates its upstream node through the sourceNodeld of the start work node, and thus determines the execution order, ensuring that the state change node is executed first, and then the start work node is executed.
[0018] The status change node is used to perform process status update operations.
[0019] A layered management system for a process engine, provided by the present invention, includes:
[0020] Module M1: The main process for obtaining configuration, wherein the main process includes multiple sub-processes; the multiple sub-processes include an initialization sub-process, a running sub-process, and a stopping sub-process in the order of execution; the running sub-process includes several branches, each branch corresponding to a different execution path; the stopping sub-process includes two branches, including: stopping operation under normal completion conditions and stopping operation under abnormal completion conditions;
[0021] Module M2: Based on the process engine, it records the execution status of each sub-process. Based on the execution status of the sub-processes recorded by the process engine, it drives the process to run in the execution order of the main process.
[0022] Preferably, the module M2 includes: a state stack maintained internally by the process engine, the state stack being used to record the execution status of each sub-process; the execution status includes: not started, in progress, and completed.
[0023] Preferably, the module M2 includes:
[0024] Module M2.1: When the execution status of the initialization subprocess is completed, the execution context of the initialization subprocess is cleared and the occupied computing resources are released;
[0025] Module M2.2: Based on the execution order of the main process, when the process engine detects that the initial subprocess status is completed and the running subprocess status is not started, it obtains the activation conditions for running the subprocess.
[0026] Module M2.3: Triggers the execution of sub-processes based on the activation conditions of the running sub-processes.
[0027] Preferably, module M2.3 includes: a process engine that creates an execution context from the starting work node of the running subprocess, loads the parameters and resources required by the node, and triggers the running of the subprocess.
[0028] Preferably, module M2.3 includes: when a user connects a start node and a state change node on the canvas, generating a connection record based on a graph structure storage mechanism; and assigning the unique identifier of the state change node to the sourceNodeld field of the start node to clarify the upstream source of the start node;
[0029] During the process execution phase, the process engine performs dynamic path parsing based on the graph structure, locates its upstream node through the sourceNodeld of the start work node, and thus determines the execution order, ensuring that the state change node is executed first, and then the start work node is executed.
[0030] The status change node is used to perform process status update operations.
[0031] Compared with the prior art, the present invention has the following beneficial effects:
[0032] 1. This invention divides the main process into multiple sub-processes such as initialization, running, and stopping, and sets multiple branch execution paths for the running and stopping sub-processes, thereby realizing the layered decomposition and refined control of complex business processes;
[0033] 2. This invention records the execution status of sub-processes (not started, in progress, or completed) by maintaining a state stack inside the process engine, and drives process switching according to the state order, forcibly implementing the "initialization → running → stopping" sequential execution of the main process;
[0034] 3. After the initialization sub-process is completed, the execution context is automatically cleared and computing resources are released, which solves the problem of redundant resource consumption in traditional process engines; especially in high-concurrency or long-running process scenarios, it can avoid resource waste and performance loss, and improve the overall throughput and stability of the system.
[0035] 4. This invention generates node connection records through a graph structure storage mechanism and uses the sourceNodeId field to identify the upstream and downstream relationships of nodes, thereby realizing dynamic path resolution during the process execution phase; effectively avoiding problems such as chaotic node jumps and execution logic errors in branch processes. Attached Figure Description
[0036] Other features, objects, and advantages of the present invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings:
[0037] Figure 1 Flowchart for the hierarchical management method of the process engine.
[0038] Figure 2 Main process diagram.
[0039] Figure 3 This is a diagram illustrating the initialization subprocess.
[0040] Figure 4 This is a diagram illustrating the operation of a sub-process.
[0041] Figure 5 This is a diagram illustrating the stopping of a subprocess. Detailed Implementation
[0042] The present invention will now be described in detail with reference to specific embodiments. These embodiments will help those skilled in the art to further understand the present invention, but do not limit the invention in any way. It should be noted that those skilled in the art can make several changes and improvements without departing from the concept of the present invention. These all fall within the protection scope of the present invention.
[0043] Example 1
[0044] According to the present invention, a hierarchical management method for a process engine is provided, such as Figure 1 As shown, it includes:
[0045] Step S1: Obtain the configured main process, wherein the main process includes multiple sub-processes; the multiple sub-processes include an initialization sub-process, a running sub-process, and a stopping sub-process in the order of execution; the running sub-process includes several branches, each branch corresponding to a different execution path; the stopping sub-process includes 2 branches, including: stopping the running under normal completion conditions and stopping the running under abnormal completion conditions;
[0046] Step S2: Record the execution status of each sub-process based on the process engine, and drive the process to run according to the execution order of the main process based on the execution status of the sub-process recorded by the process engine.
[0047] Specifically, step S2 includes: maintaining a state stack inside the process engine, the state stack being used to record the execution status of each sub-process; the execution status includes: not started, in progress, and completed.
[0048] Specifically, step S2 includes:
[0049] Step S2.1: When the execution status of the initialization subprocess is completed, clear the execution context of the initialization subprocess and release the occupied computing resources;
[0050] Step S2.2: According to the execution order of the main process, when the process engine detects that the initial subprocess status is completed and the running subprocess status is not started, the activation condition for running the subprocess is obtained.
[0051] Step S2.3: Trigger the execution of the sub-process based on the activation conditions of the running sub-process.
[0052] Specifically, step S2.3 includes: the process engine creates an execution context from the starting working node of the running sub-process, loads the parameters and resources required by the node, and triggers the running sub-process.
[0053] Specifically, step S2.3 includes: when the user connects the start working node and the state change node on the canvas, generating a connection record based on the graph structure storage mechanism; and assigning the unique identifier of the state change node to the sourceNodeld field of the start working node to clarify the upstream source of the start working node;
[0054] During the process execution phase, the process engine performs dynamic path parsing based on the graph structure, locates its upstream node through the sourceNodeld of the start work node, and thus determines the execution order, ensuring that the state change node is executed first, and then the start work node is executed.
[0055] The status change node is used to perform process status update operations.
[0056] The present invention also provides a process engine hierarchical management system, which can be implemented by executing the process steps of the process engine hierarchical management method. That is, those skilled in the art can understand the process engine hierarchical management method as a preferred embodiment of the process engine hierarchical management system.
[0057] Example 2
[0058] Example 2 is a preferred example of Example 1.
[0059] According to the present invention, a hierarchical management method for a process engine is provided, such as Figures 2 to 5 As shown, it includes:
[0060] The process is built by dragging and dropping on the page, specifically including:
[0061] Open the process setup tool
[0062] 1. Select process elements: Locate available process nodes and connectors in the toolbar or element library. Process nodes can be tasks, decision points, start / end nodes, etc. Connectors are used to indicate the flow direction of the process.
[0063] 2. Drag and drop process nodes and connect process nodes—Click and drag process nodes onto the canvas. Place the nodes in suitable positions, and continue dragging other nodes onto the canvas as needed to form the basic framework of the process. Select the output end of a node, hold down the mouse button, and drag a connecting line to the input end of another node. The system will automatically recognize the connection point and generate a connecting line, representing the flow between the two nodes.
[0064] In this embodiment, the construction of the main process and sub-processes specifically includes:
[0065] I. Main process setup includes:
[0066] Main process creation order: Initialize subprocess (init) → Run subprocess (running) → Stop subprocess (stop);
[0067] II. Sub-process setup includes:
[0068] The initialization sub-process init (system initialization process) includes: the order of event and method creation: system startup, state change (marked as "initializing"), RGB light strip settings (such as initializing the light mode), robot initialization (hardware self-test, parameter loading), and sending events (feedback of initialization status to the main process);
[0069] Running a subprocess (running the main process, including two branches) includes:
[0070] Branch 1 sequence includes: Start working (trigger task execution), state change (marked as "working"), robot plan control (planning motion trajectory), start inferApp (inference application), and obtain all raw materials (material loading);
[0071] Branch 2 sequence includes: Start working (triggering task execution), status change (marked as "working"), robot plan control (planning motion trajectory), start inferApp (inference application), solenoid valve settings (controlling pneumatic components), and RGB light strip settings (such as working status light indicators);
[0072] The `stop` option (stopping a subprocess, including those with two branches) includes:
[0073] Branch 1 sequence (stopped after normal initialization) includes: initialization completed (confirming the end of the preceding process), status change (marked as "stopping"), stop InferApp (closing the inference program), pause robot thread (terminating motion control), solenoid valve settings (resetting pneumatic components), RGB light strip settings (such as stop status light indication);
[0074] Branch 2 sequence (abnormal / active stop) includes: stop work (receive stop command), robot plan control (execute stop action plan), status change (marked as "stopping"), stop InferApp (close inference program), pause robot thread (terminate motion control), solenoid valve settings (reset pneumatic components), RGB light strip settings (such as stop status light indication).
[0075] I. Example Logic Diagram (Simplified Illustration)
[0076]
[0077] The above structure enables hierarchical management of the main process and sub-processes, while branch logic covers the process control needs of different business scenarios.
[0078] The main process is defined sequentially as "init→running→stop," essentially implemented through a state-driven mechanism of the process engine. Internally, the process engine maintains a state stack, recording the execution status of each sub-process; for example, "not started," "in progress," and "completed." When the send event node of the "init" sub-process completes execution and returns to the "completed" status, the engine performs the following operations:
[0079] State update: Mark the state of the init subprocess in the state stack as "completed", clear the execution context of the subprocess, and release the occupied computing resources.
[0080] Rule matching: Based on the pre-defined main process rules, the engine detects that the init status is "completed" and the running status is "not started", triggering the activation condition of the running sub-process.
[0081] Process switching: The engine starts by creating an execution context from the first node (start working) of the running subprocess, loading the parameters and resources required by the node, and officially starting the subprocess.
[0082] In the process connection relationship, the "Start Working" node in the running section does not have a sourceNodeId in its initial state. However, once it establishes a connection with the "State Change" node, the system will assign it a corresponding sourceNodeId based on the graph structure storage and dynamic path resolution mechanism. The specific process is as follows:
[0083] Initial state: At the beginning of the running sub-process creation, the "Start Work" node, as the process starting node, is in an isolated state. At this time, there are no upstream nodes connected to it, and therefore no sourceNodeId exists. This is similar to a new project that has just been initiated, with no prerequisite tasks associated with it.
[0084] Connection Establishment: When a user connects the "Start Working" node to the "State Change" node on the canvas, the system immediately detects this operation. Based on the graph structure storage mechanism, the system automatically generates a connection record, such as {"from":"unique identifier of the Start Working node","to":"unique identifier of the State Change node"}. Simultaneously, to clearly identify the upstream and downstream relationships between nodes, the system assigns the unique identifier of the "State Change" node to the sourceNodeId field of the "Start Working" node, clearly indicating the upstream source of the "Start Working" node.
[0085] Execution Basis: During the process execution phase, the process engine performs dynamic path resolution based on the DAG structure. By using the sourceNodeId of the "Start Work" node, the engine can quickly locate its upstream node "State Change," thereby determining the execution order and ensuring that the "State Change" node is executed first, followed by the "Start Work" node, thus guaranteeing the correct flow of process logic.
[0086] Add process information: At each process node, enter relevant information, such as task name, description, executor, etc.
[0087] Save and share the process: After completing the process setup, click the save button to save the process as a file or store it in the cloud.
[0088] Those skilled in the art will understand that, in addition to implementing the system, apparatus, and their modules provided by this invention in purely computer-readable program code, the same program can be implemented in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, the system, apparatus, and their modules provided by this invention can be considered a hardware component, and the modules included therein for implementing various programs can also be considered structures within the hardware component; alternatively, modules for implementing various functions can be considered both software programs implementing the method and structures within the hardware component.
[0089] Specific embodiments of the present invention have been described above. It should be understood that the present invention is not limited to the specific embodiments described above, and those skilled in the art can make various changes or modifications within the scope of the claims, which do not affect the essence of the present invention. Unless otherwise specified, the embodiments and features described in this application can be arbitrarily combined with each other.
Claims
1. A hierarchical management method for a process engine, characterized in that, include: Step S1: Obtain the configured main process, wherein the main process includes multiple sub-processes; the multiple sub-processes include an initialization sub-process, a running sub-process, and a stopping sub-process in the order of execution; the running sub-process includes several branches, each branch corresponding to a different execution path; the stopping sub-process includes 2 branches, including: stopping the running under normal completion conditions and stopping the running under abnormal completion conditions; Step S2: Record the execution status of each sub-process based on the process engine, and drive the process to run according to the execution order of the main process based on the execution status of the sub-process recorded by the process engine.
2. The process engine hierarchical management method according to claim 1, characterized in that, Step S2 includes: the process engine maintains a state stack, which is used to record the execution status of each sub-process; the execution status includes: not started, in progress and completed.
3. The process engine hierarchical management method according to claim 2, characterized in that, Step S2 includes: Step S2.1: When the execution status of the initialization subprocess is completed, clear the execution context of the initialization subprocess and release the occupied computing resources; Step S2.2: According to the execution order of the main process, when the process engine detects that the initial subprocess status is completed and the running subprocess status is not started, the activation condition for running the subprocess is obtained. Step S2.3: Trigger the execution of the sub-process based on the activation conditions of the running sub-process.
4. The process engine hierarchical management method according to claim 3, characterized in that, Step S2.3 includes: the process engine creates an execution context from the starting work node of the running subprocess, loads the parameters and resources required by the node, and triggers the running subprocess.
5. The process engine hierarchical management method according to claim 4, characterized in that, Step S2.3 includes: when the user connects the start node and the state change node on the canvas, a connection record is generated based on the graph structure storage mechanism; and the unique identifier of the state change node is assigned to the sourceNodeld field of the start node to clarify the upstream source of the start node. During the process execution phase, the process engine performs dynamic path parsing based on the graph structure, locates its upstream node through the sourceNodeld of the start work node, and thus determines the execution order, ensuring that the state change node is executed first, and then the start work node is executed. The status change node is used to perform process status update operations.
6. A layered management system for a process engine, characterized in that, include: Module M1: The main process for obtaining configuration, wherein the main process includes multiple sub-processes; the multiple sub-processes include an initialization sub-process, a running sub-process, and a stopping sub-process in the order of execution; the running sub-process includes several branches, each branch corresponding to a different execution path; the stopping sub-process includes 2 branches, including: stopping operation under normal completion conditions and stopping operation under abnormal completion conditions; Module M2: Based on the process engine, it records the execution status of each sub-process. Based on the execution status of the sub-processes recorded by the process engine, it drives the process to run in the execution order of the main process.
7. The process engine hierarchical management system according to claim 6, characterized in that, The module M2 includes: a state stack maintained internally by the process engine, which is used to record the execution status of each sub-process; the execution status includes: not started, in progress, and completed.
8. The process engine hierarchical management system according to claim 7, characterized in that, The module M2 includes: Module M2.1: When the execution status of the initialization subprocess is completed, the execution context of the initialization subprocess is cleared and the occupied computing resources are released; Module M2.2: Based on the execution order of the main process, when the process engine detects that the initial subprocess status is completed and the running subprocess status is not started, it obtains the activation conditions for running the subprocess. Module M2.3: Triggers the execution of sub-processes based on the activation conditions of the running sub-processes.
9. The process engine hierarchical management system according to claim 8, characterized in that, The module M2.3 includes: the process engine creates an execution context from the starting work node of the running subprocess, loads the parameters and resources required by the node, and triggers the running of the subprocess.
10. The process engine hierarchical management system according to claim 9, characterized in that, The module M2.3 includes: when the user connects the start node and the state change node on the canvas, generating a connection record based on the graph structure storage mechanism; and assigning the unique identifier of the state change node to the sourceNodeld field of the start node to clarify the upstream source of the start node; During the process execution phase, the process engine performs dynamic path parsing based on the graph structure, locates its upstream node through the sourceNodeld of the start work node, and thus determines the execution order, ensuring that the state change node is executed first, and then the start work node is executed. The status change node is used to perform process status update operations.
Citation Information
Patent Citations
Dynamic sub-process implementation method based on workflow engine
CN111178833A