Process dynamic scheduling method based on fusion of graph structure and state machine and related equipment

By adopting a process dynamic scheduling method based on the fusion of graph structure and state machine, the problem of low execution efficiency and poor flexibility of existing process scheduling systems under complex dependencies and dynamic business changes is solved, and efficient and flexible process scheduling and dynamic adjustment are achieved.

CN122114861APending Publication Date: 2026-05-29XIAN TPRI POWER PLANT INFORMATION TECHNOLOGY CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
XIAN TPRI POWER PLANT INFORMATION TECHNOLOGY CO LTD
Filing Date
2026-04-15
Publication Date
2026-05-29

Smart Images

  • Figure CN122114861A_ABST
    Figure CN122114861A_ABST
Patent Text Reader

Abstract

The application discloses a process dynamic scheduling method based on graph structure and state machine fusion and related equipment, and belongs to the technical field of computer information processing. The method comprises the following steps: listening to node state change events, obtaining events of node state changes to a completed state; determining direct successor nodes affected by the node based on preset dependency relationship data, and judging whether the direct successor nodes meet execution conditions to obtain an executable node set, wherein the dependency relationship data comprises a reverse index table used for locating the direct successor nodes; and distributing nodes in the executable node set to an execution engine for scheduling and execution. The application realizes quick positioning of the direct successor nodes through the reverse index table, reduces the calculation complexity of dependency resolution from O(N) to O(K), and significantly improves the execution efficiency of large-scale concurrent processes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer information processing technology, specifically to a dynamic scheduling method and related equipment based on the fusion of graph structure and state machine. Background Technology

[0002] As enterprises become increasingly information-driven, Business Process Management (BPM) systems face increasingly complex execution scenarios. Traditional workflow engines typically employ scheduling methods based on sequential flow or rule engines. Their core mechanism involves pre-defining a fixed process topology, with the execution engine scheduling nodes according to a preset path. Existing technologies, such as patent application CN120743253A, disclose a no-code, configurable task flow development system. This system generates task nodes and directed connections through a process visualization orchestration module, generating dependency data (adjacency matrix) describing the task execution order. The task state management module drives state transitions based on this dependency data.

[0003] However, this solution suffers from the following technical drawbacks in practical applications: First, dependency resolution is inefficient. The solution uses a static adjacency matrix to describe the task triggering order. After a node's state changes, it requires traversing all nodes or polling the database to determine if subsequent nodes meet the execution conditions. This leads to severe performance bottlenecks and resource overhead in large-scale concurrent scenarios. Second, the scheduling mechanism is rigid. Node execution scheduling is primarily based on a preset process sequence control, lacking the ability to dynamically adjust according to the actual running state of nodes, making it difficult to adapt to the flexible scheduling needs of complex business scenarios. Third, it lacks runtime adjustment capabilities. Once a process instance is started, its graph structure is fixed. If a node needs to be inserted, deleted, or replaced during execution, the entire process instance must be terminated, making hot-swappable dynamic adjustment impossible. These shortcomings result in low execution efficiency and poor flexibility in existing process scheduling systems when facing complex dependencies and dynamic business changes, making it difficult to meet the requirements of high concurrency and high stability in application scenarios. Summary of the Invention

[0004] The purpose of this invention is to provide a dynamic process scheduling method and related equipment based on the fusion of graph structure and state machine, so as to overcome the technical problem of poor process scheduling flexibility caused by the rigid scheduling mechanism in the prior art.

[0005] To achieve the above objectives, the present invention adopts the following technical solution: In a first aspect, the present invention provides a dynamic process scheduling method based on the fusion of graph structure and state machine, comprising the following steps: Listen for node state change events and obtain the event when the node state changes to the completed state; Based on preset dependency data, the direct successor nodes affected by the node are determined, and it is determined whether the direct successor nodes meet the execution conditions to obtain a set of executable nodes; the dependency data includes the in-degree counter, dependency condition expression and inverted index table for each node, and the inverted index table is used to locate the direct successor nodes of the node. The nodes in the set of executable nodes are assigned to the execution engine for scheduling and execution.

[0006] In one embodiment of the present invention, the dependency condition expression is a Boolean logic expression used to describe the completion status requirements of the preceding node or the output data conditions of the preceding node. The expression supports AND, OR, and NOT logical combination operations on multiple preceding node states.

[0007] In one embodiment of the present invention, determining whether a direct successor node satisfies the execution condition includes: decrementing the in-degree counter of the direct successor node by 1, re-evaluating the dependency condition expression of the direct successor node, and determining the direct successor node as satisfying the execution condition if and only if the in-degree counter is 0 and the dependency condition expression evaluation result is true.

[0008] In one embodiment of the present invention, the method further includes: configuring a hierarchical state machine model for each node, the hierarchical state machine model including node-level states, the node-level states including at least a pending state, a ready state, a running state, and a completed state.

[0009] In one embodiment of the present invention, the hierarchical state machine model further includes instance-level states, and the node-level states further include suspended states, failed states, and compensated states, with transitions between states triggered by internal or external events.

[0010] In one embodiment of the present invention, the step of allocating nodes in the executable node set to the execution engine for scheduling and execution includes: placing the nodes into queues of corresponding priorities to wait for execution based on the node's priority attributes, estimated execution time, and system load balancing strategy.

[0011] In one embodiment of the present invention, the method further includes a runtime process refactoring step: Receive external reconstruction instructions and perform dynamic modification operations on the directed graph model during the process. The modification operations include inserting new nodes, deleting existing nodes, or adjusting the directed connection edges between nodes. Lock the graph structure of the current process instance and pause the scheduling of new nodes; The graph structure is updated according to the modification operation, the in-degree counters of the affected nodes are recalculated, and the reverse index table is updated. Unlock the process instance and trigger a local dependency recalculation in the affected area.

[0012] In a second aspect, the present invention provides a dynamic process scheduling system based on the fusion of graph structure and state machine, comprising: The event listening module is used to listen for node state change events and obtain events when a node's state changes to the completed state. The dependency resolution calculation module is used to determine the direct successor nodes affected by the node based on preset dependency relationship data, and to determine whether the direct successor nodes meet the execution conditions to obtain a set of executable nodes; the dependency relationship data includes the in-degree counter, dependency condition expression and inverted index table of each node, and the inverted index table is used to locate the direct successor nodes of the node. The scheduling and execution module is used to allocate nodes in the set of executable nodes to the execution engine for scheduling and execution.

[0013] Thirdly, the present invention provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the process dynamic scheduling method based on the fusion of graph structure and state machine as described above.

[0014] Fourthly, the present invention provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the process dynamic scheduling method based on the fusion of graph structure and state machine as described above.

[0015] Compared with the prior art, the present invention has the following beneficial technical effects: Firstly, this invention provides a dynamic scheduling method for processes based on the fusion of graph structure and state machine. It obtains the completion status of nodes by listening to node state change events and uses these completion events as driving signals to trigger dependency resolution of subsequent nodes, thus changing the passive scheduling method of existing technologies that rely on static adjacency matrix traversal or polling of databases. Based on this, affected nodes are determined according to preset dependency relationship data, which includes an in-degree counter, dependency condition expressions, and an inverted index table. The inverted index table can directly locate successor nodes when a node's state changes, avoiding the performance overhead of traversing all nodes, thereby achieving precise scheduling control from pre-dependency judgment to conditional semantic verification. This method reduces the computational complexity of dependency resolution from O(N) (traversing all nodes) to O(K) (processing only affected nodes), significantly improving the execution efficiency of large-scale concurrent processes.

[0016] Secondly, this invention provides a dynamic scheduling system based on the fusion of graph structure and state machine. Through the collaborative operation of an event monitoring module, a dependency resolution calculation module, and a scheduling execution module, it realizes a complete processing flow from node state changes to task scheduling. The event monitoring module captures node state change events; the dependency resolution calculation module performs dependency resolution calculations based on an in-degree counter, dependency condition expressions, and a reverse index table, adding nodes that meet the execution conditions to the executable node set; and the scheduling execution module allocates nodes from the executable node set to the execution engine for scheduling and execution. This architecture reconstructs the fixed process sequence control in existing technologies into an event-driven dynamic scheduling mode, improving system scalability while separating scheduling logic from execution logic, effectively overcoming the rigidity of existing scheduling mechanisms.

