CN113076188B - Scheduling method and device of distributed system - Google Patents

Scheduling method and device of distributed system Download PDF

Info

Publication number
CN113076188B
CN113076188B CN202010004365.7A CN202010004365A CN113076188B CN 113076188 B CN113076188 B CN 113076188B CN 202010004365 A CN202010004365 A CN 202010004365A CN 113076188 B CN113076188 B CN 113076188B
Authority
CN
China
Prior art keywords
task flow
resource
task
lock file
resource node
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
CN202010004365.7A
Other languages
Chinese (zh)
Other versions
CN113076188A (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.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN202010004365.7A priority Critical patent/CN113076188B/en
Publication of CN113076188A publication Critical patent/CN113076188A/en
Application granted granted Critical
Publication of CN113076188B publication Critical patent/CN113076188B/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/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5083Techniques for rebalancing the load in a distributed system
    • G06F9/5088Techniques for rebalancing the load in a distributed system involving task migration

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a dispatching method and a dispatching device of a distributed system, wherein the method comprises the following steps: receiving a first task flow, wherein the first task flow is used for executing operation on a first resource node of a distributed system; creating a first resource lock file corresponding to the first resource node, wherein the first resource lock file comprises identification information of the first task flow and timeout time of the first task flow; and scheduling the first task flow to the first resource node based on the first resource lock file.

Description

Scheduling method and device of distributed system
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for scheduling a distributed system.
Background
With the rise of cloud computing, distributed systems are widely used. The distributed system is deployed with a large number of resource nodes that support task flow execution. To ensure mutual exclusivity of task flows to access the same resources when the distributed system schedules the task flows, resource nodes are typically coordinated using resource lock files.
In the prior art, if a plurality of task flows need to operate the same resource node, a resource lock file with an increasing sequence number is created for each task flow under the same catalog according to the receiving sequence of the task flows, and each task flow executes the operation on the resource node according to the sequence of the resource lock file. For example, when the first task flow executes, the created resource lock file is 1, and the created resource lock file for the second task flow is 2, then the second task flow must execute the operation on the resource node after the deletion of the resource lock file 1. The task flow scheduling method has at least two disadvantages: firstly, the resource lock file is deleted according to the callback notification of the callback function, but because the callback function notification is not timely, the situation that the resource lock file of the task flow which is executing the operation on the resource node is not deleted and the next task flow already executes the operation on the resource node often occurs. And if the task flow performs operation on the resource node, if the load of the resource node is too high, the task flow is suspended, so that the task flow cannot be performed, the resource lock file of the task flow cannot be released all the time, and a new task flow cannot be scheduled all the time.
Disclosure of Invention
In view of this, the present invention provides a method and apparatus for scheduling a distributed system, which mainly aims to efficiently and accurately schedule task flows in the distributed system.
In a first aspect, the present invention provides a scheduling method of a distributed system, where the method includes:
receiving a first task flow, wherein the first task flow is used for executing operation on a first resource node of a distributed system;
Creating a first resource lock file corresponding to the first resource node, wherein the first resource lock file comprises identification information of the first task flow and timeout time of the first task flow;
and scheduling the first task flow to the first resource node based on the first resource lock file.
In a second aspect, the present invention provides a scheduling apparatus for a distributed system, the apparatus comprising:
a first receiving unit, configured to receive a first task flow, where the first task flow is used to perform an operation on a first resource node of a distributed system;
the creating unit is used for creating a first resource lock file corresponding to the first resource node, wherein the first resource lock file comprises identification information of the first task flow and timeout time of the first task flow;
And the scheduling unit is used for scheduling the first task flow to the first resource node based on the first resource lock file.
In a third aspect, the present invention provides a computer readable storage medium, the computer readable storage medium including a stored program, wherein the program when run controls a device in which the storage medium is located to perform the scheduling method of the distributed system described in the first aspect.
In a fourth aspect, the present invention provides a storage management device comprising: a memory for storing a program; a processor, coupled to the memory, for executing the program to perform the scheduling method of the distributed system described in the first aspect.
By means of the technical scheme, the scheduling method and the scheduling device of the distributed system are characterized in that when a first task flow for executing operation on a first resource node of the distributed system is received, a first resource lock file corresponding to the first resource node is created. And scheduling the first task flow to the first resource node based on the first resource lock file. The first resource lock file comprises the identification information of the first task flow and the overtime time of the first task flow, and therefore, the occupation of the task flow to the resource nodes can be controlled through the identification information of the task flow and the overtime time.
The foregoing description is only an overview of the present invention, and is intended to be implemented in accordance with the teachings of the present invention in order that the same may be more clearly understood and to make the same and other objects, features and advantages of the present invention more readily apparent.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart illustrating a method of scheduling a distributed system according to one embodiment of the present invention;
FIG. 2 is a flow chart illustrating a method of scheduling a distributed system according to another embodiment of the present invention;
FIG. 3 is a schematic diagram illustrating a resource lock control scheme of a distributed system according to another embodiment of the present invention;
FIG. 4 is a schematic diagram of a scheduling apparatus of a distributed system according to an embodiment of the present invention;
Fig. 5 is a schematic structural diagram of a scheduling apparatus of a distributed system according to another embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
The embodiment of the invention provides a dispatching method of a distributed system, as shown in fig. 1, which mainly comprises the following steps:
101. a first task flow is received, the first task flow for performing operations on a first resource node of a distributed system.
The task flow described in this embodiment is typically composed of a plurality of task items, where there is a set execution order among the plurality of task items, and where execution of the plurality of task items has an uninterruptible feature, and once a task item is interrupted, the entire task flow will fail to execute. The execution of the task flow depends on the resources in the resource nodes of the distributed system, and once the task flow has faults when executing the operation on one resource node of the distributed system and the task project is interrupted, the task flow needs to be scheduled to the other resource node in the distributed system again in order to ensure the smooth execution of the task flow. It can be seen that the first task flow is of at least two types: first, the first task flow is a task flow which is not operated on any resource node of the distributed system; second, the first task flow is an executed but interrupted task flow, which has performed an operation on at least one resource node in the distributed system, but has failed in the operation process, so that in order to ensure that the first task flow can be executed, an operation needs to be performed on another resource node in the distributed system.
102. Creating a first resource lock file corresponding to the first resource node, wherein the first resource lock file comprises identification information of the first task flow and timeout time of the first task flow.
In practical applications, there are multiple resource nodes in a distributed system. When a task flow is received, the task flow needs to be scheduled to a resource node on which an operation needs to be performed, and the resource node provides resources for the task flow to be performed. In order for a task flow to operate on its required resource node, it is necessary to create a resource lock file corresponding to its required resource node so that the task flow can preempt the resource node based on the resource lock file.
In this embodiment, the principle of creating the first resource lock file corresponding to the first resource node at least includes the following two types:
1. In order to ensure mutual exclusivity of task flows on the same resource, one resource node is occupied by one task flow at the same time, and then one resource node only has a resource lock file corresponding to one task flow at the same time. The meaning of the resource lock file corresponding to only one task flow includes: (1) When the task flow is completed to execute the operation on the resource node, the resource lock file of the resource node aiming at the task flow is automatically deleted, and when the corresponding resource lock file exists in the resource node, the resource lock file is effective, and the task flow can be scheduled to the resource node based on the effective resource lock file; (2) When the task flow is completed to execute the operation on the resource node, the resource lock file of the resource node for the task flow is identified as invalid, that is, only one resource lock file in the resource lock files of the resource node is valid at the same time, and the task flow can be scheduled to the resource node based on the valid resource lock file.
2. In order to ensure that a plurality of task flows can execute operations based on the same resource node at the same time, a plurality of effective resource lock files exist in the same resource at the same time, and each resource lock file corresponds to one task flow.
In this embodiment, the following cases may be faced in creating the first resource lock file corresponding to the first resource node:
And when any one of the task flows releases the first resource node, creating a first resource lock file corresponding to the first resource node.
Or the first resource node is not occupied by the task flow currently or occupied by the task flow, but the number of the task flows does not reach a preset number threshold, and then the first resource lock file corresponding to the first resource node is directly created.
In this embodiment, the specific pattern of the resource lock file may be determined based on the traffic requirements and may include, but is not limited to, any of a TXT pattern, a json pattern, an XML pattern. The resource lock file comprises identification information of the first task flow and timeout time of the first task flow. The identification information of the first task flow is used for identifying the first task flow so as to clearly distinguish which task flow currently preempts the first resource node based on the identification information. The timeout time of the first task flow refers to a time limit that the first task flow can execute an operation on the first resource node, and once the time of the first task flow for executing the operation on the first resource node reaches the timeout time, the occupation of the first task flow on the resource node is ended, other task flows can preempt the first resource node, and resource lock files aiming at other task flows are created for the first resource node. After the occupation of the resource node is finished, the resource lock file can be deleted or the resource lock file can be marked as invalid.
103. And scheduling the first task flow to the first resource node based on the first resource lock file.
In this embodiment, after the first resource lock file corresponding to the first resource node is created, it is indicated that the first resource node has been preempted by the first task flow successfully, and then the first task flow is scheduled to the first resource node according to the identification information of the first task flow in the first resource lock file, so that the first task flow performs an operation on the first resource node.
In this embodiment, in order to ensure that the first resource node can be released in time for other task flows to perform operations, after the first task flow is scheduled to the first resource node, the first task flow needs to be monitored according to the timeout time of the first task flow in the first resource lock file.
Specifically, when the execution time of the first task flow to execute the operation on the first resource node reaches the timeout time, it is indicated that the occupation of the first task flow on the first resource node is finished, and in order to enable other task flows to be scheduled to the first resource node, the first resource lock file needs to be deleted or marked to be invalid. Meanwhile, the process of scheduling the first task flow to the first resource node can be terminated in time according to the identification information of the first task flow in the first resource lock file, so that the first task flow stops executing the operation on the first resource node.
Specifically, when the execution time of the first task flow to execute the operation on the first resource node does not reach the timeout time, it is indicated that the first task flow can still occupy the first resource node, and the first task flow is maintained to execute the operation on the first resource node.
The scheduling method of the distributed system provided by the embodiment of the invention firstly creates a first resource lock file corresponding to a first resource node of the distributed system when receiving a first task flow for executing operation on the first resource node. And scheduling the first task flow to the first resource node based on the first resource lock file. The first resource lock file comprises the identification information of the first task flow and the overtime time of the first task flow, and therefore, the occupation of the first resource node by the first task flow can be controlled through the identification information and the overtime time.
Further, according to the method shown in fig. 1, another embodiment of the present invention further provides a scheduling method of a distributed system, as shown in fig. 2, where the method mainly includes:
201. a first task flow is received, the first task flow for performing operations on a first resource node of a distributed system.
202. Creating a first resource lock file corresponding to the first resource node, wherein the first resource lock file comprises identification information of the first task flow and timeout time of the first task flow.
203. And scheduling the first task flow to the first resource node based on the first resource lock file.
In this embodiment, a preset process pool exists in the distributed system, and when the first task flow is scheduled to the first resource node based on the first resource lock file, a process is allocated to the first task flow from the process pool, and the first task flow is scheduled to the first resource node by using the process.
204. And receiving a second task flow, wherein the second task flow is used for executing operation on the first resource node.
In this embodiment, the task flow has an uninterruptible feature, and once a certain task item is interrupted, the whole task flow fails to execute. During the task flow execution process, the task flow needs to be monitored for faults, so that when the task flow breaks down, the task flow is scheduled to another resource node in the distributed system again in time. The new resource node is a substitute of the previous resource node, and the task flow can be completed according to the execution of the required resources. It can be seen that the second task flow is of at least two types: the first, the second task flow is a task flow which has not operated on any resource node of the distributed system; second, the second task flow is an interrupted first task flow, which has performed an operation on at least one resource node in the distributed system, but has failed during the operation, and is scheduled to another resource node in the distributed system to perform the operation in order to ensure that the first task flow can perform the completion.
205. And judging whether the identification information of the second task flow is consistent with the identification information of the first task flow or not based on the first resource lock file.
In this embodiment, when a task flow seizes a resource node, in order to enable it to schedule to other resource nodes in time to perform an operation when it fails, it seizes two or more resource nodes directly when it seizes a resource node. When a task flow is scheduled to one resource node to fail, the task flow is directly scheduled to the preempted resource node without preempting the resource node, and the operation can be continuously executed. Therefore, in order to determine whether the first resource lock file of the first resource node is a resource node preempted before the second task flow, it is determined whether the identification information of the second task flow is consistent with the identification information of the first task flow based on the first resource lock file.
It should be noted that, all the resource nodes preempted by the task flows create the resource lock file for them. It should be noted that, the resource lock files of the plurality of preempted resource nodes include the same timeout time, or may include different timeout times. For example, the timeout time in the resource lock file corresponding to the resource node as the disaster recovery is relatively late.
206. And processing the second task flow according to the judging result.
In this embodiment, the method for processing the second task flow according to the determination result is related to the determination result, and at least the following methods exist:
First, if the identification information of the second task flow is consistent with the identification information of the first task flow, determining whether the first task flow is overtime or not based on the overtime time of the first task flow; if not, scheduling the second task flow to the first resource node based on the first resource lock file; and if the first task flow is overtime, stopping executing the first task flow.
Specifically, when the identification information of the second task flow is determined to be consistent with the identification information of the first task flow, the second task flow and the first task flow are the same task flow, and the first resource node is a resource node preempted by the task flow. At this time, whether the first task flow is overtime is determined directly according to the overtime time of the first task flow in the first resource lock file.
Specifically, when it is determined that the first task flow does not timeout, it is indicated that the first resource node is still occupied by the first task flow node, and then the second task flow is scheduled to the first resource node based on the first resource lock file.
Specifically, if the second task flow is the first task flow after the failure, determining a task item with the failure in the task flow, and dispatching the task item with the failure and the task item after the task item with the failure to the first resource node according to the identification information of the first task flow in the first resource lock file, so that the task item dispatched to the first resource node in the timeout time can execute the operation on the first resource node, thereby completing the whole first task flow.
Illustratively, the first task flow A includes task item 1, task item 2, task item 3, and task item 4. The first task flow a fails in task item 2 when accessing resource node 1 and determines a substitute resource node "resource node 2" that substitutes for resource node 1. If the resource node 2 is the previously preempted resource node for the first task flow a and the resource lock file thereof is not overtime, the task items 2 to 4 are directly scheduled to the resource node 2.
Specifically, when the first task flow is determined to be overtime, the occupation of the first task flow on the first resource node is ended, and in order to enable other task flows to occupy the first resource node, execution of the first task flow needs to be ended, and the occupation of the first task flow on the first resource node is ended. Creating a second resource lock file corresponding to the second resource node after terminating execution of the first task flow, the second resource lock file including identification information of the second task flow and a timeout time of the second task flow, and then scheduling the second task flow to the first resource node based on the second resource lock file. Similarly, if the second task flow is the first task flow after the failure, determining a task item with the failure in the task flow, and dispatching the task item with the failure and the task item after the task item with the failure to the first resource node according to the identification information of the first task flow in the first resource lock file, so that the task item dispatched to the first resource node in the timeout period can execute the operation on the first resource node, thereby completing the whole first task flow.
Secondly, if the identification information of the second task flow is inconsistent with the identification information of the first task flow, determining whether the first task flow is overtime or not based on the overtime time of the first task flow; if the first resource node is not overtime, waiting for the first task flow to release the first resource node, and creating a second resource lock file corresponding to the first resource node when the first task flow releases the first resource node, wherein the second resource lock file comprises identification information of the second task flow and overtime time of the second task flow; and if the first task flow is overtime, stopping executing the first task flow.
Specifically, if it is determined that the identification information of the second task flow is inconsistent with the identification information of the first task flow, it is indicated that the second task flow is not the same task flow as the first task flow. At this time, it is required to determine whether the first task flow is overtime according to the timeout time of the first task flow in the first resource lock file, so that when the first task flow is overtime, execution of the first task flow is terminated, so that the first task flow timely releases the first resource node, so that other task flows preempt the first resource node.
Specifically, when it is determined that the first resource lock file is not timed out, it is indicated that the first resource node is still occupied by the first task flow, and at this time, the following two operations may be performed: first, waiting for the first task flow to release the first resource node, and creating a second resource lock file corresponding to the first resource node when the first task flow releases the first resource node, wherein the second resource lock file comprises identification information of the second task flow and timeout time of the second task flow. And then scheduling a second task flow to the first resource node based on the second resource lock file. And secondly, continuing to search other resource nodes capable of replacing the first resource node, if the other resource nodes are not occupied by other task flows, creating a second resource lock file corresponding to the resource node, and scheduling the second task flow to the resource node based on the second resource lock file. And if the other resource nodes are occupied, training the first resource node and the other resource nodes until one of the resource nodes is released by the task flow. And then creating a second resource lock file corresponding to the released resource node, and scheduling a second task flow to the resource node based on the second resource lock file. It should be noted that, at least two cases exist where the first task flow releases the first resource node: first, the first task flow times out, and the first task flow is terminated to be executed, so that the first task flow releases the first resource node; second, the first task flow does not timeout, but the first task flow is based on the execution operation to the first resource node, the first task flow execution is completed, and the first task flow autonomously terminates execution.
Specifically, when the first task flow is determined to be overtime, the occupation of the first task flow on the first resource node is ended, and in order to enable other task flows to occupy the first resource node, execution of the first task flow is ended, so that the occupation of the first task flow on the first resource node is ended. Creating a second resource lock file corresponding to the second resource node after terminating execution of the first task flow, the second resource lock file including identification information of the second task flow and a timeout time of the second task flow, and then scheduling the second task flow to the first resource node based on the second resource lock file.
Specifically, based on the second resource lock file, the specific process of scheduling the second task flow to the first resource node is related to the specific type of the second task flow:
First, if the second task flow is a task flow which is not executed, the second task flow is completely scheduled to the first resource node directly according to the identification information of the second task flow in the second resource lock file, so that the task flow scheduled to the first resource node in the timeout time executes the operation on the first resource node, and the whole second task flow is completed.
Secondly, if the second task flow is the task flow after the fault, determining the task item with the fault in the task flow, and dispatching the task item with the fault and the task item after the task item with the fault to the first resource node according to the identification information of the second task flow in the second resource lock file, so that the task item dispatched to the first resource node in the overtime time can execute the operation on the first resource node, thereby completing the whole second task flow.
In this embodiment, both of the above-described methods refer to terminating execution of the first task flow when the first task flow times out. When the first task flow is terminated, the first resource lock file including the identification information of the first task flow and the timeout time is invalid, and in order to reduce the storage space occupied by the first resource lock file, the first resource lock file is deleted based on the identification information of the first task flow when the first task flow is timeout.
Specifically, the following specific process of deleting the first resource lock file is: when deleting the first resource lock file, calling a first interface, and deleting the first resource lock file based on the identification information of the first task flow, wherein the first interface is used for forcedly deleting the resource lock file corresponding to the resource node of the distributed system.
Further, taking fig. 3 as an example, a scheduling method of a distributed system is described below, as shown in fig. 3, the method includes a resource node 1"node1", a resource node 2"node2" and a resource node 3"node3", a master node "master" of the distributed system, and the distributed system has three interfaces: an overwrite file interface (CREATE FILE Without Overwrite), a first interface (Condition Delete) and a second interface (Session Expire Time). It should be noted that all three interfaces may be API interfaces.
The distributed system schedules the task flow 'ProcessID 1' to execute, and when the resource node is robbed, the following steps are executed aiming at node1 to do operation:
First, the distributed system receives a task stream "ProcessID1".
Next, an overlay File interface (CREATE FILE Without Overwrite) is used to create a resource lock File "Normal File" corresponding to the resource node 1"node1", where the content of the resource lock File includes the identification information "ProcessID" of the task flow "ProcessID1" and the timeout time "TTL", and as can be seen in fig. 3, the resource lock File is created by invoking a distributed consistency system such as a zookeeper or etcd through the overlay File interface. Based on the resource lock file, task flow "ProcessID" is scheduled to resource node 1"node1". When the task flow "ProcessID1" is scheduled to the resource node 1"node1", the second interface (Session Expire Time) determines whether the task flow "ProcessID1" is overtime based on the timeout period "TTL" rotation of the task flow "ProcessID1" in the resource lock file, so as to call the first interface (Condition Delete) to Delete the resource lock file when the timeout occurs.
Further, task flow "ProcessID" includes task item 1, task item 2, task item 3, and task item 4. Task flow "ProcessID" fails in task item 2 when it accesses node1 and determines the alternate resource node "node2" that replaces node 1. It is detected that node2 has been occupied by task flow "ProcessID" and that there is identification information and timeout time including task flow "ProcessID 3". If the identification information of the task flow in the resource lock file of node2 is inconsistent with the identification information of the task flow "ProcessID1", it is determined whether the task flow "ProcessID3" is timed out or not based on the timeout time of the task flow "ProcessID3" in the resource lock file. If it is determined that the task flow "ProcessID3" is out of time, execution of the task flow "ProcessID3" is terminated, the first interface is invoked, and the resource lock file is deleted based on the identification information of "ProcessID3" in the resource lock file. When the second interface is called to determine that the resource lock file is truly deleted, the overlay file interface (CREATE FILE Without Overwrite) is called to create a resource lock file for the resource node2, including the identification information of the task flow "ProcessID1" and the timeout time. Then, task items 2 through 4 in task stream "ProcessID1" are scheduled to node2, thereby allowing task stream "ProcessID1" to be completed.
Similarly, the task flow "ProcessID2" in fig. 3 is executed substantially the same as the task flow "ProcessID1" described above, and thus will not be described in detail herein.
Further, according to the above method embodiment, another embodiment of the present invention further provides a scheduling apparatus of a distributed system, as shown in fig. 4, where the apparatus includes:
a first receiving unit 31, configured to receive a first task flow, where the first task flow is used to perform an operation on a first resource node of the distributed system;
a creating unit 32, configured to create a first resource lock file corresponding to the first resource node, where the first resource lock file includes identification information of the first task flow and a timeout time of the first task flow;
a scheduling unit 33, configured to schedule the first task flow to the first resource node based on the first resource lock file.
The scheduling device of the distributed system provided by the embodiment of the invention firstly creates a first resource lock file corresponding to a first resource node of the distributed system when receiving a first task flow for executing operation on the first resource node. And scheduling the first task flow to the first resource node based on the first resource lock file. The first resource lock file comprises the identification information of the first task flow and the overtime time of the first task flow, and therefore, the occupation of the first resource node by the first task flow can be controlled through the overtime time.
Further, as shown in fig. 5, the apparatus further includes:
A second receiving unit 34, configured to receive a second task flow, where the second task flow is used to perform an operation on the first resource node;
A judging unit 35, configured to judge, based on the first resource lock file, whether the identification information of the second task flow is consistent with the identification information of the first task flow;
and the processing unit 36 is configured to process the second task flow according to a determination result.
Further, as shown in fig. 5, the processing unit 36 includes:
a first determining module 361, configured to determine, if the identification information of the second task flow is consistent with the identification information of the first task flow, whether the first task flow is overtime based on a timeout time of the first task flow; if not, triggering the first scheduling module 362; if the time-out occurs, triggering the termination module 363;
the first scheduling module 362 is configured to schedule, under the trigger of the first determining module 361, the second task flow to the first resource node based on the first resource lock file;
the termination module 363 is configured to terminate execution of the first task flow under the trigger of the first determination module 361.
Further, as shown in fig. 5, the processing unit 36 includes:
A second determining module 364, configured to determine, if the identification information of the second task flow is inconsistent with the identification information of the first task flow, whether the first task flow is overtime based on the overtime time of the first task flow; triggering preemption module 365; otherwise, trigger termination module 363;
the preemption module 365 is configured to, if the second determination module 364 determines that the first task flow is not overtime, wait for the first task flow to release the first resource node, and create a second resource lock file corresponding to the first resource node when the first task flow releases the first resource node, where the second resource lock file includes identification information of the second task flow and a timeout time of the second task flow;
The termination module 363 is configured to terminate execution of the first task flow if the second determination module 364 determines that the first task flow is timeout.
Further, as shown in fig. 5, the apparatus further includes: and a deleting unit 37, configured to delete the first resource lock file based on the identification information of the first task flow if the first task flow is overtime.
Further, as shown in fig. 5, the creating unit 32 is further configured to create, after the termination module 363 terminates execution of the first task flow, a second resource lock file corresponding to the second resource node, where the second resource lock file includes identification information of the second task flow and a timeout time of the second task flow;
The scheduling unit 33 is further configured to schedule the second task flow to the first resource node based on the second resource lock file.
Further, as shown in fig. 5, the scheduling unit 33 includes:
A third determining module 331, configured to determine whether the second task flow is a failed task flow; if so, triggering the second scheduling module 332;
The second scheduling module 332 is configured to determine a task item corresponding to a fault in the second task flow, and schedule the task item and the task items that follow the task item to the first resource node.
The content of information interaction and execution process between the modules in the above-mentioned device, because the same concept as the scheduling method embodiment of the distributed system in the embodiment of the present invention, can be referred to in the description of the method embodiment of the present invention, and the details are not repeated here. Based on the description in the above embodiments, the embodiments of the device can be freely combined according to the service requirement to form a new embodiment.
The embodiment of the invention provides a computer readable storage medium, which comprises a stored program, wherein when the program runs, a device where the storage medium is controlled to execute the scheduling method of the distributed system of the workflow scheduling system.
The embodiment of the invention provides a storage management device, which comprises: a memory for storing a program; a processor, coupled to the memory, for executing the program to perform the method of scheduling a distributed system of the workflow scheduling system of any one of the above.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and for parts of one embodiment that are not described in detail, reference may be made to related descriptions of other embodiments.
It will be appreciated that the relevant features of the methods and apparatus described above may be referenced to one another. In addition, the "first", "second", and the like in the above embodiments are for distinguishing the embodiments, and do not represent the merits and merits of the embodiments.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein.
The algorithms and displays presented herein are not inherently related to any particular computer, virtual system, or other apparatus. Various general-purpose systems may also be used with the teachings herein. The required structure for a construction of such a system is apparent from the description above. In addition, the present invention is not directed to any particular programming language. It will be appreciated that the teachings of the present invention described herein may be implemented in a variety of programming languages, and the above description of specific languages is provided for disclosure of enablement and best mode of the present invention.
In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be construed as reflecting the intention that: i.e., the claimed invention requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the apparatus of the embodiments may be adaptively changed and disposed in one or more apparatuses different from the embodiments. The modules or units or components of the embodiments may be combined into one module or unit or component and, furthermore, they may be divided into a plurality of sub-modules or sub-units or sub-components. Any combination of all features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or units of any method or apparatus so disclosed, may be used in combination, except insofar as at least some of such features and/or processes or units are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings), may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features but not others included in other embodiments, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments can be used in any combination.
Various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that some or all of the functions of some or all of the components in the methods, apparatus and framework of operation of the deep neural network model according to embodiments of the present invention may be implemented in practice using a microprocessor or Digital Signal Processor (DSP). The present invention can also be implemented as an apparatus or device program (e.g., a computer program and a computer program product) for performing a portion or all of the methods described herein. Such a program embodying the present invention may be stored on a computer readable medium, or may have the form of one or more signals. Such signals may be downloaded from an internet website, provided on a carrier signal, or provided in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The use of the words first, second, third, etc. do not denote any order. These words may be interpreted as names.

