Distributed scheduling system, method and storage medium for big data processing

By introducing the scheduling center, leader, follower, coordinator and task queue modules into the big data distributed scheduling system, combined with ZooKeeper's high availability strategy, the problem of task dependencies and single points of failure is solved, and stable task distribution is achieved. and system load balancing to ensure efficient execution of big data processing tasks and system reliability.

CN112162841BActive Publication Date: 2024-09-06CHONGQING CHANGAN AUTOMOBILE CO LTD
View PDF 11 Cites 0 Cited by

Patent Information

Application Number
CN202011069582.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-30
Publication Date
2024-09-06
Estimated Expiration
2040-09-30

AI Technical Summary

Technical Problem

Existing big data distributed scheduling systems do not consider task dependencies when dealing with complex task flow dependencies and orchestration. As a result, upstream tasks time out or run idle, which may cause downstream tasks to run idle. There is also the risk of single point failure, which affects the stability of computing logic. .

Method used

A distributed scheduling system for big data processing is designed, including a scheduling center, leader, follower, coordinator, task queue and metadata module. The workflow is configured through the API interface and the Round-Robin algorithm is used for load balancing and For task allocation, ZooKeeper is used to implement a high-availability fault-tolerant strategy to ensure task dependencies and system stability.

Benefits of technology

It effectively avoids the idle running of downstream tasks caused by upstream task timeout or empty running, ensures high availability and load balancing of the system, reduces the burden on developers, and achieves linear expansion of Leader and Follower nodes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112162841B
    Figure CN112162841B
Patent Text Reader

Abstract

The present invention discloses a distributed scheduling system, method and storage medium for big data processing, including a scheduling center module, which is responsible for workflow dependency configuration and job development; a leader module, which is a task flow segmentation and allocation node in a cluster, segments the workflow configured by the scheduling center according to the dependency relationship, and sends the segmented specific task nodes to the follower nodes; a follower module, which is used to execute the specific computing tasks assigned by the leader module, submit the task results, and save the task execution log; a coordinator module, which is used to regularly retrieve the tasks to be executed from the database, and use the Round‑Robin algorithm to load balance the leader module according to the current load conditions of all leader modules; a task queue module and a metadata module. The present invention takes into account the dependency on tasks, avoids the phenomenon of downstream tasks running empty due to the execution time timeout or empty running of upstream tasks, and is beneficial to the entire data flow.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of big data computing task scheduling, and specifically relates to a distributed scheduling system, method and storage medium for big data processing. Background Art

[0002] With the rapid development of data technology, modern enterprises are beginning to move from the IT era to the DT era. Regardless of whether they choose public clouds or self-built data centers, big data platforms have become the infrastructure of modern enterprises. Big data platforms have gradually evolved from the initial single execution engine MapReduce to the era of multiple execution engines such as MapReduce, Spark, and Flink. In the process of mining data value, enterprises now generate thousands of data computing tasks. How to schedule and arrange these tasks and build a complex computing task dependency network is particularly important.

[0003] For example, the patent document CN107506381A discloses a big data distributed scheduling and analysis method, system device and storage medium: describes a self-built big data distributed scheduling and analysis system, whose core function is to realize the encapsulation of the big data processing technology process and has some scheduling functions, but does not propose a method to deal with the complex task flow dependency and orchestration in the big data scenario, and the whole system has a single point of failure, and does not consider high-availability fault-tolerant strategies, so it will face the following problems:

[0004] (1) The task distribution method does not take into account the dependencies between tasks. Once the execution time of the upstream task exceeds the limit or runs in vain, the downstream task is likely to run in vain, which is not conducive to the entire data flow process and increases the burden on developers.

[0005] (2) The server that submits or executes computing tasks has a single point of failure. Once it goes down, the computing task will not be triggered, affecting the computing logic.

[0006] Therefore, it is necessary to develop a distributed scheduling system, method and storage medium for big data processing. Summary of the invention

[0007] To solve the above problems, the present invention provides a distributed scheduling system, method and storage medium for big data processing.

[0008] In a first aspect, a distributed scheduling system for big data processing according to the present invention comprises:

[0009] The scheduling center module is responsible for workflow dependency configuration and job development, and persists the configured workflow into the to-be-executed workflow table of the relational database through the API interface;

[0010] The leader module, as the task flow segmentation and allocation node in the cluster, segments the workflow configured by the scheduling center according to the dependency relationship and sends the segmented specific task nodes to the follower nodes;

