Task execution method and device, computer readable storage medium and electronic device

By obtaining and comparing task execution information and reassigning executors, the problem of inconsistent subtask execution times in the big data platform is solved, task execution efficiency and resource utilization are improved, and task completion time is shortened.

CN113806034BActive Publication Date: 2024-09-20BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110011919.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-01-06
Publication Date
2024-09-20
Estimated Expiration
2041-01-06

AI Technical Summary

Technical Problem

In task scheduling of big data platforms, subtask execution times are inconsistent due to differences in executor performance and network fluctuations. Unfinished subtasks will delay the completion time of the entire stage and task. Existing speculative execution algorithms cannot detect inefficient tasks in time. , leading to resource waste and extended running time.

Method used

By obtaining task information, calculate the execution efficiency of completed and unfinished tasks, compare and determine the target tasks, and reallocate them to executors with better performance to optimize task execution efficiency.

Benefits of technology

It reduces the number of tasks with inefficient execution, reduces waste of resources, improves the accurate identification and reallocation of inefficient tasks, and shortens the execution time of tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113806034B
    Figure CN113806034B
Patent Text Reader

Abstract

The present disclosure provides a task execution method and a task execution device, a storage medium and an electronic device, and relates to the field of data processing technology. The task execution method includes: obtaining task information corresponding to each task in a plurality of tasks, wherein the plurality of tasks include a completed task set and an uncompleted task set; using the task information of each completed task in the completed task set to determine a reference execution efficiency; using the task information of each uncompleted task in the uncompleted task set to determine the execution efficiency of each uncompleted task; using the reference execution efficiency and the execution efficiency of each uncompleted task to determine a target task from the uncompleted task set, and assigning the target task to an executor other than the executor currently executing the target task. The present disclosure accurately infers tasks with low execution efficiency by comparing the execution efficiency of completed tasks with the execution efficiency of uncompleted tasks, reallocates executors to tasks with low execution efficiency, and reduces the execution time of tasks.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] In a big data platform, in order to ensure the effective execution of tasks within the platform, the platform usually builds a task scheduling platform to manage the tasks.

[0003] The task scheduling platform usually divides the tasks in the platform into multiple stages to be completed. When all the tasks in one stage are completed, the tasks in the next stage are executed until all the tasks are completed. Each stage can contain multiple subtasks. The task scheduling platform assigns these multiple subtasks to multiple executors to complete them together. Different subtasks on different executors can be executed in parallel.

[0004] Due to the different configuration performance of each executor, network fluctuations and other reasons, the execution time of subtasks on different executors varies. Some subtasks may be completed very quickly, while some subtasks may not be completed even after a long period of execution. The unfinished subtasks will affect the completion time of the entire stage, and thus affect the completion time of tasks in the entire platform. Summary of the invention

[0005] The purpose of the present disclosure is to provide a task execution method and a task execution device, a computer-readable storage medium and an electronic device, thereby overcoming the problem of long task execution time caused by the limitations and defects of related technologies at least to a certain extent.

[0006] According to a first aspect of the present disclosure, a task execution method is provided, including: obtaining task information corresponding to each task in a plurality of tasks, the plurality of tasks including a completed task set and an uncompleted task set; determining a reference execution efficiency using the task information of each completed task in the completed task set; determining the execution efficiency of each uncompleted task using the task information of each uncompleted task in the uncompleted task set; determining a target task from the uncompleted task set using the reference execution efficiency and the execution efficiency of each uncompleted task, and assigning the target task to an executor other than the executor currently executing the target task.

[0007] Optionally, the reference execution efficiency is determined using task information of each completed task in the completed task set, including: when the number of completed tasks meets a preset condition, the reference execution efficiency is determined using task information of each completed task in the completed task set.

[0008] Optionally, the execution efficiency of each unfinished task is determined using the task information of each unfinished task in the unfinished task set, including: when the number of completed tasks meets a preset condition, the execution efficiency of each unfinished task is determined using the task information of each unfinished task in the unfinished task set.

[0009] Optionally, task information corresponding to each task in multiple tasks is obtained, including: obtaining the time point when a task starts to be executed, calculating the time interval between the current time point and the time point when execution starts as the execution time; determining the input data volume and output data volume corresponding to the task within the execution time; calculating the sum of the input data volume and the output data volume as the execution data volume of the task; wherein the task information of the task is configured to include the execution time and the execution data volume.

