WO2014173339A1 - Task scheduling service system and method - Google Patents

Task scheduling service system and method Download PDF

Info

Publication number
WO2014173339A1
WO2014173339A1 PCT/CN2014/077702 CN2014077702W WO2014173339A1 WO 2014173339 A1 WO2014173339 A1 WO 2014173339A1 CN 2014077702 W CN2014077702 W CN 2014077702W WO 2014173339 A1 WO2014173339 A1 WO 2014173339A1
Authority
WO
WIPO (PCT)
Prior art keywords
task
scheduling
priority
module
component module
Prior art date
Application number
PCT/CN2014/077702
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 WO2014173339A1 publication Critical patent/WO2014173339A1/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 invention relates to the field of communications, and more particularly to a task scheduling service system and method. Background technique
  • the voice mailbox includes new mail phone notification, guest timed message, outbound call fetching, schedule reminder and other timed tasks. Some of these timed tasks are business operations specified by the user at the date and time, and some are caused by the user's specified date and time business operations. Subsequent processing, some of which are implemented by internal task mechanisms for implementing a function.
  • timing tasks is based on the internal processing steps of the business application layer, which increases the complexity of the business application module, resulting in strong coupling between the business application layer and the data structure, data distribution and module relationships within the system, and Continuous expansion and change will result in repeated development tests of the same function, reducing R&D efficiency, and making it difficult to ensure product quality and performance.
  • the technical problem to be solved by the present invention is to provide a task scheduling service system and method.
  • the processing logic of the business application layer can be simplified, and the execution efficiency and user experience of the task scheduling service can be improved.
  • an embodiment of the present invention provides a task scheduling service system and method, where the task scheduling service system includes:
  • the task invoking module is set to: initiate a task scheduling request
  • the service interface component module is configured to: create a task according to the task scheduling request, and create a corresponding scheduling task record in the database;
  • the task scanning component module is configured to: scan the scheduled task record, calculate the task priority according to the task scheduling priority algorithm, and then put the task into the corresponding priority queue;
  • the task queue component module is configured to: select a task to be executed in the priority queue according to a priority queue element dequeue algorithm;
  • the task execution module is set to: execute the current task to be executed.
  • the task scheduling service system further includes:
  • the task statistics module is configured to: obtain and count the total number of task scheduling requests initiated by the task invoking module in the scheduling period, and the number of tasks successfully executed by the task execution module and the number of tasks that fail to execute.
  • the WEB management module is configured to: configure the scheduling rules of the task, system parameters, and query the processing progress of the current task.
  • the service interface component module is configured to: when creating a task, calculate a startup time and a task number for the task according to the task scheduling algorithm.
  • the service interface component module is further configured to: receive a task execution result report of the task execution module, and respond to the task execution module to perform task retry or perform task return processing on the task that fails to perform.
  • the service interface component module is further configured to: when the task is retried, calculate a restart time of the task according to the task scheduling rule calculation algorithm.
  • the task scheduling rule calculation algorithm includes: a current system time when the task is created
  • the service interface component module is configured to: when performing task receipt processing, return the task receipt information to the task invoking module according to the information of the task.
  • the service interface component module is further configured to: move the task that ends the execution to the history table for saving.
  • the task scanning component module is further configured to: when scanning a timeout and expired task, report the task result to the service interface component module, so that the service interface component module performs a task retry or performs a task for timeout and expired tasks. Receipt processing of tasks.
  • the task queue component module is further configured to: when the startup task is abnormal, report the task result to the service interface component module, so that the service interface component module performs task retry or task receipt processing on the task that initiates the abnormality. .
  • the task scheduling priority algorithm includes: a system level priority corresponding to a task type of the new task * 2 + a task priority flag + 1.
  • the priority queue element outbound algorithm includes: The task queue component module extracts the task processing from each task queue one by one according to the scheduling priority of each queue, first processes the tasks in the high priority queue, and then processes the low priority. The tasks in the level queue, then loop.
  • An embodiment of the present invention further provides a task scheduling method, including:
  • the task scheduling method further includes: calculating, when the task is retried, a restart time of the task according to the task rule algorithm.
  • the foregoing embodiment of the present invention initiates a task scheduling request by using a task invoking module; the service interface component module creates a task according to the task scheduling request, and creates a corresponding scheduling task record in the database; the task scanning component module processes the scheduling task The record is scanned, the task priority is calculated according to the task scheduling priority algorithm, and the task is placed in the corresponding priority queue; the task queue component module selects the current execution in the priority queue according to the priority queue element dequeue algorithm.
  • the task execution module executes the task to be executed currently; simplifies the processing logic of the business application layer, improves the execution efficiency of the task scheduling service, and enhances the differentiated experience of external users for different priority task scheduling services. . BRIEF abstract
  • FIG. 1 is a structural diagram of a task scheduling service system according to an embodiment of the present invention.
  • FIG. 2 is a flowchart of a method for implementing task scheduling according to an embodiment of the present invention
  • FIG. 5 is a flowchart of a method for scheduling a task according to an embodiment of the present invention.
  • the call of the present invention for the existing timing tasks is based on the problem that the business application layer performs internal processing and is inefficient, and provides a task scheduling service system and method.
  • an embodiment of the present invention provides a task scheduling service system, including: a task invoking end module 101, configured to initiate a task scheduling request;
  • the service interface component module 102 is configured to create a task according to the task scheduling request, and create a corresponding scheduling task record in the database;
  • the task scanning component module 103 is configured to scan the scheduled task record, calculate a task priority according to a task scheduling priority algorithm, and then put the task into a corresponding priority queue;
  • the task queue component module 104 is configured to select a task to be executed in the priority queue according to a priority queue element dequeue algorithm
  • the task execution module 105 is configured to execute the task to be executed currently.
  • the foregoing embodiment of the present invention initiates a task scheduling request by using a task invoking module; the service interface component module creates a task according to the task scheduling request, and creates a corresponding scheduling task record in the database; the task scanning component module processes the scheduling task The record is scanned, the task priority is calculated according to the task scheduling priority algorithm, and the task is placed in the corresponding priority queue; the task queue component module selects the current execution in the priority queue according to the priority queue element dequeue algorithm.
  • the task execution module executes the current task to be executed; not only simplifies the processing logic of the business application layer, but also improves the execution efficiency of the task scheduling service, and also enhances the differentiated experience of external users for different priority task scheduling services. .
  • the embodiment of the task scheduling service system of the present invention may further include:
  • the task statistics module 106 is configured to obtain a total number of task scheduling requests initiated by the task invoking module in the scheduling period, a number of tasks successfully executed by the task execution module, and a number of tasks that fail to execute.
  • the WEB management module 107 is configured to configure scheduling rules of the task, system parameters, and query processing progress of the current task.
  • the service interface component module 102 is specifically configured to: calculate a startup time and a task number for the task according to the task scheduling algorithm.
  • the service interface component module 102 is further configured to: receive a task execution result report of the task execution module 105, respond to the task execution module 105, perform task retry on the task that fails to perform, or perform a receipt process of the task.
  • the service interface component module 102 is further configured to: when the task is retried, calculate a restart time of the task according to the task scheduling rule calculation algorithm.
  • the task scheduling rule calculation algorithm specifically refers to: the current system time when the task is created + the maximum startup delay duration * (the sum of the task counts of all the scheduling priorities greater than the new task scheduling priority).
  • the service interface component module 102 When the service interface component module 102 performs the task receipt processing, it is specifically configured to: return the task receipt information to the task invoking end module 101 according to the information of the task.
  • the service interface component module 102 is further configured to: move the task that ends the execution to a history table to save.
  • the task scanning component module 103 is further configured to: when scanning a timeout and expired task, report the task result to the service interface component module 102, so that the service interface component module 102 performs a task retry on the timeout and expired tasks or Carry out the receipt processing of the task.
  • the task queue component module 104 is further configured to: when the startup task has an abnormality, report the task result to the service interface component module 102, so that the service interface component module 102 performs a task retry or a task receipt for the task that initiates the abnormality. deal with.
  • the task scheduling priority algorithm specifically refers to: a system level priority corresponding to a task type of a new task * 2 + task priority flag + 1.
  • the priority queue element dequeue algorithm specifically refers to: the task queue component module 104 extracts the task processing from each task queue one by one according to the scheduling priority of each queue, and first processes the tasks in the high priority queue, and the processing is low. The tasks in the priority queue are then looped.
  • a specific flowchart of the method for implementing the task scheduling service system according to the present invention mainly includes the following steps:
  • Step 201 The WEB management module 107 is mainly responsible for configuring task scheduling rules, including tasks. The system-level priority, the forbidden scheduling time, the retry interval, and the maximum number of retries, and the like; Step 202, the task invoking module 101 sends a task scheduling request to the service interface component module 102, and the type of the current scheduling task needs to be specified in the request message. Whether the field of the scheduling result receipt is required, and the scheduling task startup time field is optional;
  • Step 203 After receiving the task scheduling request, the service interface component module 102 calculates the startup time of the task according to the task scheduling rule calculation algorithm, and creates a corresponding task scheduling record in the database; wherein, each scheduling priority in the statistical period is required.
  • the task counter calculates the ratio of the number of tasks for each scheduling priority to the total number of tasks.
  • Step 204 The task scanning component 103 queries the task that meets the task start condition according to the task scheduling priority algorithm, scans the task scheduling record, and puts the task scheduling record into the corresponding task priority queue; wherein, for example, system level priority The level is 3 (0, 1, 2). Each task type is divided into two types: normal and emergency (0, 1). Therefore, the maximum scheduling priority level of the whole system is 6, but considering the possible extension. The system-level priority number, so the task scheduling service can configure the maximum number of scheduling system-level priorities it supports. The default is 6.
  • Step 205 The task queue component module 104 calls out the task that meets the requirements in the priority queue according to the queue function of the priority queue element, and sends the task to the task execution module 105.
  • the task priority queue element dequeue algorithm includes: The task queue component takes the task processing from each task queue one by one according to the scheduling priority of each queue, processes the high priority queue first, then processes the low priority queue, and then loops. Each round of the loop takes the elements from the corresponding queue according to the priority values 6, 5, 4, 3, 2, 1;
  • Step 206 after receiving the task scheduling execution request, the task execution module 105 triggers the intelligent network platform to perform task scheduling, and feeds the execution result to the service interface component module 102;
  • Step 207 the service interface component module 102 determines whether the scheduling is successful, if successful, proceeds to step 208; if it fails, proceeds to step 209;
  • Step 208 the service interface component module 102 determines whether the task scheduling request requires a receipt. If the receipt is required, the process proceeds to step 210; if not, the process proceeds to step 214, and the current task scheduling ends, and the service interface component module 102 imports the scheduled task. In the task history table;
  • Step 209 the service interface component module 102 determines whether the number of retries of the scheduled task has exceeded the maximum number of retries, if yes, returns to step 208; if not, proceeds to step 212, by the service The interface component module 102 calculates the task retry start time for the task scan component module 103 to scan; Step 210, the service interface component module 102 determines whether the receipt execution result is successful to the task call end 101, and if successful, proceeds to step 214, the task Scheduling end, service interface component module
  • the scheduling task is imported into the task history table; if not, the process proceeds to step 213, where the task retry receipt time is calculated by the service interface component module 102 for scanning by the task scanning component module 103.
  • tasks that request scheduling from the service interface component module 102 can be divided into two phases: task execution and task receipt during the creation and execution process:
  • the first is that the service interface component module 102 creates a task in the task table, and needs to wait for execution after the task is created;
  • the task execution module 105 executes the task
  • the task call end 101 actively cancels the task
  • the task execution module 105 returns that the task execution is successful
  • the execution fails, and can be divided into: the task execution module 105 returns the task execution failure; the task queue component module 104 returns the task startup failure; the task in the waiting state times out;
  • Tasks in the task table require a receipt. There are usually four situations in the task receipt phase: Waiting for a receipt, the receipt fails but can be retried;
  • the task statistics module 106 obtains the task counters of the respective scheduling priorities in the scheduling period, and calculates the proportion of the tasks of the respective scheduling priorities to the total number of tasks.
  • the algorithm uses the proportion of the total number of tasks according to each scheduling priority to the total number of tasks of all scheduling priorities to calculate the task start of each scheduling priority. time.
  • an embodiment of the present invention further provides a task scheduling method, including: Step 501: Initiate a task scheduling request.
  • Step 502 Create a task according to the task scheduling request, and create a corresponding scheduling task record in the database.
  • Step 503 Scan the scheduled task record, calculate the task priority according to the task scheduling priority algorithm, and then put the task into the corresponding priority queue.
  • Step 504 selects a task to be executed in the priority queue according to a priority queue element out queue algorithm
  • Step 505 performs the task currently to be executed.
  • the foregoing embodiment may further include:
  • the execution result is returned to the task service interface component module 102.
  • the service interface component module 102 moves the completed task to the task history table for saving. Further, the task scheduling method further includes: when the task is retried, the service interface component should calculate the restart time of the task according to the task rule algorithm.
  • the task scheduling method further includes: for the task that ends and requests the receipt, the service interface component should return the task receipt information to the task invoking end according to the task information.
  • the embodiment of the method is an embodiment corresponding to the above system. All the implementation processes in the above system embodiment are applicable to the embodiment of the method, and the same technical effects can be achieved.
  • the task scheduling service system and method according to the embodiments of the present invention are based on the idea of system layered construction, and the intermediate service layer is responsible for interacting with internal modules to implement scheduling of scheduled tasks.
  • the scheduling of tasks is more intelligent and real-time, and supports multiple deployments of the task scheduling system module; functions such as forbidden call period and start-up delay can be set; The difference in priority task scheduling services.
  • the system configuration is simple and effective, and the operation is convenient; the business application layer processing logic is simplified, and the management is improved.
  • the efficiency of the dispatching service is realized; the WEB interface of parameter configuration is realized, which is convenient for administrators to manage and maintain; the data statistics platform is adopted, and the statistics of system user quantity, performance and stability are more clear and evidence-based.
  • the above embodiments of the present invention not only simplify the processing logic of the service application layer, but also improve the execution efficiency of the task scheduling service, and also enhance the differentiation of external user scheduling services for different priority tasks.

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)
  • Debugging And Monitoring (AREA)