[0011] The follower module, also known as the executor, is used to execute specific computing tasks assigned by the leader module, submit task results, and save task execution logs;

[0012] The coordinator module is used to retrieve the tasks to be executed from the database at a regular interval and use the Round-Robin algorithm to balance the load of the leader modules according to the current load of all leader modules.

[0013] The task queue module is a message queue that contains workflow topics, task topics, and task result topics, and is used to implement task dependencies between workflows.

[0014] The metadata module includes two databases, namely a relational database and a distributed memory database. The relational database is used to persistently store the execution records of the workflow; the distributed memory database is used to extract the workflow-related metadata from the relational database and load it into the memory.

[0015] In a second aspect, the distributed scheduling method for big data processing described in the present invention adopts the distributed scheduling system for big data processing described in the present invention, and the method includes the following steps:

[0016] Receive workflow dependency configuration and job development, and persist the configured workflow to the to-be-executed workflow table of the relational database through the API interface;

[0017] Split the workflow configured by the scheduling center according to the dependency relationship, and send the split specific task nodes to the follower nodes;

[0018] Used to execute specific computing tasks assigned by the leader module, submit task results, and save task execution logs;

[0019] It is used to retrieve the tasks that need to be executed from the database at a regular interval, and use the Round-Robin algorithm to balance the load of the leader module based on the current load conditions of all leader modules.

[0020] Furthermore, the coordinator service periodically scans the table of pending workflows in the relational database to obtain pending commands, and periodically requests the load information of the Leader cluster from the ZooKeeper cluster, and uses the Round-Robin algorithm to assign workflows to the corresponding Leader according to the current CPU and memory margin of each Leader machine; finally, the workflow tagged with the Leader is sent to the process_instance topic in the message queue, waiting for the Leader to consume the topic to execute the workflow.

[0021] Furthermore, the Leader consumes the process_instance topic in the message queue and determines whether the workflow needs to be executed based on the Leader_host_name field in the message; if the workflow needs to be executed, the workflow is divided into several computing tasks according to the dependencies of the workflow, and the computing resources required for each computing task are estimated; the load information of each machine in the Follower cluster is obtained from the ZooKeeper cluster, and the Round-Robin algorithm is used to load balance the executor to obtain the task; the independent computing tasks after the division are added with the corresponding executor Follower_host_name information, and sent to the task_instance topic in the message queue; in the process of suspending the workflow execution thread, the Leader will consume the data in the task_instance_result topic returned by the Follower through the message queue to update the execution result of the workflow; when the execution status of the entire workflow becomes the final state, the workflow execution result is persisted to the relational database.

[0022] Furthermore, the Follower consumes the data of the task_instance topic in the message queue, matches the corresponding executor according to the Follower_host_name for execution, and after the task is completed, writes the execution result of the task back to the task_instance_result topic in the message queue, waiting for the Leader to consume the task execution result. After the Leader writes the completed task result back to the relational database, the entire task flow is completed.

[0023] Furthermore, when the system starts, the Leader and Follower will register with the Leader_mechs and Follower_mechs znodes on Zookeeper, provide the local CPU and memory information and maintain the heartbeat; each Leader and Follower monitors the znode; once a Leader or Follower is found to be down, the workflow fault tolerance process will be entered, which includes the Leader fault tolerance process and the Follower fault tolerance process.

[0024] Furthermore, the Leader fault tolerance process is specifically as follows:

[0025] Each machine in the Leader cluster monitors the znode of the Leader on the ZooKeeper cluster. Once a Leader is found to be down, a distributed lock mechanism based on the ZooKeeper cluster will be triggered. One of the living Leaders will obtain the distributed lock and trigger the workflow fault-tolerant logic. The workflow information that needs fault tolerance will be inserted into the fault-tolerant command table in the relational database. The Leader that obtains the distributed lock will then take over the workflow and complete the distributed fault-tolerant process of the Leader.

[0026] Furthermore, the Follower fault tolerance process is specifically as follows:

[0027] Each machine in the Follower cluster registers itself with a znode on the ZooKeeper cluster. If a Follower that is executing a task crashes, a monitoring mechanism of the Leader is triggered, which terminates all running tasks on all currently crashed Followers. The Leader then marks the workflow as requiring fault tolerance and reselects a surviving Follower as the executor of the remaining tasks of the workflow.

[0028] In a third aspect, the storage medium described in the present invention stores a computer-readable program therein, and when the computer-readable program is called by an executor, it can execute the steps of the distributed scheduling method for big data processing described in the present invention.