[0010] Optionally, the reference execution efficiency is determined using the task information of each completed task in the completed task set, including: calculating the sum of the execution data volume of each completed task in the completed task set as the sum of the execution data volume of the completed tasks; calculating the sum of the execution time of each completed task in the completed task set as the sum of the execution time of the completed tasks; calculating the ratio of the sum of the execution data volume of the completed tasks to the sum of the execution time of the completed tasks to determine the reference execution efficiency.

[0011] Optionally, the execution efficiency of each unfinished task is determined using the task information of each unfinished task in the unfinished task set, including: calculating the ratio of the execution data volume to the execution time of each unfinished task in the unfinished task set respectively, to determine the execution efficiency of each unfinished task.

[0012] Optionally, the reference execution efficiency and the execution efficiency of each unfinished task are used to determine the target task from the unfinished task set, including: comparing the execution efficiency of each unfinished task with the reference execution efficiency respectively; and determining the unfinished task whose execution efficiency is lower than the reference execution efficiency as the target task.

[0013] According to a second aspect of the present disclosure, a task execution device is provided, comprising: an information acquisition module, a completed efficiency calculation module, an uncompleted efficiency calculation module, and a task determination module.

[0014] Specifically, the information acquisition module can be used to obtain task information corresponding to each task in a plurality of tasks, wherein the plurality of tasks include a completed task set and an unfinished task set; the completed efficiency calculation module can be used to determine a reference execution efficiency using the task information of each completed task in the completed task set; the unfinished efficiency calculation module can be used to determine the execution efficiency of each unfinished task using the task information of each unfinished task in the unfinished task set; the task determination module can determine a target task from the unfinished task set using the reference execution efficiency and the execution efficiency of each unfinished task, and assign the target task to an executor other than the executor currently executing the target task.

[0015] Optionally, the completed efficiency calculation module may be configured to perform: when the number of completed tasks meets a preset condition, determine a reference execution efficiency using task information of each completed task in the completed task set.

[0016] Optionally, the unfinished efficiency calculation module may be configured to perform: when the number of completed tasks meets a preset condition, determine the execution efficiency of each unfinished task using the task information of each unfinished task in the unfinished task set.

[0017] Optionally, the information acquisition module can be configured to perform: obtain the time point when a task starts to be executed, calculate the time interval between the current time point and the time point when the execution starts, as the execution time; determine the input data volume and output data volume corresponding to the task within the execution time; calculate the sum of the input data volume and the output data volume, as the execution data volume of the task; wherein the task information of the task is configured to include the execution time and the execution data volume.

[0018] Optionally, the completed efficiency calculation module can be configured to perform: calculating the sum of the execution data volume of each completed task in the completed task set as the sum of the execution data volume of the completed tasks; calculating the sum of the execution time of each completed task in the completed task set as the sum of the execution time of the completed tasks; calculating the ratio of the sum of the execution data volume of the completed tasks to the sum of the execution time of the completed tasks to determine the reference execution efficiency.

[0019] Optionally, the unfinished efficiency calculation module may be configured to perform: respectively calculating the ratio of the execution data volume to the execution time of each unfinished task in the unfinished task set to determine the execution efficiency of each unfinished task.

[0020] Optionally, the task determination module may be configured to perform: comparing the execution efficiency of each unfinished task with a reference execution efficiency; and determining the unfinished task whose execution efficiency is lower than the reference execution efficiency as the target task.

[0021] According to a third aspect of the present disclosure, a storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, any one of the above-mentioned task execution methods is implemented.

[0022] According to a fourth aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any one of the above-mentioned task execution methods by executing the executable instructions.

[0023] In the technical solutions provided by some embodiments of the present disclosure, task information corresponding to each task in a plurality of tasks is obtained, and the plurality of tasks include a completed task set and an unfinished task set; the reference execution efficiency is determined using the task information of each completed task in the completed task set; the execution efficiency of each unfinished task is determined using the task information of each unfinished task in the unfinished task set; the target task is determined from the unfinished task set using the reference execution efficiency and the execution efficiency of each unfinished task, and the target task is assigned to an executor other than the executor currently executing the target task. The task execution method proposed in the present disclosure can, on the one hand, reduce the number of tasks with low execution efficiency inferred, thereby reducing the number of tasks that need to be re-executed, and avoiding waste of resources; on the other hand, by comparing the execution efficiency of completed tasks with the execution efficiency of unfinished tasks, tasks with low execution efficiency can be accurately inferred, the accuracy of the inferred tasks with low execution efficiency can be improved, and executors can be reallocated to tasks with low execution efficiency, so that tasks with low running efficiency can be completed faster, and the execution time of tasks is reduced.