Abstract

A task scheduling service system and method, said task scheduling service system comprising: a task calling end module, configured to initiate task scheduling requests; a service interface component module, configured to create a task in accordance with the task scheduling request, and to create a corresponding scheduling task record in a database; a task scanning component module, configured to scan the scheduling request record, to calculate task priority in accordance with a task scheduling priority algorithm, and to then enter the task into a corresponding priority queue; a task queue component module, configured to select, from the priority queue and in accordance with a priority queue element queue algorithm, a current task to be executed; a task execution module, configured to execute the current task to be executed. The task scheduling service system and method provided in the embodiment of the present invention cause task scheduling to distinguish between priority levels, thus increasing task scheduling service execution efficiency and simultaneously improving the user's differentiated experience in regard to task scheduling services having different priority levels.

Description

一种任务调度服务系统及方法  Task scheduling service system and method
技术领域 Technical field
本发明涉及通信领域, 特别是指一种任务调度服务系统及方法。 背景技术  The present invention relates to the field of communications, and more particularly to a task scheduling service system and method. Background technique
近年来, 电子通信已经普及我们的日常生活。 其中语音信箱的应用也十 分广泛。 目前语音信箱包括新邮件电话通知、客人定时留言、外呼提取传真、 日程提醒等定时任务,这些定时任务有些是由用户指定日期时间的业务操作, 有些是由于用户指定日期时间的业务操作所引起的后续处理, 有些是为实现 某项功能釆用内部任务机制实现。  In recent years, electronic communication has spread our daily lives. The application of voice mail is also very extensive. At present, the voice mailbox includes new mail phone notification, guest timed message, outbound call fetching, schedule reminder and other timed tasks. Some of these timed tasks are business operations specified by the user at the date and time, and some are caused by the user's specified date and time business operations. Subsequent processing, some of which are implemented by internal task mechanisms for implementing a function.
这些定时任务的调用都是基于业务应用层执行内部处理步骤, 增加了业 务应用模块的复杂度, 造成业务应用层与系统内部的数据结构、 数据分布以 及模块间关系的强耦合, 而且由于业务通道不断扩展和变化, 会造成相同功 能的重复开发测试, 降低研发效率, 也 4艮难确保产品质量和性能。 发明内容  The invocation of these timing tasks is based on the internal processing steps of the business application layer, which increases the complexity of the business application module, resulting in strong coupling between the business application layer and the data structure, data distribution and module relationships within the system, and Continuous expansion and change will result in repeated development tests of the same function, reducing R&D efficiency, and making it difficult to ensure product quality and performance. Summary of the invention
本发明要解决的技术问题是提供一种任务调度服务系统及方法。 可以简 化业务应用层的处理逻辑, 提高任务调度服务的执行效率及用户体验。  The technical problem to be solved by the present invention is to provide a task scheduling service system and method. The processing logic of the business application layer can be simplified, and the execution efficiency and user experience of the task scheduling service can be improved.
为解决上述技术问题, 本发明的实施例提供一种任务调度服务系统及方 法, 所述任务调度服务系统包括:  To solve the above technical problem, an embodiment of the present invention provides a task scheduling service system and method, where the task scheduling service system includes:
任务调用端模块, 设置为: 发起任务调度请求;  The task invoking module is set to: initiate a task scheduling request;
服务接口组件模块, 设置为: 根据所述任务调度请求, 创建任务, 并在 数据库中创建对应的调度任务记录;  The service interface component module is configured to: create a task according to the task scheduling request, and create a corresponding scheduling task record in the database;
任务扫描组件模块, 设置为: 对所述调度任务记录进行扫描, 按照任务 调度优先级算法计算任务优先级, 再将任务放入对应的优先级队列中;  The task scanning component module is configured to: scan the scheduled task record, calculate the task priority according to the task scheduling priority algorithm, and then put the task into the corresponding priority queue;
任务队列组件模块, 设置为: 按照优先级队列元素出队列算法在所述优 先级队列中选择当前要执行的任务; 任务执行模块, 设置为: 执行所述当前要执行的任务。 The task queue component module is configured to: select a task to be executed in the priority queue according to a priority queue element dequeue algorithm; The task execution module is set to: execute the current task to be executed.
其中, 所述任务调度服务系统还包括:  The task scheduling service system further includes:
任务统计模块, 设置为: 获取和统计调度周期内的所述任务调用端模块 发起的任务调度请求总数以及所述任务执行模块执行成功的任务数和执行失 败的任务数。  The task statistics module is configured to: obtain and count the total number of task scheduling requests initiated by the task invoking module in the scheduling period, and the number of tasks successfully executed by the task execution module and the number of tasks that fail to execute.
WEB管理模块, 设置为: 配置任务的调度规则、 系统参数, 以及查询当 前任务的处理进度。  The WEB management module is configured to: configure the scheduling rules of the task, system parameters, and query the processing progress of the current task.
其中, 所述服务接口组件模块设置为: 在创建任务时, 应该按照任务调 度算法为任务计算启动时间和分配任务号。  The service interface component module is configured to: when creating a task, calculate a startup time and a task number for the task according to the task scheduling algorithm.
其中, 所述服务接口组件模块还设置为: 接收所述任务执行模块的任务 执行结果报告、 响应所述任务执行模块对执行失败的任务进行任务重试或进 行任务的回执处理。  The service interface component module is further configured to: receive a task execution result report of the task execution module, and respond to the task execution module to perform task retry or perform task return processing on the task that fails to perform.
其中, 所述服务接口组件模块还设置为: 在任务重试时, 按照任务调度 规则计算算法计算任务的重新启动时间。  The service interface component module is further configured to: when the task is retried, calculate a restart time of the task according to the task scheduling rule calculation algorithm.
其中, 所述任务调度规则计算算法, 包括: 创建任务时当前的系统时间 The task scheduling rule calculation algorithm includes: a current system time when the task is created
+最大启动延迟时长 * (大于新任务调度优先级的所有调度优先级的任务数 比例总和) 。 +Maximum startup delay duration * (The sum of the proportions of all scheduling priorities greater than the priority of the new task scheduling priority).
其中, 所述服务接口组件模块设置为: 进行任务回执处理时, 应该根据 任务的信息向任务调用端模块返回任务回执信息。  The service interface component module is configured to: when performing task receipt processing, return the task receipt information to the task invoking module according to the information of the task.
其中, 所述服务接口组件模块还设置为: 将执行结束的任务移动到历史 表中保存。  The service interface component module is further configured to: move the task that ends the execution to the history table for saving.
其中,所述任务扫描组件模块还设置为:在扫描到超时和过期的任务时, 向服务接口组件模块报告任务结果, 使所述服务接口组件模块对超时和过期 的任务进行任务重试或进行任务的回执处理。  The task scanning component module is further configured to: when scanning a timeout and expired task, report the task result to the service interface component module, so that the service interface component module performs a task retry or performs a task for timeout and expired tasks. Receipt processing of tasks.
其中, 所述任务队列组件模块还设置为: 在启动任务发生异常时, 向服 务接口组件模块报告任务结果, 使所述服务接口组件模块对启动异常的任务 进行任务重试或进行任务的回执处理。  The task queue component module is further configured to: when the startup task is abnormal, report the task result to the service interface component module, so that the service interface component module performs task retry or task receipt processing on the task that initiates the abnormality. .
其中, 所述任务调度优先级算法, 包括: 新任务的任务类型对应的系统 级优先级 * 2 +任务优先标志 + 1。 其中, 所述优先级队列元素出队列算法, 包括: 任务队列组件模块按照 各队列的调度优先级逐一从每个任务队列中取出任务处理, 先处理高优先级 队列中的任务, 再处理低优先级队列中的任务, 然后循环。 The task scheduling priority algorithm includes: a system level priority corresponding to a task type of the new task * 2 + a task priority flag + 1. The priority queue element outbound algorithm includes: The task queue component module extracts the task processing from each task queue one by one according to the scheduling priority of each queue, first processes the tasks in the high priority queue, and then processes the low priority. The tasks in the level queue, then loop.
本发明的实施例还提供了一种任务调度方法, 包括:  An embodiment of the present invention further provides a task scheduling method, including:
发起任务调度请求;  Initiating a task scheduling request;
根据所述任务调度请求, 创建任务, 并在数据库中创建对应的调度任务 记录;  Creating a task according to the task scheduling request, and creating a corresponding scheduling task record in the database;
对所述调度任务记录进行扫描, 按照任务调度优先级算法计算任务优先 级, 再将任务放入对应的优先级队列中;  Scanning the scheduled task record, calculating the task priority according to the task scheduling priority algorithm, and then placing the task into the corresponding priority queue;
按照优先级队列元素出队列算法, 在所述优先级队列中选择当前要执行 的任务;  Selecting a task to be executed in the priority queue according to a priority queue element dequeue algorithm;
执行当前要执行的任务。  Perform the task you want to perform now.
其中, 所述任务调度方法还包括: 在任务重试时, 按照任务规则算法计 算任务的重新启动时间。  The task scheduling method further includes: calculating, when the task is retried, a restart time of the task according to the task rule algorithm.
本发明实施例的上述技术方案的有益效果如下:  The beneficial effects of the above technical solutions of the embodiments of the present invention are as follows:
本发明的上述实施例通过任务调用端模块发起任务调度请求; 服务接口 组件模块根据所述任务调度请求, 创建任务, 并在数据库中创建对应的调度 任务记录; 任务扫描组件模块对所述调度任务记录进行扫描, 按照任务调度 优先级算法计算任务优先级, 再将任务放入对应的优先级队列中; 任务队列 组件模块按照优先级队列元素出队列算法在所述优先级队列中选择当前要执 行的任务; 任务执行模块执行所述当前要执行的任务; 既简化了业务应用层 的处理逻辑, 提高了任务调度服务执行效率, 同时还增强了外部用户对不同 优先级任务调度服务的差别化体验。 附图概述  The foregoing embodiment of the present invention initiates a task scheduling request by using a task invoking module; the service interface component module creates a task according to the task scheduling request, and creates a corresponding scheduling task record in the database; the task scanning component module processes the scheduling task The record is scanned, the task priority is calculated according to the task scheduling priority algorithm, and the task is placed in the corresponding priority queue; the task queue component module selects the current execution in the priority queue according to the priority queue element dequeue algorithm. The task execution module executes the task to be executed currently; simplifies the processing logic of the business application layer, improves the execution efficiency of the task scheduling service, and enhances the differentiated experience of external users for different priority task scheduling services. . BRIEF abstract
图 1为本发明实施例所述任务调度服务系统的结构图;  1 is a structural diagram of a task scheduling service system according to an embodiment of the present invention;
图 2、 图 3、 图 4为本发明实施例所述任务调度实现方法的具体流程图; 图 5为本发明实施例所述任务调度方法的流程图。 本发明的较佳实施方式 FIG. 2 is a flowchart of a method for implementing task scheduling according to an embodiment of the present invention; FIG. 5 is a flowchart of a method for scheduling a task according to an embodiment of the present invention. Preferred embodiment of the invention
下面将结合附图及具体实施例进行详细描述。  The detailed description will be made below in conjunction with the accompanying drawings and specific embodiments.
本发明针对现有的定时任务的调用都是基于业务应用层执行内部处理且 效率很低的问题, 提供一种任务调度服务系统及方法。  The call of the present invention for the existing timing tasks is based on the problem that the business application layer performs internal processing and is inefficient, and provides a task scheduling service system and method.
如图 1所示, 本发明的实施例提供一种任务调度服务系统, 包括: 任务调用端模块 101 , 用于发起任务调度请求;  As shown in FIG. 1 , an embodiment of the present invention provides a task scheduling service system, including: a task invoking end module 101, configured to initiate a task scheduling request;
服务接口组件模块 102 , 用于根据所述任务调度请求, 创建任务, 并在 数据库中创建对应的调度任务记录;  The service interface component module 102 is configured to create a task according to the task scheduling request, and create a corresponding scheduling task record in the database;
任务扫描组件模块 103 , 用于对所述调度任务记录进行扫描, 按照任务 调度优先级算法计算任务优先级, 再将任务放入对应的优先级队列中;  The task scanning component module 103 is configured to scan the scheduled task record, calculate a task priority according to a task scheduling priority algorithm, and then put the task into a corresponding priority queue;
任务队列组件模块 104 , 用于按照优先级队列元素出队列算法在所述优 先级队列中选择当前要执行的任务;  The task queue component module 104 is configured to select a task to be executed in the priority queue according to a priority queue element dequeue algorithm;
任务执行模块 105 , 用于执行所述当前要执行的任务。  The task execution module 105 is configured to execute the task to be executed currently.
本发明的上述实施例通过任务调用端模块发起任务调度请求; 服务接口 组件模块根据所述任务调度请求, 创建任务, 并在数据库中创建对应的调度 任务记录; 任务扫描组件模块对所述调度任务记录进行扫描, 按照任务调度 优先级算法计算任务优先级, 再将任务放入对应的优先级队列中; 任务队列 组件模块按照优先级队列元素出队列算法在所述优先级队列中选择当前要执 行的任务; 任务执行模块执行所述当前要执行的任务; 不仅简化了业务应用 层的处理逻辑, 提高了任务调度服务执行效率, 同时还增强了外部用户对不 同优先级任务调度服务的差别化体验。  The foregoing embodiment of the present invention initiates a task scheduling request by using a task invoking module; the service interface component module creates a task according to the task scheduling request, and creates a corresponding scheduling task record in the database; the task scanning component module processes the scheduling task The record is scanned, the task priority is calculated according to the task scheduling priority algorithm, and the task is placed in the corresponding priority queue; the task queue component module selects the current execution in the priority queue according to the priority queue element dequeue algorithm. The task execution module executes the current task to be executed; not only simplifies the processing logic of the business application layer, but also improves the execution efficiency of the task scheduling service, and also enhances the differentiated experience of external users for different priority task scheduling services. .
其中, 再如图 1所示, 本发明的上述任务调度服务系统的实施例还可以 包括:  As shown in FIG. 1 , the embodiment of the task scheduling service system of the present invention may further include:
任务统计模块 106, 用于获取调度周期内的所述任务调用端模块发起的 任务调度请求总数以及所述任务执行模块执行成功的任务数和执行失败的任 务数。  The task statistics module 106 is configured to obtain a total number of task scheduling requests initiated by the task invoking module in the scheduling period, a number of tasks successfully executed by the task execution module, and a number of tasks that fail to execute.
WEB管理模块 107 , 用于配置任务的调度规则、 系统参数以及查询当前 任务的处理进度。 所述服务接口组件模块 102在创建任务时, 具体用于: 按照任务调度算 法为任务计算启动时间和分配任务号。 The WEB management module 107 is configured to configure scheduling rules of the task, system parameters, and query processing progress of the current task. When the task is created, the service interface component module 102 is specifically configured to: calculate a startup time and a task number for the task according to the task scheduling algorithm.
所述服务接口组件模块 102还用于: 接收所述任务执行模块 105的任务 执行结果报告、 响应所述任务执行模块 105对执行失败的任务进行任务重试 或进行任务的回执处理。  The service interface component module 102 is further configured to: receive a task execution result report of the task execution module 105, respond to the task execution module 105, perform task retry on the task that fails to perform, or perform a receipt process of the task.
所述服务接口组件模块 102还用于: 在任务重试时, 按照任务调度规则 计算算法计算任务的重新启动时间。  The service interface component module 102 is further configured to: when the task is retried, calculate a restart time of the task according to the task scheduling rule calculation algorithm.
所述任务调度规则计算算法, 具体是指: 创建任务时当前的系统时间 + 最大启动延迟时长 * (大于新任务调度优先级的所有调度优先级的任务数比 例总和) 。  The task scheduling rule calculation algorithm specifically refers to: the current system time when the task is created + the maximum startup delay duration * (the sum of the task counts of all the scheduling priorities greater than the new task scheduling priority).
所述服务接口组件模块 102进行任务回执处理时, 具体用于: 根据任务 的信息向任务调用端模块 101返回任务回执信息。  When the service interface component module 102 performs the task receipt processing, it is specifically configured to: return the task receipt information to the task invoking end module 101 according to the information of the task.
所述服务接口组件模块 102还用于: 将执行结束的任务移动到历史表中 保存。  The service interface component module 102 is further configured to: move the task that ends the execution to a history table to save.
所述任务扫描组件模块 103还用于: 在扫描到超时和过期的任务时, 向 服务接口组件模块 102报告任务结果, 使所述服务接口组件模块 102对超时 和过期的任务进行任务重试或进行任务的回执处理。  The task scanning component module 103 is further configured to: when scanning a timeout and expired task, report the task result to the service interface component module 102, so that the service interface component module 102 performs a task retry on the timeout and expired tasks or Carry out the receipt processing of the task.
所述任务队列组件模块 104还用于: 在启动任务发生异常时, 向服务接 口组件模块 102报告任务结果, 使所述服务接口组件模块 102对启动异常的 任务进行任务重试或进行任务的回执处理。  The task queue component module 104 is further configured to: when the startup task has an abnormality, report the task result to the service interface component module 102, so that the service interface component module 102 performs a task retry or a task receipt for the task that initiates the abnormality. deal with.
所述任务调度优先级算法, 具体是指: 新任务的任务类型对应的系统级 优先级 * 2 +任务优先标志 + 1。  The task scheduling priority algorithm specifically refers to: a system level priority corresponding to a task type of a new task * 2 + task priority flag + 1.
所述优先级队列元素出队列算法, 具体是指: 任务队列组件模块 104按 照各队列的调度优先级逐一从每个任务队列中取出任务处理, 先处理高优先 级队列中的任务, 在处理低优先级队列中的任务, 然后循环。  The priority queue element dequeue algorithm specifically refers to: the task queue component module 104 extracts the task processing from each task queue one by one according to the scheduling priority of each queue, and first processes the tasks in the high priority queue, and the processing is low. The tasks in the priority queue are then looped.
下面结合图 2 -图 4具体说明上述系统是如何运行实现的。  The following describes how the above system is implemented in conjunction with FIG. 2 to FIG.
如图 2所示,为本发明所述任务调度服务系统的实现方法的具体流程图, 主要有以下步骤:  As shown in FIG. 2, a specific flowchart of the method for implementing the task scheduling service system according to the present invention mainly includes the following steps:
步骤 201 , WEB管理模块 107主要负责配置任务调度规则, 包括任务 的系统级优先级、 禁止调度时间、 重试间隔和最大重试次数等参数; 步骤 202, 任务调用端模块 101向服务接口组件模块 102发送任务调度 请求, 请求消息中需指定当前调度任务的类型、 是否需要将调度结果回执等 字段, 调度任务启动时间字段可选; Step 201: The WEB management module 107 is mainly responsible for configuring task scheduling rules, including tasks. The system-level priority, the forbidden scheduling time, the retry interval, and the maximum number of retries, and the like; Step 202, the task invoking module 101 sends a task scheduling request to the service interface component module 102, and the type of the current scheduling task needs to be specified in the request message. Whether the field of the scheduling result receipt is required, and the scheduling task startup time field is optional;
步骤 203 , 服务接口组件模块 102在接收任务调度请求后, 根据任务调 度规则计算算法计算任务的启动时间, 并在数据库中创建对应的任务调度记 录; 其中, 需要根据统计周期内的各个调度优先级的任务计数器, 计算出各 个调度优先级的任务数占总任务数的比例。  Step 203: After receiving the task scheduling request, the service interface component module 102 calculates the startup time of the task according to the task scheduling rule calculation algorithm, and creates a corresponding task scheduling record in the database; wherein, each scheduling priority in the statistical period is required. The task counter calculates the ratio of the number of tasks for each scheduling priority to the total number of tasks.
步骤 204, 任务扫描组件 103根据任务调度优先级算法查询出满足任务 启动条件的任务, 扫描其任务调度记录, 并将任务调度记录放入对应的任务 优先级队列中; 其中, 例如, 系统级优先级为 3种(0、 1、 2 ) , 每种任务类 型分为普通和紧急 2种优先级(0、 1 ) , 故整个系统的最大调度优先级级别 数为 6, 但考虑到后续可能扩展系统级优先级数, 故任务调度服务可配置其 支持的最大调度系统级优先级个数, 缺省为 6。  Step 204: The task scanning component 103 queries the task that meets the task start condition according to the task scheduling priority algorithm, scans the task scheduling record, and puts the task scheduling record into the corresponding task priority queue; wherein, for example, system level priority The level is 3 (0, 1, 2). Each task type is divided into two types: normal and emergency (0, 1). Therefore, the maximum scheduling priority level of the whole system is 6, but considering the possible extension. The system-level priority number, so the task scheduling service can configure the maximum number of scheduling system-level priorities it supports. The default is 6.
步骤 205 , 任务队列组件模块 104按照优先级队列元素出队列算法, 将 优先级队列中符合要求的任务调出,并发送给任务执行模块 105执行;其中, 任务优先级队列元素出队列算法包括: 任务队列组件按照各队列的调度优先 级数逐一从每个任务队列取出任务处理, 先处理高优先级队列, 再处理低优 先级队列, 然后循环。 每轮循环中按照优先级值 6、 5、 4、 3、 2、 1从对应的 队列中取出元素;  Step 205: The task queue component module 104 calls out the task that meets the requirements in the priority queue according to the queue function of the priority queue element, and sends the task to the task execution module 105. The task priority queue element dequeue algorithm includes: The task queue component takes the task processing from each task queue one by one according to the scheduling priority of each queue, processes the high priority queue first, then processes the low priority queue, and then loops. Each round of the loop takes the elements from the corresponding queue according to the priority values 6, 5, 4, 3, 2, 1;
步骤 206, 任务执行模块 105在接收任务调度执行请求后, 触发智能网 平台进行任务调度, 并将执行结果反馈给服务接口组件模块 102;  Step 206, after receiving the task scheduling execution request, the task execution module 105 triggers the intelligent network platform to perform task scheduling, and feeds the execution result to the service interface component module 102;
步骤 207 , 由服务接口组件模块 102判断调度是否成功, 若成功则进入 步骤 208; 若失败则进入步骤 209;  Step 207, the service interface component module 102 determines whether the scheduling is successful, if successful, proceeds to step 208; if it fails, proceeds to step 209;
步骤 208, 由服务接口组件模块 102判断任务调度请求是否需要回执, 若需要回执,则进入步骤 210;若不需要则进入步骤 214,本次任务调度结束, 服务接口组件模块 102将调度任务导入到任务历史表中;  Step 208, the service interface component module 102 determines whether the task scheduling request requires a receipt. If the receipt is required, the process proceeds to step 210; if not, the process proceeds to step 214, and the current task scheduling ends, and the service interface component module 102 imports the scheduled task. In the task history table;
步骤 209, 由服务接口组件模块 102判断调度任务的重试次数是否已超 过最大重试次数, 若超过则回到步骤 208; 若不超过则进入步骤 212 , 由服务 接口组件模块 102计算任务重试启动时间, 供任务扫描组件模块 103扫描; 步骤 210,由服务接口组件模块 102判断回执执行结果给任务调用端 101 是否成功, 若成功则进入步骤 214, 本次任务调度结束, 服务接口组件模块Step 209, the service interface component module 102 determines whether the number of retries of the scheduled task has exceeded the maximum number of retries, if yes, returns to step 208; if not, proceeds to step 212, by the service The interface component module 102 calculates the task retry start time for the task scan component module 103 to scan; Step 210, the service interface component module 102 determines whether the receipt execution result is successful to the task call end 101, and if successful, proceeds to step 214, the task Scheduling end, service interface component module
102将调度任务导入到任务历史表中; 若不成功则进入步骤 213 , 由服务接口 组件模块 102计算任务重试回执时间, 供任务扫描组件模块 103扫描。 102, the scheduling task is imported into the task history table; if not, the process proceeds to step 213, where the task retry receipt time is calculated by the service interface component module 102 for scanning by the task scanning component module 103.
如图 3所示, 向服务接口组件模块 102请求调度的任务在创建和执行的 过程中, 可以分为任务执行和任务回执两个阶段:  As shown in FIG. 3, tasks that request scheduling from the service interface component module 102 can be divided into two phases: task execution and task receipt during the creation and execution process:
首先是服务接口组件模块 102在任务表里创建任务, 任务创建之后需要 等待执行;  The first is that the service interface component module 102 creates a task in the task table, and needs to wait for execution after the task is created;
在等待执行的过程中会出现三种情况:  There are three situations that occur while waiting for execution:
调度启动成功则由任务执行模块 105执行任务;  When the scheduling is started successfully, the task execution module 105 executes the task;
由任务调用端 101主动取消任务;  The task call end 101 actively cancels the task;
等待执行且超时;  Waiting for execution and timeout;
在执行任务阶段通常会有三种结果:  There are usually three outcomes during the execution of the task phase:
执行成功, 任务执行模块 105返回任务执行成功;  If the execution is successful, the task execution module 105 returns that the task execution is successful;
执行失败, 可分为: 任务执行模块 105返回任务执行失败; 任务队列组 件模块 104返回任务启动失败; 等待状态的任务超时;  The execution fails, and can be divided into: the task execution module 105 returns the task execution failure; the task queue component module 104 returns the task startup failure; the task in the waiting state times out;
正在执行超时;  Executing timeout;
任务表中的任务都需要回执, 在任务回执阶段通常会有四种情况: 等待回执, 回执失败但可重试;  Tasks in the task table require a receipt. There are usually four situations in the task receipt phase: Waiting for a receipt, the receipt fails but can be retried;
回执成功;  Successful receipt
回执失败,回执失败且不可重试,或者回执失败且已超过最大重试次数; 回执超时, 等待回执超时;  The receipt failed, the receipt failed and cannot be retried, or the receipt failed and the maximum number of retries has been exceeded; the receipt timed out, waiting for the receipt to time out;
如图 4所示, 根据任务统计模块 106获取调度周期内的各个调度优先级 的任务计数器, 计算出各个调度优先级的任务数占总任务数的比例。 为避免 某个调度优先级不存在任务却占用延迟时间片, 因此本算法釆用根据每个调 度优先级的任务数占所有调度优先级的任务总数比例, 来计算每个调度优先 级的任务启动时间。  As shown in FIG. 4, the task statistics module 106 obtains the task counters of the respective scheduling priorities in the scheduling period, and calculates the proportion of the tasks of the respective scheduling priorities to the total number of tasks. In order to avoid the delay of a certain scheduling priority task, the algorithm uses the proportion of the total number of tasks according to each scheduling priority to the total number of tasks of all scheduling priorities to calculate the task start of each scheduling priority. time.
如图 5所示, 本发明的实施例还提供一种任务调度方法, 包括: 步骤 501 , 发起任务调度请求; As shown in FIG. 5, an embodiment of the present invention further provides a task scheduling method, including: Step 501: Initiate a task scheduling request.
步骤 502 , 根据所述任务调度请求, 创建任务, 并在数据库中创建对应 的调度任务记录;  Step 502: Create a task according to the task scheduling request, and create a corresponding scheduling task record in the database.
步骤 503 , 对所述调度任务记录进行扫描, 按照任务调度优先级算法计 算任务优先级, 再将任务放入对应的优先级队列中;  Step 503: Scan the scheduled task record, calculate the task priority according to the task scheduling priority algorithm, and then put the task into the corresponding priority queue.
步骤 504按照优先级队列元素出队列算法, 在所述优先级队列中选择当 前要执行的任务;  Step 504 selects a task to be executed in the priority queue according to a priority queue element out queue algorithm;
步骤 505执行当前要执行的任务。  Step 505 performs the task currently to be executed.
进一步的, 上述实施例还可以进一步包括:  Further, the foregoing embodiment may further include:
步骤 506任务执行成功后 ,将执行结果回执给任务服务接口组件模块 102; 步骤 507服务接口组件模块 102将结束的任务移动到任务历史表中保存。 进一步地, 所述任务调度方法, 还包括: 在任务重试时, 服务接口组件 应按照任务规则算法计算任务的重新启动时间。  After the task 506 is successfully executed, the execution result is returned to the task service interface component module 102. Step 507 The service interface component module 102 moves the completed task to the task history table for saving. Further, the task scheduling method further includes: when the task is retried, the service interface component should calculate the restart time of the task according to the task rule algorithm.
进一步地, 所述任务调度方法, 还包括: 对于结束且要求回执的任务, 服务接口组件应根据任务信息向任务调用端返回任务回执信息。  Further, the task scheduling method further includes: for the task that ends and requests the receipt, the service interface component should return the task receipt information to the task invoking end according to the task information.
该方法的实施例是与上述系统对应的实施例, 上述系统实施例中所有实 现流程均适用于该方法的实施例, 也能达到相同的技术效果。  The embodiment of the method is an embodiment corresponding to the above system. All the implementation processes in the above system embodiment are applicable to the embodiment of the method, and the same technical effects can be achieved.
以上所述是本发明的优选实施方式, 应当指出, 对于本技术领域的普通 技术人员来说, 在不脱离本发明所述原理的前提下, 还可以作出若干改进和 润饰, 这些改进和润饰也应视为本发明的保护范围。  The above is a preferred embodiment of the present invention, and it should be noted that those skilled in the art can also make several improvements and retouchings without departing from the principles of the present invention. It should be considered as the scope of protection of the present invention.
工业实用性 Industrial applicability
本发明实施例所述的任务调度服务系统及方法是基于系统分层构建的思 想, 由中间服务层负责与内部模块交互实现定时任务的调度。 具体来讲, 第 一, 对于外部用户而言, 任务的调度更加智能实时, 而且支持任务调度系统 模块的多个部署; 可以设置禁呼时段、 启呼延迟等功能; 还能使用户体验到 不同优先级任务调度服务的差异性。 第二, 对于厂商和内部工程部署维护而 言, 系统的配置简单有效, 操作方便; 简化业务应用层处理逻辑, 提高了任 务调度服务执行效率; 实现参数配置的 WEB界面化, 方便管理员的管理维 护;釆用数据统计平台,对系统用户量、性能和稳定性的统计更加清晰有据。 本发明的上述实施例不仅简化了业务应用层的处理逻辑, 提高了任务调度服 务执行效率, 同时还增强了外部用户对不同优先级任务调度服务的差别化体 The task scheduling service system and method according to the embodiments of the present invention are based on the idea of system layered construction, and the intermediate service layer is responsible for interacting with internal modules to implement scheduling of scheduled tasks. Specifically, first, for external users, the scheduling of tasks is more intelligent and real-time, and supports multiple deployments of the task scheduling system module; functions such as forbidden call period and start-up delay can be set; The difference in priority task scheduling services. Second, for vendor and internal engineering deployment and maintenance, the system configuration is simple and effective, and the operation is convenient; the business application layer processing logic is simplified, and the management is improved. The efficiency of the dispatching service is realized; the WEB interface of parameter configuration is realized, which is convenient for administrators to manage and maintain; the data statistics platform is adopted, and the statistics of system user quantity, performance and stability are more clear and evidence-based. The above embodiments of the present invention not only simplify the processing logic of the service application layer, but also improve the execution efficiency of the task scheduling service, and also enhance the differentiation of external user scheduling services for different priority tasks.