[0029] The present invention has the following advantages:

[0030] (1) The task dependencies are taken into account in the task distribution method, thus avoiding the phenomenon that downstream tasks run in vain due to the execution time timeout or empty running of upstream tasks. This is beneficial to the entire data flow and reduces the burden on developers.

[0031] (2) A fault-tolerant strategy is designed. When a single point of failure occurs in the entire system, the corresponding workflow will be taken over and continue to execute.

[0032] (3) The entire scheduling cluster can achieve linear expansion of Leader nodes and Worker nodes. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 This is a diagram of the Follower executor node architecture in this embodiment;

[0034] Figure 2 is the overall architecture diagram of this embodiment;

[0035] Figure 3 This is a workflow execution flow chart of this embodiment;

[0036] Figure 4 This is the Leader fault tolerance principle diagram of this embodiment;

[0037] Figure 5 This is a diagram of the Follower fault tolerance principle of this embodiment. DETAILED DESCRIPTION

[0038] The present invention will be further described below in conjunction with the accompanying drawings.

[0039] In this embodiment, a distributed scheduling system for big data processing includes:

[0040] The scheduling center module has a scheduling center Web interface, which provides users with a simple and convenient task visualization configuration window and provides monitoring and operation functions for scheduling platform jobs. The scheduling center module is responsible for workflow dependency configuration and job development. Through the API interface, the configured workflow is persisted to the to-be-executed workflow table of the relational database (DB for short); the workflow dependency is described through Json, and the predecessor and successor job id information is stored in the Json data of each job.

[0041] The leader module, as the task flow segmentation and allocation node in the cluster, segments the workflow configured by the scheduling center according to the dependency relationship and sends the segmented specific task nodes to the follower nodes.

[0042] The follower module, also known as the executor, is used to execute specific computing tasks assigned by the leader module, submit task results, and save task execution logs.

[0043] The coordinator module is used to periodically retrieve the tasks that need to be executed from the database and use the Round-Robin algorithm to balance the load of the leader modules based on the current load conditions of all leader modules.

[0044] The task queue module is a message queue (MQ for short), which contains workflow topics, task topics, and task result topics.

[0045] The metadata module includes two databases, namely a relational database and a distributed memory database. The relational database is used to persistently store the execution records of the workflow; the distributed memory database is used to extract the workflow-related metadata from the relational database and load it into the memory, thereby reducing delays in the workflow running process and improving operational efficiency.

[0046] This system is a multi-execution engine distributed task scheduling system for complex computing task scenarios on big data platforms. The system can segment workflows for user-defined computing task workflows based on the concept of decentralization. The segmented computing tasks are distributed to the Followers in the cluster for execution. Task dependencies between workflows are implemented using message queues, which have the ability to express complex dependency DAG graphs. The high availability of the leader module and the follower module is achieved based on the distributed coordination service zookeeper, so the entire system can achieve linear expansion during operation.

[0047] In the data platform, a complete data processing task includes four stages: data access, data cleaning, data mining, and analysis result storage. That is, a complete data processing workflow includes multiple computing engines. Figure 1 As shown in the figure, Follower is not used as the running node of specific computing tasks, but the gateway node in the big data platform, that is, the submission node of computing tasks, is used as the Follower node. The Follower node has the gateway of computing engines such as Sqoop client, Spark client, Flink client and Hive client. It is not directly used as the running node of computing tasks. It can realize the ability to schedule computing tasks of multiple execution engines, and realize the decoupling of the scheduling platform and the computing platform, avoiding resource competition.

[0048] In this embodiment, the distributed scheduling method for big data processing adopts the distributed scheduling system for big data processing as described in this embodiment, and the method includes the following steps:

[0049] Receive workflow dependency configuration and job development, and persist the configured workflow to the to-be-executed workflow table of the relational database through the API interface;

[0050] Split the workflow configured by the scheduling center according to the dependency relationship, and send the split specific task nodes to the follower nodes;

[0051] Used to execute specific computing tasks assigned by the leader module, submit task results, and save task execution logs;

[0052] It is used to retrieve the tasks that need to be executed from the database at a regular interval, and use the Round-Robin algorithm to balance the load of the leader module based on the current load conditions of all leader modules.

[0053] like Figure 2 and Figure 3 As shown, the specific process of this method is as follows:

[0054] The scheduling center module is responsible for workflow dependency configuration and job development. It persists the configured workflow into the to-be-executed workflow table of the relational database through the API interface. The workflow dependency is described through Json, and the predecessor and successor job id information is stored in the Json data of each job.