[0024] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present disclosure, and together with the specification, are used to explain the principles of the present disclosure. Obviously, the drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0026] Figure 1 A flowchart schematically shows a task execution method according to an exemplary embodiment of the present disclosure;

[0027] Figure 2 The following schematically shows an architecture diagram of a method for implementing a task execution based on a Spark computing engine according to an exemplary embodiment of the present disclosure;

[0028] Figure 3 A comparison diagram of the number of inference tasks before and after optimization according to an exemplary embodiment of the present disclosure is schematically shown;

[0029] Figure 4 A comparison diagram of the success rate of determining inefficient tasks before and after optimization according to an exemplary embodiment of the present disclosure is schematically shown;

[0030] Figure 5 A diagram schematically shows a comparison of average running time of Spark applications before and after optimization according to an exemplary embodiment of the present disclosure;

[0031] Figure 6 A block diagram schematically shows a task execution device according to an exemplary embodiment of the present disclosure;

[0032] Figure 7 A block diagram of an electronic device according to an exemplary embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION

[0033] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concepts of the example embodiments are fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.

[0034] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.

[0035] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the steps. For example, some steps may be decomposed, while some steps may be combined or partially combined, so the actual execution order may change according to the actual situation.

[0036] Spark is a large-scale data processing computing engine. When executing a Spark task, the task is first split into multiple batches of tasks with dependencies in different stages. Each batch of tasks contains multiple subtasks. Only when all subtasks in a stage are completed, the stage is considered to be over, and the corresponding tasks of the next stage will be executed. When the tasks of all stages are completed, a complete Spark task ends.

[0037] Due to different performance configurations of machines in the cluster and network fluctuations, the execution time of each subtask in each stage varies. Some subtasks are completed quickly, while others may not be completed after a long time. The unfinished subtasks will affect the completion time of the entire stage, and then affect the completion time of the entire Spark task. Therefore, it is necessary to perform speculative execution on subtasks that take a long time to execute, and start the same subtask on a different executor. When one subtask is completed, stop the other subtask.

[0038] However, the speculative execution algorithm of the prior art is relatively simple and cannot promptly discover tasks with low operating efficiency, resulting in a longer running time for the entire stage, which in turn affects the execution time of the Spark task; and, the speculative execution algorithm of the prior art has unnecessary task speculative execution, resulting in a waste of resources. When the Spark cluster resources are limited, it will affect the scheduling and execution of other Spark tasks and affect the execution time of the Spark task.

[0039] In view of this, the present disclosure proposes a task execution method.

[0040] It should be noted that the information disclosed in the above background technology section is only used to facilitate the description in the embodiments, and the method in the present disclosure can also be applied to other computing engines besides the Spark data processing computing engine.

[0041] Figure 1 The flowchart of the task execution method of the exemplary embodiment of the present disclosure is schematically shown. Figure 1 The task execution method may include the following steps:

[0042] S12. Obtaining task information corresponding to each task in a plurality of tasks, wherein the plurality of tasks include a completed task set and an uncompleted task set.

[0043] In an exemplary embodiment of the present disclosure, the operation of obtaining task information is completed by a task driver, which is responsible for converting the program input by the user into a task, tracking the operation of the executor, and scheduling the tasks in the executor. Multiple tasks refer to data processing tasks, which can be tasks executed in a Spark data processing computing engine or tasks executed in other data processing computing engines, and the present disclosure does not limit this. Task information may include the input data volume, output data volume, and execution time of each task in the data processing process, wherein the input data is the data received by each task during the execution process, the output data is the data output by each task during the execution process, the execution time is the time interval from the start time point of each task to the current time point, the completed task refers to the task that has completed the processing of the data to be processed, and the completed task set is the task set composed of all completed tasks, and the unfinished task refers to the task that has not yet completed the processing of the data to be processed, and the unfinished task set is the task set composed of all unfinished tasks.