Claims

权 利 要 求 书 Claim
1. 一种任务调度服务系统, 包括:  1. A task scheduling service system, comprising:
任务调用端模块, 设置为: 发起任务调度请求;  The task invoking module is set to: initiate a task scheduling request;
服务接口组件模块, 设置为: 根据所述任务调度请求, 创建任务, 并在 数据库中创建对应的调度任务记录;  The service interface component module is configured to: create a task according to the task scheduling request, and create a corresponding scheduling task record in the database;
任务扫描组件模块, 设置为: 对所述调度任务记录进行扫描, 按照任务 调度优先级算法计算任务优先级, 再将任务放入对应的优先级队列中; 任务队列组件模块, 设置为: 按照优先级队列元素出队列算法在所述优 先级队列中选择当前要执行的任务;  The task scanning component module is configured to: scan the scheduled task record, calculate the task priority according to the task scheduling priority algorithm, and then put the task into the corresponding priority queue; the task queue component module is set to: according to the priority The level queue element dequeue algorithm selects a task to be executed in the priority queue;
任务执行模块, 设置为: 执行所述当前要执行的任务。  The task execution module is set to: execute the current task to be executed.
2. 根据权利要求 1所述的任务调度服务系统, 其中, 还包括: 任务统计模块, 设置为: 获取调度周期内的所述任务调用端模块发起的 任务调度请求总数以及所述任务执行模块执行成功的任务数和执行失败的任 务数。  The task scheduling service system according to claim 1, further comprising: a task statistics module, configured to: obtain a total number of task scheduling requests initiated by the task invoking module in the scheduling period, and execute the task execution module The number of successful tasks and the number of tasks that failed to execute.
3. 根据权利要求 1所述的任务调度服务系统, 其中, 还包括:  3. The task scheduling service system according to claim 1, further comprising:
WEB管理模块,设置为: 配置任务的调度规则、 系统参数以及查询当前 任务的处理进度。  The WEB management module is configured to: configure the scheduling rules of the task, system parameters, and query the processing progress of the current task.
4. 根据权利要求 1所述的任务调度服务系统, 其中, 所述服务接口组件 模块设置为: 在创建任务时, 按照任务调度算法为任务计算启动时间和分配 任务号。  The task scheduling service system according to claim 1, wherein the service interface component module is configured to: when creating a task, calculate a startup time and an assignment task number for the task according to the task scheduling algorithm.
5. 根据权利要求 1所述的任务调度服务系统, 其中, 所述服务接口组件 模块还设置为: 接收所述任务执行模块的任务执行结果报告、 响应所述任务 执行模块对执行失败的任务进行任务重试或进行任务的回执处理。  The task scheduling service system according to claim 1, wherein the service interface component module is further configured to: receive a task execution result report of the task execution module, and respond to the task execution module to perform a task that fails to execute The task is retried or the receipt processing of the task is performed.
6. 根据权利要求 5所述的任务调度服务系统, 其中, 所述服务接口组件 模块还设置为: 在任务重试时, 按照任务调度规则计算算法计算任务的重新 启动时间。  The task scheduling service system according to claim 5, wherein the service interface component module is further configured to: when the task is retried, calculate a restart time of the task according to the task scheduling rule calculation algorithm.
7. 根据权利要求 6所述的任务调度服务系统, 其中, 所述任务调度规则 计算算法, 包括: 创建任务时当前的系统时间 +最大启动延迟时长 * (大于新任务调度优 先级的所有调度优先级的任务数比例总和) 。 The task scheduling service system according to claim 6, wherein the task scheduling rule calculation algorithm comprises: Current system time + maximum startup delay duration when creating a task * (sum of the number of tasks greater than all scheduling priorities for the new task scheduling priority).
8. 根据权利要求 5所述的任务调度服务系统, 其中, 所述服务接口组件 模块设置为: 进行任务回执处理时, 根据任务的信息向任务调用端模块返回 任务回执信息。  The task scheduling service system according to claim 5, wherein the service interface component module is configured to: when performing task receipt processing, return task receipt information to the task invoking module according to the information of the task.
9. 根据权利要求 1所述的任务调度服务系统, 其中, 所述服务接口组件 模块还设置为: 将执行结束的任务移动到历史表中保存。  9. The task scheduling service system according to claim 1, wherein the service interface component module is further configured to: move the task that ends execution to a history table for saving.
10. 根据权利要求 1所述的任务调度服务系统, 其中, 所述任务扫描组 件模块还设置为: 在扫描到超时和过期的任务时, 向服务接口组件模块报告 任务结果, 使所述服务接口组件模块对超时和过期的任务进行任务重试或进 行任务的回执处理。  10. The task scheduling service system according to claim 1, wherein the task scanning component module is further configured to: report a task result to a service interface component module when scanning a timeout and expired task, to enable the service interface The component module performs task retry or timeout processing of tasks for timed out and expired tasks.
11. 根据权利要求 1所述的任务调度服务系统, 其中, 所述任务队列组 件模块还设置为: 在启动任务发生异常时, 向服务接口组件模块报告任务结 果, 使所述服务接口组件模块对启动异常的任务进行任务重试或进行任务的 回执处理。  The task scheduling service module according to claim 1, wherein the task queue component module is further configured to: when an abnormality occurs in the startup task, report the task result to the service interface component module, so that the service interface component module Start an abnormal task to perform a task retry or to perform a receipt processing of the task.
12. 根据权利要求 1所述的任务调度服务系统, 其中, 所述任务调度优 先级算法, 包括:  The task scheduling service system according to claim 1, wherein the task scheduling priority algorithm comprises:
新任务的任务类型对应的系统级优先级 * 2 +任务优先标志 + 1。  The system level priority corresponding to the task type of the new task * 2 + task priority flag + 1.
13. 根据权利要求 1所述的任务调度服务系统, 其中, 所述优先级队列 元素出队列算法, 包括:  The task scheduling service system according to claim 1, wherein the priority queue element dequeue algorithm comprises:
任务队列组件模块按照各队列的调度优先级逐一从每个任务队列中取出 任务处理, 先处理高优先级队列中的任务, 再处理低优先级队列中的任务, 然后循环。  The task queue component module takes the task processing from each task queue one by one according to the scheduling priority of each queue, processes the tasks in the high priority queue first, processes the tasks in the low priority queue, and then loops.
14. 一种任务调度方法, 包括:  14. A task scheduling method, comprising:
发起任务调度请求;  Initiating a task scheduling request;
根据所述任务调度请求, 创建任务, 并在数据库中创建对应的调度任务 记录;  Creating a task according to the task scheduling request, and creating a corresponding scheduling task record in the database;
对所述调度任务记录进行扫描, 按照任务调度优先级算法计算任务优先 级, 再将任务放入对应的优先级队列中; 按照优先级队列元素出队列算法, 在所述优先级队列中选择当前要执行 的任务; Scanning the scheduled task record, calculating the task priority according to the task scheduling priority algorithm, and then placing the task into the corresponding priority queue; Selecting a task to be executed in the priority queue according to a priority queue element dequeue algorithm;
执行当前要执行的任务。  Perform the task you want to perform now.
15. 根据权利要求 14所述的任务调度方法, 其中, 还包括:  The task scheduling method according to claim 14, further comprising:
在任务重试时, 按照任务规则算法计算任务的重新启动时间。  When the task is retried, the task restart time is calculated according to the task rule algorithm.
PCT/CN2014/077702 2013-08-07 2014-05-16 Task scheduling service system and method WO2014173339A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310342752.1 2013-08-07
CN201310342752.1A CN104346215A (en) 2013-08-07 2013-08-07 Task scheduling service system and method