[0017] Thirdly, the present invention provides a computer device that, through a processor executing a specific computer program, can efficiently implement the steps of the method of the present invention. When performing data processing tasks, the computer device can accurately perform numerical calculations and logical judgments, avoiding errors caused by human factors. At the same time, since the computer program has high stability and reliability, it can ensure the accuracy and consistency of the data processing results.

[0018] Fourthly, the present invention provides a computer-readable storage medium. By programming the steps of the method of the present invention into a computer program and storing it on the computer-readable storage medium, users can easily load these programs onto any compatible computer device and execute them without rewriting or converting the code, which greatly improves the convenience and flexibility of program execution. Attached Figure Description

[0019] Figure 1 This is a flowchart of the dynamic scheduling method based on the fusion of graph structure and state machine in an embodiment of the present invention.

[0020] Figure 2 This is a schematic diagram of the structure of the multi-granularity directed graph process model and the hierarchical state machine in an embodiment of the present invention.

[0021] Figure 3 This is a flowchart illustrating the workflow of the resolution engine in this embodiment of the invention.

[0022] Figure 4 This is a schematic diagram of a priority-based scheduling queue model in an embodiment of the present invention.

[0023] Figure 5 This is a schematic diagram of dynamic reconfiguration of the running process in an embodiment of the present invention.

[0024] Figure 6 This is a complete execution sequence diagram of the loan approval process in an embodiment of the present invention.

[0025] Figure 7 This is a schematic diagram of dynamic process scheduling based on the fusion of graph structure and state machine in an embodiment of the present invention. Detailed Implementation

[0026] In business process management systems, process instances typically contain multiple business nodes with dependencies. The execution order between nodes needs to be dynamically determined based on the completion status and output data of preceding nodes. Existing technologies mostly use static adjacency matrices to describe the task triggering order. After a node's state changes, all nodes must be traversed or the database must be polled to determine the executable node, which can lead to severe performance bottlenecks in large-scale concurrent scenarios. Furthermore, existing process scheduling systems have a fixed graph structure after a process instance starts, making it impossible to dynamically adjust nodes or dependencies during runtime. This makes the system ill-suited for flexible scheduling requirements in complex business scenarios.

[0027] Based on the above background, this invention proposes a dynamic process scheduling method and related equipment based on the fusion of graph structure and state machine. By listening to nodes to complete event-triggered dependency resolution, and using a reverse index table to directly locate the affected successor nodes, the computational complexity of dependency resolution is reduced from O(N) to O(K). Furthermore, the scheduling logic and execution logic are decoupled through an event-driven scheduling mode, while supporting dynamic reconstruction of the running process, thereby significantly improving the execution efficiency and flexibility of process scheduling.

[0028] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0029] Example 1 like Figure 1 As shown, this embodiment of the invention provides a dynamic scheduling method for processes based on the fusion of graph structure and state machine.

[0030] The system listens for node state change events, specifically those indicating a node has changed to a completed state. This listening action is continuously executed in an event-driven manner, enabling the system to capture real-time state change information of each business node in the process instance and using the node's completed state as the starting signal to trigger subsequent dependency resolution calculations. Unlike existing technologies that use database polling or periodic scanning to determine node state, this embodiment achieves immediate response to state changes through an event listening mechanism, providing accurate input conditions for subsequent dependency resolution.

[0031] Based on pre-defined dependency data, the system identifies the direct successor nodes affected by a given node and determines whether these direct successor nodes meet the execution conditions, thus obtaining a set of executable nodes. The dependency data includes each node's in-degree counter, dependency condition expression, and inverted index table. Using this dependency data, when a node's state changes to a completed state, the system can directly locate all direct successor nodes affected by that node's completion event, without needing to traverse all nodes in the process instance to determine the object requiring dependency resolution computation. After identifying the direct successor nodes, the system uses the in-degree counter and dependency condition expression to determine whether the direct successor node meets the execution conditions, adding nodes that meet the execution conditions to the set of executable nodes.

