An intelligent task flow arrangement method and platform
Through intelligent task flow orchestration methods and platforms, the problems of resource adaptation and current limiting in the existing technology are solved, the stability of task flow execution and resource utilization are improved, and the operating threshold is lowered.
Patent Information
- Application Number
- CN202310317560.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-27
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2043-03-27
AI Technical Summary
Existing task flow scheduling tools cannot adaptively adjust according to resource usage, cannot limit the flow when there are too many tasks in the cluster, and large task flows are difficult to manage, resulting in low resource utilization and poor task execution efficiency.
Provide an intelligent task flow orchestration method and platform that receives the user's target task flow configuration, parses and generates job configurations, initializes the scheduler, checks the task pool, task queue and retry queue, and generates priority control according to preset rules The solution handles task status in real time and supports resource adaptation and task current limiting.
It improves the stability of task flow execution and resource utilization efficiency, reduces the possibility of task flow execution failure, avoids resource congestion and deadlock, reduces labor costs, and supports multiple ways of task management.
Smart Images

Figure CN116737331B
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of intelligent task flow orchestration, and in particular to an intelligent task flow orchestration method and platform. Background Art
[0002] Enterprises often need to regularly execute a large number of batch tasks in production and big data business processing, and there is often a sequence dependency between tasks, so we can call a group of tasks with dependencies a task flow. Apache Dolphin Scheduler and Apache Airflow are both commonly used task flow scheduling tools in the industry. They both abstract the task flow into a directed acyclic graph (DAG). Tasks will be executed in sequence according to the node order of the DAG, which is intuitive and convenient to use.
[0003] Existing task flow scheduling tools have the following problems:
[0004] When cluster resource utilization is low, users often hope that the current task can use more computing resources to complete the task as soon as possible. However, the task resources in DolphinScheduler and Airflow are fixed and cannot be adjusted adaptively according to resource utilization.
[0005] When there are too many tasks in the cluster, continuing to submit tasks will only cause task resources to occupy each other, affecting execution efficiency. DolphinScheduler and Airflow can only submit tasks in sequence according to the task flow defined by DAG, and cannot limit the flow;
[0006] Both DolphinScheduler and Airflow support priority control at the task granularity. However, when the priorities are the same, the order of task execution is often random. Users often want to prioritize time-consuming tasks to avoid waiting until the end to execute them, which would increase the total time of the task flow.
[0007] Large task flows are difficult to handle: Enterprise production task flows often have hundreds or thousands of task nodes. If tasks are still managed through web pages, it is very easy to make mistakes and increase labor costs. At the same time, large task flows are more likely to have low cluster task resource utilization and require task resource adaptive adjustment, or too many submitted tasks require flow control. Summary of the invention
[0008] Based on this, in response to the above technical problems, an intelligent task flow orchestration method and platform are provided to solve the problems that existing task flow scheduling tools cannot adaptively adjust according to resource usage, cannot limit the flow when the number of tasks in the cluster is too large, and are difficult to handle large task flows.
[0009] In a first aspect, an intelligent task flow arrangement method is provided, the method comprising:
[0010] Receive a target task flow and the target task flow configuration sent by a user;
[0011] According to the target task flow configuration, the target task flow is parsed and translated to generate a job configuration;
[0012] Initialize the target task flow according to the job configuration, and create a scheduler corresponding to the target task flow;
[0013] The scheduler initializes the task pool, task queue, executor and retry queue of the target task flow;
[0014] The scheduler checks the task pool, task queue, executor and retry queue of the target task flow, generates a priority control scheme for the target task flow according to preset rules, processes the target task flow according to the priority control scheme, and generates the processing status of the target task flow in real time;
[0015] Receive user query input and display the target task flow processing status.
[0016] In the above solution, optionally, the receiving the target task flow and the target task flow configuration sent by the user includes:
[0017] A target task flow and the target task flow configuration sent by a user are received through a command line client or a web client, wherein the target task flow includes creating, managing, submitting and retrying tasks, and the target task flow configuration includes establishing a processing priority for each task in the target task flow.
[0018] In the above solution, further optionally, the scheduler checks the task pool, task queue, executor and retry queue of the target task flow, including:
[0019] The task pool check includes: traversing all tasks to be submitted in the task pool, and submitting the task to the task queue if the task meets the submission condition;
[0020] The task queue check includes: checking whether the task at the head of the task queue meets the execution condition, if so, submitting the task to the executor to start execution, the scheduler waits until the instance starts to execute before continuing the following process, if the task instance state is abnormal before the instance starts to execute, submitting the task to the retry queue to wait for re-execution, if the task retry times exceed the preset times, the task processing fails;
[0021] The executor check includes: checking the status of the task completed in the executor, if the task fails, resubmitting the task to the task queue for re-execution after delay, and if the number of task retries exceeds a preset number, the task processing fails;
[0022] The retry queue check includes: checking whether there is a task at the head of the retry queue, and if so, resubmitting the task to the task queue.
[0023] In the above scheme, further optionally, the task meets the submission condition including: an upstream node dependency condition or a custom condition; wherein the upstream node dependency condition is that the submission condition is met when the upstream task node that the current task depends on is successfully executed; the custom condition is that the user customizes the submission condition in a plug-in manner;
[0024] The execution condition that the task satisfies includes: cluster available resource condition or custom condition; wherein, when the cluster available resource exceeds the threshold configured for the task, the execution condition is satisfied;
[0025] The custom conditions are execution conditions that are customized by the user in a plug-in manner.
[0026] In the above scheme, further optionally, the target task flow priority control scheme is generated according to preset rules, and the target task flow is processed according to the priority control scheme. The priority control scheme includes: the task queue is responsible for the priority management of all tasks to be executed, specifically, the user configures the priority and the estimated time of each task, and generates the priority control scheme according to the priority and the estimated time of the task;
[0027] If not configured, the scheduler sets a default priority for the task.
[0028] In the above scheme, further optionally, the scheduler checks the task pool, task queue, executor and retry queue of the target task flow, and generates a priority control scheme for the target task flow according to preset rules, and processes the target task flow according to the priority control scheme. It also includes: retry control, the retry queue is responsible for the management of all tasks to be retried, and the tasks submitted to the retry queue are only processed after waiting for a preset time, thereby realizing the retry control of the task.
[0029] In the above solution, further optionally, the target task flow processing state includes:
[0030] Unexecuted state: when the task is just initialized and has not yet been scheduled;
[0031] Waiting state, the task is in the task pool;
[0032] Ready to execute, the task is in the task queue and has met the submission condition check;
[0033] In the running state, the task is in the executor and has met the execution condition check;
[0034] Retry waiting state: the task is in the retry queue and the task fails but the number of failures does not exceed the preset number;
[0035] Success state: the task is processed successfully;
[0036] Failed state: The task fails and exceeds the failure count threshold.
[0037] Forced stop state.
[0038] In a second aspect, an intelligent task flow orchestration platform is provided, the platform comprising:
[0039] Client: used to communicate and interact with the task flow orchestration platform through command lines or on web pages, to create, manage, submit, and retry task flows, query task execution status, and analyze execution results;
[0040] Interpreter: responsible for translating the task flow configuration configured by the user into the job configuration for execution by the execution layer; translating the execution information of the job into visual display information;
[0041] Manager: used to receive job configuration information, initialize all pending tasks to the task pool according to the job configuration information, start the scheduler to start execution; find the corresponding scheduler, task queue and task pool based on the job unique ID, and obtain the execution status of the job;
[0042] Scheduler: responsible for the overall scheduling of tasks;
[0043] Task pool: used to store all tasks that have completed initialization but have not met the submission conditions;
[0044] Task queue: used to store all tasks that meet the submission conditions;
[0045] Executor: used to execute and manage the tasks in the task queue that meet the execution conditions, and record the information of all running task instances;
[0046] Retry queue: used to store all tasks that failed but did not exceed the preset number of retries.
[0047] In a third aspect, a computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0048] Receive a target task flow and the target task flow configuration sent by a user;
[0049] According to the target task flow configuration, the target task flow is parsed and translated to generate a job configuration;
[0050] Initialize the target task flow according to the job configuration, and create a scheduler corresponding to the target task flow;
[0051] The scheduler initializes the task pool, task queue, executor and retry queue of the target task flow;
[0052] The scheduler checks the task pool, task queue, executor and retry queue of the target task flow, generates a priority control scheme for the target task flow according to preset rules, processes the target task flow according to the priority control scheme, and generates the processing status of the target task flow in real time;
[0053] Receive user query input and display the target task flow processing status.
[0054] In a fourth aspect, a computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the following steps are implemented:
[0055] Receive a target task flow and the target task flow configuration sent by a user;
[0056] According to the target task flow configuration, the target task flow is parsed and translated to generate a job configuration;
[0057] Initialize the target task flow according to the job configuration, and create a scheduler corresponding to the target task flow;
[0058] The scheduler initializes the task pool, task queue, executor and retry queue of the target task flow;
[0059] The scheduler checks the task pool, task queue, executor and retry queue of the target task flow, generates a priority control scheme for the target task flow according to preset rules, processes the target task flow according to the priority control scheme, and generates the processing status of the target task flow in real time;
[0060] Receive user query input and display the target task flow processing status.
[0061] The present invention has at least the following beneficial effects:
[0062] Based on further analysis and research of the prior art problems, the present invention recognizes that the existing task flow scheduling tools cannot be adaptively adjusted according to resource usage, cannot limit the flow when the number of tasks in the cluster is too large, and are difficult to deal with large task flows. The present invention receives the target task flow and the target task flow configuration sent by the user, parses and translates the target task flow according to the target task flow configuration, generates a job configuration, initializes the target task flow according to the job configuration, and creates a scheduler corresponding to the target task flow. The scheduler initializes the task pool, task queue, executor and retry queue of the target task flow. The scheduler checks the task pool, task queue, executor and retry queue of the target task flow, and generates the target task flow priority control scheme according to preset rules, processes the target task flow according to the priority control scheme, and generates the target task flow processing status in real time, receives the user's query input, and displays the target task flow processing status.
[0063] The task flow scheduling method of the present invention has high availability and high reliability. Through the deployment of multiple instances, the stability of task flow execution is greatly improved, and the possibility of task flow execution failure due to network or hardware failure is reduced; through resource adaptation, task resources are automatically increased when cluster computing resources are used less, and resource utilization efficiency is improved while reducing the time consumption of task flow execution; through task flow limiting, it is avoided to continue to execute new tasks when a large number of tasks are being executed and cluster computing resources are already occupied, and task resources are prevented from crowding out each other or even causing resource deadlock, further improving the stability of task flow execution; through reasonable priority management, the task flow scheduling platform will automatically identify time-consuming tasks and give priority to execution as much as possible, avoiding the barrel effect, and further improving resource utilization efficiency and task flow execution time consumption. Supporting the submission and management of task flows in multiple ways through visual pages and Shell command lines, lowering the user's operating threshold and reducing labor costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] Figure 1 A flowchart of an intelligent task flow arrangement method provided by an embodiment of the present invention;
[0065] Figure 2 A schematic diagram of the logical architecture of an intelligent task flow orchestration platform provided by one embodiment of the present invention;
[0066] Figure 3 A task flow submission process sequence diagram of an intelligent task flow arrangement method provided by an embodiment of the present invention;
[0067] Figure 4 A scheduler execution logic diagram of an intelligent task flow scheduling method provided by an embodiment of the present invention;
[0068] Figure 5 A task state diagram of an intelligent task flow arrangement method provided by an embodiment of the present invention;
[0069] Figure 6 A schematic diagram of multiple instance deployment of an intelligent task flow orchestration method provided by one embodiment of the present invention;
[0070] Figure 7 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0071] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0072] In one embodiment, Figure 1 As shown, an intelligent task flow arrangement method is provided, comprising the following steps:
[0073] Receive a target task flow and the target task flow configuration sent by a user;
[0074] According to the target task flow configuration, the target task flow is parsed and translated to generate a job configuration;
[0075] Initialize the target task flow according to the job configuration, and create a scheduler corresponding to the target task flow;
[0076] The scheduler initializes the task pool, task queue, executor and retry queue of the target task flow;
[0077] The scheduler checks the task pool, task queue, executor and retry queue of the target task flow, generates a priority control scheme for the target task flow according to preset rules, processes the target task flow according to the priority control scheme, and generates the processing status of the target task flow in real time;
[0078] Receive user query input and display the target task flow processing status.
[0079] In one embodiment, the receiving the target task flow and the target task flow configuration sent by the user includes:
[0080] A target task flow and the target task flow configuration sent by a user are received through a command line client or a web client, wherein the target task flow includes creating, managing, submitting and retrying tasks, and the target task flow configuration includes establishing a processing priority for each task in the target task flow.
[0081] In one embodiment, the scheduler checks the task pool, task queue, executor and retry queue of the target task flow, including:
[0082] The task pool check includes: traversing all tasks to be submitted in the task pool, and submitting the task to the task queue if the task meets the submission condition;
[0083] The task queue check includes: checking whether the task at the head of the task queue meets the execution condition, if so, submitting the task to the executor to start execution, the scheduler waits until the instance starts to execute before continuing the following process, if the task instance state is abnormal before the instance starts to execute, submitting the task to the retry queue to wait for re-execution, if the task retry times exceed the preset times, the task processing fails;
[0084] The executor check includes: checking the status of the task completed in the executor, if the task fails, resubmitting the task to the task queue for re-execution after delay, and if the number of task retries exceeds a preset number, the task processing fails;
[0085] The retry queue check includes: checking whether there is a task at the head of the retry queue, and if so, resubmitting the task to the task queue.
[0086] In one embodiment, the task satisfies the submission condition including: an upstream node dependency condition or a custom condition; wherein the upstream node dependency condition is that the submission condition is satisfied when the upstream task node that the current task depends on is successfully executed; the custom condition is that the user customizes the submission condition in a plug-in manner;
[0087] The execution condition that the task satisfies includes: cluster available resource condition or custom condition; wherein, when the cluster available resource exceeds the threshold configured for the task, the execution condition is satisfied;
[0088] The custom conditions are execution conditions that are customized by the user in a plug-in manner.
[0089] In one embodiment, the target task flow priority control scheme is generated according to preset rules, and the target task flow is processed according to the priority control scheme. The priority control scheme includes: the task queue is responsible for the priority management of all tasks to be executed, specifically, the user configures the priority and the estimated time of each task, and generates the priority control scheme according to the priority and the estimated time of the task;
[0090] If not configured, the scheduler sets a default priority for the task.
[0091] In one embodiment, the scheduler checks the task pool, task queue, executor and retry queue of the target task flow, and generates a priority control scheme for the target task flow according to preset rules, processes the target task flow according to the priority control scheme, and then also includes: retry control, the retry queue is responsible for the management of all tasks to be retried, and tasks submitted to the retry queue are processed only after waiting for a preset time, thereby realizing the retry control of the task.
[0092] In one embodiment, the target task flow processing state includes:
[0093] Unexecuted state: when the task is just initialized and has not yet been scheduled;
[0094] Waiting state, the task is in the task pool;
[0095] Ready to execute, the task is in the task queue and has met the submission condition check;
[0096] In the running state, the task is in the executor and has met the execution condition check;
[0097] Retry waiting state: the task is in the retry queue and the task fails but the number of failures does not exceed the preset number;
[0098] Success state: the task is processed successfully;
[0099] Failed state: The task fails and exceeds the failure count threshold.
[0100] Forced stop state.
[0101] In this embodiment, the task flow scheduling method has high availability and high reliability. Through the deployment of multiple instances, the stability of task flow execution is greatly improved, and the possibility of task flow execution failure due to network or hardware failure is reduced; through resource adaptation, task resources are automatically increased when cluster computing resources are used less, improving resource utilization efficiency while reducing the time consumption of task flow execution; through task flow limiting, it is avoided to continue to execute new tasks when a large number of tasks are being executed and cluster computing resources are already occupied, preventing task resources from crowding out each other or even causing resource deadlock, further improving the stability of task flow execution; through reasonable priority management, the task flow scheduling platform will automatically identify time-consuming tasks and try to give priority to them, avoiding the barrel effect, and further improving resource utilization efficiency and the time consumption of task flow execution. It supports submitting and managing task flows in multiple ways through visual pages and Shell command lines, lowering the user's operating threshold and reducing labor costs.
[0102] In one embodiment, the Figure 2The logical architecture diagram of the task flow orchestration platform is shown in the figure. The various roles of the platform have been introduced in the content of the invention. Each instance of the task flow orchestration platform is deployed on an independent node. Each node contains additional Figure 1 All roles listed in .
[0103] In one embodiment, the Figure 3 The complete process of task flow execution is shown, which is introduced in order as follows:
[0104] The user submits the task flow configuration through the client and starts execution;
[0105] After receiving the task flow configuration, the interpreter parses and translates it to generate an executable job configuration;
[0106] The interpreter sends the job configuration to the manager of the execution layer. After receiving the job configuration, the manager initializes it according to the configuration and creates a scheduler corresponding to the task.
[0107] After the scheduler is created, it initializes the task pool, task queue, executor, and retry queue;
[0108] The scheduler follows the Figure 4 The process starts task scheduling;
[0109] After all tasks are completed, the scheduler-manager-interpreter returns the task results in sequence;
[0110] In one embodiment, the Figure 4 This shows the complete execution logic of the scheduler. It can be divided into four major steps:
[0111] 1) Task pool check: traverse all pending tasks in the task pool. If a task meets the submittable conditions, submit the task to the task queue. If the upstream task on which the task depends fails, the task also fails.
[0112] 2) Task queue check: Check whether the task at the head of the task queue meets the executable conditions. If so, submit the task to the executor to start execution. The scheduler will wait for a while until the instance officially starts executing before continuing the following process. If the task instance status is abnormal during this period, the task will be submitted to the retry queue and wait for re-execution. If the number of task retries exceeds the threshold, the task fails;
[0113] 3) Executor check: Check the status of newly completed tasks in the executor. If the task fails, resubmit the task to the task queue for re-execution. If the number of task retries exceeds the threshold, the task fails.
[0114] 4) Retry queue check: Check whether there is a task at the head of the retry queue. If so, it means that the task is ready to be re-executed, and the task is resubmitted to the task queue.
[0115] When there are no unfinished tasks in the task pool, task queue, retry queue, and executor, the scheduler's task ends.
[0116] In one embodiment, the task submission condition: The scheduler determines whether the task can be submitted from the task pool to the task queue by checking the submission condition. The submission conditions support the following:
[0117] Upstream node dependency: When the upstream task node that the current task depends on is successfully executed, the submission condition is met;
[0118] Custom conditions: Users can customize the conditions for submission through plug-ins. For example, when a specified partition of a hive table is created successfully, or a specified file or directory of hdfs is created successfully, the submission condition is met.
[0119] In one embodiment, the task executable condition: The scheduler determines whether the task can be submitted from the task queue to the executor for execution by checking the executable condition. The submittable conditions support the following:
[0120] Cluster available resources: When the cluster available resources (such as the number of cores, memory size) exceed the threshold of the task configuration, the execution condition is met, otherwise it will continue to wait for execution. The task scheduling platform implements the task flow control function based on this method.
[0121] Custom conditions: Users can customize executable conditions through plug-ins.
[0122] In one embodiment, the priority control: the task queue is responsible for the priority management of all tasks to be executed, and is essentially a priority queue. The higher the priority, the longer the time-consuming task is, and the closer it is to the head of the queue.
[0123] Users can configure the priority and estimated duration for each task. If not configured, the scheduler will set a default priority for the task. If the task has been executed before, the duration of the last task execution will be set as the default estimated duration.
[0124] In one embodiment, the retry control: the retry queue is responsible for the management of all tasks to be retried, which is essentially a delay queue. Tasks submitted to the retry queue can only be queried again after waiting for a period of time, thereby realizing task retry control.
[0125] In one embodiment, the task status is attached Figure 5The task state diagram is shown. There are the following types: UNSTARTED: Not executed. When the task is just initialized and has not yet been scheduled, it is in this state;
[0126] WAITING: Waiting, the task is in the task pool;
[0127] SUBMITTING: Ready to execute. At this time, the task is in the task queue and has met the submission condition check;
[0128] RUNNING: Running, the task is in the executor to meet the executable condition check;
[0129] RETRY_WAITING: Waiting for retry. At this time, the task is in the retry queue and has failed but has not exceeded the failure count threshold.
[0130] SUCCESS: Success
[0131] FAILED: The task failed and exceeded the failure count threshold
[0132] KILLED: Forced to stop
[0133] In one embodiment, the high availability is achieved by: Figure 6 The high-availability architecture of the task flow orchestration platform is demonstrated, which adopts a multi-instance deployment method, and each instance is deployed on a different node.
[0134] Zookeeper is used to elect a master instance among the instances, and the other nodes are standby instances. All task flow scheduling is performed in the master instance. Since the instance of the task flow scheduling platform itself is stateless, all state data is stored in the relational database. If the master instance fails, a new master instance is elected from all standby nodes. The new master instance can immediately obtain the required task flow configuration information from the database and continue to schedule the task flow.
[0135] It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.
[0136] In one embodiment, an intelligent task flow arrangement platform is provided, including the following program modules:
[0137] Client: used to communicate and interact with the task flow orchestration platform through command lines or on web pages, to create, manage, submit, and retry task flows, query task execution status, and analyze execution results;
[0138] Interpreter: responsible for translating the task flow configuration configured by the user into the job configuration for execution by the execution layer; translating the execution information of the job into visual display information;
[0139] Manager: used to receive job configuration information, initialize all pending tasks to the task pool according to the job configuration information, start the scheduler to start execution; find the corresponding scheduler, task queue and task pool based on the job unique ID, and obtain the execution status of the job;
[0140] Scheduler: responsible for the overall scheduling of tasks;
[0141] Task pool: used to store all tasks that have completed initialization but have not met the submission conditions;
[0142] Task queue: used to store all tasks that meet the submission conditions;
[0143] Executor: used to execute and manage the tasks in the task queue that meet the execution conditions, and record the information of all running task instances;
[0144] Retry queue: used to store all tasks that failed but did not exceed the preset number of retries.
[0145] In one embodiment, the task flow orchestration platform internally includes the following modules: client, interpreter, manager, scheduler, task pool, task queue, retry queue, and executor, among which:
[0146] Client: The client is divided into command line client and web client. Users can communicate and interact with the task flow orchestration platform through the command line or on the web page. To create, manage, submit, retry task flows, query task execution status, analyze execution results, and so on.
[0147] Interpreter: The interpreter is a bridge between the application layer and the execution layer. When submitting a task flow, it is responsible for translating the user-configured task flow configuration into a job configuration that can be executed by the execution layer. When querying the task execution status, the interpreter will translate the job execution information into user-friendly visual display information.
[0148] Manager: When submitting a task flow, the manager will receive the job configuration information from the application layer, and initialize all tasks to be executed to the task pool according to the job configuration. After the initialization is completed, the scheduler is started to start execution. When querying the execution status of the task flow, the manager will find the corresponding scheduler, task queue and task pool based on the job unique ID to obtain the execution status of the job.
[0149] Scheduler: The scheduler is responsible for the overall scheduling of tasks, ensuring priority control, automatic retry, dynamic adjustment of resources, and other functions while maximizing the use of cluster computing resources.
[0150] Task pool: It is a submodule of the scheduler and is responsible for storing all tasks that have completed initialization but have not yet met the conditions for submission.
[0151] Task queue: It is a submodule of the scheduler. All tasks that meet the submission conditions will first enter the queue and wait for execution. The tasks in the queue are sorted in order of priority, and the task with the highest priority is at the head of the queue.
[0152] Executor: It is a submodule of the scheduler. The scheduler submits the tasks that meet the executable conditions in the task queue to the executor for task execution and runtime management, and records all the task instance information that has been run.
[0153] Retry queue: It is a submodule of the scheduler. All tasks that fail but do not exceed the retry threshold will be stored in the retry queue and wait for re-execution. The retry queue is actually a delay queue. Tasks submitted to it can only be queried after waiting for a period of time.
[0154] In one embodiment, the task flow orchestration platform is divided into two layers:
[0155] a) Application layer: The interfaces provided by the bottom layer will be packaged into interfaces that meet business requirements in the application layer for users to call. The client and interpreter are both modules of the application layer;
[0156] b) Execution layer: responsible for the execution and scheduling of tasks. Managers, schedulers, task pools, task flows, executors, and retry queues are all modules of the execution layer.
[0157] In one embodiment, the task flow orchestration platform supports multi-instance deployment, and leader election is used among multiple instances to ensure that only one instance is responsible for executing a task flow at the same time. When an instance fails, the backup node can immediately switch to the main node and take over the execution of the task flow, thereby realizing 7*24 hours high availability operation of the platform.
[0158] In one embodiment, all state data of the task flow orchestration platform is stored in a relational database, and through the industry's mature relational database high availability solutions (such as MySQL's binlog or Postgresql's streaming replication technology), it is ensured that the state data will not be lost when switching occurs due to instance failure.
[0159] In one embodiment, during the execution of the task flow, if the computing resource utilization rate of the cluster is low, the task flow orchestration platform can support automatically increasing resources when executing the next task to improve the task execution efficiency.
[0160] In one embodiment, during the execution of a task flow, if a large number of tasks need to be executed at the same time, the task flow orchestration platform will automatically limit the flow according to the priority to prevent a large number of tasks from being executed in the cluster and causing resource deadlock.
[0161] In one embodiment, the priority management: users can configure the priority for each task, and tasks with higher priorities will be executed first. When there are multiple tasks with the same priority, the task flow scheduling platform will determine the execution time required for each task, and tasks that take a long time will be executed first, to prevent the task flow from being executed to the end with only a few tasks that take a long time running, and the computing resources of the cluster cannot be fully utilized.
[0162] In one embodiment, the multiple task triggering modes: tasks in a task flow can not only rely on the execution status of upstream task nodes, but also customize the task triggering mode, such as monitoring whether a table partition exists, or whether a file is created, etc.
[0163] In this embodiment, the task flow orchestration platform has high availability and high reliability. Through the deployment of multiple instances, the stability of task flow execution is greatly improved, and the possibility of task flow execution failure due to network or hardware failure is reduced;
[0164] Through resource adaptation, task resources are automatically increased when cluster computing resources are used less, improving resource utilization efficiency while reducing the time spent on task flow execution;
[0165] By limiting the task flow, we can avoid executing new tasks when a large number of tasks are being executed and the cluster computing resources are fully occupied, prevent the task resources from crowding out each other or even causing resource deadlock, and further improve the stability of task flow execution;
[0166] Through reasonable priority management, the task flow orchestration platform will automatically identify time-consuming tasks and prioritize their execution as much as possible to avoid the "water bucket effect", further improving resource utilization efficiency and the time consumption of task flow execution.
[0167] It supports submitting and managing task flows in multiple ways through visual pages and Shell command lines, lowering the user's operating threshold and reducing labor costs.
[0168] For the specific definition of the intelligent task flow orchestration platform, please refer to the definition of the intelligent task flow orchestration method above, which will not be repeated here. Each module in the above-mentioned intelligent task flow orchestration platform can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0169] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 7 As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input platform connected through a platform bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating platform and a computer program. The internal memory provides an environment for the operation of the operating platform and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, an intelligent task flow scheduling method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input platform of the computer device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse, etc.
[0170] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0171] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, which involves all or part of the processes in the above-mentioned embodiment method.
[0172] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which involves all or part of the processes in the above-mentioned embodiment method.
[0173] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0174] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, 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.
[0175] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. An intelligent task flow arrangement method, It is characterized in that The method comprises: Receive a target task flow and the target task flow configuration sent by a user; According to the target task flow configuration, the target task flow is parsed and translated to generate a job configuration; Initialize the target task flow according to the job configuration, and create a scheduler corresponding to the target task flow; The scheduler initializes the task pool, task queue, executor and retry queue of the target task flow; The scheduler checks the task pool, task queue, executor and retry queue of the target task flow, generates a priority control scheme for the target task flow according to preset rules, processes the target task flow according to the priority control scheme, and generates the processing status of the target task flow in real time; Receive user query input and display the target task flow processing status; The receiving the target task flow and the target task flow configuration sent by the user includes: Receiving a target task flow and the target task flow configuration sent by a user through a command line client or a web client, wherein the target task flow includes creating, managing, submitting and retrying tasks, and the target task flow configuration includes establishing a processing priority for each task in the target task flow; The scheduler checks the task pool, task queue, executor and retry queue of the target task flow, including: The task pool check includes: traversing all tasks to be submitted in the task pool, and if the task meets the submission condition, submitting the task to the task queue; The task queue check includes: checking whether the task at the head of the task queue meets the execution condition, if so, submitting the task to the executor to start execution, the scheduler waits until the instance starts to execute before continuing the following process, if the task instance state is abnormal before the instance starts to execute, submitting the task to the retry queue to wait for re-execution, if the task retry times exceed the preset times, the task processing fails; The executor check includes: checking the status of the task completed in the executor, if the task fails, resubmitting the task to the task queue for re-execution after delay, and if the number of task retries exceeds a preset number, the task processing fails; The retry queue check includes: checking whether there is a task at the head of the retry queue, and if so, resubmitting the task to the task queue; The task meets the submission condition including: upstream node dependency condition or custom condition; wherein, the upstream node dependency condition is that when the upstream task node that the current task depends on is successfully executed, the submission condition is met; the custom condition is that the user customizes the submission condition in a plug-in manner; The execution condition that the task satisfies includes: cluster available resource condition or custom condition; wherein, when the cluster available resource exceeds the threshold configured for the task, the execution condition is satisfied; The custom conditions are user-defined execution conditions in a plug-in manner; The priority control scheme of the target task flow is generated according to the preset rules, and the target task flow is processed according to the priority control scheme. The priority control scheme includes: the task queue is responsible for the priority management of all tasks to be executed, specifically, the user configures the priority and the estimated time of each task, and generates the priority control scheme according to the priority and the estimated time of the task; If not configured, the scheduler sets a default priority for the task.
2. The method according to claim 1, It is characterized in that The scheduler checks the task pool, task queue, executor and retry queue of the target task flow, and generates a priority control scheme for the target task flow according to preset rules, processes the target task flow according to the priority control scheme, and then also includes: retry control, the retry queue is responsible for the management of all tasks to be retried, and tasks submitted to the retry queue are only processed after waiting for a preset time, thereby realizing the retry control of the task.
3. The method according to claim 1, It is characterized in that The target task flow processing status includes: Unexecuted state: when the task is just initialized and has not yet been scheduled; Waiting state, the task is in the task pool; Ready to execute, the task is in the task queue and has met the submission condition check; In the running state, the task is in the executor and has met the execution condition check; Retry waiting state: the task is in the retry queue and the task fails but the number of failures does not exceed the preset number; Success state: the task is processed successfully; Failed state: The task fails and exceeds the failure count threshold; Forced stop state.
4. An intelligent task flow arrangement platform, used to implement the intelligent task flow arrangement method according to claim 1, It is characterized in that The platform includes: Client: used to communicate and interact with the task flow orchestration platform through command lines or on web pages, to create, manage, submit, and retry task flows, query task execution status, and analyze execution results; Interpreter: responsible for translating the task flow configuration configured by the user into the job configuration for execution by the execution layer; translating the execution information of the job into visual display information; Manager: used to receive job configuration information, initialize all pending tasks to the task pool according to the job configuration information, start the scheduler to start execution; find the corresponding scheduler, task queue and task pool based on the job unique ID, and obtain the execution status of the job; Scheduler: responsible for the overall scheduling of tasks; Task pool: used to store all tasks that have completed initialization but have not met the submission conditions; Task queue: used to store all tasks that meet the submission conditions; Executor: used to execute and manage the tasks in the task queue that meet the execution conditions, and record the information of all running task instances; Retry queue: used to store all tasks that failed but did not exceed the preset number of retries.
5. A computer device comprising a memory and a processor, wherein the memory stores a computer program, It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 3 are implemented.
6. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 3 are implemented.