[0044] In an exemplary embodiment of the present disclosure, a task driver obtains the input data volume, output data volume, execution time, etc. corresponding to each task in a plurality of data processing tasks, and the plurality of data processing tasks include a task set consisting of all completed tasks and a task set consisting of all unfinished tasks.

[0045] In an exemplary embodiment of the present disclosure, a time point at which a task starts to be executed is obtained, and the time interval between the current time point and the time point at which the execution starts is calculated as the execution time; the input data volume and the output data volume corresponding to the task within the execution time are determined; the sum of the input data volume and the output data volume is calculated as the execution data volume of the task; wherein the task information of the task is configured to include the execution time and the execution data volume.

[0046] In an exemplary embodiment of the present disclosure, when a task starts to be executed, the time point of the start of execution is recorded, and the time point of the current time is obtained. By calculating the time interval between the current time point and the time point of the start of task execution, the execution time of the task can be obtained. The input data volume and output data volume corresponding to the task can be obtained and recorded by the driver. After obtaining the input data volume and the output data volume, the sum of the input data volume and the output data volume is calculated to obtain the total amount of data processed by the task during the execution time, that is, the execution data volume. The execution time and execution data volume of all tasks can be obtained by the above method, and the task information of the task can be configured to include the execution time and the execution data volume.

[0047] S14. Determine a reference execution efficiency using the task information of each completed task in the completed task set.

[0048] In the exemplary embodiment of the present disclosure, the reference execution efficiency refers to a value that can reasonably reflect the execution efficiency of all completed tasks, and this value is used to compare with the execution efficiency of each unfinished task, thereby determining the unfinished tasks with lower execution efficiency. The reference execution efficiency is determined by using the execution time and execution data volume of each completed task in the task set composed of all completed tasks.

[0049] In an exemplary embodiment of the present disclosure, when the number of completed tasks meets a preset condition, the reference execution efficiency is determined using the task information of each completed task in the completed task set. During the task execution process, the reference execution efficiency is calculated only when the number of completed tasks meets the preset condition. For example, the preset condition may be that the reference execution efficiency is calculated when the ratio of the number of completed tasks to the total number of tasks is higher than 60%. The specific ratio can be freely set by the user according to the actual situation.

[0050] In an exemplary embodiment of the present disclosure, the sum of the execution data volume of each completed task in the completed task set is calculated as the sum of the execution data volume of the completed tasks; the sum of the execution time of each completed task in the completed task set is calculated as the sum of the execution time of the completed tasks; the ratio of the sum of the execution data volume of the completed tasks to the sum of the execution time of the completed tasks is calculated to determine the reference execution efficiency.

[0051] In an exemplary embodiment of the present disclosure, the method for calculating the reference execution efficiency may be to calculate the average execution efficiency of all completed tasks. When the amount of calculation is too large, in order to increase the calculation speed and reduce resource usage, the reference execution efficiency may be obtained by randomly selecting some completed tasks and calculating the average execution efficiency of the selected completed tasks. In addition, a value representing the execution efficiency of all completed tasks may be obtained by other means, and the present disclosure does not impose any restrictions on this.

[0052] In an exemplary embodiment of the present disclosure, taking the calculation of the average execution efficiency of all completed tasks as an example, the execution data volumes of all completed tasks can be added together to obtain the total execution data volumes of the completed tasks; then the execution time of all completed tasks can be added together to obtain the total execution time of the completed tasks; finally, the reference execution efficiency can be obtained by calculating the ratio of the total execution data volume to the total execution time.

[0053] S16. Determine the execution efficiency of each unfinished task by using the task information of each unfinished task in the unfinished task set.

[0054] In the exemplary embodiment of the present disclosure, the execution efficiency of each unfinished task refers to the execution efficiency of each unfinished task. The execution efficiency of each unfinished task is calculated by using the execution time and execution data volume of each unfinished task in the task set composed of all unfinished tasks.

[0055] In an exemplary embodiment of the present disclosure, when the number of completed tasks meets a preset condition, the execution efficiency of each unfinished task is determined using the task information of each unfinished task in the unfinished task set. During the task execution process, the reference execution efficiency is calculated only when the number of completed tasks meets the preset condition. For example, the preset condition may be that when the ratio of the number of completed tasks to the total number of tasks is higher than 60%, the reference execution efficiency is calculated. The specific ratio can be freely set by the user according to the actual situation.

