CN111782366A - Distributed task scheduling method and device - Google Patents

Distributed task scheduling method and device Download PDF

Info

Publication number
CN111782366A
CN111782366A CN202010615362.7A CN202010615362A CN111782366A CN 111782366 A CN111782366 A CN 111782366A CN 202010615362 A CN202010615362 A CN 202010615362A CN 111782366 A CN111782366 A CN 111782366A
Authority
CN
China
Prior art keywords
task
batch
client
scheduling
task scheduling
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.)
Pending
Application number
CN202010615362.7A
Other languages
Chinese (zh)
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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202010615362.7A priority Critical patent/CN111782366A/en
Publication of CN111782366A publication Critical patent/CN111782366A/en
Pending legal-status Critical Current

Links

Images

Classifications

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

Landscapes

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

Abstract

A distributed task scheduling method and device are provided, the method comprises the following steps: receiving a message request for starting task scheduling sent by a client; and executing task scheduling operation according to the task batch number in the message request or according to the task batch number and the current batch task execution state. According to the method and the device, when the distributed task scheduling system performs scheduling processing on two adjacent job tasks, the scheduling is more compact, and the waiting time delay is shortened.

Description

Distributed task scheduling method and device
Technical Field
The application relates to a computer application technology, in particular to a distributed task scheduling method and device.
Background
The distributed task scheduling system is widely favored by the advantages of strong resource sharing, high computing speed, high reliability, convenient and fast application and the like, can realize remote communication and data transmission among different nodes, can comprehensively coordinate system resources, performs distributed processing on job tasks submitted by users, and provides great convenience for information exchange among people and completion of various computing job tasks.
However, in many cases, when the distributed task scheduling system performs scheduling processing on two adjacent job tasks, scheduling is not compact, and waiting time is prolonged.
Disclosure of Invention
Aiming at the problems in the prior art, the application provides a distributed task scheduling method and a distributed task scheduling device, which can solve the problems of incompact scheduling and large waiting time delay when a distributed task scheduling system schedules two adjacent job tasks.
In order to solve the technical problem, the application provides the following technical scheme:
in a first aspect, the present application provides a distributed task scheduling method, including:
receiving a task starting scheduling message request sent by a client;
and executing task scheduling operation according to the task batch number in the request for starting task scheduling message or according to the task batch number and the current batch task execution state.
Further, the executing the task scheduling operation according to the task batch number in the start task scheduling packet request or according to the task batch number and the current batch task execution state includes:
judging whether the task batch number is 1;
and if so, executing task scheduling operation and sending a task execution notification to the client.
Further, the executing the task scheduling operation according to the task batch number in the start task scheduling packet request or according to the task batch number and the current batch task execution state further includes:
if the task batch number is not 1;
judging whether the task scheduling operation of the client of the current batch task can be executed or not according to the execution state of the current batch task;
and if so, executing the task scheduling operation and sending a task execution notification to the client.
Further, before sending the execution task notification to the client, the method further includes:
judging whether an execution node exists in the current task batch;
and if not, creating an execution node for the current task batch and executing task scheduling operation.
Further, the distributed task scheduling method further includes:
receiving a task scheduling ending message request sent by a client;
and modifying the task execution state of the corresponding node into the completed task execution state according to the task batch number in the task scheduling ending message request.
Further, the determining whether to execute the task scheduling operation of the client of the current batch task according to the execution state of the current batch task includes:
and judging whether the task scheduling operation of the client of the current batch task can be executed or not according to the batch number in the received task scheduling ending message request of the client corresponding to the last batch task.
In a second aspect, a distributed task scheduler includes:
a starting message receiving unit, configured to receive a task scheduling starting message request sent by a client;
and the scheduling unit is used for executing task scheduling operation according to the task batch number in the starting task scheduling message request or according to the task batch number and the current batch task execution state.
Further, the scheduling unit includes:
the batch judging module is used for judging whether the task batch number is 1;
and the execution module is used for executing the task scheduling operation corresponding to the task batch with the batch number of 1 and sending a task execution notification to the client.
Further, the scheduling unit further includes:
the state judgment module is used for judging whether the task scheduling operation of the client of the current batch task with the task batch number not being 1 can be executed or not according to the execution state of the current batch task;
the execution module is further configured to execute the task scheduling operation and send a notification of executing the task to the client.
Further, the distributed task scheduling apparatus further includes:
the node judging unit is used for judging whether an execution node exists in the current task batch; the dispatching unit is also used for creating an execution node for the current task batch without the execution node and executing task dispatching operation.
Further, the distributed task scheduling apparatus further includes:
an end message receiving unit, configured to receive a task scheduling end message request sent by a client;
and the state modifying unit is used for modifying the task execution state of the corresponding node into the completed task execution state according to the task batch number in the task scheduling ending message request.
Further, the execution module includes:
and the judging module is used for judging whether the task scheduling operation of the client of the current batch task can be executed or not according to the batch number in the received task scheduling ending message request of the client corresponding to the last batch task.
In a third aspect, the present application provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the distributed task scheduling method when executing the program.
In a fourth aspect, the present application provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the distributed task scheduling method.
According to the technical scheme, the distributed task scheduling method and the distributed task scheduling device are provided, the client initiates the task execution request to the server, and the distributed task scheduling system can perform scheduling processing on two adjacent job tasks more compactly and shorten waiting time delay according to the task batch number corresponding to the task execution request and the task execution state set by the server.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is one of general flow diagrams of a distributed task scheduling method in an embodiment of the present application;
fig. 2 is one of the flow diagrams illustrating the task scheduling operation performed in the distributed task scheduling method according to the embodiment of the present application;
FIG. 3 is a second flowchart illustrating a task scheduling operation performed in the distributed task scheduling method according to an embodiment of the present application;
FIG. 4 is a second general flowchart of a distributed task scheduling method according to an embodiment of the present application;
fig. 5 is a third general flowchart of a distributed task scheduling method according to an embodiment of the present application;
fig. 6 is one of general structural diagrams of a distributed task scheduling apparatus in an embodiment of the present application;
FIG. 7 is a diagram illustrating one of the structures of a scheduling unit according to an embodiment of the present application;
FIG. 8 is a second block diagram of a scheduling unit in an embodiment of the present application;
FIG. 9 is a second general block diagram of a distributed task scheduler according to an embodiment of the present application;
FIG. 10 is a third block diagram of a distributed task scheduler according to an embodiment of the present application;
fig. 11 is a schematic structural diagram of an electronic device in an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The scheme described in the present application can be applied to the following scenarios: the distributed task scheduling system comprises a plurality of clients and a zookeeper scheduling server. The client is used for executing tasks issued to the client by the remote system, and the tasks can be divided into a plurality of batches. Because the programs loaded in the clients are different and the functions of the clients are different, the task batches and the clients have a binding relationship, that is, tasks in one batch are fixedly executed by a plurality of clients, tasks in another batch are fixedly executed by another plurality of clients, and the tasks in the previous batch and the tasks in the next batch have a sequence, that is, the tasks in the next batch can be executed after the tasks in the previous batch are executed. Based on the above scenario, the zookeeper dispatching server needs to complete dispatching of a plurality of clients in a batch and dispatching of each client between batches.
In order to solve the problems of non-compact scheduling and prolonged waiting time when a distributed task scheduling system performs scheduling processing on two adjacent job tasks, the application provides a distributed task scheduling method, and referring to fig. 1, the distributed task scheduling method comprises the following steps:
s101: receiving a message request for starting task scheduling sent by a client;
it can be understood that, in the above application scenario, when the client receives a task of a task batch corresponding to the client from the remote system, the client needs to first send a request for starting a task scheduling packet to the server, so as to notify the server that the client has a requirement for executing the task. The start task scheduling message request is named StartSchedule. When the client side sends a request for starting task execution to the server side, the server side calls a StartSchedulHandle processor for processing.
S102: and executing task scheduling operation according to the task batch number in the request for starting task scheduling message or according to the task batch number and the current batch task execution state.
It can be understood that the server side needs to determine whether the task in the start task scheduling packet request is the first task, and the determination is based on the task batch number carried in the start task scheduling packet request. If the first batch of tasks is the first batch of tasks, the server can immediately dispatch the first batch of tasks to be executed at the client, and the first batch of tasks can be executed without waiting for the execution result of the preorder batch because the preorder batch does not exist in the first batch of tasks. If the task is not the first batch of tasks, the execution state of the current batch of tasks needs to be continuously judged. Because the execution sequence exists between the tasks of the current batch and the tasks of the next batch, the next batch of tasks can be executed only after the tasks of the current batch are executed, and therefore, before the client corresponding to the next batch is dispatched to execute the next batch of tasks, whether the execution state of the tasks of the current batch is finished or not must be judged. The task scheduling operation is an operation for scheduling a task.
As can be seen from the above description, the distributed task scheduling method provided in the present application receives, through the server, a start task scheduling packet request sent by the client, and executes task scheduling operations according to a task batch number in the start task scheduling packet request or according to the task batch number and a current batch task execution state, so that when a distributed task scheduling system performs scheduling processing on two adjacent job tasks, scheduling is more compact, and waiting time delay is shortened.
In an embodiment, in order to make the scheduling of two adjacent job tasks more compact and shorten the waiting time delay when the distributed task scheduling system performs scheduling processing on the two adjacent job tasks, the server side performs the following settings: and adding a ServerCnxnActiory subclass at the zookeeper server, and establishing the connection between the client and the server based on SofaBolt.
Firstly, a server side starts a thread, the thread establishes monitoring on a port ClientPort which is in charge of client side connection, and whether a client side initiates a connection request is monitored. Then, registering an adaptation layer for processing a client connection event and a disconnection event at a server, namely, when the client requests to establish connection with the server, the server receives a CONNECT event; and when the client requests to disconnect from the server, the server receives the CLOSE event. For the CONNECT event, the server needs to cache the connection information of the client so as to identify the client; and for the CLOSE event, the server CLOSEs the client connection and cleans up the relevant non-persistent data written into the server by the client. And finally, registering a client task scheduling start handler StartSchedulHandle and an end handler EndSchedulHandle at the server side. After the client end is connected with the server end, the client end can send two types of messages to the server end, namely a start task scheduling message and an end task scheduling message, and the message types are distinguished by a message header sent by the client end.
After the client end is connected with the server end, when the server end receives a task scheduling starting message request sent by the client end, the server end prepares to call a StartSchedulHandle processor to process the task scheduling starting message request. Before this, the server first needs to determine whether the server has cached the connection of the client sending the message.
If not, rejecting the client corresponding to the message to initiate a task execution request;
if the request message is cached, judging whether a request message corresponding to the task execution request initiated by the client carries a task batch number of the client participating in task scheduling, and if the request message does not carry the task batch number or the carried task batch number is not a number, rejecting the client corresponding to the message to initiate the task execution request;
and if the cached task batch number carried in the request message corresponding to the task execution request initiated by the client is a number, allowing the client to execute the tasks in the corresponding batch. Before executing the task, whether the task to be executed initiated by the client is a first task or not is judged according to the task batch number, and if the task is the first task, the task can be executed; otherwise, it needs to judge whether the pre-order batch task corresponding to the task to be executed initiated by the client is executed completely, if the execution is completed, that is, the current batch task execution state dispatched by the server is completed, the server can dispatch the client corresponding to the task batch to execute the task, otherwise, the dispatching is refused.
In another embodiment, in order to solve the problems that the scheduling is not compact and the waiting time is prolonged when the distributed task scheduling system performs scheduling processing on two adjacent job tasks, the modified zookeeper server and the client may establish network connection based on the sofabelt. After the network connection is established, different clients mutually agree to write the directory and the format of the execution node into the zookeeper server. These directories and formats will play a role in the subsequent scheduling process and can be used to determine whether a batch of tasks has started to execute and completed.
The form of these directories and formats are for example:
the path of the execution node established by the first batch of clients executing the tasks is as follows: /rwdd/task/p 0001;
the path of the execution node established by the client side executing the tasks in the second batch is as follows: /rwdd/task/p 0002.
After the above setting is completed, the execution of the first batch task and the second batch task will be described as an example. The execution principle of other batches is similar, and is not repeated. In an embodiment, first, N clients corresponding to a first batch of tasks request a zookeeper server to create an execution node for the zookeeper server in a competitive and exclusive manner according to an agreed directory and format, and the server may execute the task for only one client that successfully creates the execution node. For the other N-1 clients, the contention fails, that is, when another N-1 clients attempt to create an execution node to the server, it is found that the execution node of the corresponding batch already exists, that is, the task of the task batch is being executed, and the execution node does not need to be repeatedly executed, that is, the execution node does not need to be created, that is, the execution node is failed to be created.
Then, when M clients responsible for executing the second batch of tasks want to execute the second batch of tasks, the zookeeper server first monitors that the client corresponding to the current batch of tasks (the first batch of tasks) goes to the execution node created by the zookeeper server, so as to know whether the task execution state of the current batch of tasks is completed.
After the client corresponding to the first batch of tasks finishes executing the tasks, the M clients corresponding to the second batch of tasks request the zookeeper server to create the execution nodes for the zookeeper server according to the appointed directory and format, the server only schedules the client which successfully creates the execution nodes, so that the server can execute the tasks of the second batch, and the scheduling process is similar to the process of scheduling the N clients when the first batch of tasks is executed, and is not repeated.
In order to execute task scheduling operation of a first task in a distributed task scheduling system, in an embodiment of the distributed task scheduling method provided by the present application, referring to fig. 2, the executing task scheduling operation according to a task batch number in the start task scheduling packet request or according to the task batch number and a current batch task execution state includes:
s201: judging whether the task batch number is 1;
it can be understood that, since the task batch number is carried in the request for starting task scheduling packet, the server may determine whether the task batch number is 1, that is, whether the batch task is the first batch task.
S202: and if so, executing task scheduling operation and sending a task execution notification to the client.
It can be understood that, if the task batch number is 1, it indicates that the task batch is a first task to be executed, that is, a non-preamble batch, and at this time, the server may schedule one of the plurality of clients corresponding to the first task to execute the first task. And when scheduling, the server side sends a task execution notification to one of the plurality of clients.
As can be seen from the above description, the distributed task scheduling method provided by the present application can determine whether a task in a batch is the first batch to be executed by determining whether a task batch number is 1, and accordingly, an execution node is created for a client corresponding to the batch of tasks, and the task is finally completed.
In order to execute the task scheduling operation of the non-initial task in the distributed task scheduling system, referring to fig. 3, in an embodiment of the distributed task scheduling method provided in the present application, the executing the task scheduling operation according to the task batch number in the start task scheduling packet request or according to the task batch number and the current batch task execution state further includes:
s301: if the task batch number is not 1;
it can be understood that, since the task batch number is carried in the request for starting task scheduling packet, the server may determine whether the task batch number is 1, that is, whether the batch task is a non-first batch task.
S302: judging whether the task scheduling operation of the client of the current batch task can be executed or not according to the execution state of the current batch task;
it will be appreciated that if the lot number of the task to be executed by the tape is not 1, this indicates that there is a preceding lot in the lot, and therefore it is necessary to wait for the completion of the execution of the preceding lot before execution can begin. In order to determine whether the task of the current batch is completed, the task execution state of the execution node corresponding to the current task batch needs to be checked to determine whether the task of the current batch is completed.
S303: and if so, executing the task scheduling operation and sending a task execution notification to the client.
It can be understood that, if the execution status of the pre-order batch corresponding to the task batch to be executed is complete, the server may dispatch one of the servers corresponding to the batch to execute the batch of tasks.
As can be seen from the above description, the distributed task scheduling method provided by the present application can determine whether the task in the batch is not the first batch of tasks to be executed by determining whether the task batch number is not 1, and then, in combination with the task execution state of the current batch at the server, create an execution node for the client corresponding to the task, and finally complete the task.
In order to execute a task of a client in a distributed task scheduling system, referring to fig. 4, the distributed task scheduling method provided in the present application further includes, before sending a notification of executing the task to the client:
s401: judging whether an execution node exists in the current task batch;
it can be understood that, taking the second batch of tasks as an example, assuming that there are L clients corresponding to the second batch of tasks, and all the L clients want to execute the second batch of tasks, so that all the competing request server sides create execution nodes for the clients, but according to the sequence, only one execution node of a client can be successfully created. Therefore, before L clients prepare to create nodes to the server, it is necessary to determine whether the second batch of tasks has execution nodes, i.e. whether the execution nodes/rwdd/task/p 0002 corresponding to the second batch of tasks already exist. If the task exists, the client is indicated to be executed by the second batch of tasks, and repeated execution is not needed. The execution principle of other batches is similar, and is not repeated.
S402: and if not, creating an execution node for the current task batch and executing task scheduling operation.
It can be understood that, still taking the second batch of tasks as an example, if the/rwdd/task/p 0002 node does not exist yet, an execution node may be created for the client corresponding to the current task batch (the second task batch) and a task scheduling operation may be performed, that is, one of the L clients performs the task of the second batch. The execution principle of other batches is similar, and is not repeated.
From the above description, it can be seen that the distributed task scheduling method provided by the present application can implement fast notification scheduling of a task of a client in a distributed task scheduling system by determining whether an execution node exists in a current task batch, and reduce waiting time delay.
Referring to fig. 5, in order to end the client to execute the completed task, the distributed task scheduling method further includes:
s501: receiving a task scheduling ending message request sent by a client;
it can be understood that, when the task of the task batch corresponding to the client is completed, a message request for ending task scheduling needs to be sent to the server, and the server receives the message, so as to know that the task of the task batch corresponding to the client is completed, and can schedule and schedule the task of a new task batch. The end task scheduling message request is named EndSchedule. And when the type of the message received by the server is EndSchedule, the server schedules an EndScheduleHandle processor for processing.
S502: and modifying the task execution state of the corresponding node into the completed task execution state according to the task batch number in the task scheduling ending message request.
It can be understood that the server end may end to execute the task scheduling operation according to the task batch number carried in the end task scheduling packet request. If the task execution of the client corresponding to the current batch task is completed, the client corresponding to the current batch task initiates a request for modifying the task execution state into the completed task, and the server modifies the task accordingly, so that all the clients monitoring the execution node can quickly receive the notification.
The monitoring process means that a monitoring mechanism needs to be established at the server end in order to know whether the tasks of the pre-order batches are executed or not by a plurality of clients corresponding to the task batches to be executed, that is, the clients corresponding to the task batches to be executed actively inform the server end of which batch (namely, the batch number of the pre-order task batch) the clients are to monitor the task execution node corresponding to the pre-order batch, when the execution of the current task of the pre-order batch is completed, the task execution state corresponding to the task of the pre-order batch is modified to be completed, and the clients corresponding to the task batches to be executed can send a task scheduling starting message request to the server end accordingly.
From the above description, it can be seen that the distributed task scheduling method provided by the present application can end execution of task scheduling operation by using the end task scheduling packet request and combining the task batch number in the end task scheduling packet request and the current batch task execution state, so that the server end can start scheduling a new batch task.
In order to determine whether to perform a task scheduling operation of a client of a current batch task, the determining whether to perform the task scheduling operation of the client of the current batch task according to the current batch task execution state includes:
and judging whether the task scheduling operation of the client of the current batch task can be executed or not according to the batch number in the received task scheduling ending message request of the client corresponding to the last batch task.
It can be understood that, still taking the second batch of tasks as an example, since only one of the L clients corresponding to the second batch of tasks can be successfully created with a node, when another L-1 clients prepare to create a node at the server, it is found that an execution node corresponding to the second batch of tasks already exists, that is, the second batch of tasks is already executed, and at this time, the server may return a message to inform the L-1 clients that the tasks corresponding to the batch of tasks do not need to be processed. The execution principle of other batches is similar, and is not repeated.
In addition, still taking the second batch of tasks as an example, before dispatching the second batch of tasks, it is necessary to check whether the first batch of tasks has been executed completely, and if the path/rwdd/task/p 0001 corresponding to the execution node corresponding to the task batch with the task batch number of 1 does not exist, it is determined that the first batch of tasks has not started to be executed, and at this time, a message is returned to notify the client corresponding to the second batch of tasks to wait. The execution principle of other batches is similar, and is not repeated.
If the path/rwdd/task/p 0001 corresponding to the execution node corresponding to the first batch of tasks already exists but the set task execution state is not completed, monitoring the/rwdd/task/p 0001 node for the client corresponding to the second batch of tasks is established, and when the task execution state marked in the/rwdd/task/p 0001 node is modified to be completed by the server, L clients corresponding to the second batch of tasks obtain a notification from the server to inform the server that the first batch of tasks are completely executed, and the server can send a start task scheduling message to request the server to create the execution node of the second batch of tasks for the second batch of tasks.
As can be seen from the above description, the distributed task scheduling method provided in the present application can modify the task execution state of the corresponding execution node to be completed according to the batch number in the received end task scheduling packet request of the client corresponding to the previous batch of tasks, and determine whether to execute the task scheduling operation of the client of the current batch of tasks.
Based on the same inventive concept, the embodiment of the present application further provides a distributed task scheduling device, which can be used to implement the methods described in the foregoing embodiments, as described in the following embodiments. Because the principle of the distributed task scheduling device for solving the problem is similar to that of the distributed task scheduling method, the implementation of the distributed task scheduling device can refer to the implementation of the software performance reference determination method, and repeated parts are not described again. As used hereinafter, the term "unit" or "module" may be a combination of software and/or hardware that implements a predetermined function. While the system described in the embodiments below is preferably implemented in software, implementations in hardware, or a combination of software and hardware are also possible and contemplated.
In terms of hardware, in order to solve the problems of non-compact scheduling and prolonged waiting time when a distributed task scheduling system performs scheduling processing on two adjacent job tasks, the present application provides an embodiment of an electronic device with all or part of contents in a distributed task scheduling method, where the electronic device specifically includes the following contents:
referring to fig. 6, the present application provides a distributed task scheduling apparatus, including a start packet receiving unit 601 and a scheduling unit 602:
a start message receiving unit 601, configured to receive a start task scheduling message request sent by a client;
the dispatching unit 602 is configured to execute task dispatching operation according to the task batch number in the start task dispatching packet request or according to the task batch number and the current batch task execution state.
Referring to fig. 7, the dispatching unit of the distributed task dispatching device includes a batch determining module 701 and an executing module 702:
a batch determining module 701, configured to determine whether the task batch number is 1;
the execution module 702 is configured to execute the task scheduling operation corresponding to the task batch with the batch number 1, and send a notification of executing the task to the client.
Referring to fig. 8, the scheduling unit further includes a state determining module 801 and an executing module 702:
a state determining module 801, configured to determine, according to a current batch task execution state, whether to execute a task scheduling operation of a client of a current batch task whose task batch number is not 1;
the executing module 702 is further configured to execute the task scheduling operation and send a notification of executing a task to the client.
Referring to fig. 9, the distributed task scheduling apparatus further includes:
a node determining unit 901, configured to determine whether an execution node exists in a current task batch;
the dispatching unit 602 is further configured to create an execution node for the current task batch where the execution node does not exist and execute a task dispatching operation.
Referring to fig. 10, the distributed task scheduling apparatus further includes an end packet receiving unit 1001 and a state modifying unit 1002:
an end message receiving unit 1001, configured to receive a task scheduling end message request sent by a client;
and a state modification unit 1002, configured to modify the task execution state of the corresponding node to be completed according to the task batch number in the request for ending task scheduling packet.
A processor (processor), a memory (memory), a communication Interface (Communications Interface), and a bus; the processor, the memory and the communication interface complete mutual communication through the bus; the communication interface is used for realizing information transmission between the distributed task scheduling device and relevant equipment such as a core service system, a user terminal, a relevant database and the like; the logic controller may be a desktop computer, a tablet computer, a mobile terminal, and the like, but the embodiment is not limited thereto. In this embodiment, the logic controller may be implemented with reference to the embodiment of the distributed task scheduling method and the embodiment of the distributed task scheduling apparatus in the embodiment, and the contents thereof are incorporated herein, and repeated descriptions are omitted.
It is understood that the user terminal may include a smart phone, a tablet electronic device, a network set-top box, a portable computer, a desktop computer, a Personal Digital Assistant (PDA), an in-vehicle device, a smart wearable device, and the like. Wherein, intelligence wearing equipment can include intelligent glasses, intelligent wrist-watch, intelligent bracelet etc..
In practical applications, part of the distributed task scheduling method may be executed on the electronic device side as described in the above, or all operations may be completed in the client device. The selection may be specifically performed according to the processing capability of the client device, the limitation of the user usage scenario, and the like. This is not a limitation of the present application. The client device may further include a processor if all operations are performed in the client device.
The client device may have a communication module (i.e., a communication unit), and may be communicatively connected to a remote server to implement data transmission with the server. The server may include a server on the task scheduling center side, and in other implementation scenarios, the server may also include a server on an intermediate platform, for example, a server on a third-party server platform that is communicatively linked to the task scheduling center server. The server may include a single computer device, or may include a server cluster formed by a plurality of servers, or a server structure of a distributed apparatus.
Fig. 11 is a schematic block diagram of a system configuration of an electronic device 9600 according to an embodiment of the present application. As shown in fig. 11, the electronic device 9600 can include a central processor 9100 and a memory 9140; the memory 9140 is coupled to the central processor 9100. Notably, this FIG. 11 is exemplary; other types of structures may also be used in addition to or in place of the structure to implement telecommunications or other functions.
In one embodiment, the distributed task scheduling method functions may be integrated into the central processor 9100. The central processor 9100 may be configured to control as follows:
s101: receiving a message request for starting task scheduling sent by a client;
s102: and executing task scheduling operation according to the task batch number in the starting message request or according to the task batch number and the current batch task execution state.
As can be seen from the above description, according to the electronic device provided in the embodiment of the present application, the client initiates the task execution request to the server, and according to the task batch number corresponding to the task execution request and the task execution state set by the server, when the distributed task scheduling system performs scheduling processing on two adjacent job tasks, scheduling is more compact, and waiting time delay is shortened.
In another embodiment, the distributed task scheduling apparatus may be configured separately from the central processor 9100, for example, the distributed task scheduling apparatus may be configured as a chip connected to the central processor 9100, and the function of the distributed task scheduling method may be implemented by the control of the central processor.
As shown in fig. 11, the electronic device 9600 may further include: a communication module 9110, an input unit 9120, an audio processor 9130, a display 9160, and a power supply 9170. It is noted that the electronic device 9600 also does not necessarily include all of the components shown in fig. 11; in addition, the electronic device 9600 may further include components not shown in fig. 11, which may be referred to in the prior art.
As shown in fig. 11, a central processor 9100, sometimes referred to as a controller or operational control, can include a microprocessor or other processor device and/or logic device, which central processor 9100 receives input and controls the operation of the various components of the electronic device 9600.
The memory 9140 can be, for example, one or more of a buffer, a flash memory, a hard drive, a removable media, a volatile memory, a non-volatile memory, or other suitable device. The information relating to the failure may be stored, and a program for executing the information may be stored. And the central processing unit 9100 can execute the program stored in the memory 9140 to realize information storage or processing, or the like.
The input unit 9120 provides input to the central processor 9100. The input unit 9120 is, for example, a key or a touch input device. Power supply 9170 is used to provide power to electronic device 9600. The display 9160 is used for displaying display objects such as images and characters. The display may be, for example, an LCD display, but is not limited thereto.
The memory 9140 can be a solid state memory, e.g., Read Only Memory (ROM), Random Access Memory (RAM), a SIM card, or the like. There may also be a memory that holds information even when power is off, can be selectively erased, and is provided with more data, an example of which is sometimes called an EPROM or the like. The memory 9140 could also be some other type of device. Memory 9140 includes a buffer memory 9141 (sometimes referred to as a buffer). The memory 9140 may include an application/function storage portion 9142, the application/function storage portion 9142 being used for storing application programs and function programs or for executing a flow of operations of the electronic device 9600 by the central processor 9100.
The memory 9140 can also include a data store 9143, the data store 9143 being used to store data, such as contacts, digital data, pictures, sounds, and/or any other data used by an electronic device. The driver storage portion 9144 of the memory 9140 may include various drivers for the electronic device for communication functions and/or for performing other functions of the electronic device (e.g., messaging applications, contact book applications, etc.).
The communication module 9110 is a transmitter/receiver 9110 that transmits and receives signals via an antenna 9111. The communication module (transmitter/receiver) 9110 is coupled to the central processor 9100 to provide input signals and receive output signals, which may be the same as in the case of a conventional mobile communication terminal.
Based on different communication technologies, a plurality of communication modules 9110, such as a cellular network module, a bluetooth module, and/or a wireless local area network module, may be provided in the same electronic device. The communication module (transmitter/receiver) 9110 is also coupled to a speaker 9131 and a microphone 9132 via an audio processor 9130 to provide audio output via the speaker 9131 and receive audio input from the microphone 9132, thereby implementing ordinary telecommunications functions. The audio processor 9130 may include any suitable buffers, decoders, amplifiers and so forth. In addition, the audio processor 9130 is also coupled to the central processor 9100, thereby enabling recording locally through the microphone 9132 and enabling locally stored sounds to be played through the speaker 9131.
An embodiment of the present application further provides a computer-readable storage medium capable of implementing all the steps in the distributed task scheduling method in which the execution subject is the server or the client in the foregoing embodiments, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the computer program implements all the steps in the distributed task scheduling method in which the execution subject is the server or the client in the foregoing embodiments, for example, when the processor executes the computer program, the processor implements the following steps:
s101: receiving a message request for starting task scheduling sent by a client;
s102: and executing task scheduling operation according to the task batch number in the starting message request or according to the task batch number and the current batch task execution state.
As can be seen from the above description, according to the electronic device provided in the embodiment of the present application, the client initiates the task execution request to the server, and according to the task batch number corresponding to the task execution request and the task execution state set by the server, when the distributed task scheduling system performs scheduling processing on two adjacent job tasks, scheduling is more compact, and waiting time delay is shortened.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (devices), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The principle and the implementation mode of the invention are explained by applying specific embodiments in the invention, and the description of the embodiments is only used for helping to understand the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (14)