[0032] Nodes from the executable node set are assigned to the execution engine for scheduling and execution. After receiving an executable node, the execution engine creates an execution instance of the node and calls the pre-registered business processing components to execute the business logic. After the node completes execution, the state machine state of the node is updated to the completed state, and the state change event is published to the event bus to trigger subsequent dependency resolution calculations, forming an event-driven closed loop from event listening to dependency resolution to scheduling and execution.

[0033] Through the above steps, this embodiment realizes a complete processing flow from node completion event triggering to direct successor node location, execution condition judgment, and scheduling execution. The use of the reverse index table reduces the computational scope of dependency resolution from all nodes of the process instance to the affected direct successor nodes, effectively reducing computational complexity. The event-driven scheduling mode decouples node state changes from scheduling logic, enabling the system to handle the state changes and scheduling execution of multiple nodes asynchronously and in parallel, providing efficient technical support for process scheduling in large-scale concurrent scenarios.

[0034] Example 2 This embodiment, based on embodiment 1, further elaborates on the hierarchical state machine model, the specific form of the dependency condition expression, the priority scheduling mechanism, and the refactoring of the runtime process.

[0035] A hierarchical state machine model is configured for each node. This hierarchical state machine model includes node-level states and instance-level states. Node-level states include at least the pending scheduling state, ready state, running state, and completed state. The pending scheduling state indicates that the node has not yet met its prerequisites and is in a waiting state; the ready state indicates that the node has met its prerequisites and is waiting for execution resources to be allocated; the running state indicates that the node is executing; and the completed state indicates that the node has finished executing. In addition to the above basic states, node-level states also include the suspended state, the failed state, and the compensating state. The suspended state indicates that the node has paused execution due to external intervention or anomalies; the failed state indicates that an error occurred during the node's execution; and the compensating state indicates that the node is performing compensation operations after execution failure. Instance-level states manage the running state of the entire process instance and work in conjunction with node-level states to form a complete state management hierarchy from nodes to process instances. Transitions between states are triggered by internal or external events, making state changes themselves an active signal source driving subsequent node scheduling.

[0036] The dependency condition expression is a Boolean logic expression used to describe the completion status requirements of a preceding node or the output data conditions of a preceding node. This expression supports AND, OR, and NOT logical combinations of multiple preceding node states. For example, in a loan approval process, the dependency condition expression for the comprehensive approval node D can be set to "A.status == COMPLETED AND B.status == COMPLETED AND C.status == COMPLETED", meaning that nodes A, B, and C must all be completed before node D can be triggered; the dependency condition expression for the income verification node C can be set to "A.status == COMPLETED AND A.output.creditScore>600", meaning that node C can only be triggered when node A is completed and its output credit score is greater than 600. Through dependency condition expressions, the system can achieve fine-grained scheduling control of complex business rules, meeting the differentiated dependency requirements under different business scenarios.

[0037] To determine whether a direct successor node meets the execution conditions, the following method is used: The in-degree counter of the direct successor node is decremented by 1, and its dependency condition expression is re-evaluated. The direct successor node is considered to meet the execution conditions if and only if the in-degree counter reaches zero and the dependency condition expression evaluates to true. The initial value of the in-degree counter is equal to the number of incoming edges of the node, used to record the number of unmet predecessor dependencies. Each time a predecessor node is completed, the in-degree counter is decremented by 1, until it reaches zero, indicating that all predecessor nodes have been completed. The dependency condition expression is evaluated after the in-degree counter reaches zero, ensuring that the business rule conditions are met simultaneously. The in-degree counter and the dependency condition expression form a dual verification mechanism, combining structured dependency counting with semantic condition logic, ensuring the integrity of dependency relationships while supporting the flexible expression of complex business rules.

[0038] When allocating nodes from the executable node set to the execution engine for scheduling and execution, a priority-based scheduling queue model is used. Specifically, multiple first-in-first-out queues are maintained based on the node's priority attribute, with high-priority nodes placed in high-priority queues and low-priority nodes placed in low-priority queues. The load balancer monitors system resource usage, including metrics such as CPU utilization, memory usage, and thread pool activity, and dynamically adjusts the rate at which nodes are retrieved from each priority queue. When the system load is high, the node retrieval rate for low-priority queues is appropriately reduced to prioritize the execution of high-priority tasks. The thread pool executor is responsible for actually executing the logic of the business processing components, supporting concurrent execution of multiple nodes. Thread reuse reduces the overhead of thread creation and destruction, improving system throughput.