[0056] In an exemplary embodiment of the present disclosure, the ratio of the execution data volume to the execution time of each unfinished task in the unfinished task set is calculated to determine the execution efficiency of each unfinished task. Each unfinished task corresponds to a calculated execution efficiency of the unfinished task, and there is only one reference execution efficiency, which is calculated by the sum of the execution data volume and the sum of the execution time of all completed tasks.

[0057] S18. Determine a target task from the set of unfinished tasks using the reference execution efficiency and the execution efficiency of each of the unfinished tasks, and assign the target task to an executor other than the executor currently executing the target task.

[0058] In an exemplary embodiment of the present disclosure, the target task is an unfinished task whose execution efficiency is lower than the reference execution efficiency. After the target task is determined, the target task is assigned to other executors. The executors are responsible for the execution of the task and for storing data in memory or on disk. There can be one or more independent executors in each stage. Each executor can be configured on one device or on multiple devices. When the number of executors in a certain stage is insufficient, computing resources can be applied for through the driver to establish another executor.

[0059] In an exemplary embodiment of the present disclosure, a target task can be assigned to an executor other than the executor currently executing the target task, and the specific executor to which it is assigned depends on the execution capability of the executor; when there are sufficient computing resources, a target task can also be assigned to multiple executors. When one of the multiple executors completes the target task, the other executors executing the target task among the multiple executors stop executing the target task, which can further reduce the execution time of the task.

[0060] In an exemplary embodiment of the present disclosure, the execution efficiency of each unfinished task is compared with a reference execution efficiency; and the unfinished task whose execution efficiency is lower than the reference execution efficiency is determined as a target task.

[0061] In an exemplary embodiment of the present disclosure, the target task can also be determined from the unfinished tasks by setting the execution efficiency coefficient. Specifically, the execution efficiency of each unfinished task is multiplied by the execution efficiency coefficient to obtain a calculation result, and the calculation results corresponding to each unfinished task are compared with the reference execution efficiency, and the unfinished task whose calculation result is lower than the reference execution efficiency is determined as the target task. Among them, the default value of the execution efficiency coefficient is usually set to 1, and can also be set to 1.2, 0.8, etc., and the specific value can be determined according to the actual situation.

[0062] In an exemplary embodiment of the present disclosure, the target task is assigned to an executor other than the executor currently executing the target task, and the target task is executed on the executor. When all unfinished tasks in one stage are completed, the tasks of the next stage are started to be executed.

[0063] In the exemplary implementation of the present disclosure, the execution of each task in a Spark job is taken as an example to further illustrate the method in the present disclosure.

[0064] In a Spark cluster, there is a node responsible for central coordination and scheduling of each distributed slave node. This central coordination node is called a driver node, and the corresponding slave node is called an executor node. The driver node can communicate with a large number of executor nodes, and they all run as independent processes. The driver node and all executor nodes are together called a Spark application. The driver converts the operation of the elastic distributed dataset into a logical directed acyclic graph composed of operations, and divides the elastic distributed dataset in the directed acyclic graph into multiple different stages for processing. Each stage consists of multiple tasks, that is, multiple stages constitute a complete Spark job.

[0065] refer to Figure 2 , Figure 2 The following schematically shows an architecture diagram of a method for implementing a task execution based on a Spark computing engine according to an exemplary embodiment of the present disclosure. Figure 2As shown in the figure, a certain stage in a Spark job contains 10 tasks. After the tasks are divided, the driver will assign all tasks to the appropriate executor process based on the location of the data according to the current set of executor nodes. Among them, tasks 1 to 3 are assigned to executor 1, tasks 4 to 6 are assigned to executor 2, tasks 7 to 9 are assigned to executor 3, and task 10 is assigned to executor 4. During the execution of each task, the driver has a complete record of all executor nodes. During the execution of tasks 1 to 10, the corresponding input data volume and output data volume can be recorded, and then reported to the driver through the network, such as Figure 2 The process represented by process 1 in .