1. A distributed task scheduling method, comprising:
receiving a task starting scheduling message request sent by a client;
and executing task scheduling operation according to the task batch number in the request for starting task scheduling message or according to the task batch number and the current batch task execution state.
2. The distributed task scheduling method according to claim 1, wherein the performing task scheduling operation according to the task batch number in the start task scheduling packet request or according to the task batch number and the current batch task execution state includes:
judging whether the task batch number is 1;
and if so, executing task scheduling operation and sending a task execution notification to the client.
3. The distributed task scheduling method according to claim 2, wherein the task scheduling operation is executed according to the task batch number in the start task scheduling packet request or according to the task batch number and the current batch task execution state, further comprising:
if the task batch number is not 1;
judging whether the task scheduling operation of the client of the current batch task can be executed or not according to the execution state of the current batch task;
and if so, executing the task scheduling operation and sending a task execution notification to the client.
4. The distributed task scheduling method according to claim 2 or 3, further comprising, before sending the execution task notification to the client:
judging whether an execution node exists in the current task batch;
and if not, creating an execution node for the current task batch and executing task scheduling operation.
5. The distributed task scheduling method of claim 3, further comprising:
receiving a task scheduling ending message request sent by a client;
and modifying the task execution state of the corresponding node into the completed task execution state according to the task batch number in the task scheduling ending message request.
6. The distributed task scheduling method according to claim 5, wherein the determining whether to execute the task scheduling operation of the client of the current batch task according to the execution state of the current batch task includes:
and judging whether the task scheduling operation of the client of the current batch task can be executed or not according to the batch number in the received task scheduling ending message request of the client corresponding to the last batch task.
7. A distributed task scheduler, comprising:
a starting message receiving unit, configured to receive a task scheduling starting message request sent by a client;
and the scheduling unit is used for executing task scheduling operation according to the task batch number in the starting task scheduling message request or according to the task batch number and the current batch task execution state.
8. The distributed task scheduler of claim 7, wherein the scheduling unit comprises:
the batch judging module is used for judging whether the task batch number is 1;
and the execution module is used for executing the task scheduling operation corresponding to the task batch with the batch number of 1 and sending a task execution notification to the client.
9. The distributed task scheduler of claim 8, wherein the scheduler unit further comprises:
the state judgment module is used for judging whether the task scheduling operation of the client of the current batch task with the task batch number not being 1 can be executed or not according to the execution state of the current batch task;
the execution module is further configured to execute the task scheduling operation and send a notification of executing the task to the client.
10. The distributed task scheduler of claim 8 or 9, further comprising:
the node judging unit is used for judging whether an execution node exists in the current task batch;
the dispatching unit is also used for creating an execution node for the current task batch without the execution node and executing task dispatching operation.
11. The distributed task scheduler of claim 9, further comprising:
an end message receiving unit, configured to receive a task scheduling end message request sent by a client;
and the state modifying unit is used for modifying the task execution state of the corresponding node into the completed task execution state according to the task batch number in the task scheduling ending message request.
12. The distributed task scheduler of claim 11, wherein the execution module comprises:
and the judging module is used for judging whether the task scheduling operation of the client of the current batch task can be executed or not according to the batch number in the received task scheduling ending message request of the client corresponding to the last batch task.
13. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the steps of the distributed task scheduling method according to any one of claims 1 to 6 are implemented when the program is executed by the processor.
14. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the distributed task scheduling method according to any one of claims 1 to 6.
CN202010615362.7A 2020-06-30 2020-06-30 Distributed task scheduling method and device Pending CN111782366A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010615362.7A CN111782366A (en) 2020-06-30 2020-06-30 Distributed task scheduling method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010615362.7A CN111782366A (en) 2020-06-30 2020-06-30 Distributed task scheduling method and device

Publications (1)

Publication Number Publication Date
CN111782366A true CN111782366A (en) 2020-10-16

Family

ID=72760916

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010615362.7A Pending CN111782366A (en) 2020-06-30 2020-06-30 Distributed task scheduling method and device

Country Status (1)

Country Link
CN (1) CN111782366A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112965814A (en) * 2021-02-09 2021-06-15 中国工商银行股份有限公司 Multi-task scheduling method and system
CN113949601A (en) * 2021-11-12 2022-01-18 杭州和利时自动化有限公司 Controller inter-station communication method and device and computer readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160335124A1 (en) * 2015-05-14 2016-11-17 Atlassian Pty Ltd Systems and Methods for Task Scheduling
CN107168789A (en) * 2016-03-08 2017-09-15 阿里巴巴集团控股有限公司 The serial scheduling method and device of multitask
US20180004568A1 (en) * 2015-12-30 2018-01-04 Sengled Optoelectronics Co., Ltd. Distributed task system and service processing method based on internet of things
CN109656706A (en) * 2018-12-25 2019-04-19 江苏满运软件科技有限公司 Distributed task dispatching method, system, equipment and medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160335124A1 (en) * 2015-05-14 2016-11-17 Atlassian Pty Ltd Systems and Methods for Task Scheduling
US20180004568A1 (en) * 2015-12-30 2018-01-04 Sengled Optoelectronics Co., Ltd. Distributed task system and service processing method based on internet of things
CN107168789A (en) * 2016-03-08 2017-09-15 阿里巴巴集团控股有限公司 The serial scheduling method and device of multitask
CN109656706A (en) * 2018-12-25 2019-04-19 江苏满运软件科技有限公司 Distributed task dispatching method, system, equipment and medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112965814A (en) * 2021-02-09 2021-06-15 中国工商银行股份有限公司 Multi-task scheduling method and system
CN113949601A (en) * 2021-11-12 2022-01-18 杭州和利时自动化有限公司 Controller inter-station communication method and device and computer readable storage medium

Similar Documents

Publication Publication Date Title
CN111031058A (en) Websocket-based distributed server cluster interaction method and device
US11758087B2 (en) Multimedia conference data processing method and apparatus, and electronic device
CN112689012A (en) Cross-network proxy communication method and device
CN110764881A (en) Distributed system background retry method and device
CN111767558B (en) Data access monitoring method, device and system
CN111782366A (en) Distributed task scheduling method and device
CN111445331A (en) Transaction matching method and device
CN111510493B (en) Distributed data transmission method and device
CN111818291B (en) Method and device for establishing multimedia call and electronic equipment
CN111328061B (en) Audio resource control method, vehicle-mounted terminal and system
CN113055483A (en) Message middleware data processing method, device and system
CN111338905A (en) Application node data processing method and device
CN114257532A (en) Server side state detection method and device
CN112468574B (en) Processing method, device and system for application service publishing and subscribing mechanism
CN113138812A (en) Spacecraft task scheduling method and device
CN112947880A (en) Screen projection method and device and electronic equipment
CN112860431A (en) Connection method, system, equipment and storage medium of micro service node
CN107395493B (en) Method and device for sharing message based on intention
US20150135269A1 (en) Method and system for sharing applications among a plurality of electronic devices
CN111818293B (en) Communication method and device and electronic equipment
CN115834649A (en) Remote procedure calling method, device and system
CN113014544B (en) Method and device for establishing centerless media link based on webRtc
CN115103053A (en) Call establishment method, device, terminal, system and readable storage medium
CN114710496A (en) Multi-node load balancing method and device
CN114697339A (en) Load balancing method and device under centralized architecture

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