[0055] The coordinator service (i.e., coordinator) periodically scans the table of pending workflows in the relational database to obtain pending commands, and periodically requests the load information of the Leader cluster from ZooKeeper (ZK for short), and uses the Round-Robin algorithm to assign workflows to the corresponding Leader based on the CPU and memory margin of each Leader machine. Finally, the workflow with the Leader tag is sent to the process_instance topic in the message queue, waiting for the Leader to consume the topic to execute the workflow.

[0056] The Leader consumes the process_instance topic in the message queue and determines whether the workflow needs to be executed based on the Leader_host_name field in the message; if the workflow needs to be executed, the workflow is divided into several computing tasks according to the dependencies of the workflow, and the computing resources required for each computing task are estimated. The load information of each machine in the Follower cluster is obtained from the ZooKeeper cluster, and the Round-Robin algorithm is used to load balance the executor acquisition task; the independent computing tasks after segmentation are added with the corresponding executor Follower_host_name information, and sent to the task_instance topic in the message queue. In the process of suspending the workflow execution thread, the Leader consumes the data in the task_instance_result topic returned by the Follower through the message queue to update the execution result of the workflow. When the execution status of the entire workflow becomes the final state, the workflow execution result is persisted to the relational database.

[0057] Follower consumes the data of the task_instance topic in the message queue, matches the corresponding executor according to Follower_host_name, and executes it. After the task is completed, the execution result of the task is written back to the task_instance_result topic in the message queue, waiting for the Leader to consume the task execution result. After the Leader writes the completed task result back to the relational database, the entire task flow is completed.

[0058] As a scheduling system with distributed capabilities, fault-tolerant design is the core that must be considered for the entire system because of the inherent unreliability of distributed systems. The distributed fault tolerance of the entire scheduling system is implemented based on ZooKeeper. When the system starts, the Leader and Follower will register with the Leader_mechs and Follower_mechs znodes on Zookeeper, provide the CPU and memory information of the local machine and maintain the heartbeat; each Leader and Follower monitors the znode; once a Leader or Follower is found to be down, the workflow fault-tolerant process is entered, which includes the Leader fault-tolerant process and the Follower fault-tolerant process.

[0059] like Figure 4 As shown, in this embodiment, the Leader fault tolerance process is specifically as follows:

[0060] Each machine in the Leader cluster monitors the znode on ZooKeeper. Once a Leader crashes, a distributed lock mechanism based on ZooKeeper is triggered. One of the surviving Leaders obtains the distributed lock and triggers the workflow fault-tolerant logic. The workflow information that needs fault tolerance is inserted into the fault-tolerant command table in the relational database. The Leader that obtains the distributed lock then takes over the workflow and completes the Leader's distributed fault-tolerant process. Figure 4 As shown in the figure, after Leader1 hangs up, Leader2 obtains the distributed lock, then triggers the workflow fault-tolerant logic, inserts the workflow information that needs fault-tolerant into the fault-tolerant command table in the relational database, and then Leader2 takes over this workflow to complete the distributed fault-tolerant process of Leader.

[0061] In this embodiment, the Follower fault tolerance process is specifically as follows:

[0062] Each machine in the Follower cluster registers itself with a znode on the ZooKeeper cluster. If a Follower that is executing a task crashes, a monitoring mechanism of the Leader is triggered, which terminates all running tasks on all currently crashed Followers. The Leader then marks the workflow as requiring fault tolerance and reselects a surviving Follower as the executor of the remaining tasks of the workflow.

[0063] like Figure 5 As shown, when Follwer1 crashes, Follwer2 will re-execute it.

[0064] In this embodiment, a storage medium stores a computer-readable program, and when the computer-readable program is called by an executor, it can execute the steps of the distributed scheduling method for big data processing as described in this embodiment.

Claims

1. A distributed scheduling system for big data processing, It is characterized in that include: The scheduling center module is responsible for workflow dependency configuration and job development, and persists the configured workflow into the to-be-executed workflow table of the relational database through the API interface; The leader module, as the task flow segmentation and allocation node in the cluster, segments the workflow configured by the scheduling center according to the dependency relationship and sends the segmented specific task nodes to the follower nodes; The follower module, also known as the executor, is used to execute specific computing tasks assigned by the leader module, submit task results, and save task execution logs; The coordinator module is used to retrieve the tasks to be executed from the database at a regular interval and use the Round-Robin algorithm to balance the load of the leader modules according to the current load of all leader modules. The task queue module is a message queue that contains workflow topics, task topics, and task result topics, and is used to implement task dependencies between workflows. The metadata module includes two databases: a relational database and a distributed memory database. The relational database is used to persistently store the execution records of the workflow; the distributed memory database is used to extract the workflow-related metadata from the relational database and load it into the memory; When the system starts, the Leader and Follower will register with the Leader_mechs and Follower_mechs znodes on Zookeeper, provide local CPU and memory information and maintain heartbeats; each Leader and Follower monitors the znode; Once a leader or follower is found to be down, the workflow fault tolerance process will be entered. The workflow fault tolerance process includes the leader fault tolerance process and the follower fault tolerance process. The Leader fault tolerance process is specifically as follows: Each machine in the Leader cluster monitors the znode on ZooKeeper. Once a Leader crashes, a distributed lock mechanism based on ZooKeeper is triggered. One of the surviving Leaders obtains the distributed lock and triggers the workflow fault-tolerant logic. The workflow information that needs fault-tolerance is inserted into the fault-tolerant command table in the relational database. The Leader that obtains the distributed lock then takes over the workflow, completing the Leader's distributed fault-tolerant process. The Follower fault tolerance process is specifically as follows: Each machine in the Follower cluster registers itself with a znode on ZooKeeper. If a Follower that is executing a task crashes, a monitoring mechanism of the Leader is triggered to terminate all running tasks on the currently crashed Follower. The Leader then marks the workflow as requiring fault tolerance and reselects a surviving Follower as the executor of the remaining tasks of the workflow. The Leader consumes the process_instance topic in the message queue and determines whether the workflow needs to be executed based on the Leader_host_name field in the message. If the workflow needs to be executed, the workflow is divided into several computing tasks according to the dependencies of the workflow, and the computing resources required for each computing task are estimated. The load information of each machine in the Follower cluster is obtained from the ZooKeeper cluster, and the Round-Robin algorithm is used to load balance the executor acquisition tasks. The independent computing tasks after segmentation are added with the corresponding executor Follower_host_name information and sent to the task_instance topic in the message queue. In the process of suspending the workflow execution thread, the Leader consumes the data in the task_instance_result topic returned by the Follower through the message queue to update the execution result of the workflow. When the execution status of the entire workflow becomes the final state, the workflow execution result status is persisted to the relational database.

2. A distributed scheduling method for big data processing, It is characterized in that The distributed scheduling system for big data processing as claimed in claim 1 comprises the following steps: Receive workflow dependency configuration and job development, and persist the configured workflow to the to-be-executed workflow table of the relational database through the API interface; Split the workflow configured by the scheduling center according to the dependency relationship, and send the split specific task nodes to the follower nodes; Used to execute specific computing tasks assigned by the leader module, submit task results, and save task execution logs; It is used to retrieve the tasks that need to be executed from the database at a regular interval, and use the Round-Robin algorithm to balance the load of the leader module based on the current load conditions of all leader modules.

3. The distributed scheduling method for big data processing according to claim 2, Features: The coordinator service periodically scans the table of pending workflows in the relational database to obtain pending commands, and periodically requests the load information of the Leader cluster from ZooKeeper. It uses the Round-Robin algorithm to assign workflows to the corresponding Leader based on the CPU and memory margin of each Leader machine. Finally, it sends the workflow tagged with the Leader to the process_instance topic in the message queue, waiting for the Leader to consume the topic to execute the workflow.

4. The distributed scheduling method for big data processing according to claim 3, Features: The Follower consumes the data of the task_instance topic in the message queue, matches the corresponding executor according to the Follower_host_name, and executes it. After the task is completed, the execution result of the task is written back to the task_instance_result topic in the message queue, waiting for the Leader to consume the task execution result. After the Leader writes the completed task result back to the relational database, the entire task flow is completed.

5. A storage medium having a computer-readable program stored therein, Features: When the computer-readable program is called by an executor, it can execute the steps of the distributed scheduling method for big data processing as described in any one of claims 2 to 4.

Citation Information

Patent Citations

  • Distributed scheduling analysis method, system and device for big data, and storage medium

    CN107506381A

  • Distributed data analysis task scheduling system

    CN107766147A

  • Distributed task scheduling system and method based on web service

    CN110888719A

  • Method and system for improving operation performance based on dependency tree splitting

    CN111209301A

  • Distributed timed task scheduling system and computing device

    CN111338774A