Workflow operation condition monitoring method and device and computer equipment
By extracting node status and relationships from the execution logs of workflow tasks, constructing a hierarchical nested graph object and generating a visual graph, the problem of low efficiency and poor accuracy in existing workflow monitoring technologies is solved, and efficient, reliable and intuitive workflow management is achieved in a cloud network environment.
Patent Information
- Application Number
- CN202511774193.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-28
- Publication Date
- 2026-03-06
AI Technical Summary
Existing methods for monitoring workflow operation are inefficient and difficult to accurately and quickly locate problems, especially in cloud network environments where users cannot directly access web pages to view status, server load is high, scheduling reliability is poor, and monitoring and problem localization are difficult.
By extracting node status information and relationships from the execution logs of workflow tasks, a hierarchical nested graph object is constructed, generating descriptive text that conforms to the target syntax, and a visualization graph is generated based on the descriptive text. It supports a manual retry mechanism and uses Go coroutine technology and Mermaid format to display the workflow operation status.
It enables efficient monitoring and improved accuracy of workflow operation, allowing users to intuitively identify problems, reduce server load, enhance workflow reliability and stability, and provide a convenient method for fault location.
Smart Images

Figure CN121614341A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, computer equipment, storage medium, and computer program product for monitoring workflow operation. Background Technology
[0002] With the development of computer and internet technologies and the advent of the 5G era, the internet has brought great convenience to modern life, and workflow management in cloud network environments has attracted much attention. In this environment, workflow services are typically deployed on remote servers, and clients connect to the server via the network. The server then presents the workflow status information to the client in the form of a webpage.
[0003] However, current workflow monitoring methods primarily rely on querying database records using business logic to obtain workflow status. This approach requires writing complex query statements and is inefficient. When workflow issues arise, it's difficult to quickly pinpoint the problem, requiring significant time and effort for troubleshooting. Therefore, improving both the efficiency and accuracy of workflow monitoring is a pressing issue that needs to be addressed. Summary of the Invention
[0004] Therefore, it is necessary to provide a method, device, computer equipment, computer-readable storage medium, and computer program product for monitoring workflow operation status, which can improve the efficiency of workflow operation status monitoring, effectively improve the accuracy of workflow operation status monitoring, and more intuitively identify problems in the workflow.
[0005] Firstly, this application provides a method for monitoring the operation of a workflow. The method includes: during the execution of a workflow task, extracting the status information of each node and the relationships between the nodes from the execution log of the workflow task; constructing a graph object with a hierarchical nested structure based on the relationships between the nodes; generating descriptive text conforming to a target syntax based on the status information of each node, the graph object, and a preset template; and generating a visualization graph reflecting the operation of the workflow task based on the descriptive text; the visualization graph includes at least the execution order and execution status of each node in the workflow task.
[0006] Secondly, this application also provides a monitoring device for workflow operation. The device includes: an extraction module, used to extract the status information of each node and the relationships between the nodes from the execution log of the workflow task during execution; a construction module, used to construct a graph object with a hierarchical nested structure based on the relationships between the nodes; a generation module, used to generate descriptive text conforming to a target syntax based on the status information of each node, the graph object, and a preset template; and to generate a visualization graph reflecting the operation of the workflow task based on the descriptive text; the visualization graph includes at least the execution order and execution status of each node in the workflow task.
[0007] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps described in the above-mentioned workflow operation monitoring method.
[0008] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps described in the above-described workflow operation monitoring method.
[0009] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps described in the above-mentioned workflow operation monitoring method.
[0010] The aforementioned method, apparatus, computer equipment, storage medium, and computer program product for monitoring workflow operation status extracts the status information of each node and the relationships between nodes from the execution log of the workflow task during the execution of the workflow task, and constructs a graph object with a hierarchical nested structure based on the relationships between nodes; further, based on the status information of each node, the graph object, and a preset template, a descriptive text conforming to the target syntax is generated, and based on the descriptive text, a visualization graph reflecting the operation status of the workflow task is generated, the visualization graph including at least the execution order and execution status of each node in the workflow task. Since the status information of each node and the relationships between nodes are extracted dynamically and in real time from the execution logs of the workflow task, the graph object with a hierarchical nested structure built based on the relationships between nodes is more accurate. Consequently, the dynamically generated descriptive text based on the status information of each node, the graph object, and the preset template is also more accurate. Furthermore, based on the descriptive text, a visualization graph reflecting the operation status of the workflow task can be automatically generated. This visualization graph can more intuitively display the execution order and execution status of each node in the workflow task, thereby reflecting a more comprehensive and accurate workflow task operation status. This achieves the technical effect of improving the efficiency of workflow operation monitoring while also effectively improving the accuracy of workflow operation monitoring, and more intuitively and quickly identifying problems in the workflow. Attached Figure Description
[0011] Figure 1 This is an application environment diagram of a workflow operation monitoring method in one embodiment;
[0012] Figure 2 This is a flowchart illustrating a method for monitoring workflow operation in one embodiment;
[0013] Figure 3 This is a schematic diagram of a manual retry workflow or event flow provided in one embodiment;
[0014] Figure 4 This is a schematic diagram of a program flow based on the mermaid format provided in one embodiment;
[0015] Figure 5 This is a structural block diagram of a workflow operation monitoring device in one embodiment;
[0016] Figure 6 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0017] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0018] It should be noted that in the following description, the terms "first, second, and third" are used only to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first, second, and third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0019] The workflow operation monitoring method provided in this application embodiment can be applied to, for example, Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or placed on a cloud or other network server. Terminal 102 can be a user terminal, and server 104 can be a remote server deployed with a workflow service. Specifically, when server 104 receives a workflow task sent by terminal 102, during the execution of the workflow task, server 104 can extract the status information of each node and the relationships between nodes from the workflow task's execution log, and construct a graph object with a hierarchical nested structure based on the relationships between nodes. Furthermore, server 104 can generate descriptive text conforming to the target syntax based on the status information of each node, the graph object, and a preset template, and send the descriptive text conforming to the target syntax to terminal 102, so that terminal 102 can generate a visualization graph reflecting the operation of the workflow task based on the descriptive text. The visualization graph includes at least the execution order and execution status of each node in the workflow task.
[0020] Among them, terminal 102 can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, IoT device and portable wearable device, and IoT device can be a smart speaker, smart TV, smart air conditioner and smart vehicle device, etc.
[0021] Server 104 can be a standalone physical server or a service node in a blockchain system.
[0022] In one embodiment, such as Figure 2 As shown, a method for monitoring workflow operation is provided. This method can be executed by the server or terminal alone, or by both the server and terminal. This method can be applied to... Figure 1 Taking the server in the example, the following steps are included:
[0023] Step 202: During the execution of the workflow task, extract the status information of each node and the relationship between each node from the execution log of the workflow task.
[0024] In this context, a workflow task refers to a task used to execute a workflow. For example, in this application, a workflow task can be a different business request.
[0025] Execution logs are logs generated in real time when workflow tasks are executed.
[0026] A node is a specific unit of execution within a workflow task; it can also be called a Step or a node task. For example, in this application, a node can refer to a specific unit of execution within a workflow or event flow, representing a defined task or operation. Each step has its own inputs, outputs, and execution logic, and its parameters can be configured as needed. In business logic, a step is typically a specific method that is executed.
[0027] The status information of a node refers to information related to the execution status of the execution unit. For example, the status information in this application includes the execution status of each node (node task), such as whether each node task has started execution, is in execution, has completed execution, or has failed execution, and this status information is stored in the database.
[0028] Association refers to the relationships between various execution units (execution nodes) in a workflow task. For example, ... Figure 3 The diagram illustrates a manual retry workflow or event flow. Figure 3 The workflow task shown contains 3 nodes, which are 3 specific execution units (step1, step2 and step3). The parallel relationship between these three nodes is the association relationship.
[0029] Step 204: Based on the relationships between nodes, construct a graph object with a hierarchical nested structure.
[0030] In this context, a graph object refers to a drawing object used to reflect the structural relationships between various objects (instances) involved in a workflow task. It can be understood as a graph architecture. In some cases, the graph object in this application can be an object graph. An object graph contains the structural relationships between various object instances involved in a workflow task, that is, it is used to show the association relationships between object instances of a workflow task at a specific moment, and is a type of data graph. It is constructed through the attribute values, names (in the format "object name: class name"), and links of specific objects, reflecting the instantiation state of a class diagram or component. It is often used to verify data structure design or to illustrate static snapshots of dynamic interaction scenarios. For example, as... Figure 4The diagram shown is a flowchart based on the Mermaid format. The diagram objects in this application can be as follows: Figure 4 The diagram shown illustrates a hierarchical structure representing objects and their relationships at a given moment. Based on the graph objects, dynamic information of each node, and preset templates, a visualization of the workflow task's execution can be automatically generated, as shown below. Figure 4 The image shown is a visualization of the real-time status of each node.
[0031] Specifically, let's take a remote server, i.e., a cloud server, that has deployed workflow services as an example. During the execution of workflow tasks on the cloud server, it can read the execution logs of the workflow tasks in real time and extract the status information of each node and the relationships between them. For example, the status information extracted by the cloud server includes the execution status of each node (node task), such as whether the node task has started execution, is executing, has completed execution, or has failed, and stores this status information in a database. Furthermore, the cloud server can use the Cobra open-source tool to create binary executable files, allowing it to remotely schedule database content and view the workflow status in real time.
[0032] Furthermore, cloud servers can construct nested subgraph structures based on the relationships between nodes. For example, a cloud server can automatically derive boundary subgraphs using the relationships between nodes, achieving seamless connection between subgraphs and parent graphs. This overcomes the limitations of Mermaid's native syntax in supporting complex nested structures and supports the expression of workflows at arbitrary depths. Moreover, cloud servers can construct graph objects with hierarchical nesting structures based on nested subgraph structures (i.e., multi-level nested graph structures under parent-child scheduling). For example, the multi-level nested structures constructed by the cloud server could be like... Figure 4 The call structure between multi-level nodes is shown in the figure.
[0033] In one embodiment, the execution method of a workflow task includes: generating an event creation request based on the workflow task; creating a target event based on the event creation request and persisting the state of the target event in the database as an initial state; detecting the execution status of each node task contained in the event structure of the target event; and updating the state of the target event to indicate successful execution when the execution status of each node task indicates successful execution.
[0034] In one embodiment, the node includes a first node task, and the method further includes: parsing the event structure of the target event to obtain the number of retries for the target event; the event structure is a hierarchically nested recursive structure; after detecting the execution status of each node task included in the event structure of the target event, the method further includes: if the execution status of the first node task indicates execution failure, propagating the execution status indicating execution failure back to the associated nodes in the task execution tree; the task execution tree is constructed based on the association relationship between each node task; triggering the re-execution of the first node task based on the number of retries; or, in response to the triggered retry operation, triggering the re-execution of the first node task.
[0035] In one embodiment, after triggering the re-execution of the first node task based on the number of retries, the method further includes: if the execution status obtained from executing the first node task indicates execution failure, in response to the retry operation triggered for the target event, triggering the re-execution of each node task contained in the event structure of the target event. Thus, the manually triggered retry mechanism enhances the workflow's ability to handle abnormal situations, improving the reliability and stability of the entire workflow.
[0036] Step 206: Based on the state information of each node, graph objects, and preset templates, generate descriptive text that conforms to the target syntax.
[0037] Here, the preset template refers to a pre-defined template used to generate descriptive text that conforms to the target syntax. For example, the preset template in this application can be a Mermaid template. Subsequently, the real-time obtained node status information can be dynamically bound to the Mermaid template variable to obtain the dynamically bound Mermaid template content. That is, the real-time obtained node status information is streamed into the Mermaid template. For example, the Mermaid template content in this application is shown in the following example:
[0038] var mermaidTemplate = mermaid
[0039] title: Workflow diagram of {{.WorkflowName}}
[0040] flowchart {{.Direction}}
[0041] {{printf "%s:%s" .Root.Id .Root.Status}}
[0042] {{printf "%s:%s -.-> %s" .Root.Id .Root.Status .WorkflowName}}
[0043] {{template "graph" .}}
[0044] {{define "graph"}}
[0045] subgraph {{printf "%s[%s]" .WorkflowName .WorkflowName}}
[0046] direction {{.Direction}}
[0047] {{range $node := .Nodes}}
[0048] {{printf "%s:%s[%s:%s]" $node.Id $node.Status $node.Id $node.Status}}
[0049] {{- end -}}
[0050] {{range $transition := .Transitions}}
[0051] {{range $toNode := $transition.To}}
[0052] {{printf "%s:%s --> %s:%s" $transition.From.Id $transition.From.Status $toNode.Id $toNode.Status}}
[0053] end
[0054] {{range $transition := .ExternalTransitions}}
[0055] {{range $toNode := $transition.To}}
[0056] {{printf "%s:%s -.-> %s:%s" $transition.From.Id $transition.From.Status $toNode.Id $toNode.Namespace}}
[0057] {{- end -}}
[0058] {{if .Subgraphs}}
[0059] {{range $ns, $subgraph := .Subgraphs}}
[0060] {{template "graph" $subgraph}}
[0061] {{- end -}}.
[0062] The target grammar refers to the preset grammar. For example, the target grammar in this application could be Mermaid grammar.
[0063] The descriptive text refers to the text used to generate the visualization. For example, in this application, the descriptive text can be text output in Mermaid text format or a visualization file. After obtaining the text or visualization file output in Mermaid text format, the client user only needs to paste the generated text onto an external website that supports Mermaid to automatically convert the descriptive text into a visualization. The user can then visually view the workflow's progress and locate problematic nodes that failed to execute.
[0064] Step 208: Based on the description text, generate a visualization diagram to reflect the operation of the workflow task; the visualization diagram shall include at least the execution order and execution status of each node in the workflow task.
[0065] The visualization diagram can be a state operation diagram of a workflow task, which contains information such as the execution status and execution order (dependency) of each node under the parent-child structure scheduling.
[0066] Specifically, let's take a remote server, i.e., a cloud server, that has deployed workflow services as an example. During the execution of workflow tasks on the cloud server, after constructing a hierarchical nested graph object based on the relationships between nodes, the cloud server can automatically generate descriptive text conforming to the target syntax based on the status information of each node, the graph object, and preset templates. For example, the cloud server can automatically generate a visualization file conforming to Mermaid syntax. Furthermore, based on the descriptive text, the cloud server can generate a visualization diagram reflecting the operation of the workflow task. For example, based on a visualization file conforming to Mermaid syntax, the cloud server can generate a status graph of the workflow task under a parent-child structure scheduling, allowing users to intuitively understand the overall status of the current workflow operation and quickly locate faults from the status graph.
[0067] Furthermore, in some situations, such as after a workflow task has been completed, users can check the workflow's progress at any time. For example, users can view relevant information about a specific workflow through maintenance tools. The cloud server responds to user-triggered drawing commands, displaying a page for selecting workflow task parameters. Further, in response to user actions on the page, the cloud server identifies the relationship structure between nodes in the workflow task and dynamically updates the state of the relational structure based on data stored in the database. Then, based on the state and a preset template, it generates descriptive text in the target format and, based on the descriptive text, generates a state flow diagram under the parent-child structure scheduling of the workflow task. This allows users to quickly find nodes that failed to execute. In other words, the cloud server can call the `event-draw` command, select relevant parameters, automatically identify the parent-child relationship structure between events and steps, update the corresponding structure state from stored data, and finally generate mermaid text based on the template.
[0068] In one embodiment, based on the state information of each node, the graph object, and the preset template, a description text conforming to the target syntax is generated, including: dynamically binding the state information of each node to the template variable in the preset template to obtain an updated template; generating a description text conforming to the target syntax based on the graph object and the updated template; or, obtaining the rendering template and layout information input by the user, and generating a description text conforming to the target syntax based on the rendering template, layout information, graph object, and updated template.
[0069] In this embodiment, during the execution of a workflow task, the status information of each node and the relationships between each node are extracted from the execution log of the workflow task. Based on the relationships between each node, a graph object with a hierarchical nested structure is constructed. Furthermore, based on the status information of each node, the graph object, and a preset template, descriptive text conforming to the target syntax is generated. Based on the descriptive text, a visualization graph reflecting the operation of the workflow task is generated. The visualization graph includes at least the execution order and execution status of each node in the workflow task. Since the status information of each node and the relationships between nodes are extracted dynamically and in real time from the execution logs of the workflow task, the graph object with a hierarchical nested structure built based on the relationships between nodes is more accurate. Consequently, the dynamically generated descriptive text based on the status information of each node, the graph object, and the preset template is also more accurate. Furthermore, based on the descriptive text, a visualization graph reflecting the operation status of the workflow task can be automatically generated. This visualization graph can more intuitively display the execution order and execution status of each node in the workflow task, thereby reflecting a more comprehensive and accurate workflow task operation status. This achieves the technical effect of improving the efficiency of workflow operation monitoring while also effectively improving the accuracy of workflow operation monitoring, and more intuitively and quickly identifying problems in the workflow.
[0070] In one embodiment, the execution method of a workflow task includes:
[0071] Generate event creation requests based on workflow tasks;
[0072] Based on the event creation request, create the target event and persist the state of the target event in the database to the initial state;
[0073] Detect the execution status of each node task contained in the event structure of the target event;
[0074] If the execution status of each node task indicates successful execution, update the status of the target event to indicate successful execution.
[0075] Specifically, let's take a remote server (cloud server) with a deployed workflow service as an example. The cloud server can generate an event creation request based on workflow tasks, create a target event (Event), and persist the target event's state in the database as its initial state. Alternatively, after receiving an event creation request, the cloud server can create the target event and persist its initial state as "init" in the database. Furthermore, the cloud server can start an elastic coroutine allocator, allowing it to consume queues according to the priority of each target event based on current resource load. Simultaneously, the cloud server monitors the execution status of each step (node) within the target event in real time and implements optimistic locking control through version numbers. That is, the cloud server can detect the execution status of each task node within the event structure of the target event in real time, and update the target event's state to indicate successful execution when all task node execution statuses indicate success. This allows for more efficient use of server resources in a cloud environment through the lightweight nature of coroutines, reducing server load and improving the overall performance and response speed of the workflow service. Furthermore, in scenarios involving synchronous calls between multiple components, a well-structured Step can asynchronously implement RPC calls for each request. If a step fails, the operation and maintenance tools implemented in Cobra can be used to reschedule the Step and update the Event status, thereby ensuring resource consistency for business requests and improving the stability and reliability of the workflow.
[0076] In one embodiment, the node task includes a first node task, and the method further includes:
[0077] Analyze the event structure of the target event to obtain the number of retries for the target event; the event structure is a hierarchical nested recursive structure;
[0078] After detecting the execution status of each node task contained in the event structure of the target event, the method further includes:
[0079] If the execution status of the first node task indicates failure, the execution status indicating failure is propagated back to the associated nodes in the task execution tree; the task execution tree is constructed based on the relationships between the tasks at each node.
[0080] Based on the number of retries, trigger the re-execution of the first node task; or...
[0081] In response to the triggered retry operation, the first node task is re-executed.
[0082] In this context, a node task refers to a subtask executed by each node (each Step). The first node task can be a subtask executed by any node (any Step) in the target event.
[0083] Specifically, let's take a remote server, i.e., a cloud server, that has deployed workflow services as an example. Based on an event creation request, the cloud server creates a target event (Event) and persists its state in the database to an initial state. Then, the cloud server can parse the event structure of the target event to obtain the retry count. The event structure is a hierarchical, nested recursive structure. Furthermore, the cloud server monitors the execution status of each step (node) in the target event in real time and implements optimistic locking control through version numbers. That is, the cloud server can detect the execution status of each node task contained in the event structure of the target event in real time. If the execution status of the first node task (one of the node tasks) indicates failure, it propagates the failure status back to the associated nodes (upper or lower level nodes) in the task execution tree. The task execution tree is constructed based on the relationships between the node tasks. Further, the cloud server can automatically trigger the re-execution of the first node task based on the retry count until the retry count is reached, and then outputs the execution status of the first node task.
[0084] Alternatively, if the execution status of the first node task (one of the node tasks) indicates failure, the cloud server can propagate the failure status back to the related nodes (upper or lower level nodes) in the task execution tree. Furthermore, it can provide a user-initiated retry function. This means that operations personnel can choose to retry the failed step (node task) based on the actual situation. For example, if an operations personnel triggers a retry operation for the first node task, the cloud server will respond by re-executing the first node task. The cloud server will reload the relevant parameters of the workflow task; the specific context has been stored in the database, so it can be rescheduled to a suitable node for execution. This addition of a manual retry mechanism effectively enhances the workflow's ability to handle abnormal situations and improves the overall reliability and stability of the workflow.
[0085] In one embodiment, after triggering the re-execution of the first node task based on the number of retries, the method further includes:
[0086] If the execution status obtained from executing the first node task indicates that the execution has failed, in response to the retry operation triggered for the target event, the node tasks contained in the event structure of the target event are re-executed.
[0087] If the execution status of the first node task indicates that the execution failed, such as Figure 3 As shown, operations and maintenance personnel can choose to retry a failed step (node task) or retry the target event, depending on the actual situation. In other words, users can manually retry failed events. In response to the user's retry operation triggered for the target event, the node tasks contained in the event structure of the target event are re-executed. This adds a manual retry mechanism, effectively enhancing the workflow's ability to handle exceptions. It supports users manually retrying failed events, avoiding duplicate resource requests and ensuring business consistency.
[0088] In one embodiment, the step of constructing a graph object with a hierarchical nested structure based on the relationships between nodes includes:
[0089] Based on the relationships between nodes, construct a nested subgraph structure;
[0090] Based on the nested subgraph structure, construct graph objects with hierarchical nesting.
[0091] Specifically, let's take a remote server, i.e., a cloud server, that has deployed workflow services as an example. During the execution of workflow tasks on the cloud server, it can construct nested subgraph structures based on the relationships between nodes. For instance, the cloud server can automatically deduce boundary subgraphs using the relationships between nodes, achieving seamless connection between subgraphs and parent graphs. This has the advantage of overcoming the limitations of Mermaid's native syntax in supporting complex nested structures, while also supporting the expression of workflows of arbitrary depth. Furthermore, the cloud server can construct graph objects with hierarchical nesting structures based on the nested subgraph structure (i.e., a multi-level nested graph structure under parent-child structure scheduling). For example, the multi-level nested structure constructed by the cloud server could be like this... Figure 4 The diagram illustrates the multi-level node call structure. This allows for the automatic derivation of boundary subgraphs by leveraging the relationships between nodes, achieving seamless integration between subgraphs and parent graphs. This overcomes the limitations of Mermaid's native syntax in supporting complex nested structures and supports the expression of workflows at arbitrary depths. It makes the real-time constructed graph objects with hierarchical nested structures more accurate, better reflecting business problems in deep workflows and facilitating rapid identification of these problems.
[0092] In one embodiment, the step of generating descriptive text conforming to the target syntax based on the state information of each node, graph objects, and preset templates includes:
[0093] The status information of each node is dynamically bound to the template variables in the preset template to obtain the updated template;
[0094] Based on the graph object and the updated template, generate descriptive text that conforms to the target syntax; or,
[0095] Obtain the rendering template and layout information input by the user, and generate descriptive text that conforms to the target syntax based on the rendering template, layout information, graph object, and update template.
[0096] Specifically, let's take a remote server, i.e., a cloud server, that has deployed workflow services as an example. During the execution of workflow tasks on the cloud server, after constructing a hierarchical nested graph object based on the relationships between nodes, the cloud server can automatically generate descriptive text conforming to the target syntax based on the status information of each node, the graph object, and preset templates. For example, the cloud server can dynamically bind the status information of each node to template variables in the preset template to obtain an updated template, and generate descriptive text conforming to Mermaid syntax based on the graph object and the updated template. Alternatively, users can input custom rendering templates and layout information in real time. The terminal then obtains the user-input rendering templates and layout information, and generates descriptive text conforming to Mermaid syntax based on the rendering template, layout information, graph object, and updated template. This allows users to paste the generated descriptive text onto external websites, automatically converting it into a visual graph reflecting the workflow task's operation. This allows users to intuitively understand the overall status of the current workflow operation and quickly locate faults from the status graph, effectively improving the user's interactive experience and bringing convenience.
[0097] In one embodiment, after generating a visualization based on descriptive text to reflect the execution status of workflow tasks, the method further includes:
[0098] Once the workflow task is completed, in response to the triggered drawing command, a page for selecting relevant parameters of the workflow task is displayed;
[0099] In response to page-triggered actions, identify the relationship structure between nodes in the workflow task;
[0100] Based on the data stored in the database, the state of the relational structure is dynamically updated.
[0101] Based on the status and preset template, generate descriptive text in the target format;
[0102] Based on the description text, a state operation diagram is generated under the parent-child structure scheduling of the workflow task. The state operation diagram is used to locate the node that represents the execution failure.
[0103] Specifically, after a workflow task is completed, users can check its execution status at any time. For example, users can view relevant information about a specific workflow through maintenance tools. The cloud server responds to user-triggered drawing commands, displaying a page for selecting workflow task parameters. Furthermore, in response to user actions on the page, the cloud server identifies the relationship structure between nodes in the workflow task and dynamically updates the state of the relational structure based on data stored in the database. Then, based on the state and a preset template, it generates a description text in the target format and, based on the description text, generates a state flow diagram under the parent-child structure scheduling of the workflow task. This allows users to quickly find nodes that failed to execute. In other words, the cloud server can call the `event-draw` command, select relevant parameters, automatically identify the parent-child relationship structure between events and steps, update the corresponding state of the structure based on stored data, and finally generate mermaid text based on the template. This solves the problems of traditional methods, such as the inability to directly access web pages to view workflow status, low scheduling reliability, and difficulty in monitoring and locating issues. In short, this technical solution uses Go to implement maintenance tools that can monitor the execution status of workflow tasks in real time, effectively reducing server load. It also provides a manual retry mechanism, greatly enhancing workflow reliability. Simultaneously, it can generate a workflow parent-child structure scheduling status graph in Mermaid format, intuitively displaying the execution order, dependencies, and current status of each task in the workflow. This effectively solves a series of key problems in workflow management in cloud environments, such as restricted access, high load, unstable scheduling, and difficulties in monitoring and locating issues.
[0104] In one embodiment, this application also provides an application scenario in which the above-described workflow operation monitoring method is applied. Specifically, the workflow operation monitoring method is applied in this scenario as follows:
[0105] This application provides an effective operation and maintenance tool for workflow-based scheduling, enabling real-time monitoring of workflow execution status, manual triggering of retry mechanisms, and outputting a status graph of the workflow's parent-child structure in Mermaid format. This graph can be generated and pasted onto an external website for viewing, providing a more intuitive way to identify business problems and easily locate failed execution nodes. Specifically, this application focuses on workflow management in a cloud network environment where services are deployed on cloud terminals, limiting the use of traditional web-based status viewing. The technical solution utilizes Go to implement an operation and maintenance tool that can monitor workflow task execution status in real time, effectively reducing server load. Furthermore, it provides a manual retry mechanism, greatly enhancing workflow reliability. Simultaneously, it generates a workflow parent-child structure scheduling status graph in Mermaid format, intuitively displaying the execution order, dependencies, and current status of each task in the workflow. This solves a series of key problems in workflow management in cloud environments, such as limited access, high load, unstable scheduling, and difficulties in monitoring and locating issues.
[0106] EventFlow describes the entire process of an event's generation, propagation, and processing within a system. It defines the triggering order of events, the dependencies between events, and the event processing path. An event flow can be viewed as a process composed of a series of related events combined according to specific rules, used to implement complex business logic and system behavior.
[0107] Event: An event is an identifier of a specific event or state change that occurs in a system, and it can trigger a series of subsequent operations. In business logic, events are often used to abstract a set of business processes, such as remote calls between multiple services.
[0108] Step: A step is a specific unit of execution within a workflow or event flow, representing a defined task or operation. Each step has its own inputs, outputs, and execution logic, and its parameters can be configured as needed. In business logic, a step is typically a specific method that is executed.
[0109] RPC (Remote Procedure Call): RPC is a computer communication protocol that allows a program to call a procedure or function located in a different address space (usually on a different computer) as easily as calling a local procedure.
[0110] Cobra (a Go library for creating powerful command-line interfaces): Cobra is a popular open-source Go library designed specifically for developing command-line applications. It provides a concise, flexible, and powerful API that helps developers quickly build CLI tools with rich commands and subcommands. With Cobra, developers can easily define commands, parameters, flags, and handle command execution logic.
[0111] Mermaid (an open-source charting library based on JavaScript): Mermaid is a text-based open-source charting tool that allows users to describe various types of charts, such as flowcharts, sequence diagrams, Gantt charts, and class diagrams, using simple text syntax. Mermaid then parses these text descriptions and converts them into visual charts.
[0112] In the current workflow visualization technology field, traditional solutions are mainly based on local deployment or server-client models. In a local deployment scenario, all workflow-related services and data are stored on a local server, and users can view the workflow's status and progress by directly accessing a web interface on the local server. In a server-client model, the workflow service is deployed on a remote server, and the client connects to the server via a network. The server then presents the workflow's status information to the client in the form of a webpage.
[0113] These solutions typically rely on large frameworks and complex architectures to manage the various components of the workflow. The definition and execution logic of the workflow are often implemented through complex configuration files or code, requiring specialized tools for visualization. Monitoring the workflow's running status primarily involves retrieving information from relevant records in the database using business logic. This approach requires writing complex query statements and makes it difficult to intuitively display the overall workflow's operation.
[0114] Technical problems existing in traditional technical solutions:
[0115] 1. Restricted Access in Cloud Network Environments: In cloud network environments, services are deployed on cloud terminals, preventing users from directly accessing web pages to view workflow status as in traditional methods. Due to the security and isolation requirements of cloud environments, directly exposing web interfaces may pose security risks and also increases the complexity of network management. This makes it difficult for users to obtain workflow status information, reducing work efficiency.
[0116] 2. Server Load Issues: Existing workflow visualization solutions typically rely on large frameworks and complex architectures, with multiple components interdependent. As the scale and complexity of workflows increase, these frameworks can exacerbate server load. Servers need to handle a large number of requests and data, which can easily lead to performance degradation or even service crashes.
[0117] 3. Scheduling reliability issues: When scheduling among multiple services, existing technical solutions struggle to guarantee scheduling reliability due to the complex dependencies between components. If a component fails or experiences a delay, it may affect the normal operation of the entire workflow, leading to task execution failures or data loss.
[0118] 4. Difficulty in monitoring and problem localization: Existing monitoring methods mainly rely on business logic to query records in the database to obtain the workflow's operational status. This approach requires writing complex query statements and makes it difficult to intuitively display the overall workflow operation. When problems occur in the workflow, it is difficult to quickly locate the problem, requiring a significant amount of time and effort for troubleshooting.
[0119] Therefore, to address the aforementioned issues, this application proposes a real-time monitoring and visualization method for cloud network workflows. This method aims to solve problems such as restricted access, high server load, and difficulties in monitoring and problem localization in existing cloud network workflow visualization and scheduling management, providing an efficient, reliable, and intuitive workflow operation and maintenance solution. The specific implementation steps are as follows:
[0120] 1. Real-time monitoring of operating status
[0121] Go goroutines are used to push the execution of each task in the workflow. Go goroutines continuously collect task status information, such as whether the task has started, is in progress, completed, or failed, using a lightweight concurrent processing method, and store this information in a database. This step is one of the key inventions; scheduling the binary executable file generated by cobra allows real-time monitoring of the workflow's execution status in the database.
[0122] 2. Manual retry mechanism triggered
[0123] When a step task fails, the system provides a manual retry function. Operations personnel can choose to retry the failed step based on the actual situation. The system will reload the relevant parameters of the task; the specific context is stored in the database, so it can be rescheduled to a suitable node for execution. This is another key invention: the manual retry mechanism enhances the workflow's ability to handle exceptions and improves the overall reliability of the workflow. Figure 3 As shown in the image.
[0124] 3. Generate a Mermaid format status graph.
[0125] During or after workflow execution, a state graph of the workflow's parent-child structure can be generated using operations and maintenance tools. This graph is output in Mermaid text format and includes detailed information such as the execution order, dependencies, and current status of each task in the workflow. Users can simply paste the generated text onto an external website that supports Mermaid to visually view the workflow's progress. This is the main innovation: the Mermaid-formatted state graph provides users with an intuitive and convenient way to locate problems, significantly improving operational efficiency. Figure 4 As shown in the image.
[0126] This application provides a Go coroutine event scheduling mechanism:
[0127] Traditional workflow systems suffer from difficulties in granular task control, and the propagation of exceptions and state synchronization in complex business processes present efficiency bottlenecks. Therefore, this application proposes an "Event-Step" nested structure definition to implement a recursive task parsing engine and develop a dependency analyzer based on the Event parent-child structure. Key aspects include: constructing an event definition module to create a recursive task structure containing nested Steps and child Events; building a dynamic parsing engine to construct a task execution tree and detect circular dependencies using a depth-first search algorithm; and a state manager that uses Go coroutines for efficient database persistence. The workflow operates as follows:
[0128] Step 1: Receive the event creation request and persist the initial state as init;
[0129] Step 2: Analyze the event structure to determine the number of retries;
[0130] Step 3: Start the elastic coroutine allocator and consume the queue according to the current resource load and event priority.
[0131] Step 4: Monitor the execution status of each Step and implement optimistic locking control through version numbers;
[0132] Step 5: If an execution failure occurs, propagate the state backward along the execution tree to the associated node;
[0133] Step 6: After completing all Steps, update the final status to success.
[0134] Go goroutines' lightweight nature enables more efficient use of server resources in cloud environments, reducing server load and improving system performance and response speed. In scenarios involving synchronous calls between multiple components, a well-structured Step can asynchronously implement RPC calls for each request. If a step fails, Cobra-based operations tools can be used to reschedule the Step and update the Event state, ensuring resource consistency for business requests and guaranteeing workflow stability and reliability.
[0135] Recursive chart dynamic generation technology:
[0136] This technique uses a depth-first traversal algorithm to recursively process nested subgraph structures, as shown below:
[0137] type MermaidFormat struct {
[0138] Root *Node
[0139] WorkflowName (string)
[0140] Direction constant.MermaidDirection
[0141] Nodes []*Node
[0142] StartingPostrings []*Node
[0143] TerminalPostrings []*Node
[0144] Transitions []MermaidTransition
[0145] Subgraphs map[*Node]MermaidFormat
[0146] ExternalTransitions[]MermaidTransition}
[0147] type MermaidTransition struct {From *NodeTo []*Node}.
[0148] In this application, by utilizing the relationships between nodes, the boundary subgraph is automatically derived, achieving seamless connection between the subgraph and the parent graph. The advantage of this is that it breaks through the limitations of Mermaid's native syntax in supporting complex nested structures, while also supporting the expression of workflows of arbitrary depth.
[0149] The workflow status dynamic visualization method provided in this application has the following process:
[0150] Step 1: Parse the workflow execution log to extract node status and migration relationships;
[0151] Step 2: Recursively identify the subgraph structure and construct multi-level nested graph objects;
[0152] Step 3: Select the rendering template and layout direction according to the user configuration;
[0153] Step 4: Dynamically bind node status information to template variables;
[0154] Step 5: Stream writing generates a visualization file that conforms to Mermaid syntax.
[0155] In this application, the Mermaid-formatted status graph provides users with an intuitive and convenient way to view the overall workflow operation. Compared to querying database records through business logic, this method greatly improves the efficiency of problem localization, lowers the technical threshold for operations and maintenance personnel, and enables quick identification of where the business is experiencing problems.
[0156] The beneficial effects of the technical solution provided in this application are as follows:
[0157] In a cloud network environment, traditional technologies rely on web pages to view workflow status, while this application uses Go to monitor workflows in real time in the cloud, reducing server load. Traditional workflow scheduling technologies suffer from reliability issues due to component dependencies; therefore, this application introduces a manual retry mechanism to avoid wasting resources on duplicate requests. Traditional technologies rely on business logic to query database records to display workflow status, while this application's solution generates a Mermaid-formatted status graph for intuitive viewing and problem localization, representing a completely new visualization method. Furthermore, the application scenarios applicable to this application's solution include, but are not limited to:
[0158] 1. In the order processing workflow of large e-commerce platforms, the workflow status of each stage of the order, from order placement, inventory preparation, shipment to delivery, can be monitored in real time to ensure efficient order flow.
[0159] 2. In the loan approval process of financial institutions, a manual retry mechanism is used to ensure a smooth approval process, and Mermaid status graphs are used to quickly locate the obstructed parts of the approval process.
[0160] The technical solution proposed in this application can significantly improve the processing efficiency of business processes, reduce business downtime caused by workflow anomalies, and lower operating costs.
[0161] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0162] Based on the same inventive concept, this application also provides a workflow operation monitoring device for implementing the workflow operation monitoring method described above. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations of the one or more workflow operation monitoring device embodiments provided below can be found in the limitations of the workflow operation monitoring method described above, and will not be repeated here.
[0163] In one embodiment, such as Figure 5 As shown, a workflow operation monitoring device is provided, comprising: an extraction module 502, a construction module 504, and a generation module 506, wherein:
[0164] The extraction module 502 is used to extract the status information of each node and the relationship between each node from the execution log of the workflow task during the execution of the workflow task.
[0165] Module 504 is used to construct a graph object with a hierarchical nested structure based on the relationships between nodes.
[0166] The generation module 506 is used to generate descriptive text that conforms to the target syntax based on the status information of each node, graph objects and preset templates; based on the descriptive text, it generates a visualization graph that reflects the running status of the workflow task; the visualization graph includes at least the execution order and execution status of each node in the workflow task.
[0167] In one embodiment, the generation module is further configured to generate an event creation request based on the workflow task; the apparatus further includes: a creation module, configured to create a target event based on the event creation request, and persist the state of the target event in the database as an initialization state; a detection module, configured to detect the execution state of each node task included in the event structure of the target event; and an update module, configured to update the state of the target event to indicate a successful execution state when the execution states of each node task indicate successful execution.
[0168] In one embodiment, the node task includes a first node task, and the device further includes: an obtaining module, configured to parse the event structure of the target event and obtain the number of retries for the target event; the event structure is a hierarchically nested recursive structure; the device further includes: a propagation module, configured to propagate the execution state indicating execution failure to the associated nodes in the task execution tree when the execution state of the first node task indicates execution failure; the task execution tree is constructed based on the association relationship between the node tasks; and an execution module, configured to trigger the re-execution of the first node task based on the number of retries; or, in response to the triggered retry operation, trigger the re-execution of the first node task.
[0169] In one embodiment, the execution module is further configured to, in response to a retry operation triggered for the target event, trigger the re-execution of each node task contained in the event structure of the target event if the execution status obtained from executing the first node task indicates execution failure.
[0170] In one embodiment, the construction module is further configured to construct a nested subgraph structure based on the association relationships between the nodes; and to construct a graph object with a hierarchical nested structure based on the nested subgraph structure.
[0171] In one embodiment, the apparatus further includes: a binding module, configured to dynamically bind the state information of each node to a template variable in a preset template to obtain an updated template; and a generation module, configured to generate descriptive text conforming to the target syntax based on the graph object and the updated template; or, to obtain a rendering template and layout information input by the user, and generate descriptive text conforming to the target syntax based on the rendering template, the layout information, the graph object, and the updated template.
[0172] In one embodiment, the apparatus further includes: a display module, configured to display a page for selecting relevant parameters of the workflow task in response to a triggered drawing instruction when the workflow task is completed; an identification module, configured to identify the relationship structure between nodes in the workflow task in response to a triggered operation on the page; an update module, configured to dynamically update the state of the structure of the relationship structure based on data stored in a database; and a generation module, further configured to generate descriptive text in a target format based on the state and a preset template; and to generate a state operation diagram under the parent-child structure scheduling corresponding to the workflow task based on the descriptive text, wherein the state operation diagram is used to locate nodes indicating execution failure.
[0173] Each module in the aforementioned workflow operation monitoring device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0174] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 6 As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores monitoring data on workflow operation. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a method for monitoring workflow operation.
[0175] Those skilled in the art will understand that Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0176] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0177] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.
[0178] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0179] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0180] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0181] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0182] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for monitoring workflow operation, characterized in that, The method comprises: In the process of executing the workflow task, extracting state information of each node and an association relationship between each node from an execution log of the workflow task; Based on the association relationship between each node, a graph object with a hierarchical nested structure is constructed; Based on the state information of each node, the graph object and a preset template, a description text conforming to a target syntax is generated; Based on the description text, a visual graph reflecting the running condition of the workflow task is generated; the visual graph at least includes an execution order and an execution state of each node in the workflow task.
2. The method of claim 1, wherein, The execution mode of the workflow task comprises: Based on the workflow task, an event creation request is generated; Based on the event creation request, a target event is created, and the state of the target event in the database is persisted as an initialization state; Detecting the execution state of each node task contained in the event structure of the target event; In the case that the execution state of each node task indicates execution success, updating the state of the target event to a state indicating execution success.
3. The method of claim 2, wherein, The node task includes a first node task, and the method further comprises: Parsing the event structure of the target event to obtain a retry number of the target event; the event structure is a recursive structure with a hierarchical nesting; After detecting the execution state of each node task contained in the event structure of the target event, the method further comprises: In the case that the execution state of the first node task indicates execution failure, the execution state indicating execution failure is back propagated to an associated node in a task execution tree; the task execution tree is constructed based on the association relationship between each node task; Based on the retry number, triggering re-execution of the first node task; or, In response to the triggered retry operation, triggering re-execution of the first node task.
4. The method of claim 3, wherein, After triggering re-execution of the first node task based on the retry number, the method further comprises: In the case that the execution state obtained by executing the first node task indicates execution failure, in response to the retry operation triggered for the target event, triggering re-execution of each node task contained in the event structure of the target event.
5. The method of claim 1, wherein, Based on the association relationship between each node, a graph object with a hierarchical nested structure is constructed, comprising: Based on the association relationship between each node, a nested subgraph structure is constructed; Based on the nested subgraph structure, a graph object with a hierarchical nested structure is constructed.
6. The method of claim 1, wherein, Based on the state information of each node, the graph object and a preset template, a description text conforming to a target syntax is generated, comprising: Dynamically binding the state information of each node with a template variable in the preset template to obtain an updated template; Based on the graph object and the updated template, a description text conforming to a target syntax is generated; or, Obtaining a rendering template and layout information input by a user, and based on the rendering template, the layout information, the graph object and the updated template, a description text conforming to a target syntax is generated.
7. The method of claim 1, wherein, After generating the visual graph reflecting the running condition of the workflow task based on the description text, the method further comprises: In the case that the workflow task is executed, a page for selecting parameters related to the workflow task is displayed in response to the triggered drawing instruction; In response to a triggering operation on the page, a relationship structure between nodes in the workflow task is identified; Based on data stored in a database, a state of a structure of the relationship structure is dynamically updated; Based on the state and a preset template, a description text in a target format is generated; Based on the description text, a state running graph under a parent-child structure scheduling corresponding to the workflow task is generated, and the state running graph is used to locate a node representing a failure in execution.
8. A monitoring device for workflow operation, characterized in that, The apparatus comprises: An extraction module configured to extract state information of nodes and an association relationship between the nodes from an execution log of the workflow task in a process of executing the workflow task; A construction module configured to construct a graph object with a hierarchical nested structure based on the association relationship between the nodes; A generation module configured to generate a description text conforming to a target syntax based on the state information of the nodes, the graph object, and a preset template, and generate a visual graph reflecting a running condition of the workflow task based on the description text, wherein the visual graph at least includes an execution order and an execution state of the nodes in the workflow task. 9.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-8 when the computer program is executed by the processor. The processor implements the steps of the method of any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program implements the steps of the method of any one of claims 1 to 7 when executed by the processor.