Search

CN-114443244-B - Task execution method, device and equipment

CN114443244BCN 114443244 BCN114443244 BCN 114443244BCN-114443244-B

Abstract

The application discloses a task execution method, device and equipment, which comprise the steps of obtaining tasks to be executed, dividing the tasks to be executed into items of task groups corresponding to first priorities, determining task margins of the tasks to be executed corresponding to the items of the task groups respectively, reordering the tasks to be executed corresponding to the items according to the task margins to obtain reordered task queues corresponding to the task groups, wherein the task margins represent the execution emergency degree of the tasks to be executed, polling the task groups in a priority polling mode to determine the tasks to be executed from the reordered task queues, and executing the tasks to be executed by using a work engine. The application solves the problem that the task is firstly served and the execution low delay is ignored, and improves the task execution and work engine scheduling efficiency.

Inventors

  • ZHANG HUILIN
  • WANG MINGMING
  • MA HENG
  • WU RUIZHEN

Assignees

  • 山东云海国创云计算装备产业创新中心有限公司
  • 山东云海国创云计算装备产业创新中心有限公司

Dates

Publication Date
20260421
Application Date
20211228
Priority Date
20211228

Claims (8)

  1. 1. A method of performing a task, comprising: Acquiring tasks to be executed, and dividing the tasks to be executed into items of task groups corresponding to first priorities, wherein each task group has a unique corresponding first priority; Determining the expected completion time and the latest completion time of the tasks to be executed corresponding to each project respectively, determining the difference value between the expected completion time and the latest completion time as the task margin of the tasks to be executed, and reordering the tasks to be executed corresponding to the projects according to the task margin to obtain reordered task queues corresponding to the task groups, wherein the task margin represents the execution emergency degree of the tasks to be executed; Polling the task group in a priority polling mode to determine the task to be executed from the corresponding reordered task queue, and executing the task to be executed by using a working engine; after the task to be executed is executed by the working engine, the method further comprises the following steps: and determining the completion time after the execution of the task to be executed is completed, and correcting the expected completion time based on the completion time and the arrival time of the task to be executed reaching the project after the task to be executed is divided, wherein the correction mode is that the average value of the actual completion time and the expected completion time is used as the expected completion time of the next task execution.
  2. 2. The task execution method according to claim 1, wherein the acquiring the task to be executed includes: And after the task to be executed is input through a task bus interface and flows through a task buffer zone, parity check is carried out on the task to be executed, and if the parity check is passed, the effective task to be executed is obtained.
  3. 3. The task execution method according to claim 2, characterized by further comprising: And judging whether the available buffer memory of the task buffer area is smaller than a preset threshold value, and if so, triggering to generate an interrupt early warning signal so as to perform interrupt early warning on the condition that the buffer memory of the task buffer area is full.
  4. 4. The task execution method according to claim 1, wherein reordering the tasks to be executed corresponding to the items according to the task margin to obtain reordered task queues corresponding to the task groups includes: And sequencing the task margin by using a four-level sequencing network, and sequentially writing the corresponding tasks to be executed into a queue according to the sequence of the sequenced task margin to obtain the reordered task queue corresponding to the task group.
  5. 5. The task execution method according to claim 1, wherein the polling the task group by a priority polling method to determine the task to be executed from the corresponding reordered task queue includes: Polling the task group according to the first priority order of the task group; and allocating a second priority to the tasks to be executed in the reordered task queues, and determining the tasks to be executed from the corresponding reordered task queues according to the second priority order of the tasks to be executed.
  6. 6. The task execution method according to any one of claims 1 to 5, wherein the first priority corresponding to the task group is QOS priority; Correspondingly, the method further comprises the steps of: And dividing the task group and the QOS priority corresponding to the task group according to the QOS indication or the task type corresponding to the task transmitted by the bus task interface.
  7. 7. A task execution device, characterized by comprising: The system comprises an acquisition and division module, a first priority generation module and a second priority generation module, wherein the acquisition and division module is used for acquiring a task to be executed and dividing the task to be executed into items of task groups corresponding to the first priority; the system comprises a determining and sorting module, a sorting module and a processing module, wherein the determining and sorting module is used for respectively determining expected completion time and latest completion time of the tasks to be executed corresponding to each project, determining a difference value between the expected completion time and the latest completion time as a task margin of the tasks to be executed, and reordering the tasks to be executed corresponding to the projects according to the task margin to obtain a reordered task queue corresponding to the task group, wherein the task margin represents execution emergency degree of the tasks to be executed; The polling execution module is used for polling the task group in a priority polling mode to determine the task to be executed from the corresponding reordered task queue, executing the task to be executed by utilizing a work engine, determining the completion time of the task to be executed after the task to be executed is executed by utilizing the work engine, and correcting the expected completion time based on the completion time and the arrival time of the task to be executed reaching the project after the task to be executed is divided, wherein the correction mode is that the average value of the actual completion time and the expected completion time is used as the expected completion time of next task execution.
  8. 8. An electronic device comprising a processor and a memory, wherein the memory is configured to store a computer program that is loaded and executed by the processor to implement the task execution method of any one of claims 1 to 6.