[0039] During process execution, this embodiment also supports runtime process refactoring. Specifically, upon receiving an external refactoring instruction, dynamic modification operations are performed on the directed graph model during process execution. These modifications include inserting new nodes, deleting existing nodes, or adjusting directed connections between nodes. Upon receiving the refactoring instruction, the graph structure of the current process instance is locked, and the scheduling of new nodes is paused to ensure the consistency of the graph structure during refactoring. The graph structure is updated according to the modification operations, the in-degree counters of affected nodes are recalculated, and the inverted index table is updated. For example, when inserting a new node E_blacklist review in a loan approval process, the original edge A→D is deleted, and edges A→E and E→D are added. The in-degree counter of node D is incremented by 1, the in-degree counter of node E is set to 1, and the inverted index table is updated to add E to A's notification list, add D to E's notification list, and remove D from A's notification list. After unlocking the process instance, the local dependency recalculation of the affected area is triggered. Since node A has been completed, the system immediately detects that the in-degree counter of node E is zero and the dependency condition expression is empty. Node E is added to the set of executable nodes, realizing the dynamic adjustment of the running logic without terminating the entire process instance.

[0040] Through the above-mentioned extension mechanism, this embodiment further realizes the ability to finely schedule and control complex business rules, dynamically load balance system resources, and dynamically adjust the running process structure based on embodiment 1, which significantly improves the flexibility and adaptability of the process scheduling system.

[0041] Example 3 The technical solution of the present invention will be described in detail below with reference to a specific business process scenario. This embodiment takes a loan approval process as an example, which includes four business nodes: A_credit inquiry, B_anti-fraud check, C_income verification, and D_comprehensive approval. Their dependencies are as follows: D depends on the completion of A, B, and C; A and B have no dependencies and can be executed in parallel; C depends on the completion of A, that is, income verification is only performed after the credit inquiry is passed.

[0042] like Figure 2 As shown, the system first constructs a multi-granularity directed graph process model. This model includes multiple business nodes and directed edges between nodes. A_credit query, B_anti-fraud check, C_income verification, and D_comprehensive approval are all atomic nodes, and the directed edges between nodes are used to represent data dependencies or control flow dependencies. Simultaneously, a hierarchical state machine model is configured for each node, with node-level states including pending scheduling, ready, running, and completed states.

[0043] like Figure 3 As shown, the system is built based on a directed graph dependency resolution engine. The dependency resolution engine maintains an in-degree counter, dependency condition expression, and inverted index table for each node. Node A's in-degree counter is initially 0, and its inverted index table includes C and D; node B's in-degree counter is initially 0, and its inverted index table includes D; node C's in-degree counter is initially 1, its dependency condition expression is "A.status == COMPLETED AND A.output.creditScore>600", and its inverted index table includes D; node D's in-degree counter is initially 3, and its dependency condition expression is "A.status == COMPLETED AND B.status == COMPLETED AND C.status == COMPLETED". When the process starts, nodes A and B, with in-degree counters of 0 and empty dependency condition expressions, are immediately determined to be executable nodes and added to the executable node set.

[0044] The execution engine schedules nodes A and B to execute concurrently. Assuming node A completes execution and its status is updated to "complete," the event bus publishes an A_COMPLETED event. Upon receiving this event, the dependency resolution engine locates all affected direct successor nodes (nodes C and D) using the inverted index table and executes the following pseudocode logic: function onNodeCompleted(completedNode): for each successorNode in reverseIndex[completedNode.id]: successorNode.inDegree-- if successorNode.inDegree == 0: bool conditionMet = evaluateCondition(successorNode.conditionExpression) if conditionMet: addToExecutableSet(successorNode) For successor node C, its in-degree counter is decremented from 1 to 0, and the dependency expression "A.status== COMPLETED AND A.output.creditScore>600" is re-evaluated. Assuming A's output credit score is 650, the expression evaluates to true, therefore node C is determined to be an executable node and added to the executable node set. For successor node D, its in-degree counter is decremented from 3 to 2, but it has not yet reached zero, so it is not yet determined.