Claims (10)

1. A method of scheduling a distributed system, comprising:
receiving a first task flow, wherein the first task flow is used for executing operation on a first resource node of a distributed system;
Creating a first resource lock file corresponding to the first resource node, wherein the first resource lock file comprises identification information of the first task flow and timeout time of the first task flow;
Scheduling the first task flow to the first resource node based on the first resource lock file;
Receiving a second task flow, wherein the second task flow is used for executing operation on the first resource node;
Judging whether the identification information of the second task flow is consistent with the identification information of the first task flow or not based on the first resource lock file;
And processing the second task flow according to the judging result, wherein the processing comprises the following steps:
If the identification information of the second task flow is consistent with the identification information of the first task flow, determining whether the first task flow is overtime or not based on the overtime time of the first task flow; if not, scheduling the second task flow to the first resource node based on the first resource lock file; if the first task flow is overtime, the execution of the first task flow is terminated;
Or, include:
If the identification information of the second task flow is inconsistent with the identification information of the first task flow, determining whether the first task flow is overtime or not based on the overtime time of the first task flow; if the first resource node is not overtime, waiting for the first task flow to release the first resource node, and creating a second resource lock file corresponding to the first resource node when the first task flow releases the first resource node, wherein the second resource lock file comprises identification information of the second task flow and overtime time of the second task flow; and if the first task flow is overtime, stopping executing the first task flow.
2. The method of claim 1, further comprising:
And deleting the first resource lock file based on the identification information of the first task flow if the first task flow is overtime.
3. The method of claim 1, wherein after terminating execution of the first task flow, further comprising:
creating a second resource lock file corresponding to a second resource node, wherein the second resource lock file comprises identification information of the second task flow and timeout time of the second task flow;
and scheduling the second task flow to the first resource node based on the second resource lock file.
4. A method according to claim 3, wherein scheduling the second task flow to the first resource node comprises:
determining whether the second task flow is a failed task flow;
if yes, determining task items corresponding to faults in the second task flow, and scheduling the task items and the task items after the task items to the first resource node.
5. A scheduling apparatus of a distributed system, comprising:
a first receiving unit, configured to receive a first task flow, where the first task flow is used to perform an operation on a first resource node of a distributed system;
the creating unit is used for creating a first resource lock file corresponding to the first resource node, wherein the first resource lock file comprises identification information of the first task flow and timeout time of the first task flow;
a scheduling unit, configured to schedule the first task flow to the first resource node based on the first resource lock file;
A second receiving unit, configured to receive a second task flow, where the second task flow is used to perform an operation on the first resource node;
The judging unit is used for judging whether the identification information of the second task flow is consistent with the identification information of the first task flow or not based on the first resource lock file;
the processing unit is configured to process the second task flow according to a determination result, where the processing unit includes:
The first determining module is used for determining whether the first task flow is overtime or not based on the overtime time of the first task flow if the identification information of the second task flow is consistent with the identification information of the first task flow; if the first scheduling module is not overtime, triggering the first scheduling module; if the time is out, triggering a termination module;
the first scheduling module is configured to schedule, under the trigger of the first determining module, the second task flow to the first resource node based on the first resource lock file;
the termination module is used for terminating execution of the first task flow under the triggering of the first determination module;
The processing unit further includes:
A second determining module, configured to determine, if the identification information of the second task flow is inconsistent with the identification information of the first task flow, whether the first task flow is overtime based on a timeout time of the first task flow; triggering a preemption module; otherwise, triggering a termination module;
The preemption module is configured to, if the second determination module determines that the first task flow is not overtime, wait for the first task flow to release the first resource node, and create a second resource lock file corresponding to the first resource node when the first task flow releases the first resource node, where the second resource lock file includes identification information of the second task flow and a timeout time of the second task flow;
and the termination module is used for terminating the execution of the first task flow if the second determination module determines that the first task flow is overtime.
6. The apparatus of claim 5, further comprising:
And the deleting unit is used for deleting the first resource lock file based on the identification information of the first task flow if the first task flow is overtime.
7. The apparatus of claim 5, wherein the creating unit is further configured to create, after the termination module terminates execution of the first task flow, a second resource lock file corresponding to a second resource node, the second resource lock file including identification information of the second task flow and a timeout time of the second task flow;
The scheduling unit is further configured to schedule the second task flow to the first resource node based on the second resource lock file.
8. The apparatus of claim 7, wherein the scheduling unit comprises:
A third determining module, configured to determine whether the second task flow is a failed task flow; if yes, triggering a second scheduling module;
The second scheduling module is configured to determine a task item corresponding to a fault in the second task flow, and schedule the task item and a task item after the task item to the first resource node.
9. A computer-readable storage medium, characterized in that the computer-readable storage medium comprises a stored program, wherein the program, when run, controls a device in which the storage medium is located to perform the scheduling method of the distributed system according to any one of claims 1-4.
10. A storage management device, comprising:
A memory for storing a program;
A processor, coupled to the memory, for executing the program to perform the method of scheduling a distributed system according to any one of claims 1-4.
CN202010004365.7A 2020-01-03 2020-01-03 Scheduling method and device of distributed system Active CN113076188B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010004365.7A CN113076188B (en) 2020-01-03 2020-01-03 Scheduling method and device of distributed system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010004365.7A CN113076188B (en) 2020-01-03 2020-01-03 Scheduling method and device of distributed system