[0066] The driver receives the input data volume and output data volume reported by each task. When half (parameters can be set) of the tasks are completed, that is, when 5 tasks are completed, the sum of the input data volume of all completed tasks is calculated, recorded as sumInputRecords, the sum of the output data volume of all completed tasks is calculated, recorded as sumOutputRecords, and the total time consumed by the completed tasks is calculated, recorded as sumExecutorRunTime. The running efficiency of the completed tasks, that is, the reference execution efficiency is:

[0067] successTaskProgress=(sumInputRecords+sumOutputRecords) / sumRunTime.

[0068] For unfinished tasks, the driver calculates the execution time of the unfinished tasks based on the current time and the start execution time corresponding to the unfinished tasks, which is recorded as runTime. According to the amount of input data and output data reported to the driver by the unfinished tasks, the driver calculates the execution efficiency of each unfinished task, which is recorded as TaskProgress.

[0069] TaskProgress=(inputRecords+outputRecords) / runTime.

[0070] The driver compares the execution efficiency TaskProgress of each unfinished task with the reference execution efficiency successTaskProgress. The comparison method can be:

[0071] When TaskProgress≤Multiplier*successTaskProgress, the unfinished task corresponding to the execution efficiency TaskProgress is determined to be an inefficient task, that is, the target task. Among them, Multiplier is the execution efficiency coefficient, and the default value is 1. Figure 2 As shown, Task 1 and Task 4 are target tasks.

[0072] like Figure 2 As shown, since only one task 10 is executed on executor 4, the execution pressure of executor 4 is smaller than that of other executors, so tasks 1 and 4 are assigned to executor 4 for execution. Figure 2 Task 1+ and Task 4+ in Executor 4 means that Task 1 and Task 4 are assigned to Executor 4 for execution. Figure 2 Process 2 is the process of reporting the input data volume and output data volume corresponding to Task 1+ and Task 4+ to the driver through the network. At this point, a round of task execution method is completed, and then the task execution method proposed in the present disclosure is used to judge each unfinished task, and tasks with low execution efficiency are continuously assigned to other executors for execution until all tasks in this stage are completed.

[0073] The task execution method proposed in the present invention is an optimization of the existing Spark task speculation execution algorithm. In order to more intuitively reflect the effect of the task execution method in the present invention, the task execution method proposed in the present invention and the existing Spark task speculation execution method are used respectively, based on 600,000 Spark applications, running on 27,000 data nodes, and a comparative analysis before and after optimization is carried out.

[0074] refer to Figure 3 , Figure 3 Schematically shows a comparison chart of the number of inference tasks before and after optimization of an exemplary embodiment of the present disclosure. Figure 3 As shown, a is the number of inefficient tasks determined before optimization, and the value is 8510110, and b is the number of inefficient tasks determined after optimization, and the value is 2211013. It can be found that the number of inefficient tasks determined after optimization is significantly reduced, that is, the task execution method proposed in the present disclosure avoids re-running of tasks with higher efficiency, saving computing resources.

[0075] refer to Figure 4 , Figure 4 The following schematically shows a comparison chart of the success rate of determining inefficient tasks before and after optimization according to an exemplary embodiment of the present disclosure. Figure 4As shown, a is the success rate of determining inefficient tasks before optimization, which is 0.55, and b is the success rate of determining inefficient tasks after optimization, which is 0.44. It can be found that the success rate of determining inefficient tasks is improved after optimization, that is, through the task execution method disclosed in the present invention, tasks with low execution efficiency can be more accurately determined, thereby improving the success rate of determining inefficient tasks.

[0076] refer to Figure 5 , Figure 5 The figure schematically shows the comparison of the average running time of Spark applications before and after optimization according to an exemplary embodiment of the present disclosure. Figure 5 As shown, a is the average running time of the Spark application before optimization, which is 1810 seconds, and b is the average running time of the Spark application after optimization, which is 1537 seconds. It can be found that the average running time of the Spark application is reduced after optimization, that is, through the task execution method disclosed in the present invention, tasks with low execution efficiency can be discovered in advance and allocated to other executors for execution, thereby reducing the running time of the Spark application.

[0077] It should be noted that although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.

[0078] Furthermore, this example implementation also provides a task execution device.

[0079] Figure 6 The block diagram schematically shows a task execution device according to an exemplary embodiment of the present disclosure. Figure 6 The task execution device 6 according to an exemplary embodiment of the present disclosure may include an information acquisition module 61 , a completed efficiency calculation module 63 , an uncompleted efficiency calculation module 65 , and a task determination module 67 .