[0045] Node B then completes execution, and the event bus publishes a B_COMPLETED event. The dependency resolution engine executes the aforementioned pseudocode logic again, decrementing the in-degree counter of node D from 2 to 1. After node C completes execution, it publishes a C_COMPLETED event, decrementing the in-degree counter of node D from 1 to 0. At this point, the dependency condition expression is re-evaluated; all three predecessor nodes have completed and the condition is met, so node D is added to the set of executable nodes.

[0046] like Figure 4As shown, the system employs a priority-based scheduling queue model for node scheduling. The priority queue manager maintains multiple first-in-first-out queues based on node priority attributes, such as high-priority queues, medium-priority queues, and low-priority queues. The load balancer monitors system resource usage and dynamically adjusts the rate at which nodes are retrieved from each priority queue. When the system load is high, the node retrieval rate for low-priority queues is appropriately reduced to prioritize the execution of high-priority tasks. The thread pool executor is responsible for actually executing the logic of the business processing components, supporting concurrent execution of multiple nodes.

[0047] like Figure 5 As shown, this embodiment also supports dynamic refactoring of the running process during execution. Assume that while node A is completed and nodes B and C are executing, the risk control strategy changes, requiring the addition of a new node E_Blacklist Review between credit inquiry and comprehensive approval. The system receives a refactoring instruction: operation type is insert new node, target is node D, new node is E, and edge relationships are from A to E and from E to D. The runtime refactoring module performs the following operations: locks the graph structure of the current process instance and pauses the scheduling of the new node; creates a new instance of node E, initializes its state to pending scheduling, and sets its in-degree counter to 1; deletes the existing edge A→D and adds edges A→E and E→D; updates the in-degree counters of affected nodes, incrementing the in-degree of node D by 1 and setting the in-degree of node E to 1; updates the reverse index table, adding E to A's notification list, adding D to E's notification list, and removing D from A's notification list; unlocks the process instance and triggers local dependency recalculation in the affected area. Since node A has been completed, the system immediately detects that the in-degree counter of node E has returned to zero and the dependency condition expression is empty. Node E is then added to the set of executable nodes, enabling dynamic adjustment of the running logic without terminating the entire process instance.

[0048] like Figure 6 As shown, the complete execution sequence diagram of this embodiment illustrates the complete scheduling process from process initiation to completion of all nodes, including the order of occurrence of node state change events, the triggering timing of dependency resolution calculation, and the concurrency of scheduling execution.

[0049] Through the above process, this embodiment realizes a complete technical solution from directed graph modeling, hierarchical state machine configuration, event-driven dependency resolution, priority scheduling to runtime dynamic reconstruction. While greatly improving the efficiency of dependency resolution, it provides the process scheduling system with flexible runtime adjustment capabilities.

[0050] Example 4 like Figure 7 As shown, this embodiment of the invention provides a dynamic scheduling system for processes based on the fusion of graph structure and state machine. The system includes an event monitoring module, a dependency resolution calculation module, and a scheduling execution module.

[0051] The event listening module is used to monitor node state change events and capture events indicating that a node's state has changed to the "complete" state. This module continuously monitors the state changes of each business node in the process instance in an event-driven manner. When the state machine of any node transitions to the "complete" state, the event listening module captures the state change event and passes it as a trigger signal to the dependency resolution calculation module. Through this event listening mechanism, the system can respond to node state changes in real time, avoiding the resource consumption and response latency associated with polling.

[0052] The dependency resolution calculation module communicates with the event listening module. Based on preset dependency relationship data, it identifies the direct successor nodes affected by a given node and determines whether these direct successor nodes meet the execution conditions, thus obtaining a set of executable nodes. The dependency relationship data includes each node's in-degree counter, dependency condition expression, and inverted index table. The in-degree counter records the number of unmet predecessor dependencies of a node. The dependency condition expression describes the completion status requirements or output data conditions of the predecessor node. The inverted index table directly locates the node's direct successor nodes when the node's state changes. Upon receiving a node completion event from the event listening module, the dependency resolution calculation module locates all affected direct successor nodes using the inverted index table. It performs dependency resolution calculations on each direct successor node, determining that nodes with in-degree counters set to zero and dependency condition expressions evaluating to true meet the execution conditions and adding them to the set of executable nodes.