Publications (2)

Publication Number Publication Date
CN113076188A CN113076188A (en) 2021-07-06
CN113076188B true CN113076188B (en) 2024-05-14

Family

ID=76608628

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010004365.7A Active CN113076188B (en) 2020-01-03 2020-01-03 Scheduling method and device of distributed system

Country Status (1)

Country Link
CN (1) CN113076188B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106933662A (en) * 2017-03-03 2017-07-07 广东神马搜索科技有限公司 Distributed system and its dispatching method and dispatching device
WO2020000944A1 (en) * 2018-06-25 2020-01-02 星环信息科技(上海)有限公司 Preemptive scheduling based resource sharing use method, system and

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106933662A (en) * 2017-03-03 2017-07-07 广东神马搜索科技有限公司 Distributed system and its dispatching method and dispatching device
WO2020000944A1 (en) * 2018-06-25 2020-01-02 星环信息科技(上海)有限公司 Preemptive scheduling based resource sharing use method, system and

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
DScheduler: Dynamic Network Scheduling Method for MapReduce in Distributed Controllers;Tianxiao Liu;IEEE;20170119;全文 *
云系统中面向海量多媒体数据的动态任务调度算法;朱映映;陈阳;明仲;;小型微型计算机系统;20130415(第04期);全文 *