[0080] Specifically, the information acquisition module 61 can be used to obtain task information corresponding to each task in a plurality of tasks, wherein the plurality of tasks include a completed task set and an unfinished task set; the completed efficiency calculation module 63 can be used to determine a reference execution efficiency using the task information of each completed task in the completed task set; the unfinished efficiency calculation module 65 can be used to determine the execution efficiency of each unfinished task using the task information of each unfinished task in the unfinished task set; the task determination module 67 can determine a target task from the unfinished task set using the reference execution efficiency and the execution efficiency of each unfinished task, and assign the target task to an executor other than the executor currently executing the target task.

[0081] According to an exemplary embodiment of the present disclosure, the completed efficiency calculation module 63 may be configured to perform: when the number of completed tasks meets a preset condition, determine a reference execution efficiency using task information of each completed task in the completed task set.

[0082] According to an exemplary embodiment of the present disclosure, the unfinished efficiency calculation module 65 may be configured to perform: when the number of completed tasks meets a preset condition, determine the execution efficiency of each unfinished task using the task information of each unfinished task in the unfinished task set.

[0083] According to an exemplary embodiment of the present disclosure, the information acquisition module 61 can be configured to perform: obtaining the time point when a task starts to be executed, calculating the time interval between the current time point and the time point when the execution starts as the execution time; determining the input data volume and output data volume corresponding to the task within the execution time; calculating the sum of the input data volume and the output data volume as the execution data volume of the task; wherein the task information of the task is configured to include the execution time and the execution data volume.

[0084] According to an exemplary embodiment of the present disclosure, the completed efficiency calculation module 63 can be configured to perform: calculating the sum of the execution data volume of each completed task in the completed task set as the sum of the execution data volume of the completed tasks; calculating the sum of the execution time of each completed task in the completed task set as the sum of the execution time of the completed tasks; calculating the ratio of the sum of the execution data volume of the completed tasks to the sum of the execution time of the completed tasks to determine the reference execution efficiency.

[0085] According to an exemplary embodiment of the present disclosure, the unfinished efficiency calculation module 65 may be configured to perform: respectively calculating the ratio of the execution data volume to the execution time of each unfinished task in the unfinished task set, and determining the execution efficiency of each unfinished task.

[0086] According to an exemplary embodiment of the present disclosure, the task determination module 67 may be configured to perform: comparing the execution efficiency of each unfinished task with the reference execution efficiency; and determining the unfinished task whose execution efficiency is lower than the reference execution efficiency as the target task.

[0087] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of the present specification is stored. In some possible implementations, various aspects of the present invention can also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary embodiments of the present invention described in the above "Exemplary Method" section of the present specification.

[0088] The program product for implementing the above method according to an embodiment of the present invention can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto, and in this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.

[0089] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical disk, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0090] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0091] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.

[0092] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).

[0093] In an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.

[0094] It will be appreciated by those skilled in the art that various aspects of the present invention may be implemented as a system, method or program product. Therefore, various aspects of the present invention may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as a "circuit", "module" or "system".

[0095] Refer to the following Figure 7 An electronic device 700 according to this embodiment of the present invention will be described. Figure 7 The electronic device 700 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0096] like Figure 7 As shown, the electronic device 700 is in the form of a general computing device. The components of the electronic device 700 may include, but are not limited to: the at least one processing unit 710, the at least one storage unit 720, a bus 730 connecting different system components (including the storage unit 720 and the processing unit 710), and a display unit 740.

[0097] The storage unit 720 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 7201 and / or a cache storage unit 7202 , and may further include a read-only storage unit (ROM) 7203 .

[0098] The storage unit 720 may also include a program / utility 7204 having a set (at least one) of program modules 7205, such program modules 7205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0099] Bus 730 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0100] The electronic device 700 may also communicate with one or more external devices 800 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), and / or communicate with any device (e.g., routers, modems, etc.) that enables the electronic device 700 to communicate with one or more other computing devices. Such communication may be performed via an input / output (I / O) interface 750. In addition, the electronic device 700 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 760. As shown, the network adapter 760 communicates with other modules of the electronic device 700 via a bus 730. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.

[0101] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.

[0102] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to an exemplary embodiment of the present invention, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.

[0103] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.

[0104] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and examples are to be considered as exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.