[0053] The scheduling and execution module communicates with the dependency resolution and computation module to allocate nodes from the executable node set to the execution engine for scheduling and execution. After receiving the executable node set output by the dependency resolution and computation module, the scheduling and execution module places the nodes into queues of corresponding priorities based on their priority attributes, estimated execution time, and system load balancing strategies, and then invokes pre-registered business processing components to execute business logic. After a node completes execution, the scheduling and execution module updates the node's state machine to the completed state and publishes the state change event to the event bus. The event bus then passes the event to the event listening module, triggering subsequent dependency resolution computation, forming a complete closed loop from event listening to dependency resolution to scheduling and execution.

[0054] The three modules work together: the event monitoring module is responsible for the real-time perception of state changes; the dependency resolution calculation module is responsible for the rapid location of dependencies and the accurate judgment of execution conditions; and the scheduling and execution module completes the concurrent execution of business logic and state updates. A reverse index table enables rapid location of direct successor nodes, narrowing the scope of dependency resolution calculation from all nodes of the process instance to the affected direct successor nodes. An event-driven scheduling model decouples state updates from dependency resolution, enabling the system to handle state changes and scheduling execution of multiple nodes asynchronously and in parallel. This architecture provides efficient technical support for process scheduling in large-scale concurrent scenarios and provides a fundamental guarantee for dynamic reconfiguration of runtime processes.

[0055] Example 5 This invention also provides a computer device in specific embodiments. Specifically, the computer device includes a processor and a memory. The memory stores a computer program, which includes program instructions. The processor executes the program instructions stored in the computer storage medium. The processor may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing and control core of the terminal, suitable for implementing one or more instructions, specifically suitable for loading and executing one or more instructions to achieve corresponding method flows or corresponding functions. The processor described in this embodiment can be used to monitor node state change events and obtain events indicating that a node state has changed to a completed state. Based on preset dependency data, the direct successor nodes affected by the node are determined, and it is determined whether the direct successor nodes meet the execution conditions to obtain a set of executable nodes; the dependency data includes the in-degree counter, dependency condition expression and inverted index table for each node, and the inverted index table is used to locate the direct successor nodes of the node. The nodes in the set of executable nodes are assigned to the execution engine for scheduling and execution.

[0056] Example 6 This invention also provides a storage medium, specifically a computer-readable storage medium, which is a memory device in a terminal device used to store programs and data. It is understood that the computer-readable storage medium here can include both the built-in storage medium in the terminal device and extended storage media supported by the terminal device. The computer-readable storage medium provides storage space, which stores the terminal's operating system. Furthermore, the storage space also stores one or more instructions suitable for loading and execution by a processor. These instructions can be one or more computer programs (including program code). It should be noted that the computer-readable storage medium here can be a high-speed RAM memory or a nonvolatile memory, such as at least one disk storage device. The processor can load and execute one or more instructions stored in the computer-readable storage medium to implement the corresponding steps of the methods in the above embodiments; the one or more instructions in the computer-readable storage medium are loaded and executed by the processor to perform the following steps: listening for node state change events, and obtaining an event indicating that the node state has changed to a completed state; Based on preset dependency data, the direct successor nodes affected by the node are determined, and it is determined whether the direct successor nodes meet the execution conditions to obtain a set of executable nodes; the dependency data includes the in-degree counter, dependency condition expression and inverted index table for each node, and the inverted index table is used to locate the direct successor nodes of the node. The nodes in the set of executable nodes are assigned to the execution engine for scheduling and execution.

[0057] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0058] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0059] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0060] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0061] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. It will be apparent to those skilled in the art that the invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered illustrative and non-limiting in all respects, and the scope of the invention is not limited by the foregoing description. Thus, all changes falling within the meaning and scope of equivalents are intended to be included within the scope of the invention. No reference numerals in the drawings should be considered limiting.