Also Published As

Publication number Publication date
CN113076188A (en) 2021-07-06

Similar Documents

Publication Publication Date Title
WO2020000944A1 (en) Preemptive scheduling based resource sharing use method, system and
WO2020181813A1 (en) Task scheduling method based on data processing and related device
CN110515704B (en) Resource scheduling method and device based on Kubernetes system
CN113051075B (en) Kubernetes intelligent capacity expansion method and device
US8661441B2 (en) Transaction load reduction for process completion
CN106156939A (en) Dispatching System based on job stream and application process
CN111949386A (en) Task scheduling method, system, computing device and readable storage medium
US8806497B2 (en) System and method for altering the work definitions in an iterative parallel opportunistic work stealing scheduler
WO2015131542A1 (en) Data processing method, device and system
CN110971700A (en) Method and device for realizing distributed lock
CN113535532B (en) Fault injection system, method and device
CN112199178A (en) Cloud service dynamic scheduling method and system based on lightweight container
CN113626173B (en) Scheduling method, scheduling device and storage medium
CN113051054A (en) Method, apparatus and computer readable storage medium for scheduling artificial intelligence platform resources
CN114880159A (en) Data processing method, device, equipment and storage medium
CN113076188B (en) Scheduling method and device of distributed system
CN111831408A (en) Asynchronous task processing method and device, electronic equipment and medium
CN111353752B (en) Flow processing method and device, electronic equipment and storage medium
CN116974689A (en) Cluster container scheduling method, device, equipment and computer readable storage medium
CN105487847B (en) A kind of function dissemination method and equipment
CN114816662A (en) Container arrangement method and system applied to Kubernetes
CN111158880B (en) Distributed timing task scheduling method, system, device and storage medium
CN110188008B (en) Job scheduling master-slave switching method and device, computer equipment and storage medium
CN114189439A (en) Automatic capacity expansion method and device
CN116263698A (en) Database scheduling method and device

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