[0105] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A task execution method, characterized in that: include: Obtaining task information corresponding to each task in a plurality of tasks, wherein the plurality of tasks include a set of completed tasks and a set of uncompleted tasks; Determine a reference execution efficiency by using the task information of each completed task in the completed task set; Determine the execution efficiency of each unfinished task by using the task information of each unfinished task in the unfinished task set; Determine a target task from the set of unfinished tasks by using the reference execution efficiency and the execution efficiency of each of the unfinished tasks, and assign the target task to an executor other than the executor currently executing the target task; Wherein, using the reference execution efficiency and the execution efficiency of each of the unfinished tasks to determine a target task from the unfinished task set includes: comparing the execution efficiency of each of the unfinished tasks with the reference execution efficiency, and determining the unfinished tasks whose execution efficiency is lower than the reference execution efficiency as the target tasks; or The execution efficiency of each of the unfinished tasks is multiplied by the execution efficiency coefficient to obtain a calculation result, and the calculation results corresponding to each of the unfinished tasks are compared with the reference execution efficiency respectively, and the unfinished task whose calculation result is lower than that corresponding to the reference execution efficiency is determined as the target task.

2. The task execution method according to claim 1, characterized in that: Using the task information of each completed task in the completed task set, determining a reference execution efficiency includes: When the number of the completed tasks meets a preset condition, the reference execution efficiency is determined using the task information of each completed task in the completed task set.

3. The task execution method according to claim 1, characterized in that: Determining the execution efficiency of each unfinished task by using the task information of each unfinished task in the unfinished task set includes: When the number of the completed tasks meets a preset condition, the execution efficiency of each of the unfinished tasks in the unfinished task set is determined using the task information of each of the unfinished tasks.

4. The task execution method according to claim 1, characterized in that: Get the task information corresponding to each task in multiple tasks, including: Obtaining a time point at which a task starts to be executed, and calculating the time interval between the current time point and the time point at which the task starts to be executed as the execution time; Determine the input data volume and output data volume corresponding to the task within the execution time; Calculating the sum of the input data volume and the output data volume as the execution data volume of the task; The task information of the task is configured to include the execution time and the execution data volume.

5. The task execution method according to claim 4, characterized in that: Using the task information of each completed task in the completed task set, determining a reference execution efficiency includes: Calculating the sum of the execution data volumes of each completed task in the completed task set as the sum of the execution data volumes of the completed tasks; Calculating the sum of the execution time of each completed task in the completed task set as the sum of the execution time of the completed tasks; The ratio of the total amount of execution data of the completed tasks to the total execution time of the completed tasks is calculated to determine the reference execution efficiency.

6. The task execution method according to claim 4, characterized in that: Determining the execution efficiency of each unfinished task by using the task information of each unfinished task in the unfinished task set includes: The ratio of the execution data volume to the execution time of each unfinished task in the unfinished task set is calculated respectively to determine the execution efficiency of each unfinished task.

7. A task execution device, characterized in that: include: An information acquisition module, used to acquire task information corresponding to each task in a plurality of tasks, wherein the plurality of tasks include a set of completed tasks and a set of uncompleted tasks; A completed efficiency calculation module, used to determine a reference execution efficiency by using the task information of each completed task in the completed task set; An unfinished efficiency calculation module, used to determine the execution efficiency of each unfinished task by using the task information of each unfinished task in the unfinished task set; A task determination module, using the reference execution efficiency and the execution efficiency of each of the unfinished tasks, determines a target task from the unfinished task set, and assigns the target task to an executor other than an executor currently executing the target task; The process of determining the target task by the task determination module is configured as follows: comparing the execution efficiency of each of the unfinished tasks with the reference execution efficiency, and determining the unfinished tasks whose execution efficiency is lower than the reference execution efficiency as the target tasks; or The execution efficiency of each of the unfinished tasks is multiplied by the execution efficiency coefficient to obtain a calculation result, and the calculation results corresponding to each of the unfinished tasks are compared with the reference execution efficiency respectively, and the unfinished task whose calculation result is lower than that corresponding to the reference execution efficiency is determined as the target task.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the task execution method according to any one of claims 1 to 6 is implemented.

9. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; Wherein, the processor is configured to execute the task execution method described in any one of claims 1-6 by executing the executable instructions.