[0062] Furthermore, it should be understood that although this specification describes embodiments, not every embodiment contains only one independent technical solution. This narrative style is merely for clarity. Those skilled in the art should consider the specification as a whole, and the technical solutions in each embodiment can be appropriately combined to form other embodiments that can be understood by those skilled in the art. The above content is only for illustrating the technical concept of the present invention and should not be used to limit the scope of protection of the present invention. Any modifications made to the technical solutions based on the technical concept proposed in this invention fall within the scope of protection of this invention.

Claims

1. A dynamic process scheduling method based on the fusion of graph structure and state machine, characterized in that, Includes the following steps: Listen for node state change events and obtain the event when the node state changes to the completed state; Based on preset dependency data, the direct successor nodes affected by the node are determined, and it is determined whether the direct successor nodes meet the execution conditions to obtain a set of executable nodes. The dependency data includes an in-degree counter for each node, a dependency condition expression, and an inverted index table, which is used to locate the direct successor node of a node. The nodes in the set of executable nodes are assigned to the execution engine for scheduling and execution.

2. The process dynamic scheduling method based on the fusion of graph structure and state machine as described in claim 1, characterized in that, The dependency condition expression is a Boolean logic expression used to describe the completion status requirements of the preceding node or the output data conditions of the preceding node. The expression supports AND, OR, and NOT logical combination operations on multiple preceding node states.

3. The process dynamic scheduling method based on the fusion of graph structure and state machine as described in claim 1, characterized in that, The step of determining whether a direct successor node meets the execution conditions includes: decrementing the in-degree counter of the direct successor node by 1, re-evaluating the dependency condition expression of the direct successor node, and determining the direct successor node as meeting the execution conditions if and only if the in-degree counter is 0 and the evaluation result of the dependency condition expression is true.

4. The process dynamic scheduling method based on the fusion of graph structure and state machine as described in claim 1, characterized in that, Also includes: A hierarchical state machine model is configured for each node. The hierarchical state machine model includes node-level states, which include at least the pending state, ready state, running state, and completed state.

5. The process dynamic scheduling method based on the fusion of graph structure and state machine according to claim 4, characterized in that, The hierarchical state machine model also includes instance-level states, and the node-level states include suspended states, failed states, and compensating states. The transitions between states are triggered by internal or external events.

6. The process dynamic scheduling method based on the fusion of graph structure and state machine as described in claim 1, characterized in that, The step of allocating nodes from the executable node set to the execution engine for scheduling and execution includes: placing nodes into queues of corresponding priorities to wait for execution based on the node's priority attributes, estimated execution time, and system load balancing strategy.

7. The process dynamic scheduling method based on the fusion of graph structure and state machine according to claim 1, characterized in that, It also includes runtime process refactoring steps: Receive external reconstruction instructions and perform dynamic modification operations on the directed graph model during the process. The modification operations include inserting new nodes, deleting existing nodes, or adjusting the directed connection edges between nodes. Lock the graph structure of the current process instance and pause the scheduling of new nodes; The graph structure is updated according to the modification operation, the in-degree counters of the affected nodes are recalculated, and the reverse index table is updated. Unlock the process instance and trigger a local dependency recalculation in the affected area.

8. A dynamic process scheduling system based on the fusion of graph structure and state machine, characterized in that, include: The event listening module is used to listen for node state change events and obtain events when a node's state changes to the completed state. The dependency resolution calculation module is used to determine the direct successor nodes affected by the node based on preset dependency relationship data, and to determine whether the direct successor nodes meet the execution conditions, thereby obtaining a set of executable nodes. The dependency data includes an in-degree counter for each node, a dependency condition expression, and an inverted index table, which is used to locate the direct successor node of a node. The scheduling and execution module is used to allocate nodes in the set of executable nodes to the execution engine for scheduling and execution.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the process dynamic scheduling method based on the fusion of graph structure and state machine as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the process dynamic scheduling method based on the fusion of graph structure and state machine as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Code-free configurable task process type development system and method

    CN120743253A