Publications (1)

Publication Number Publication Date
WO2014173339A1 true WO2014173339A1 (en) 2014-10-30

Family

ID=51791069

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/077702 WO2014173339A1 (en) 2013-08-07 2014-05-16 Task scheduling service system and method

Country Status (2)

Country Link
CN (1) CN104346215A (en)
WO (1) WO2014173339A1 (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106648845A (en) * 2016-09-23 2017-05-10 努比亚技术有限公司 Distributed type task scheduling system and method
CN110309024A (en) * 2019-04-23 2019-10-08 网宿科技股份有限公司 Data processing system and its method for executing data processing task
CN110895488A (en) * 2018-09-12 2020-03-20 北京奇虎科技有限公司 Task scheduling method and device
CN111240823A (en) * 2020-01-16 2020-06-05 青岛农业大学 Remote collaborative computing application management scheduling algorithm
CN111352728A (en) * 2019-08-28 2020-06-30 北京大学(天津滨海)新一代信息技术研究院 Self-adaptive scheduling method of data service cluster
CN112667375A (en) * 2020-12-22 2021-04-16 杭州东信北邮信息技术有限公司 Task scheduling method and system based on big data service
CN112764902A (en) * 2021-01-21 2021-05-07 上海明略人工智能(集团)有限公司 Task scheduling method and system
CN116109423A (en) * 2023-04-11 2023-05-12 山东小数点信息技术有限公司 Social insurance batch reporting system and method

Families Citing this family (25)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104794077A (en) * 2015-04-07 2015-07-22 无锡天脉聚源传媒科技有限公司 Link list storage method and system
CN106295927B (en) * 2015-05-21 2022-07-05 北京京东尚科信息技术有限公司 Method and device for allocating tasks to operator
CN104915256B (en) * 2015-06-05 2019-03-26 惠州Tcl移动通信有限公司 A kind of the Real-Time Scheduling implementation method and its system of task
CN106547635B (en) * 2015-09-18 2020-10-09 阿里巴巴集团控股有限公司 Operation retry method and device for operation
CN106557359B (en) * 2015-09-30 2021-02-05 腾讯科技(深圳)有限公司 Task scheduling method and system
CN106598705B (en) * 2015-10-15 2020-08-11 菜鸟智能物流控股有限公司 Asynchronous task scheduling method, device and system and electronic equipment
CN106570585B (en) * 2016-05-25 2019-10-18 清华大学 A kind of method for scheduling task and energy management apparatus towards self-power supply system
CN106407021A (en) * 2016-07-01 2017-02-15 厦门易名科技股份有限公司 Queue-based business request processing method
CN107688489B (en) * 2016-08-03 2021-01-26 北京京东尚科信息技术有限公司 Method and system for scheduling tasks
CN106790642A (en) * 2017-01-10 2017-05-31 深圳淞鑫金融服务科技发展有限公司 The dispatching method and device of big data acquisition tasks
CN108804209A (en) * 2017-05-05 2018-11-13 中思博安科技(北京)有限公司 The dispatching method and device of intelligent contract
CN109144683A (en) * 2017-06-28 2019-01-04 北京京东尚科信息技术有限公司 Task processing method, device, system and electronic equipment
CN109388482A (en) * 2017-08-11 2019-02-26 中兴通讯股份有限公司 Dispatching method, device and the storage medium of task
CN107423918A (en) * 2017-08-16 2017-12-01 广州环球梦电子商务股份有限公司 One kind is borrowed and sells platform commodity method for scheduling task and system
CN108255589A (en) * 2017-08-29 2018-07-06 平安科技(深圳)有限公司 Method for scheduling task and server
CN107704323A (en) * 2017-11-07 2018-02-16 广州探迹科技有限公司 A kind of web crawlers method for scheduling task and device
CN109358956B (en) * 2018-09-30 2021-03-16 上海保险交易所股份有限公司 Service calling method
CN109669735B (en) * 2018-12-07 2022-02-22 武汉斗鱼鱼乐网络科技有限公司 Application starting method and device based on delayed registration and storage medium
CN109783211A (en) * 2018-12-14 2019-05-21 成都四方伟业软件股份有限公司 A kind of batch task scheduling system and dispatching method based on business diary
CN110109764A (en) * 2019-05-15 2019-08-09 重庆天蓬网络有限公司 Delayed tasks creation method, device, medium and electronic equipment
CN110362362A (en) * 2019-07-24 2019-10-22 北京明略软件系统有限公司 Method for scheduling task and device, storage medium, electronic device
CN112130972A (en) * 2020-08-24 2020-12-25 北京思特奇信息技术股份有限公司 Task processing method and system
CN112988428A (en) * 2021-04-26 2021-06-18 南京蜂泰互联网科技有限公司 Distributed message asynchronous notification middleware implementation method and system
CN113656157B (en) * 2021-08-10 2024-04-23 北京锐安科技有限公司 Distributed task scheduling method and device, storage medium and electronic equipment
CN114625520B (en) * 2022-05-16 2022-08-30 中博信息技术研究院有限公司 Distributed task scheduling gateway scheduling method based on current limiting

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1536335A2 (en) * 2003-10-30 2005-06-01 Alcatel Intelligent scheduler for multi-level exhaustive scheduling of tasks
CN101510164A (en) * 2009-03-25 2009-08-19 北京中星微电子有限公司 Multi-service scheduling method, apparatus and system
CN101770402A (en) * 2008-12-29 2010-07-07 中国移动通信集团公司 Map task scheduling method, equipment and system in MapReduce system
CN102096599A (en) * 2009-12-14 2011-06-15 中国移动通信集团公司 Multi-queue task scheduling method and related system and equipment

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100509794B1 (en) * 2005-03-09 2005-08-23 주식회사 퓨전소프트 Method of scheduling jobs using database management system for real-time processing
CN102196157B (en) * 2010-03-02 2015-09-23 新奥特(北京)视频技术有限公司 A kind of delivery system of station synchronization
CN102567106B (en) * 2010-12-30 2014-10-01 中国移动通信集团云南有限公司 Task scheduling method, system and device
CN102122302B (en) * 2011-03-11 2013-03-13 北京神舟航天软件技术有限公司 Centralized processing system and method for documents
CN103177035A (en) * 2011-12-26 2013-06-26 中国银联股份有限公司 Data query device and data query method in data base
CN102880503B (en) * 2012-08-24 2015-04-15 新浪网技术(中国)有限公司 Data analysis system and data analysis method
CN103197969B (en) * 2013-03-27 2017-02-08 百度在线网络技术(北京)有限公司 Distributed timed task control device and method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1536335A2 (en) * 2003-10-30 2005-06-01 Alcatel Intelligent scheduler for multi-level exhaustive scheduling of tasks
CN101770402A (en) * 2008-12-29 2010-07-07 中国移动通信集团公司 Map task scheduling method, equipment and system in MapReduce system
CN101510164A (en) * 2009-03-25 2009-08-19 北京中星微电子有限公司 Multi-service scheduling method, apparatus and system
CN102096599A (en) * 2009-12-14 2011-06-15 中国移动通信集团公司 Multi-queue task scheduling method and related system and equipment

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106648845A (en) * 2016-09-23 2017-05-10 努比亚技术有限公司 Distributed type task scheduling system and method
CN110895488A (en) * 2018-09-12 2020-03-20 北京奇虎科技有限公司 Task scheduling method and device
CN110895488B (en) * 2018-09-12 2023-10-20 三六零科技集团有限公司 Task scheduling method and device
CN110309024B (en) * 2019-04-23 2023-07-18 网宿科技股份有限公司 Data processing system and method for executing data processing task
CN110309024A (en) * 2019-04-23 2019-10-08 网宿科技股份有限公司 Data processing system and its method for executing data processing task
CN111352728A (en) * 2019-08-28 2020-06-30 北京大学(天津滨海)新一代信息技术研究院 Self-adaptive scheduling method of data service cluster
CN111352728B (en) * 2019-08-28 2023-10-03 北京大学(天津滨海)新一代信息技术研究院 Self-adaptive scheduling method of data service cluster
CN111240823A (en) * 2020-01-16 2020-06-05 青岛农业大学 Remote collaborative computing application management scheduling algorithm
CN112667375A (en) * 2020-12-22 2021-04-16 杭州东信北邮信息技术有限公司 Task scheduling method and system based on big data service
CN112764902A (en) * 2021-01-21 2021-05-07 上海明略人工智能(集团)有限公司 Task scheduling method and system
CN112764902B (en) * 2021-01-21 2024-03-29 上海明略人工智能(集团)有限公司 Task scheduling method and system
CN116109423A (en) * 2023-04-11 2023-05-12 山东小数点信息技术有限公司 Social insurance batch reporting system and method
CN116109423B (en) * 2023-04-11 2024-04-12 山东小数点信息技术有限公司 Social insurance batch reporting system and method

Also Published As

Publication number Publication date
CN104346215A (en) 2015-02-11

Similar Documents

Publication Publication Date Title
WO2014173339A1 (en) Task scheduling service system and method
CN106293950B (en) A kind of resource optimization management method towards group system
CN106293919A (en) The built-in tasks dispatching device of a kind of Time Triggered and method
CN103458131B (en) It attends a banquet login, the method for scheduling and center of attending a banquet
CN101102360B (en) A method for automatic form return
CN103164273A (en) Method for changing synchronous service call to asynchronous parallel call with self-expanding choking algorithm
WO2012037760A1 (en) Method, server and system for improving alarm processing efficiency
CN107491346A (en) A kind of task processing method of application, apparatus and system
CN104954411A (en) Method for sharing network resource by distributed system, terminal thereof and system thereof
CN106502767A (en) A kind of process management method and its device
US8296766B2 (en) Start-up task dispatching for instant messenger applications
CN111427670A (en) Task scheduling method and system
WO2012152035A1 (en) Method and mobile terminal for handling concurrent services
CN102023899B (en) Multithreaded data synchronization method and device
CN102402461A (en) Balanced scheduling method based on operation scale
CN111429033A (en) Workflow task scheduling system and method and service terminal
CN113535362A (en) Distributed scheduling system architecture and micro-service workflow scheduling method
CN112667383A (en) Task execution and scheduling method, system, device, computing equipment and medium
WO2014173366A2 (en) Method, device and system for carrying out telecommunication capability group sending
WO2016149945A1 (en) Life cycle event processing method and vnfm
CN100525211C (en) Method and system for implementing integral dispatching in network element management system
CN102573073B (en) Resource allocation method and system for physical layer of terminal
CN105320563A (en) Process scheduling and optimization method
WO2012174838A1 (en) Method and system of parallel transmitting network element messages
CN110377411B (en) Distributed cloud-oriented workflow task scheduling method and system

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: 14788655

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14788655

Country of ref document: EP

Kind code of ref document: A1