CN112346842B - Workflow task scheduling method based on directed acyclic graph - Google Patents

Workflow task scheduling method based on directed acyclic graph Download PDF

Info

Publication number
CN112346842B
CN112346842B CN202011302488.5A CN202011302488A CN112346842B CN 112346842 B CN112346842 B CN 112346842B CN 202011302488 A CN202011302488 A CN 202011302488A CN 112346842 B CN112346842 B CN 112346842B
Authority
CN
China
Prior art keywords
workflow
task
state
scheduling
event
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011302488.5A
Other languages
Chinese (zh)
Other versions
CN112346842A (en
Inventor
邹方波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jiajia Technology Co ltd
Original Assignee
Jiajia Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jiajia Technology Co ltd filed Critical Jiajia Technology Co ltd
Priority to CN202011302488.5A priority Critical patent/CN112346842B/en
Publication of CN112346842A publication Critical patent/CN112346842A/en
Application granted granted Critical
Publication of CN112346842B publication Critical patent/CN112346842B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a workflow task scheduling method based on a directed acyclic graph, which comprises the following steps: acquiring a plurality of task nodes under different processes; establishing a model for a plurality of task nodes based on the DAG, wherein the model comprises a plurality of workflows, the workflows comprise a plurality of task nodes and front-back dependency relationships between the task nodes, vertexes of the model represent the task nodes, and directed edges of the model represent the front-back dependency relationships between the task nodes; acquiring an event, and triggering the state circulation of the workflow in the model according to the event; and starting the scheduling of task nodes of the workflow according to the state flow of the workflow so as to execute the task. By means of the mode, the workflow task scheduling method based on the directed acyclic graph can achieve free arrangement of the cross-flow tasks and scheduling of the cross-flow tasks according to the dependency relationship.

Description

Workflow task scheduling method based on directed acyclic graph
Technical Field
The invention relates to the technical field of Internet, in particular to a workflow task scheduling method based on a directed acyclic graph.
Background
Along with the rapid development of information technology, informatization becomes an important path for enterprise development. Task scheduling is a relatively common technology in the computer field, and in the traditional manner, task scheduling field does not generally involve scheduling of complex situations, and even if there are many restrictions, it is impossible to achieve true free scheduling, i.e. all scheduling combinations performed under logically reasonable situations.
Disclosure of Invention
The invention mainly solves the technical problem of providing a workflow task scheduling method based on a directed acyclic graph, which can realize free arrangement of cross-flow tasks and scheduling of the cross-flow tasks according to a dependency relationship.
In order to solve the technical problems, the invention adopts a technical scheme that: the workflow task scheduling method based on the directed acyclic graph is characterized by comprising the following steps: acquiring a plurality of task nodes under different processes; establishing a model for a plurality of task nodes based on the DAG, wherein the model comprises a plurality of workflows, the workflows comprise a plurality of task nodes and front-back dependency relationships between the task nodes, vertexes of the model represent the task nodes, and directed edges of the model represent the front-back dependency relationships between the task nodes; and acquiring an event, triggering the state flow of the workflow in the model according to the event, and starting the scheduling of task nodes of the workflow according to the state flow of the workflow so as to execute the task.
Further, the method further comprises: and performing loop-free verification on the workflow in the model based on the topological order, so that the workflow in the model meets the loop-free requirement.
Further, the method further comprises: and modeling and storing the front-back dependency relationship between the tasks based on the adjacency matrix so as to obtain the front-back dependency relationship between the tasks and the relationship between the tasks.
Further, the step of acquiring the event, triggering the state flow of the workflow in the model according to the event, and starting the scheduling of the task node of the workflow according to the state flow of the workflow to execute the task comprises the following steps: and acquiring a start event of the workflow, and triggering task nodes of the workflow to start scheduling according to the start event of the workflow.
Further, the step of triggering the task node of the workflow according to the workflow start event includes: and acquiring a starting event of the task node, and triggering the scheduling of the task node according to the starting event of the task node.
Further, after the step of triggering the scheduling of the task node according to the start event of the task node, the method includes: after the current task node successfully executes the task, triggering the scheduling of the next task node according to the front-back dependency relationship of the current workflow, and converting the state of the current task node into a successful state.
Further, after the step of triggering the scheduling of the task node according to the start event of the task node, the method includes: after the task execution of the current task node fails, the scheduling of the next task node triggering the current workflow is suspended, the state of the current task node is converted into a failure state, and meanwhile, the state of the workflow corresponding to the current task node is converted into the failure state.
Further, the step of acquiring the event, triggering the state flow of the workflow in the model according to the event, and starting the scheduling of the task node of the workflow according to the state flow of the workflow to execute the task further comprises: and acquiring a time event of the workflow, and triggering the workflow in the model according to the time event of the workflow to perform state circulation after a preset time, wherein the state circulation comprises a starting state, an executing state and an ending state.
Further, the step of performing state circulation after the predetermined event according to the workflow in the time event trigger model includes: and acquiring a time event of the task node, triggering the task node in the workflow to perform state circulation after a preset time according to the time event of the task node, wherein the state circulation comprises a waiting state, an executing state and a finishing state.
Further, the step of starting the scheduling of the task nodes of the workflow according to the state transition of the workflow to execute the task includes: and starting the scheduling of task nodes of the workflow according to the state transitions of the workflow in the model, and scheduling the task nodes from different flows according to the front-back dependency relationship between the task nodes of the workflow in the model to execute the task.
The beneficial effects of the invention are as follows: unlike the prior art, the workflow task scheduling method based on the directed acyclic graph disclosed by the invention comprises the following steps: acquiring a plurality of task nodes under different processes; establishing a model for a plurality of task nodes based on the DAG, wherein the model comprises a plurality of workflows, the workflows comprise a plurality of task nodes and front-back dependency relationships between the task nodes, vertexes of the model represent the task nodes, and directed edges of the model represent the front-back dependency relationships between the task nodes; acquiring an event, and triggering the state circulation of the workflow in the model according to the event; and starting the scheduling of task nodes of the workflow according to the state flow of the workflow so as to execute the task. By means of the mode, the workflow task scheduling method based on the directed acyclic graph can achieve free arrangement of the cross-flow tasks and scheduling of the cross-flow tasks according to the dependency relationship.
Drawings
FIG. 1 is a flow chart of the directed acyclic graph-based workflow task scheduling method of the present invention.
Detailed Description
The present invention will be described in detail with reference to the drawings and embodiments.
As shown in fig. 1, the workflow task scheduling method based on the directed acyclic graph comprises the following steps:
step S101: a plurality of task nodes under different flows are acquired.
It should be understood that in step S101, a plurality of task nodes under different processes are mainly acquired, that is, the information of the task nodes is acquired quite cross-process, so as to construct different workflows in the model through the task node information.
Step S102: a model is built for a plurality of task nodes based on a DAG (directed acyclic graph).
In this embodiment, the model includes a plurality of workflows composed of a plurality of task nodes and front-rear dependencies between task nodes. Further, vertices of the model represent task nodes, and directed edges of the model represent front-to-back dependencies between task nodes.
Further, in this embodiment, the workflow task scheduling method based on the directed acyclic graph further includes: and performing loop-free verification on the workflow in the model based on the topological order, so that the workflow in the model meets the loop-free requirement.
Further, in this embodiment, the workflow task scheduling method based on the directed acyclic graph further includes: and modeling and storing the front-back dependency relationship between the tasks based on the adjacency matrix so as to obtain the front-back dependency relationship between the tasks and the relationship between the tasks. It should be understood that the adjacency matrix may be implemented by adopting an adjacency matrix in the prior art, which is not described in detail herein.
Step S103: and acquiring an event, triggering the state flow of the workflow in the model according to the event, and starting the scheduling of task nodes of the workflow according to the state flow of the workflow so as to execute the task.
In this embodiment, the step of starting the scheduling of the task nodes of the workflow according to the state transition of the workflow in step S103 to perform task execution includes: and starting the scheduling of task nodes of the workflow according to the state transitions of the workflow in the model, and scheduling the task nodes from different flows according to the front-back dependency relationship between the task nodes of the workflow in the model to execute the task.
It should be understood that the front-back dependency relationship between task nodes is actually a sequential relationship between task nodes, i.e. which task node performs scheduling first and which task node performs scheduling later.
Specifically, the step of scheduling task nodes from different flows to execute tasks according to front-to-back dependency relationships between task nodes of a workflow in a model includes:
firstly, acquiring task nodes needing to be scheduled in a workflow; then, a scheduling path (i.e. a path in which flow) of the task node to be scheduled is acquired; and finally, scheduling task nodes from different flows according to the scheduling paths to execute tasks.
In this embodiment, step S103 obtains an event, triggers a state flow of a workflow in the model according to the event, and starts scheduling of task nodes of the workflow according to the state flow of the workflow, so as to perform task execution, where the step includes:
and acquiring a start event of the workflow, and triggering task nodes of the workflow to start scheduling according to the start event of the workflow. It should be appreciated that a start event of a workflow can trigger a task node of the workflow to start scheduling.
It should be appreciated that when a task node of a workflow starts scheduling, a start of the task node is required, and thus the step of triggering the task node of the workflow according to a workflow start event comprises: and acquiring a starting event of the task node, and triggering the scheduling of the task node according to the starting event of the task node. That is, the task node needs a start event to trigger to perform scheduling.
Further, after the step of triggering the task node scheduling according to the start event of the task node, the workflow task scheduling method based on the directed acyclic graph further comprises the following steps: after the current task node successfully executes the task, triggering the scheduling of the next task node according to the front-back dependency relationship of the current workflow, and converting the state of the current task node into a successful state.
It should be noted that, the states of the task node and the corresponding workflow are corresponding, and when the task node in the workflow is in the scheduling, executing or completing state, the workflow corresponding to the task node is also in the scheduling, executing or completing state.
Specifically, after the step of triggering the task node scheduling according to the start event of the task node, the workflow task scheduling method based on the directed acyclic graph further comprises the following steps: after the task execution of the current task node fails, the scheduling of the next task node triggering the current workflow is suspended, the state of the current task node is converted into a failure state, and meanwhile, the state of the workflow corresponding to the current task node is converted into the failure state.
In addition, in this embodiment, the steps of acquiring an event, triggering a state flow of a workflow in the model according to the event, and starting scheduling of task nodes of the workflow according to the state flow of the workflow to execute the task further include:
and acquiring a time event of the workflow, and triggering the workflow in the model according to the time event of the workflow to perform state circulation after the preset time.
The state flow includes a start state, an execute state, and an end state. It should be understood that the time event of the workflow is a condition for controlling state transition of the workflow, and the time event satisfies the timing, period, calendar schedule of the workflow.
Further, the step of performing state circulation after a predetermined event according to the workflow in the time event trigger model includes: and acquiring a time event of the task node, triggering the task node in the workflow to perform state circulation after a preset time according to the time event of the task node.
The state flow includes a wait state, an executing state, and a completion state. It should be understood that the time event of the task node is a condition for controlling the state transition of the task node, and the time event satisfies the timing, period, calendar scheduling manner of the task node.
In addition, in this embodiment, the steps of acquiring an event, triggering a state flow of a workflow in the model according to the event, and starting scheduling of task nodes of the workflow according to the state flow of the workflow to execute the task further include:
and acquiring an automatic event of the workflow, and performing state circulation according to the workflow in the automatic event trigger model of the workflow after executing a certain operation. It should be appreciated that an operation may include completion of a task, an intermediate period of task execution, after completion of a task by a task node, etc.
The state flow of the workflow includes a start state, an execution state, and an end state. It should be appreciated that an automatic event of a workflow is a condition for automatically controlling a state transition of the workflow.
Further, the step of performing state circulation according to the workflow in the automatic event triggering model of the workflow after executing a certain operation includes: acquiring an automatic event of a task node, triggering the task node in the workflow to perform state circulation after executing a certain operation according to the automatic event of the task node. The task node performs a task in a middle period of time, and the task node performs a task after the task node performs the task.
The state flow of the task node includes a waiting state, an executing state and a completion state. It should be appreciated that an automatic event of a task node is a condition for automatically controlling a state transition of the task node.
In conclusion, the workflow task scheduling method based on the directed acyclic graph disclosed by the invention can realize the free arrangement of the cross-flow tasks and realize the scheduling of the cross-flow tasks according to the dependency relationship.
The foregoing description is only illustrative of the present invention and is not intended to limit the scope of the invention, and all equivalent structures or equivalent processes or direct or indirect application in other related technical fields are included in the scope of the present invention.

Claims (9)

1. The workflow task scheduling method based on the directed acyclic graph is characterized by comprising the following steps of:
acquiring a plurality of task nodes under different processes;
establishing a model for a plurality of task nodes based on the DAG, wherein the model comprises a plurality of workflows, the workflows comprise a plurality of task nodes and front-back dependency relationships between the task nodes, vertexes of the model represent the task nodes, and directed edges of the model represent the front-back dependency relationships between the task nodes;
acquiring an event, triggering the state flow of the workflow in the model according to the event, and starting the scheduling of task nodes of the workflow according to the state flow of the workflow so as to execute the task;
the step of starting the scheduling of task nodes of the workflow according to the state flow of the workflow to execute the task comprises the following steps:
and starting the scheduling of task nodes of the workflow according to the state transitions of the workflow in the model, and scheduling the task nodes from different flows according to the front-back dependency relationship between the task nodes of the workflow in the model to execute the task.
2. The method according to claim 1, characterized in that the method further comprises:
and performing loop-free verification on the workflow in the model based on the topological order, so that the workflow in the model meets the loop-free requirement.
3. The method according to claim 2, characterized in that the method further comprises:
and modeling and storing the front-back dependency relationship between the tasks based on the adjacency matrix so as to obtain the front-back dependency relationship between the tasks and the relationship between the tasks.
4. The method of claim 1, wherein the steps of acquiring events and triggering state flows of workflows in the model according to the events, and starting scheduling of task nodes of the workflows according to the state flows of the workflows for task execution comprise:
and acquiring a start event of the workflow, and triggering task nodes of the workflow to start scheduling according to the start event of the workflow.
5. The method of claim 4, wherein the step of triggering task nodes of a workflow based on a workflow start event comprises:
and acquiring a starting event of the task node, and triggering the scheduling of the task node according to the starting event of the task node.
6. The method of claim 5, wherein after the step of triggering scheduling of the task node based on a start event of the task node, the method comprises:
after the current task node successfully executes the task, triggering the scheduling of the next task node according to the front-back dependency relationship of the current workflow, and converting the state of the current task node into a successful state.
7. The method of claim 6, wherein after the step of triggering scheduling of the task node based on a start event of the task node, the method comprises:
after the task execution of the current task node fails, the scheduling of the next task node triggering the current workflow is suspended, the state of the current task node is converted into a failure state, and meanwhile, the state of the workflow corresponding to the current task node is converted into the failure state.
8. The method of claim 1, wherein the steps of acquiring the event and triggering a state flow of the workflow in the model according to the event, and initiating scheduling of task nodes of the workflow according to the state flow of the workflow for task execution further comprise:
and acquiring a time event of the workflow, and triggering the workflow in the model according to the time event of the workflow to perform state circulation after a preset time, wherein the state circulation comprises a starting state, an executing state and an ending state.
9. The method of claim 8, wherein the step of state-cycling the workflow in the time-event-triggered model after a predetermined event comprises:
and acquiring a time event of the task node, triggering the task node in the workflow to perform state circulation after a preset time according to the time event of the task node, wherein the state circulation comprises a waiting state, an executing state and a finishing state.
CN202011302488.5A 2020-11-19 2020-11-19 Workflow task scheduling method based on directed acyclic graph Active CN112346842B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011302488.5A CN112346842B (en) 2020-11-19 2020-11-19 Workflow task scheduling method based on directed acyclic graph

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011302488.5A CN112346842B (en) 2020-11-19 2020-11-19 Workflow task scheduling method based on directed acyclic graph

Publications (2)

Publication Number Publication Date
CN112346842A CN112346842A (en) 2021-02-09
CN112346842B true CN112346842B (en) 2024-03-26

Family

ID=74364276

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011302488.5A Active CN112346842B (en) 2020-11-19 2020-11-19 Workflow task scheduling method based on directed acyclic graph

Country Status (1)

Country Link
CN (1) CN112346842B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113220434B (en) * 2021-05-14 2022-08-12 上海哔哩哔哩科技有限公司 Task scheduling method based on dependency model and dependency model configuration method
CN113535367B (en) * 2021-09-07 2022-01-25 北京达佳互联信息技术有限公司 Task scheduling method and related device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101963921A (en) * 2010-09-21 2011-02-02 卓望数码技术(深圳)有限公司 Operation scheduling method and system
CN104965754A (en) * 2015-03-31 2015-10-07 腾讯科技(深圳)有限公司 Task scheduling method and task scheduling apparatus
CN106293971A (en) * 2016-08-15 2017-01-04 张家林 A kind of method and apparatus of distributed task dispatching
CN108037991A (en) * 2017-12-26 2018-05-15 中山大学 A kind of timing operation dispatching method and system for supporting job dependence relation
CN109725989A (en) * 2017-10-31 2019-05-07 阿里巴巴集团控股有限公司 A kind of method and device of task execution
CN110402431A (en) * 2017-03-23 2019-11-01 亚马逊科技公司 Event driven scheduling is carried out using directed acyclic graph

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101963921A (en) * 2010-09-21 2011-02-02 卓望数码技术(深圳)有限公司 Operation scheduling method and system
CN104965754A (en) * 2015-03-31 2015-10-07 腾讯科技(深圳)有限公司 Task scheduling method and task scheduling apparatus
CN106293971A (en) * 2016-08-15 2017-01-04 张家林 A kind of method and apparatus of distributed task dispatching
CN110402431A (en) * 2017-03-23 2019-11-01 亚马逊科技公司 Event driven scheduling is carried out using directed acyclic graph
CN109725989A (en) * 2017-10-31 2019-05-07 阿里巴巴集团控股有限公司 A kind of method and device of task execution
CN108037991A (en) * 2017-12-26 2018-05-15 中山大学 A kind of timing operation dispatching method and system for supporting job dependence relation

Also Published As

Publication number Publication date
CN112346842A (en) 2021-02-09

Similar Documents

Publication Publication Date Title
US11429433B2 (en) Process discovery and automatic robotic scripts generation for distributed computing resources
US10664243B2 (en) System and method for iterative generating and testing of application code
CN112346842B (en) Workflow task scheduling method based on directed acyclic graph
US9405577B2 (en) Realizing jumps in an executing process instance
US9063673B2 (en) System and method for implementing application code from application requirements
EP1480144A1 (en) Planning and scheduling for failure recovery system and method
CN111124636A (en) Process arrangement engine and control method thereof
CN102572896A (en) Upgrading method and upgrading device for wireless communication system
CN109445929A (en) A kind of method and system of scheduler task
US20030144891A1 (en) Supervising the processing status of activities within workflow management systems
CN110019144A (en) A kind of method and system of big data platform data O&M
CN113010276A (en) Task scheduling method and device, terminal equipment and storage medium
CN110852623A (en) BPMN-based command control process design method
US8108868B2 (en) Workflow execution plans through completion condition critical path analysis
JP2020537269A (en) How to implement an ordering plan that guarantees low latency communication between real-time tasks
CN110795224A (en) Automatic operation and maintenance system and method based on infrastructure
US8352055B2 (en) Method for implementing production processes and system for executing the method
US7418306B2 (en) Framework for managing process including sequential actions
JPWO2019187975A1 (en) System update device and system update method
Guiotto et al. MaTeLo: automated testing suite for software validation
CN116737331B (en) Intelligent task flow arrangement method and platform
Giro Workflow verification: a new tower of Babel
Petry et al. Model-Based Testing of Software Product Lines
CN115794344A (en) Quartz frame-based multi-stage task scheduling method
KR101877841B1 (en) Method for Developing Add-in Program in Aveva Marine CAD System

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant