WO2019041824A1 - Task scheduling method and server - Google Patents

Task scheduling method and server Download PDF

Info

Publication number
WO2019041824A1
WO2019041824A1 PCT/CN2018/083048 CN2018083048W WO2019041824A1 WO 2019041824 A1 WO2019041824 A1 WO 2019041824A1 CN 2018083048 W CN2018083048 W CN 2018083048W WO 2019041824 A1 WO2019041824 A1 WO 2019041824A1
Authority
WO
WIPO (PCT)
Prior art keywords
task
executed
tasks
executed tasks
priority
Prior art date
Application number
PCT/CN2018/083048
Other languages
French (fr)
Chinese (zh)
Inventor
李斌
王瑞阳
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2019041824A1 publication Critical patent/WO2019041824A1/en

Links

Classifications

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

Definitions

  • the present application belongs to the technical field of task scheduling, and in particular, to a task scheduling method and a server.
  • the quartz function in the spring software is generally used to complete. If the dependencies between the various tasks are involved, it needs to be controlled indirectly through some identification records. At this time, the tasks are basically isolated, which makes the system unable to conveniently control and manage each task.
  • the embodiment of the present application provides a task scheduling method and a server, so as to solve the problem that the isolation between tasks in the prior art can not easily control and manage each task.
  • a task scheduling method provided by the application includes:
  • the low priority pending task is not sent to the corresponding task performer.
  • the embodiment of the present application has the beneficial effects that: in the embodiment of the present application, each task to be executed sent by each task requester is first obtained, each task to be executed is detected, and the current priority order of each task to be executed is obtained. Sending each to-be-executed task to the corresponding task performer in order of priority level, so that the corresponding task performer executes each to-be-executed task; and the high-priority pending task is not executed by the corresponding task performer When successful, the low-priority tasks to be executed are not sent to the corresponding task executors, and the tasks to be executed are uniformly controlled and scheduled by each task requester, so that the scheduled execution of the tasks to be executed can be performed more safely and accurately. .
  • FIG. 1 is a flowchart of an implementation of a task scheduling method provided by an embodiment of the present application
  • step S102 in FIG. 1 is a flowchart of an implementation of step S102 in FIG. 1;
  • FIG. 3 is a flowchart of an implementation of step S103 in FIG. 1;
  • FIG. 4 is a schematic diagram of an operating environment of a task scheduler according to an embodiment of the present application.
  • FIG. 5 is a block diagram of a program of a task scheduler according to an embodiment of the present application.
  • FIG. 1 is a flowchart showing an implementation process of a task scheduling method according to Embodiment 1 of the present application, which is described in detail as follows:
  • Step S101 Acquire each to-be-executed task sent by each task requester.
  • the task requester is the party that initiates the task to be executed, and is opposite to the task performer in the subsequent step, and the task performer is the party that executes each task to be executed.
  • the tasks to be executed may include real-time tasks, quasi-real-time tasks, and other tasks.
  • Real-time tasks mainly refer to tasks with high urgency requirements and immediate execution by task performers.
  • Quasi-real-time tasks mainly mean that the urgency requirements are not high, but the task execution instructions must also be forwarded to the task executor within a limited time (for example, within 10 minutes).
  • Other tasks are tasks with low urgency requirements and no requirements for execution time or long time.
  • Step S102 Detect each of the to-be-executed tasks, and obtain a current priority order of each of the to-be-executed tasks.
  • the step S102 is specifically: detecting each of the to-be-executed tasks once every preset time, and acquiring a current priority order of each of the to-be-executed tasks.
  • step S101 the task to be executed sent by the task requester is continuously acquired in step S101, and therefore the acquired task to be executed needs to be updated.
  • each of the acquired tasks to be executed is detected once every preset time, and then the current priority order of each task to be executed is determined.
  • the to-be-executed task may include task execution time information, task performer information, task requester information, and the like.
  • the to-be-executed task includes task execution time information, and step S102 may include the following steps:
  • Step S201 Detect task execution time of each of the to-be-executed tasks.
  • the task to be executed corresponds to a task execution time, and the task execution time may be a time segment or a time point.
  • the task execution time may be a time segment or a time point.
  • two pending tasks are acquired at 16:00, the task execution time in the first pending task is 16:05, and the task execution time of the second pending task is 16:10 ⁇ 16:20. That is, the task execution time of the first task to be executed is the time point, and the task execution time of the second task to be executed is the time period.
  • Step S202 Determine a current priority order of each of the to-be-executed tasks according to a task execution time of each of the to-be-executed tasks.
  • the current priority order of each task to be executed is determined by the task execution time of each task to be executed.
  • the priority sequence of the task execution time may be taken as the priority order of each task to be executed, that is, the priority of the task to be executed with the task execution time being higher is higher, and the priority of the task to be executed after the task execution time is later. low.
  • each of the to-be-executed tasks is sent to the corresponding one according to the determined priority order of each to-be-executed task.
  • the task executor is such that the respective task executor executes each of the to-be-executed tasks. Specifically, when the high priority pending task is not successfully executed by the corresponding task performer, the low priority pending task is not sent to the corresponding task performer.
  • the three tasks to be executed are the first task to be executed, the second task to be executed, and the third task to be executed.
  • the task execution time of the first task to be executed is 16:05
  • the task execution time of the second task to be executed is For 16:10 ⁇ 16:20
  • the task execution time of the third task to be executed is 16:40
  • the priority order of the three tasks to be executed is the first task to be executed and the second task to be executed in descending order.
  • the third task to be performed is the third task to be performed.
  • Step S103 Send each of the to-be-executed tasks to the corresponding task performers in order according to the priority level, so that the corresponding task performers execute each of the to-be-executed tasks.
  • the low priority pending task is not sent to the corresponding task performer.
  • the three tasks to be executed are the first task to be executed, the second task to be executed, and the third task to be executed.
  • the task execution time of the first task to be executed is 16:05
  • the task execution time of the second task to be executed is For 16:10 ⁇ 16:20
  • the task execution time of the third task to be executed is 16:40
  • the priority order of the three tasks to be executed is the first task to be executed and the second task to be executed in descending order.
  • the third task to be performed is the third task to be performed.
  • the second to-be-executed task and the third-generation execution task are not sent to the corresponding task execution party; until the first to-be-executed task is successfully executed, The second task to be executed is sent to the corresponding task performer to execute; when the second task to be executed is executed or not executed successfully, the third task to be executed is not sent to the corresponding task performer until the second task to be executed When the execution is successful, the third pending task is sent to the corresponding task performer for execution.
  • step S103 may include the following steps:
  • Step S301 sequentially send each of the to-be-executed tasks to a client corresponding to the corresponding task executor in order of priority.
  • the number of the client is multiple, and one client corresponds to one task performer.
  • Each client is deployed on the host of the task executor and can execute the shell script of the task executor.
  • the deployment mode of each client in the task executor can be a single point deployment mode, HA (Hadoop) deployment mode, cluster (cluster) deployment mode or component deployment mode.
  • each to-be-executed task may be sequentially sent to the client corresponding to the corresponding task executor in order of priority, so that the client causes the task executor to execute the to-be-executed task.
  • each of the to-be-executed tasks may be sequentially sent to the client corresponding to the corresponding task executor in order of the task execution time of each task to be executed, so that the client causes the task executor to execute the to-be-executed task.
  • Step S302 The client controls the corresponding task performer to execute the to-be-executed task by using a shell script according to the to-be-executed task.
  • the task scheduling method in this embodiment is applicable to a task management center, and the task management center includes a task scheduling center and a plurality of clients.
  • the task scheduling center initiates a call instruction to the task performer according to the task requester or the established policy; the task dispatch center is responsible for controlling each pending task, for example, monitoring the task execution time, and executing the task in the previous zone before the task execution time is not executed or When the execution is not successful, the execution instruction of the next execution task after the execution time is not sent to the corresponding task execution agent, until the execution of the previous execution task is successful, and then the execution instruction of the next execution task is generated and sent to The corresponding client executes the task to be executed through the client control task executive. Through the task management center to control each task to be executed, the scheduling execution of each task to be executed can be performed more safely and accurately.
  • the data interaction process between the task requester, the task scheduling center, the client, and the task performer is as follows:
  • the task requester sends the real-time task request to the task dispatching center.
  • the real-time task is directly requested by the task initiator to the task dispatching center, and the task executing party is immediately called to perform the task to be executed.
  • the task scheduling center After obtaining the real-time task request, the task scheduling center generates a real-time task execution instruction according to the task execution party and the like in the real-time task request, and sends the command to the corresponding client through the interface;
  • the client controls the corresponding task performer to execute the real-time task in the real-time task execution instruction according to the real-time task execution instruction.
  • the data interaction process between the task requester, the task scheduling center, the client, and the task performer is as follows:
  • the task requester sends the quasi-real-time task request to the task dispatching center, and the quasi-real-time task is the request directly from the task requesting party to the dispatching center, and the dispatching center initiates an execution instruction to the task executing party within a certain time according to the actual situation;
  • the task scheduling center After obtaining the quasi-real-time task request, the task scheduling center generates a quasi-real-time task execution instruction according to the task name, the task execution time, and the client corresponding to the task in the quasi-real-time task request, and passes the interface at a certain time according to the actual situation. Send to the corresponding client.
  • the quasi-real-time task may forward the instruction to invoke the task to the servant within 10 minutes after receiving the requestor system call instruction;
  • the client controls the task performer to execute the quasi-real-time task in the quasi-real-time task execution instruction according to the quasi-real-time task execution instruction.
  • the task scheduling method firstly acquires each to-be-executed task sent by each task requester, detects each to-be-executed task, and obtains the current priority order of each to-be-executed task, and sequentially sends each to-be-executed task to the corresponding one according to the priority level.
  • the task executor so that the corresponding task executor executes each task to be executed; and when the high priority task to be executed is not successfully executed by the corresponding task executor, the low priority task to be executed is not sent to the corresponding task
  • the task executor performs unified control scheduling on each task to be executed of each task requester, so that the scheduling execution of the task to be executed can be performed more safely and accurately.
  • FIG. 4 is a schematic diagram showing an operating environment of the task scheduling program provided by the embodiment of the present application. For the convenience of explanation, only the parts related to the present embodiment are shown.
  • the task scheduler 400 is installed and runs in the server 40.
  • the server 40 can include, but is not limited to, a memory 401 and a processor 402.
  • Figure 4 shows only server 40 with components 401-402, but it should be understood that not all illustrated components may be implemented, and more or fewer components may be implemented instead.
  • the memory 401 includes at least one type of computer readable storage medium, which in some embodiments may be an internal storage unit of the server 40, such as a hard disk or memory of the server 40.
  • the memory 401 may also be an external storage device of the server 40 in other embodiments, such as a plug-in hard disk equipped on the server 40, a smart memory card (SMC), and a secure digital number (Secure). Digital, SD) cards, flash cards, etc.
  • the memory 401 may also include both an internal storage unit of the server 40 and an external storage device.
  • the memory 401 is configured to store application software and various types of data installed in the server 40, such as program codes of the task scheduler 400.
  • the memory 401 can also be used to temporarily store data that has been output or is about to be output.
  • the processor 402 can be a central processor (Central) A processing unit (CPU), a microprocessor or other data processing chip for running program code or processing data stored in the memory 401, such as executing the task scheduler 400 and the like.
  • Central central processor
  • CPU central processor
  • microprocessor or other data processing chip for running program code or processing data stored in the memory 401, such as executing the task scheduler 400 and the like.
  • server 40 may also include a display.
  • the display may be an LED display, a liquid crystal display, a touch liquid crystal display, and an OLED (Organic) in some embodiments. Light-Emitting Diode, organic light-emitting diodes, etc.
  • the display is for displaying information processed in the server 40 and a user interface for displaying visualizations, such as a task scheduling interface or the like.
  • the components 401-42 of the server 40 communicate with one another via a system bus.
  • FIG. 5 is a program module diagram of the task scheduler 400 provided by the embodiment of the present application.
  • the task scheduler 400 may be divided into one or more modules, and the one or more modules are stored in the memory 401 and executed by one or more processors (this implementation)
  • the processor 402 is executed to complete the application.
  • the task scheduler 400 can be divided into a task acquisition module 501, a detection module 502, and an execution module 503 to be executed.
  • a module referred to in this application refers to a series of computer readable instruction instruction segments capable of performing a particular function, and is more suitable than the program to describe the execution of the task scheduler 400 in the server 40. The following description will specifically describe the functions of the program modules 501-503.
  • the task to be executed 501 is configured to acquire each task to be executed sent by each task requester.
  • the detecting module 502 is configured to detect each of the to-be-executed tasks, and obtain a current priority order of each of the to-be-executed tasks.
  • the executing module 503 is configured to sequentially send each of the to-be-executed tasks to the corresponding task performers in order of priority, so that the corresponding task performers execute the respective to-be-executed tasks. Wherein, when the high priority pending task is not successfully executed by the corresponding task performer, the low priority pending task is not sent to the corresponding task performer.
  • the detecting module 502 is configured to: detect each of the to-be-executed tasks once every preset time, and obtain a current priority order of each of the to-be-executed tasks.
  • the detecting module 502 can include a time detecting unit and a priority determining unit.
  • the time detecting unit is configured to detect a task execution time of each of the to-be-executed tasks.
  • the priority determining unit is configured to determine a current current priority order of each of the to-be-executed tasks according to a task execution time of each of the to-be-executed tasks.
  • the execution module 503 can include a sending unit and an executing unit.
  • the sending unit is configured to sequentially send each of the to-be-executed tasks to an execution unit corresponding to a corresponding task executor according to a priority level; each execution unit corresponds to one client, and the number of the client is multiple One of the clients corresponds to a task performer.
  • the execution unit is configured to execute, by using a shell script, a corresponding task execution party to execute the to-be-executed task according to the to-be-executed task.
  • the to-be-executed task includes task execution time information and task performer identification information; each task performer identification information corresponds to one of the clients.
  • the sending unit is specifically configured to: send each of the to-be-executed tasks to a client corresponding to the task performer identification information in each of the to-be-executed tasks according to a priority level.
  • each functional unit and module in the foregoing system may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit, and the integrated unit may be implemented by hardware.
  • Formal implementation can also be implemented in the form of software functional units.
  • the specific names of the respective functional units and modules are only for the purpose of facilitating mutual differentiation, and are not intended to limit the scope of protection of the present application.

Landscapes

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

Abstract

The present application is applicable to the technical field of task scheduling, and provides a task scheduling method and a server. The method comprises: obtaining tasks to be executed sent by task requesters; detecting the tasks to be executed, and obtaining a current priority order of the tasks to be executed; and sequentially sending the tasks to be executed to corresponding task executors in descending order of priorities, so as to enable the corresponding task executors to execute the tasks to be executed, wherein if a high priority task to be executed is not successfully executed by the corresponding task executor, no low priority task to be executed is sent to the corresponding task executor. According to the task scheduling method and the server, the tasks to be executed of the task requesters are controlled and scheduled in a unified manner, so that the schedule execution of the tasks to be executed can be performed more securely and accurately.

Description

任务调度方法及服务器Task scheduling method and server
本申请申明享有2017年08月29日递交的申请号为201710756348.7、名称为“任务调度方法及服务器”中国专利申请的优先权,该中国专利申请的整体内容以参考的方式结合在本申请中。The present application claims the benefit of the priority of the Japanese Patent Application Serial No. JP-A No. No. No. No. No. No. No. No.
技术领域Technical field
本申请属于任务调度技术领域,尤其涉及任务调度方法及服务器。The present application belongs to the technical field of task scheduling, and in particular, to a task scheduling method and a server.
背景技术Background technique
在系统内部有定时任务需要执行时,一般使用的是spring软件中的quartz功能来完成。如果涉及各个任务之间的依赖关系,则需要间接通过一些标识记录来控制,此时各个任务之间基本隔离,导致系统无法便捷的对各个任务进行控制和管理。When there are timing tasks inside the system that need to be executed, the quartz function in the spring software is generally used to complete. If the dependencies between the various tasks are involved, it needs to be controlled indirectly through some identification records. At this time, the tasks are basically isolated, which makes the system unable to conveniently control and manage each task.
技术问题technical problem
有鉴于此,本申请实施例提供了任务调度方法及服务器,以解决现有技术中各个任务之间隔离导致无法便捷的对各个任务进行控制和管理的问题。In view of this, the embodiment of the present application provides a task scheduling method and a server, so as to solve the problem that the isolation between tasks in the prior art can not easily control and manage each task.
技术解决方案Technical solution
本申请提供的一种任务调度方法,包括:A task scheduling method provided by the application includes:
获取各个任务请求方发送的各个待执行任务;Obtaining each to-be-executed task sent by each task requester;
检测各个所述待执行任务,并获取各个所述待执行任务当前的优先级顺序;Detecting each of the to-be-executed tasks, and acquiring a current priority order of each of the to-be-executed tasks;
按照优先级高低顺序依次将各个所述待执行任务发送至相应的任务执行方,以使得相应的任务执行方执行各个所述待执行任务;Sending each of the to-be-executed tasks to the corresponding task performers in order of priority level, so that the corresponding task performers execute each of the to-be-executed tasks;
其中,在高优先级的待执行任务未被相应的任务执行方执行成功时,不将低优先级的待执行任务发送给相应的任务执行方。Wherein, when the high priority pending task is not successfully executed by the corresponding task performer, the low priority pending task is not sent to the corresponding task performer.
有益效果Beneficial effect
本申请实施例与现有技术相比存在的有益效果是:本申请实施例,首先获取各个任务请求方发送的各个待执行任务,检测各个待执行任务并获取各个待执行任务当前的优先级顺序,按照优先级高低顺序依次将各个待执行任务发送至相应的任务执行方,以使得相应的任务执行方执行各个待执行任务;而在高优先级的待执行任务未被相应的任务执行方执行成功时,不将低优先级的待执行任务发送给相应的任务执行方,通过对各个任务请求方的各个待执行任务进行统一控制调度,从而能够更加安全、准确的进行待执行任务的调度执行。Compared with the prior art, the embodiment of the present application has the beneficial effects that: in the embodiment of the present application, each task to be executed sent by each task requester is first obtained, each task to be executed is detected, and the current priority order of each task to be executed is obtained. Sending each to-be-executed task to the corresponding task performer in order of priority level, so that the corresponding task performer executes each to-be-executed task; and the high-priority pending task is not executed by the corresponding task performer When successful, the low-priority tasks to be executed are not sent to the corresponding task executors, and the tasks to be executed are uniformly controlled and scheduled by each task requester, so that the scheduled execution of the tasks to be executed can be performed more safely and accurately. .
附图说明DRAWINGS
图1是本申请实施例提供的任务调度方法的实现流程图;1 is a flowchart of an implementation of a task scheduling method provided by an embodiment of the present application;
图2是图1中步骤S102的实现流程图;2 is a flowchart of an implementation of step S102 in FIG. 1;
图3是图1中步骤S103的实现流程图;FIG. 3 is a flowchart of an implementation of step S103 in FIG. 1;
图4是本申请实施例提供的任务调度程序的运行环境示意图;4 is a schematic diagram of an operating environment of a task scheduler according to an embodiment of the present application;
图5是本申请实施例提供的任务调度程序的程序模块图。FIG. 5 is a block diagram of a program of a task scheduler according to an embodiment of the present application.
本发明的实施方式Embodiments of the invention
实施例一Embodiment 1
图1示出了本申请实施例一提供的任务调度方法的实现流程,详述如下:FIG. 1 is a flowchart showing an implementation process of a task scheduling method according to Embodiment 1 of the present application, which is described in detail as follows:
步骤S101,获取各个任务请求方发送的各个待执行任务。Step S101: Acquire each to-be-executed task sent by each task requester.
其中,任务请求方为发起待执行任务的一方,与后续步骤中的任务执行方相对,任务执行方为执行各个待执行任务的一方。The task requester is the party that initiates the task to be executed, and is opposite to the task performer in the subsequent step, and the task performer is the party that executes each task to be executed.
本实施例中,待执行任务可以包括实时任务、准实时任务和其他任务。实时任务主要指紧急性要求高,需要任务执行方立即执行的任务。准实时任务主要指紧急性要求不高,但是也必须在限定的时间内(例如10分钟内)将任务执行指令转发至任务执行方。其他任务则为紧急性要求不高,对执行时间没有要求或时间较长的任务。In this embodiment, the tasks to be executed may include real-time tasks, quasi-real-time tasks, and other tasks. Real-time tasks mainly refer to tasks with high urgency requirements and immediate execution by task performers. Quasi-real-time tasks mainly mean that the urgency requirements are not high, but the task execution instructions must also be forwarded to the task executor within a limited time (for example, within 10 minutes). Other tasks are tasks with low urgency requirements and no requirements for execution time or long time.
步骤S102,检测各个所述待执行任务,并获取各个所述待执行任务当前的优先级顺序。Step S102: Detect each of the to-be-executed tasks, and obtain a current priority order of each of the to-be-executed tasks.
可选的,步骤S102具体可以为:每隔预设时间检测一次各个所述待执行任务,并获取各个所述待执行任务当前的优先级顺序。Optionally, the step S102 is specifically: detecting each of the to-be-executed tasks once every preset time, and acquiring a current priority order of each of the to-be-executed tasks.
可以理解的,步骤S101中在不断的获取任务请求方发送的待执行任务,因此需要对获取到的待执行任务进行更新。本实施例中,通过每隔预设时间检测一次获取到的各个待执行任务,然后确定各个待执行任务当前的优先级顺序。It can be understood that the task to be executed sent by the task requester is continuously acquired in step S101, and therefore the acquired task to be executed needs to be updated. In this embodiment, each of the acquired tasks to be executed is detected once every preset time, and then the current priority order of each task to be executed is determined.
作为一种可实施方式,所述待执行任务可以包括任务执行时间信息、任务执行方信息、任务请求方信息等。参见图2,本实施例中,所述待执行任务包括任务执行时间信息,步骤S102可以包括以下步骤:As an implementation manner, the to-be-executed task may include task execution time information, task performer information, task requester information, and the like. Referring to FIG. 2, in this embodiment, the to-be-executed task includes task execution time information, and step S102 may include the following steps:
步骤S201,检测各个所述待执行任务的任务执行时间。Step S201: Detect task execution time of each of the to-be-executed tasks.
其中,每个待执行任务对应一个任务执行时间,任务执行时间可以为时间段,也可以为时间点。例如,在16:00获取到两个待执行任务,第一个待执行任务中的任务执行时间为16:05,第二个待执行任务的任务执行时间为16:10~16:20。即获取到的第一个待执行任务的任务执行时间为时间点,第二个待执行任务的任务执行时间为时间段。The task to be executed corresponds to a task execution time, and the task execution time may be a time segment or a time point. For example, two pending tasks are acquired at 16:00, the task execution time in the first pending task is 16:05, and the task execution time of the second pending task is 16:10~16:20. That is, the task execution time of the first task to be executed is the time point, and the task execution time of the second task to be executed is the time period.
步骤S202,根据各个所述待执行任务的任务执行时间,确定各个所述待执行任务当前的优先级顺序。Step S202: Determine a current priority order of each of the to-be-executed tasks according to a task execution time of each of the to-be-executed tasks.
本实施例中,通过各个待执行任务的任务执行时间确定各个待执行任务当前的优先级顺序。具体的,可以将任务执行时间的先后顺序作为各个待执行任务的优先级顺序,即将任务执行时间靠前的待执行任务的优先级较高,任务执行时间靠后的待执行任务的优先级较低。In this embodiment, the current priority order of each task to be executed is determined by the task execution time of each task to be executed. Specifically, the priority sequence of the task execution time may be taken as the priority order of each task to be executed, that is, the priority of the task to be executed with the task execution time being higher is higher, and the priority of the task to be executed after the task execution time is later. low.
在根据各个待执行任务的任务执行时间,确定各个所述待执行任务当前的优先级顺序之后,则根据所确定的各个待执行任务的优先级顺序,将各个所述待执行任务发送至相应的任务执行方,以使得相应的任务执行方执行各个所述待执行任务。具体的,在高优先级的待执行任务未被相应的任务执行方执行成功时,不将低优先级的待执行任务发送给相应的任务执行方。After determining the current priority order of each of the to-be-executed tasks according to the task execution time of each to-be-executed task, each of the to-be-executed tasks is sent to the corresponding one according to the determined priority order of each to-be-executed task. The task executor is such that the respective task executor executes each of the to-be-executed tasks. Specifically, when the high priority pending task is not successfully executed by the corresponding task performer, the low priority pending task is not sent to the corresponding task performer.
例如,三个待执行任务分别为第一待执行任务、第二待执行任务和第三待执行任务,第一待执行任务的任务执行时间为16:05,第二待执行任务的任务执行时间为16:10~16:20,第三待执行任务的任务执行时间为16:40,则三个待执行任务的优先级顺序由高到低依次为第一待执行任务、第二待执行任务和第三待执行任务。For example, the three tasks to be executed are the first task to be executed, the second task to be executed, and the third task to be executed. The task execution time of the first task to be executed is 16:05, and the task execution time of the second task to be executed is For 16:10~16:20, the task execution time of the third task to be executed is 16:40, and the priority order of the three tasks to be executed is the first task to be executed and the second task to be executed in descending order. And the third task to be performed.
步骤S103,按照优先级高低顺序依次将各个所述待执行任务发送至相应的任务执行方,以使得相应的任务执行方执行各个所述待执行任务。Step S103: Send each of the to-be-executed tasks to the corresponding task performers in order according to the priority level, so that the corresponding task performers execute each of the to-be-executed tasks.
其中,在高优先级的待执行任务未被相应的任务执行方执行成功时,不将低优先级的待执行任务发送给相应的任务执行方。Wherein, when the high priority pending task is not successfully executed by the corresponding task performer, the low priority pending task is not sent to the corresponding task performer.
例如,三个待执行任务分别为第一待执行任务、第二待执行任务和第三待执行任务,第一待执行任务的任务执行时间为16:05,第二待执行任务的任务执行时间为16:10~16:20,第三待执行任务的任务执行时间为16:40,则三个待执行任务的优先级顺序由高到低依次为第一待执行任务、第二待执行任务和第三待执行任务。For example, the three tasks to be executed are the first task to be executed, the second task to be executed, and the third task to be executed. The task execution time of the first task to be executed is 16:05, and the task execution time of the second task to be executed is For 16:10~16:20, the task execution time of the third task to be executed is 16:40, and the priority order of the three tasks to be executed is the first task to be executed and the second task to be executed in descending order. And the third task to be performed.
其中,在第一待执行任务未执行或未执行成功时,不将第二待执行任务和第三代执行任务发送给相应的任务执行方执行;直至第一待执行任务执行成功时,再将第二待执行任务发送给相应的任务执行方执行;在第二待执行任务为执行或未执行成功时,不将第三待执行任务发送给相应的任务执行方执行,直至第二待执行任务执行成功时,在将第三待执行任务发送给相应的任务执行方执行。Wherein, when the first to-be-executed task is not executed or is not executed successfully, the second to-be-executed task and the third-generation execution task are not sent to the corresponding task execution party; until the first to-be-executed task is successfully executed, The second task to be executed is sent to the corresponding task performer to execute; when the second task to be executed is executed or not executed successfully, the third task to be executed is not sent to the corresponding task performer until the second task to be executed When the execution is successful, the third pending task is sent to the corresponding task performer for execution.
参见图3,一个实施例中,步骤S103可以包括以下步骤:Referring to FIG. 3, in an embodiment, step S103 may include the following steps:
步骤S301,按照优先级高低顺序依次将各个所述待执行任务发送至与相应的任务执行方对应的客户端。Step S301: sequentially send each of the to-be-executed tasks to a client corresponding to the corresponding task executor in order of priority.
其中,所述客户端的个数为多个,一个所述客户端对应一个任务执行方。各个客户端部署在任务执行方的主机上,可执行任务执行方的shell脚本。各个客户端在任务执行方的部署方式可以为单点部署方式、HA(Hadoop)部署方式、Cluster(集群)部署方式或组件式部署方式。The number of the client is multiple, and one client corresponds to one task performer. Each client is deployed on the host of the task executor and can execute the shell script of the task executor. The deployment mode of each client in the task executor can be a single point deployment mode, HA (Hadoop) deployment mode, cluster (cluster) deployment mode or component deployment mode.
本实施例中,可以按照优先级高低顺序依次将各个待执行任务发送至与相应的任务执行方对应的客户端,以使得客户端使得任务执行方执行该待执行任务。In this embodiment, each to-be-executed task may be sequentially sent to the client corresponding to the corresponding task executor in order of priority, so that the client causes the task executor to execute the to-be-executed task.
例如,可以按照各个待执行任务的任务执行时间的先后顺序,依次将各个待执行任务发送至与相应的任务执行方对应的客户端,以使得客户端使得任务执行方执行该待执行任务。For example, each of the to-be-executed tasks may be sequentially sent to the client corresponding to the corresponding task executor in order of the task execution time of each task to be executed, so that the client causes the task executor to execute the to-be-executed task.
步骤S302,所述客户端根据所述待执行任务通过shell脚本控制对应的任务执行方执行所述待执行任务。Step S302: The client controls the corresponding task performer to execute the to-be-executed task by using a shell script according to the to-be-executed task.
本实施例中的任务调度方法适用于任务管理中心,该任务管理中心包括任务调度中心和多个客户端。任务调度中心按照任务请求方或既定策略向任务执行方发起调用指令;任务调度中心负责对各个待执行任务进行管控,例如监测任务执行时间,在任务执行时间靠前的前一带执行任务未执行或未执行成功时,不向相应的任务执行方下发执行时间靠后的后一待执行任务的执行指令,直至前一待执行任务执行成功后,再生成下一待执行任务的执行指令发送到相应的客户端,通过该客户端控制任务执行方执行该待执行任务。通过任务管理中心对各个待执行任务进行控制,能够更加安全、准确的进行各个待执行任务的调度执行。The task scheduling method in this embodiment is applicable to a task management center, and the task management center includes a task scheduling center and a plurality of clients. The task scheduling center initiates a call instruction to the task performer according to the task requester or the established policy; the task dispatch center is responsible for controlling each pending task, for example, monitoring the task execution time, and executing the task in the previous zone before the task execution time is not executed or When the execution is not successful, the execution instruction of the next execution task after the execution time is not sent to the corresponding task execution agent, until the execution of the previous execution task is successful, and then the execution instruction of the next execution task is generated and sent to The corresponding client executes the task to be executed through the client control task executive. Through the task management center to control each task to be executed, the scheduling execution of each task to be executed can be performed more safely and accurately.
一个实施例中,任务请求方、任务调度中心、客户端和任务执行方之间的数据交互过程如下:In one embodiment, the data interaction process between the task requester, the task scheduling center, the client, and the task performer is as follows:
任务请求方将实时任务请求发送给任务调度中心,实时任务为由任务发起方直接向任务调度中心请求,立即调用任务执行方执行改待执行任务;The task requester sends the real-time task request to the task dispatching center. The real-time task is directly requested by the task initiator to the task dispatching center, and the task executing party is immediately called to perform the task to be executed.
任务调度中心获取到实时任务请求后,根据实时任务请求中的任务执行方等信息,生成实时任务执行指令,通过接口发送给对应的客户端;After obtaining the real-time task request, the task scheduling center generates a real-time task execution instruction according to the task execution party and the like in the real-time task request, and sends the command to the corresponding client through the interface;
客户端根据该实时任务执行指令,控制对应的任务执行方执行实时任务执行指令中的实时任务。The client controls the corresponding task performer to execute the real-time task in the real-time task execution instruction according to the real-time task execution instruction.
另一个实施例中,任务请求方、任务调度中心、客户端和任务执行方之间的数据交互过程如下:In another embodiment, the data interaction process between the task requester, the task scheduling center, the client, and the task performer is as follows:
任务请求方将准实时任务请求发送给任务调度中心,准实时任务为由任务请求方直接向调度中心的请求,调度中心会根据实际情况在某个时间内向任务执行方发起执行指令;The task requester sends the quasi-real-time task request to the task dispatching center, and the quasi-real-time task is the request directly from the task requesting party to the dispatching center, and the dispatching center initiates an execution instruction to the task executing party within a certain time according to the actual situation;
任务调度中心获取到准实时任务请求后,根据准实时任务请求中的任务名称、任务执行时间、任务对应的客户端等信息,生成准实时任务执行指令,并根据实际情况在某个时间通过接口发送给对应的客户端。例如,准实时任务可以在接收到请求方系统调用指令后,在10分钟以内将调用任务的指令转发至服务方;After obtaining the quasi-real-time task request, the task scheduling center generates a quasi-real-time task execution instruction according to the task name, the task execution time, and the client corresponding to the task in the quasi-real-time task request, and passes the interface at a certain time according to the actual situation. Send to the corresponding client. For example, the quasi-real-time task may forward the instruction to invoke the task to the servant within 10 minutes after receiving the requestor system call instruction;
客户端根据该准实时任务执行指令,控制任务执行方执行准实时任务执行指令中的准实时任务。The client controls the task performer to execute the quasi-real-time task in the quasi-real-time task execution instruction according to the quasi-real-time task execution instruction.
上述任务调度方法,首先获取各个任务请求方发送的各个待执行任务,检测各个待执行任务并获取各个待执行任务当前的优先级顺序,按照优先级高低顺序依次将各个待执行任务发送至相应的任务执行方,以使得相应的任务执行方执行各个待执行任务;而在高优先级的待执行任务未被相应的任务执行方执行成功时,不将低优先级的待执行任务发送给相应的任务执行方,通过对各个任务请求方的各个待执行任务进行统一控制调度,从而能够更加安全、准确的进行待执行任务的调度执行。The task scheduling method firstly acquires each to-be-executed task sent by each task requester, detects each to-be-executed task, and obtains the current priority order of each to-be-executed task, and sequentially sends each to-be-executed task to the corresponding one according to the priority level. The task executor, so that the corresponding task executor executes each task to be executed; and when the high priority task to be executed is not successfully executed by the corresponding task executor, the low priority task to be executed is not sent to the corresponding task The task executor performs unified control scheduling on each task to be executed of each task requester, so that the scheduling execution of the task to be executed can be performed more safely and accurately.
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that the size of the sequence of the steps in the above embodiments does not mean that the order of execution is performed. The order of execution of each process should be determined by its function and internal logic, and should not be construed as limiting the implementation process of the embodiments of the present application.
实施例二Embodiment 2
对应于上文实施例所述的任务调度方法,图4示出了本申请实施例提供的任务调度程序的运行环境示意图。为了便于说明,仅示出了与本实施例相关的部分。Corresponding to the task scheduling method described in the foregoing embodiment, FIG. 4 is a schematic diagram showing an operating environment of the task scheduling program provided by the embodiment of the present application. For the convenience of explanation, only the parts related to the present embodiment are shown.
在本实施例中,所述的任务调度程序400安装并运行于服务器40中。该服务器40可包括,但不仅限于,存储器401和处理器402。图4仅示出了具有组件401-402的服务器40,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。In the present embodiment, the task scheduler 400 is installed and runs in the server 40. The server 40 can include, but is not limited to, a memory 401 and a processor 402. Figure 4 shows only server 40 with components 401-402, but it should be understood that not all illustrated components may be implemented, and more or fewer components may be implemented instead.
所述存储器401至少包括一种类型的计算机可读存储介质,其在一些实施例中可以是所述服务器40的内部存储单元,例如该服务器40的硬盘或内存。所述存储器401在另一些实施例中也可以是所述服务器40的外部存储设备,例如所述服务器40上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器401还可以既包括所述服务器40的内部存储单元也包括外部存储设备。所述存储器401用于存储安装于所述服务器40的应用软件及各类数据,例如所述任务调度程序400的程序代码等。所述存储器401还可以用于暂时地存储已经输出或者将要输出的数据。The memory 401 includes at least one type of computer readable storage medium, which in some embodiments may be an internal storage unit of the server 40, such as a hard disk or memory of the server 40. The memory 401 may also be an external storage device of the server 40 in other embodiments, such as a plug-in hard disk equipped on the server 40, a smart memory card (SMC), and a secure digital number (Secure). Digital, SD) cards, flash cards, etc. Further, the memory 401 may also include both an internal storage unit of the server 40 and an external storage device. The memory 401 is configured to store application software and various types of data installed in the server 40, such as program codes of the task scheduler 400. The memory 401 can also be used to temporarily store data that has been output or is about to be output.
所述处理器402在一些实施例中可以是一中央处理器(Central Processing Unit,CPU),微处理器或其他数据处理芯片,用于运行所述存储器401中存储的程序代码或处理数据,例如执行所述任务调度程序400等。The processor 402, in some embodiments, can be a central processor (Central) A processing unit (CPU), a microprocessor or other data processing chip for running program code or processing data stored in the memory 401, such as executing the task scheduler 400 and the like.
另外,服务器40还可以包括显示器。所述显示器在一些实施例中可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。所述显示器用于显示在所述服务器40中处理的信息以及用于显示可视化的用户界面,例如任务调度界面等。所述服务器40的部件401-402通过系统总线相互通信。Additionally, server 40 may also include a display. The display may be an LED display, a liquid crystal display, a touch liquid crystal display, and an OLED (Organic) in some embodiments. Light-Emitting Diode, organic light-emitting diodes, etc. The display is for displaying information processed in the server 40 and a user interface for displaying visualizations, such as a task scheduling interface or the like. The components 401-42 of the server 40 communicate with one another via a system bus.
请参阅图5,是本申请实施例提供的任务调度程序400的程序模块图。在本实施例中,所述的任务调度程序400可以被分割成一个或多个模块,所述一个或者多个模块被存储于所述存储器401中,并由一个或多个处理器(本实施例为所述处理器402)所执行,以完成本申请。例如,在图5中,所述的任务调度程序400可以被分割成待执行任务获取模块501、检测模块502和执行模块503。本申请所称的模块是指能够完成特定功能的一系列计算机可读指令指令段,比程序更适合于描述所述任务调度程序400在所述服务器40中的执行过程。以下描述将具体介绍所述程序模块501-503的功能。Please refer to FIG. 5 , which is a program module diagram of the task scheduler 400 provided by the embodiment of the present application. In this embodiment, the task scheduler 400 may be divided into one or more modules, and the one or more modules are stored in the memory 401 and executed by one or more processors (this implementation) For example, the processor 402) is executed to complete the application. For example, in FIG. 5, the task scheduler 400 can be divided into a task acquisition module 501, a detection module 502, and an execution module 503 to be executed. A module referred to in this application refers to a series of computer readable instruction instruction segments capable of performing a particular function, and is more suitable than the program to describe the execution of the task scheduler 400 in the server 40. The following description will specifically describe the functions of the program modules 501-503.
其中,待执行任务获取模块501,用于获取各个任务请求方发送的各个待执行任务。The task to be executed 501 is configured to acquire each task to be executed sent by each task requester.
检测模块502,用于检测各个所述待执行任务,并获取各个所述待执行任务当前的优先级顺序。The detecting module 502 is configured to detect each of the to-be-executed tasks, and obtain a current priority order of each of the to-be-executed tasks.
执行模块503,用于按照优先级高低顺序依次将各个所述待执行任务发送至相应的任务执行方,以使得相应的任务执行方执行各个所述待执行任务。其中,在高优先级的待执行任务未被相应的任务执行方执行成功时,不将低优先级的待执行任务发送给相应的任务执行方。The executing module 503 is configured to sequentially send each of the to-be-executed tasks to the corresponding task performers in order of priority, so that the corresponding task performers execute the respective to-be-executed tasks. Wherein, when the high priority pending task is not successfully executed by the corresponding task performer, the low priority pending task is not sent to the corresponding task performer.
可选的,检测模块502具体用于:每隔预设时间检测一次各个所述待执行任务,并获取各个所述待执行任务当前的优先级顺序。Optionally, the detecting module 502 is configured to: detect each of the to-be-executed tasks once every preset time, and obtain a current priority order of each of the to-be-executed tasks.
可选的,检测模块502可以包括时间检测单元和优先级确定单元。所述时间检测单元用于检测各个所述待执行任务的任务执行时间。所述优先级确定单元用于根据各个所述待执行任务的任务执行时间,确定各个所述待执行任务当前的当前优先级顺序。Optionally, the detecting module 502 can include a time detecting unit and a priority determining unit. The time detecting unit is configured to detect a task execution time of each of the to-be-executed tasks. The priority determining unit is configured to determine a current current priority order of each of the to-be-executed tasks according to a task execution time of each of the to-be-executed tasks.
可选的,执行模块503可以包括发送单元和执行单元。所述发送单元用于按照优先级高低顺序依次将各个所述待执行任务发送至与相应的任务执行方对应的执行单元;每个执行单元对应一个客户端,所述客户端的个数为多个,一个所述客户端对应一个任务执行方。所述执行单元用于根据所述待执行任务通过shell脚本控制对应的任务执行方执行所述待执行任务。Optionally, the execution module 503 can include a sending unit and an executing unit. The sending unit is configured to sequentially send each of the to-be-executed tasks to an execution unit corresponding to a corresponding task executor according to a priority level; each execution unit corresponds to one client, and the number of the client is multiple One of the clients corresponds to a task performer. The execution unit is configured to execute, by using a shell script, a corresponding task execution party to execute the to-be-executed task according to the to-be-executed task.
可选的,所述待执行任务包括任务执行时间信息和任务执行方标识信息;每个任务执行方标识信息对应一个所述客户端。所述发送单元具体用于:按照优先级高低顺序,将各个所述待执行任务发送至与各个所述待执行任务中的任务执行方标识信息对应的客户端。Optionally, the to-be-executed task includes task execution time information and task performer identification information; each task performer identification information corresponds to one of the clients. The sending unit is specifically configured to: send each of the to-be-executed tasks to a client corresponding to the task performer identification information in each of the to-be-executed tasks according to a priority level.
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。It will be clearly understood by those skilled in the art that, for convenience and brevity of description, only the division of each functional unit and module described above is exemplified. In practical applications, the above functions may be assigned to different functional units according to needs. The module is completed by dividing the internal structure of the device into different functional units or modules to perform all or part of the functions described above. Each functional unit and module in the embodiment may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit, and the integrated unit may be implemented by hardware. Formal implementation can also be implemented in the form of software functional units. In addition, the specific names of the respective functional units and modules are only for the purpose of facilitating mutual differentiation, and are not intended to limit the scope of protection of the present application. For the specific working process of the unit and the module in the foregoing system, reference may be made to the corresponding process in the foregoing method embodiment, and details are not described herein again.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。In the above embodiments, the descriptions of the various embodiments are different, and the parts that are not detailed or described in the specific embodiments may be referred to the related descriptions of other embodiments.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the various examples described in connection with the embodiments disclosed herein can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the solution. A person skilled in the art can use different methods to implement the described functions for each particular application, but such implementation should not be considered to be beyond the scope of the present application.
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。The above-mentioned embodiments are only used to explain the technical solutions of the present application, and are not limited thereto; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still implement the foregoing embodiments. The technical solutions described in the examples are modified or equivalently replaced with some of the technical features; and the modifications or substitutions do not deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in Within the scope of protection of this application.

Claims (20)

  1. 一种任务调度方法,其特征在于,包括:A task scheduling method, comprising:
    获取各个任务请求方发送的各个待执行任务;Obtaining each to-be-executed task sent by each task requester;
    检测各个所述待执行任务,并获取各个所述待执行任务当前的优先级顺序;Detecting each of the to-be-executed tasks, and acquiring a current priority order of each of the to-be-executed tasks;
    按照优先级高低顺序依次将各个所述待执行任务发送至相应的任务执行方,以使得相应的任务执行方执行各个所述待执行任务;Sending each of the to-be-executed tasks to the corresponding task performers in order of priority level, so that the corresponding task performers execute each of the to-be-executed tasks;
    其中,在高优先级的待执行任务未被相应的任务执行方执行成功时,不将低优先级的待执行任务发送给相应的任务执行方。Wherein, when the high priority pending task is not successfully executed by the corresponding task performer, the low priority pending task is not sent to the corresponding task performer.
  2. 如权利要求1所述的任务调度方法,其特征在于,所述检测各个所述待执行任务,并获取各个所述待执行任务当前的优先级顺序具体为:The task scheduling method according to claim 1, wherein the detecting the respective to-be-executed tasks and obtaining the current priority order of each of the to-be-executed tasks is specifically:
    每隔预设时间检测一次各个所述待执行任务,并获取各个所述待执行任务当前的优先级顺序。Each of the to-be-executed tasks is detected every preset time, and the current priority order of each of the to-be-executed tasks is obtained.
  3. 如权利要求1所述的任务调度方法,其特征在于,所述待执行任务包括任务执行时间信息;所述检测各个所述待执行任务,并获取各个所述待执行任务当前的优先级顺序具体包括:The task scheduling method according to claim 1, wherein the task to be executed includes task execution time information; the detecting each of the to-be-executed tasks, and obtaining a current priority order of each of the to-be-executed tasks include:
    检测各个所述待执行任务的任务执行时间;Detecting a task execution time of each of the to-be-executed tasks;
    根据各个所述待执行任务的任务执行时间,确定各个所述待执行任务当前的当前优先级顺序。Determining a current current priority order of each of the to-be-executed tasks according to task execution time of each of the to-be-executed tasks.
  4. 如权利要求1至3任一项所述的任务调度方法,其特征在于,所述按照优先级高低顺序依次将各个所述待执行任务发送至相应的任务执行方,以使得相应的任务执行方执行各个所述待执行任务具体包括:The task scheduling method according to any one of claims 1 to 3, wherein each of the to-be-executed tasks is sequentially sent to a corresponding task executing party in order of priority level, so that the corresponding task executing party Executing each of the to-be-executed tasks specifically includes:
    按照优先级高低顺序依次将各个所述待执行任务发送至与相应的任务执行方对应的客户端;所述客户端的个数为多个,一个所述客户端对应一个任务执行方;Sending each of the to-be-executed tasks to the client corresponding to the corresponding task executor in sequence according to the priority level; the number of the client is multiple, and one of the clients corresponds to one task executor;
    所述客户端根据所述待执行任务通过shell脚本控制对应的任务执行方执行所述待执行任务。The client executes the to-be-executed task by using a shell script to control a corresponding task performer according to the to-be-executed task.
  5. 如权利要求4所述的任务调度方法,其特征在于,所述待执行任务包括任务执行时间信息和任务执行方标识信息;每个任务执行方标识信息对应一个所述客户端;The task scheduling method according to claim 4, wherein the task to be executed includes task execution time information and task performer identification information; each task performer identification information corresponds to one of the clients;
    所述按照优先级高低顺序依次将各个所述待执行任务发送至与相应的任务执行方对应的客户端具体为:The sending the respective to-be-executed tasks to the client corresponding to the corresponding task executor in sequence according to the priority level is specifically:
    按照优先级高低顺序,将各个所述待执行任务发送至与各个所述待执行任务中的任务执行方标识信息对应的客户端。Each of the to-be-executed tasks is sent to a client corresponding to the task performer identification information in each of the to-be-executed tasks in order of priority.
  6. 一种服务器,其特征在于,包括:A server, comprising:
    待执行任务获取模块,用于获取各个任务请求方发送的各个待执行任务。The to-be-executed task acquisition module is configured to acquire each to-be-executed task sent by each task requester.
    检测模块,用于检测各个所述待执行任务,并获取各个所述待执行任务当前的优先级顺序。The detecting module is configured to detect each of the to-be-executed tasks, and obtain a current priority order of each of the to-be-executed tasks.
    执行模块,用于按照优先级高低顺序依次将各个所述待执行任务发送至相应的任务执行方,以使得相应的任务执行方执行各个所述待执行任务。其中,在高优先级的待执行任务未被相应的任务执行方执行成功时,不将低优先级的待执行任务发送给相应的任务执行方。The execution module is configured to sequentially send each of the to-be-executed tasks to the corresponding task performers in order of priority, so that the corresponding task performers execute the respective to-be-executed tasks. Wherein, when the high priority pending task is not successfully executed by the corresponding task performer, the low priority pending task is not sent to the corresponding task performer.
  7. 根据权利要求6所述的服务器,其特征在于,所述检测模块具体用于:每隔预设时间检测一次各个所述待执行任务,并获取各个所述待执行任务当前的优先级顺序。The server according to claim 6, wherein the detecting module is configured to: detect each of the to-be-executed tasks once every preset time, and obtain a current priority order of each of the to-be-executed tasks.
  8. 根据权利要求6所述的服务器,其特征在于,,所述检测模块包括时间检测单元和优先级确定单元;The server according to claim 6, wherein the detecting module comprises a time detecting unit and a priority determining unit;
    所述时间检测单元用于检测各个所述待执行任务的任务执行时间;The time detecting unit is configured to detect a task execution time of each of the to-be-executed tasks;
    所述优先级确定单元用于根据各个所述待执行任务的任务执行时间,确定各个所述待执行任务当前的当前优先级顺序。The priority determining unit is configured to determine a current current priority order of each of the to-be-executed tasks according to a task execution time of each of the to-be-executed tasks.
  9. 根据权利要求6-8任一项所述的服务器,其特征在于,所述执行模块包括发送单元和执行单元;The server according to any one of claims 6-8, wherein the execution module comprises a sending unit and an executing unit;
    所述发送单元用于按照优先级高低顺序依次将各个所述待执行任务发送至与相应的任务执行方对应的执行单元;每个执行单元对应一个客户端,所述客户端的个数为多个,一个所述客户端对应一个任务执行方;The sending unit is configured to sequentially send each of the to-be-executed tasks to an execution unit corresponding to a corresponding task executor according to a priority level; each execution unit corresponds to one client, and the number of the client is multiple One of the clients corresponds to a task performer;
    所述执行单元用于根据所述待执行任务通过shell脚本控制对应的任务执行方执行所述待执行任务。The execution unit is configured to execute, by using a shell script, a corresponding task execution party to execute the to-be-executed task according to the to-be-executed task.
  10. 根据权利要求9所述的服务器,其特征在于,所述待执行任务包括任务执行时间信息和任务执行方标识信息;每个任务执行方标识信息对应一个所述客户端;所述发送单元具体用于:按照优先级高低顺序,将各个所述待执行任务发送至与各个所述待执行任务中的任务执行方标识信息对应的客户端。The server according to claim 9, wherein the task to be executed includes task execution time information and task performer identification information; each task performer identification information corresponds to one of the clients; And: sending, according to the priority level, each of the to-be-executed tasks to a client corresponding to the task performer identification information in each of the to-be-executed tasks.
  11. 一种服务器,其特征在于,所述服务器包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现如下步骤:A server, comprising: a memory, a processor, and computer readable instructions stored in the memory and executable on the processor, the processor executing the computer readable instructions Implement the following steps:
    获取各个任务请求方发送的各个待执行任务;Obtaining each to-be-executed task sent by each task requester;
    检测各个所述待执行任务,并获取各个所述待执行任务当前的优先级顺序;Detecting each of the to-be-executed tasks, and acquiring a current priority order of each of the to-be-executed tasks;
    按照优先级高低顺序依次将各个所述待执行任务发送至相应的任务执行方,以使得相应的任务执行方执行各个所述待执行任务;Sending each of the to-be-executed tasks to the corresponding task performers in order of priority level, so that the corresponding task performers execute each of the to-be-executed tasks;
    其中,在高优先级的待执行任务未被相应的任务执行方执行成功时,不将低优先级的待执行任务发送给相应的任务执行方。Wherein, when the high priority pending task is not successfully executed by the corresponding task performer, the low priority pending task is not sent to the corresponding task performer.
  12. 如权利要求11所述的服务器,其特征在于,所述检测各个所述待执行任务,并获取各个所述待执行任务当前的优先级顺序具体为:The server according to claim 11, wherein the detecting the respective to-be-executed tasks and obtaining the current priority order of each of the to-be-executed tasks is specifically:
    每隔预设时间检测一次各个所述待执行任务,并获取各个所述待执行任务当前的优先级顺序。Each of the to-be-executed tasks is detected every preset time, and the current priority order of each of the to-be-executed tasks is obtained.
  13. 如权利要求11所述的服务器,其特征在于,所述检测各个所述待执行任务,并获取各个所述待执行任务当前的优先级顺序具体为:The server according to claim 11, wherein the detecting the respective to-be-executed tasks and obtaining the current priority order of each of the to-be-executed tasks is specifically:
    检测各个所述待执行任务的执行时间要求;Detecting execution time requirements of each of the to-be-executed tasks;
    根据各个所述待执行任务的执行时间要求,确定各个所述待执行任务当前的当前优先级顺序。Determining a current current priority order of each of the to-be-executed tasks according to an execution time requirement of each of the to-be-executed tasks.
  14. 如权利要求11至13任一项所述的服务器,其特征在于,所述按照优先级高低顺序依次将各个所述待执行任务发送至相应的任务执行方,以使得相应的任务执行方执行各个所述待执行任务具体包括:The server according to any one of claims 11 to 13, wherein each of the to-be-executed tasks is sequentially sent to a corresponding task executing party in order of priority level, so that the corresponding task executing party executes each The tasks to be executed specifically include:
    按照优先级高低顺序依次将各个所述待执行任务发送至与相应的任务执行方对应的客户端;所述客户端的个数为多个,一个所述客户端对应一个任务执行方;Sending each of the to-be-executed tasks to the client corresponding to the corresponding task executor in sequence according to the priority level; the number of the client is multiple, and one of the clients corresponds to one task executor;
    所述客户端根据所述待执行任务通过shell脚本控制对应的任务执行方执行所述待执行任务。The client executes the to-be-executed task by using a shell script to control a corresponding task performer according to the to-be-executed task.
  15. 根据权利要求14所述的服务器,其特征在于,所述待执行任务包括任务执行时间信息和任务执行方标识信息;每个任务执行方标识信息对应一个所述客户端;The server according to claim 14, wherein the task to be executed includes task execution time information and task performer identification information; each task performer identification information corresponds to one of the clients;
    所述按照优先级高低顺序依次将各个所述待执行任务发送至与相应的任务执行方对应的客户端具体为:The sending the respective to-be-executed tasks to the client corresponding to the corresponding task executor in sequence according to the priority level is specifically:
    按照优先级高低顺序,将各个所述待执行任务发送至与各个所述待执行任务中的任务执行方标识信息对应的客户端。Each of the to-be-executed tasks is sent to a client corresponding to the task performer identification information in each of the to-be-executed tasks in order of priority.
  16. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机可读指令,其特征在于,所述计算机可读指令被处理器执行时实现如下步骤:A computer readable storage medium storing computer readable instructions, wherein the computer readable instructions, when executed by a processor, implement the following steps:
    获取各个任务请求方发送的各个待执行任务;Obtaining each to-be-executed task sent by each task requester;
    检测各个所述待执行任务,并获取各个所述待执行任务当前的优先级顺序;Detecting each of the to-be-executed tasks, and acquiring a current priority order of each of the to-be-executed tasks;
    按照优先级高低顺序依次将各个所述待执行任务发送至相应的任务执行方,以使得相应的任务执行方执行各个所述待执行任务;Sending each of the to-be-executed tasks to the corresponding task performers in order of priority level, so that the corresponding task performers execute each of the to-be-executed tasks;
    其中,在高优先级的待执行任务未被相应的任务执行方执行成功时,不将低优先级的待执行任务发送给相应的任务执行方。Wherein, when the high priority pending task is not successfully executed by the corresponding task performer, the low priority pending task is not sent to the corresponding task performer.
  17. 如权利要求16所述的服务器,其特征在于,所述检测各个所述待执行任务,并获取各个所述待执行任务当前的优先级顺序具体为:The server according to claim 16, wherein the detecting the respective to-be-executed tasks and obtaining the current priority order of each of the to-be-executed tasks is specifically:
    每隔预设时间检测一次各个所述待执行任务,并获取各个所述待执行任务当前的优先级顺序。Each of the to-be-executed tasks is detected every preset time, and the current priority order of each of the to-be-executed tasks is obtained.
  18. 如权利要求16所述的服务器,其特征在于,所述检测各个所述待执行任务,并获取各个所述待执行任务当前的优先级顺序具体为:The server according to claim 16, wherein the detecting the respective to-be-executed tasks and obtaining the current priority order of each of the to-be-executed tasks is specifically:
    检测各个所述待执行任务的执行时间要求;Detecting execution time requirements of each of the to-be-executed tasks;
    根据各个所述待执行任务的执行时间要求,确定各个所述待执行任务当前的当前优先级顺序。Determining a current current priority order of each of the to-be-executed tasks according to an execution time requirement of each of the to-be-executed tasks.
  19. 如权利要求16至18任一项所述的服务器,其特征在于,所述按照优先级高低顺序依次将各个所述待执行任务发送至相应的任务执行方,以使得相应的任务执行方执行各个所述待执行任务具体包括:The server according to any one of claims 16 to 18, wherein each of the to-be-executed tasks is sequentially sent to a corresponding task executing party in order of priority, so that the corresponding task executing party executes each The tasks to be executed specifically include:
    按照优先级高低顺序依次将各个所述待执行任务发送至与相应的任务执行方对应的客户端;所述客户端的个数为多个,一个所述客户端对应一个任务执行方;Sending each of the to-be-executed tasks to the client corresponding to the corresponding task executor in sequence according to the priority level; the number of the client is multiple, and one of the clients corresponds to one task executor;
    所述客户端根据所述待执行任务通过shell脚本控制对应的任务执行方执行所述待执行任务。The client executes the to-be-executed task by using a shell script to control a corresponding task performer according to the to-be-executed task.
  20. 根据权利要求19所述的计算机可读存储介质,其特征在于,所述待执行任务包括任务执行时间信息和任务执行方标识信息;每个任务执行方标识信息对应一个所述客户端;The computer readable storage medium according to claim 19, wherein the task to be executed comprises task execution time information and task performer identification information; each task performer identification information corresponds to one of the clients;
    所述按照优先级高低顺序依次将各个所述待执行任务发送至与相应的任务执行方对应的客户端具体为:The sending the respective to-be-executed tasks to the client corresponding to the corresponding task executor in sequence according to the priority level is specifically:
    按照优先级高低顺序,将各个所述待执行任务发送至与各个所述待执行任务中的任务执行方标识信息对应的客户端。Each of the to-be-executed tasks is sent to a client corresponding to the task performer identification information in each of the to-be-executed tasks in order of priority.
PCT/CN2018/083048 2017-08-29 2018-04-13 Task scheduling method and server WO2019041824A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710756348.7A CN108255589A (en) 2017-08-29 2017-08-29 Method for scheduling task and server
CN201710756348.7 2017-08-29

Publications (1)

Publication Number Publication Date
WO2019041824A1 true WO2019041824A1 (en) 2019-03-07

Family

ID=62721189

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/083048 WO2019041824A1 (en) 2017-08-29 2018-04-13 Task scheduling method and server

Country Status (2)

Country Link
CN (1) CN108255589A (en)
WO (1) WO2019041824A1 (en)

Families Citing this family (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110750341B (en) * 2018-07-24 2022-08-02 深圳市优必选科技有限公司 Task scheduling method, device, system, terminal equipment and storage medium
CN109213586A (en) * 2018-08-23 2019-01-15 北京奇虎科技有限公司 A kind of dispatching method and device of task
CN111381956B (en) * 2018-12-28 2024-02-27 杭州海康威视数字技术股份有限公司 Task processing method and device and cloud analysis system
CN109816338A (en) * 2019-01-03 2019-05-28 深圳壹账通智能科技有限公司 Enterprise's rewards and punishments processing method, device, computer equipment and storage medium
CN110083712A (en) * 2019-03-12 2019-08-02 平安科技(深圳)有限公司 A kind of method for reading data, system and terminal device
CN110162388A (en) * 2019-04-26 2019-08-23 深圳智链物联科技有限公司 A kind of method for scheduling task, system and terminal device
CN110334011B (en) * 2019-05-31 2023-03-17 浙江口碑网络技术有限公司 Method and device for executing test case
CN110489217A (en) * 2019-07-11 2019-11-22 新华三大数据技术有限公司 A kind of method for scheduling task and system
CN110347602B (en) * 2019-07-11 2023-08-22 中国工商银行股份有限公司 Method and device for executing multitasking script, electronic equipment and readable storage medium
CN111124566A (en) * 2019-11-29 2020-05-08 苏州浪潮智能科技有限公司 BMC user interface operation management method, equipment and readable medium
CN111309475B (en) * 2020-01-21 2022-12-02 上海万物新生环保科技集团有限公司 Detection task execution method and equipment
CN111338967B (en) * 2020-03-09 2023-12-05 京东科技控股股份有限公司 Shunt test method and device, electronic equipment and storage medium
CN111400005A (en) * 2020-03-13 2020-07-10 北京搜狐新媒体信息技术有限公司 Data processing method and device and electronic equipment
CN111651272B (en) * 2020-05-28 2023-02-03 苏州大学 Thread time management method and device for embedded real-time operation
CN114095487B (en) * 2020-07-30 2024-03-19 中移(苏州)软件技术有限公司 Remote task execution method, device and storage medium
CN111858012A (en) * 2020-08-05 2020-10-30 杭州安恒信息技术股份有限公司 Task scheduling method, device, equipment and medium
CN113177680A (en) * 2021-03-10 2021-07-27 广州明珞自动化有限公司 Task execution system, task execution method and production system
CN113641493A (en) * 2021-08-11 2021-11-12 杭州安恒信息技术股份有限公司 Task pushing method, device and equipment and computer readable storage medium
CN113723936B (en) * 2021-10-12 2023-11-14 国网安徽省电力有限公司宿州供电公司 Quality supervision and management method and system for electric power engineering
CN114253683B (en) * 2021-11-26 2022-11-01 北京百度网讯科技有限公司 Task processing method and device, electronic equipment and storage medium
WO2023225938A1 (en) * 2022-05-26 2023-11-30 Citrix Systems, Inc. Systems and methods for scheduling multiple participant tasks
CN114896050B (en) * 2022-07-12 2022-09-30 北京云枢创新软件技术有限公司 Task scheduling method and system based on cluster resources

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101063947A (en) * 2006-04-27 2007-10-31 国际商业机器公司 Method and system convenient for determining scheduling priority of jobs
CN101169741A (en) * 2006-10-25 2008-04-30 国际商业机器公司 Method and system for determining scheduling priority of operation
CN101452399A (en) * 2007-12-05 2009-06-10 中兴通讯股份有限公司 Task secondary scheduling module and method
CN102395108A (en) * 2011-11-28 2012-03-28 苏州迈普信息技术有限公司 Cooperated rescue method based on mobile localization
CN102421060A (en) * 2011-11-28 2012-04-18 苏州迈普信息技术有限公司 GIS (Geographic Information System)-based emergency condition management system for tour group

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH02311932A (en) * 1989-05-29 1990-12-27 Oki Electric Ind Co Ltd Preference control system
CN101202761B (en) * 2007-12-04 2010-11-03 赵晓宇 System of distributed resource scheduling and method thereof
CN101561768A (en) * 2008-04-18 2009-10-21 北京闻言科技有限公司 Universal multitask scheduling method
CN101741885A (en) * 2008-11-19 2010-06-16 珠海市西山居软件有限公司 Distributed system and method for processing task flow thereof
CN102023895A (en) * 2010-11-25 2011-04-20 广东雅达电子股份有限公司 Singlechip programming method with priority task switching
CN104346215A (en) * 2013-08-07 2015-02-11 中兴通讯股份有限公司 Task scheduling service system and method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101063947A (en) * 2006-04-27 2007-10-31 国际商业机器公司 Method and system convenient for determining scheduling priority of jobs
CN101169741A (en) * 2006-10-25 2008-04-30 国际商业机器公司 Method and system for determining scheduling priority of operation
CN101452399A (en) * 2007-12-05 2009-06-10 中兴通讯股份有限公司 Task secondary scheduling module and method
CN102395108A (en) * 2011-11-28 2012-03-28 苏州迈普信息技术有限公司 Cooperated rescue method based on mobile localization
CN102421060A (en) * 2011-11-28 2012-04-18 苏州迈普信息技术有限公司 GIS (Geographic Information System)-based emergency condition management system for tour group

Also Published As

Publication number Publication date
CN108255589A (en) 2018-07-06

Similar Documents

Publication Publication Date Title
WO2019041824A1 (en) Task scheduling method and server
CN107957903B (en) Asynchronous task scheduling method, server and storage medium
WO2019114128A1 (en) Block chain transaction block processing method, electronic device and readable storage medium
US9513962B2 (en) Migrating a running, preempted workload in a grid computing system
EP3230860B1 (en) Technologies for efficient synchronization barriers with work stealing support
US8424007B1 (en) Prioritizing tasks from virtual machines
US9778962B2 (en) Method for minimizing lock contention among threads when tasks are distributed in multithreaded system and apparatus using the same
US8868604B2 (en) Methods and apparatus for implementing Semi-distributed Lock Management
TWI267782B (en) Deallocation of computer data in a multithreaded computer
US9262220B2 (en) Scheduling workloads and making provision decisions of computer resources in a computing environment
KR101332840B1 (en) Cluster system, Host node, Computing node, and application execution method based on parallel computing framework
WO2019179026A1 (en) Electronic device, method for automatically generating cluster access domain name, and storage medium
US20110161976A1 (en) Method to reduce queue synchronization of multiple work items in a system with high memory latency between processing nodes
US11630692B2 (en) Efficient worker utilization
JP2014123365A (en) DEVICE AND METHOD FOR OPTIMIZATION OF DATA PROCESSING IN MapReduce FRAMEWORK
WO2017107843A1 (en) Periodic task processing method and apparatus, computer program, and readable medium
US9229716B2 (en) Time-based task priority boost management using boost register values
CN109791502B (en) Peer-to-peer distributed computing system for heterogeneous device types
WO2020026010A2 (en) Task execution control method, device, equipment/terminal/server and storage medium
US11301304B2 (en) Method and apparatus for managing kernel services in multi-core system
EP3401784A1 (en) Multicore processing system
US9430338B2 (en) Method and computing device for recording log entries
KR101674324B1 (en) Task scheduling device and method for real-time control applications
US10810184B1 (en) Systems for consistent modification of stored values
US8327378B1 (en) Method for gracefully stopping a multi-threaded application

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18850929

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205 DATED 24/09/2020)

122 Ep: pct application non-entry in european phase

Ref document number: 18850929

Country of ref document: EP

Kind code of ref document: A1