Description

Task execution method, device and equipment Technical Field The present invention relates to the field of data processing technologies, and in particular, to a method, an apparatus, a device, and a storage medium for executing a task. Background Big data presents a major challenge for data processing capacity, dynamic scheduling, and bandwidth. The cooperation of multiple work engines is a common processing mode. The common multi-engine cooperative work processing mode is to allocate a work queue for each engine, and tasks are executed in the corresponding engine in a first come first serve mode, but the situation that a task with strict requirement on the execution delay is called a short job and later a task with relatively loose execution delay is called a long job is encountered in the work mode, because the work queue can only obtain service after the long job service is completed according to the first come first serve execution strategy, and the waiting time which can be tolerated by the short job is exceeded at the moment, the system performance is reduced or the functionality is wrong is caused. Therefore, how to improve task execution efficiency in multi-engine collaborative work is a technical problem to be solved by those skilled in the art. Disclosure of Invention Accordingly, the present invention is directed to a method, apparatus, device and storage medium for task execution, which can solve the problem of low latency of task execution which is first served and omitted, and improve task execution and work engine scheduling efficiency. The specific scheme is as follows: the first aspect of the present application provides a task execution method, including: Acquiring tasks to be executed, and dividing the tasks to be executed into items of task groups corresponding to first priorities, wherein each task group has a unique corresponding first priority; Determining task margins of the tasks to be executed corresponding to the items of the task group respectively, and reordering the tasks to be executed corresponding to the items according to the task margins to obtain reordered task queues corresponding to the task group, wherein the task margins represent execution urgency of the tasks to be executed; and polling the task group in a priority polling mode to determine the task to be executed from the corresponding reordered task queue, and executing the task to be executed by using a working engine. Optionally, the acquiring the task to be executed includes: And after the task to be executed is input through a task bus interface and flows through a task buffer zone, parity check is carried out on the task to be executed, and if the parity check is passed, the effective task to be executed is obtained. Optionally, the task execution method further includes: And judging whether the available buffer memory of the task buffer area is smaller than a preset threshold value, and if so, triggering to generate an interrupt early warning signal so as to perform interrupt early warning on the condition that the buffer memory of the task buffer area is full. Optionally, the determining task margins of the tasks to be executed corresponding to the respective items of the task group includes: And respectively determining the expected completion time and the latest completion time of the task to be executed corresponding to each item, and determining the difference value of the expected completion time and the latest completion time as the task margin of the task to be executed. Optionally, after the task to be executed is executed by using the working engine, the method further includes: And determining the completion time after the execution of the task to be executed is completed, and correcting the expected completion time based on the completion time and the arrival time of the task to be executed reaching the project after being divided. Optionally, the reordering the tasks to be executed corresponding to the items according to the task margin to obtain reordered task queues corresponding to the task groups includes: And sequencing the task margin by using a four-level sequencing network, and sequentially writing the corresponding tasks to be executed into a queue according to the sequence of the sequenced task margin to obtain the reordered task queue corresponding to the task group. Optionally, the polling the task group by a priority polling manner to determine the task to be executed from the corresponding reordered task queue includes: Polling the task group according to the first priority order of the task group; and allocating a second priority to the tasks to be executed in the reordered task queues, and determining the tasks to be executed from the corresponding reordered task queues according to the second priority order of the tasks to be executed. Optionally, the first priority corresponding to the task group is QOS priority; Correspondingly, the method further comprises the steps of: And di