A task execution system, method, electronic device, and storage medium
Patent Information
- Application Number
- CN202211597924.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-12
- Publication Date
- 2026-11-03
- Estimated Expiration
- 2042-12-12
AI Technical Summary
现有的任务执行系统中,任务按照队列的先后顺序执行导致任务吞吐量降低和执行效率低,尤其是在等待数据下载时产生不必要的延迟。
Through the collaborative work of the task scheduler and data scheduler, the execution order of tasks and data allocation are adjusted according to the data loading status and resource usage information of the machines. Machines with more target data cache and less resource usage are prioritized to reduce the amount of data downloaded and improve download efficiency, while also taking into account the load balancing between machines.
It improves the utilization rate of task execution units, reduces task waiting time, increases task throughput and execution efficiency, and ensures that tasks whose target data is loaded first can be executed first.
Smart Images

Figure CN116028173B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of autonomous driving development technology, and in particular to a task execution system, method, electronic device, and storage medium. Background Technology
[0002] In the development of autonomous driving systems, developers often need to run numerous simulation tasks to train AI (Artificial Intelligence) models and verify their correctness. A simulation task consists of multiple sub-tasks, and the simulation task submitted by the developer is considered complete only after all sub-tasks are completed.
[0003] Existing task execution systems typically execute tasks sequentially according to the order in which they are assigned by the scheduling system. However, the data required for task execution is stored in the data center, and the task cannot be executed until the data is downloaded. Tasks that are later in the sequence have to wait, which often leads to unnecessary waiting time, reduces task throughput, and results in low execution efficiency of simulation tasks. Summary of the Invention
[0004] This invention provides a task execution system to solve the problems of reduced task throughput and low task execution efficiency that occur when tasks are executed in the order of a task queue.
[0005] In a first aspect, the present invention provides a task execution system, including a task scheduler, a task and data scheduler, and at least one machine, each of the machines including at least one execution unit.
[0006] The task scheduler is used to send tasks to the task and data scheduler in the order of execution.
[0007] The task and data scheduler is used to add the task to the machine's task queue when it receives a task, based on the machine's data loading status and resource usage information.
[0008] The machine is used to load target data corresponding to tasks in its own task queue, adjust the execution order of tasks according to the loading degree of the target data, and control the execution unit to execute tasks according to the execution order of tasks.
[0009] In a second aspect, the present invention provides a task execution method applied to a task execution system, the task execution system including a task scheduler, a task and data scheduler, and at least one machine, each of the machines including at least one execution unit, the task execution method comprising:
[0010] The task scheduler sends tasks to the task and data scheduler in the order of execution.
[0011] When the task and data scheduler receives a task, it adds the task to the machine's task queue based on the machine's data loading status and resource usage information.
[0012] The machine loads the target data corresponding to the tasks in its own task queue, adjusts the execution order of the tasks according to the loading degree of the target data, and controls the execution unit to execute the tasks in the order of task execution.
[0013] Thirdly, the present invention provides an electronic device, the electronic device comprising:
[0014] At least one processor; and
[0015] A memory communicatively connected to the at least one processor; wherein,
[0016] The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the task execution method described in the second aspect of the present invention.
[0017] Fourthly, the present invention provides a computer-readable storage medium storing computer instructions for causing a processor to execute the task execution method of the first and second aspects of the present invention.
[0018] The task execution system of this invention includes a task scheduler, a task and data scheduler, and at least one machine. Each machine includes at least one execution unit. The task scheduler sends tasks to the task and data scheduler in execution order. Upon receiving a task, the task and data scheduler adds the task to the machine's task queue based on the machine's data loading status and resource usage information. The machine loads the target data corresponding to the task in its own task queue, adjusts the task execution order based on the loading degree of the target data, and controls the execution unit to execute tasks in the order they are executed. The task and data scheduler, based on the machine's data loading status and resource usage information, can prioritize machines with more cached target data and lower resource usage to reduce the amount of target data downloaded and improve the speed and efficiency of downloading target data. It also considers load balancing between machines, ensuring that the target data corresponding to a task can be efficiently loaded after it is dispatched to a machine. Furthermore, the machine adjusts the task execution order based on the loading degree of its own target data, allowing tasks whose target data is loaded first to be executed first, without waiting for other tasks to complete loading. This improves the utilization rate of the execution unit, thereby increasing task throughput and execution efficiency.
[0019] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 This is a schematic diagram of the structure of a task execution system provided in Embodiment 1 of the present invention;
[0022] Figure 2 This is a schematic diagram of a task and data scheduling process provided in Embodiment 1 of the present invention;
[0023] Figure 3 This is a flowchart of a task execution method provided in Embodiment 2 of the present invention;
[0024] Figure 4 This is a schematic diagram of the structure of the electronic device provided in Embodiment 3 of the present invention. Detailed Implementation
[0025] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0026] Example 1
[0027] Figure 1 This is a schematic diagram of a task execution system provided in Embodiment 1 of the present invention. This embodiment is applicable to situations involving the execution of a large number of autonomous driving simulation tasks, such as... Figure 1 As shown, the task execution system includes a task scheduler 1, a task and data scheduler 2, and at least one machine 3. Each machine 3 includes at least one execution unit 4. The number of machines 3 is generally multiple, and the number of execution units 4 in each machine 3 is also generally multiple.
[0028] The task scheduler sends tasks to the task and data scheduler in the order of execution.
[0029] In this embodiment, the task can be an autonomous driving simulation task. In reality, the driving environment of a car is infinitely rich, extremely complex, and inexhaustible. The test scenario is a limited mapping of the driving environment. Autonomous driving simulation is to transfer all the content involved in autonomous driving into the virtual environment and simulate the entire process of autonomous driving.
[0030] Different tasks do not have contextual dependencies, meaning they do not need to be executed in a specific order. However, for the task scheduler, tasks can have an execution order. Specifically, the execution order can be determined based on the order in which the task scheduler receives the tasks, or it can be determined by first calculating the estimated execution time for each task and then arranging the tasks in the order based on the estimated time. The execution order is positively correlated with the estimated time; that is, tasks with shorter estimated times are executed first. The task scheduler essentially determines the execution order of each task at a macro level and dispatches the tasks to the task and data scheduler according to this execution order.
[0031] After a task is generated, it can be input into the task and data scheduler. The task and data scheduler is used to add the task to the machine's task queue when it receives the task, based on the machine's data loading status and resource usage information.
[0032] The function of the task and data scheduler is to allocate tasks reasonably, so that tasks can be executed efficiently while reducing excessive resource consumption.
[0033] When allocating tasks, the task and data scheduler can consider machine resource usage. A machine's task queue can be set with a preset number of tasks. If the preset number of tasks is already in the queue, it indicates the queue is full; otherwise, it indicates the queue is not full. If the task queue is full, the machine cannot accept new tasks. On the other hand, the scheduler can also consider the estimated total duration of tasks in the machine's task queue and then allocate tasks to the machine with the shortest estimated total duration, reducing task waiting time and avoiding situations where some machines are busy while others are idle.
[0034] Furthermore, for tasks, data is required during execution. Different tasks may require partially the same or different target data. Once a task is assigned to the machine's task queue, the machine needs to download the target data required for task execution. If the machine already stores some or all of the target data, it doesn't need to load that data, thus saving network resources. The more target data a machine stores, the higher its affinity with that machine. The machine's data loading status indicates the amount of data stored on it, allowing the affinity between the task and the machine to be determined. Tasks can then be assigned based on this affinity, reducing the number of data resource loading operations. Target data can include maps, road conditions, binary code, etc.
[0035] When allocating tasks, the task and data scheduler should first consider the machine's resource usage, and then consider the compatibility between the task and the machine.
[0036] It's important to note that when the task and data scheduler receives a task, the task has an execution order set. Therefore, when assigning tasks to different machines, the scheduler follows this execution order. For tasks assigned to the same machine, the task that had a higher execution order in the task and data scheduler will still have a higher execution order on that machine. For example, if tasks A, B, C, and D in the task and data scheduler have execution orders of 1-4 respectively, then task A will have a higher execution order than task D after being assigned to the same machine.
[0037] The machine loads the target data corresponding to the tasks in its own task queue, adjusts the execution order of the tasks according to the loading status of the target data, and controls the execution unit to execute the tasks in the order of task execution.
[0038] The machine has a cache and multiple execution units. The cache is used to store data, which is generally the target data corresponding to the tasks that the machine has already executed or will execute.
[0039] An execution unit is like a container burned into a machine, and multiple execution units can run simultaneously on each machine. Execution units are a key component of machine learning systems, used to handle real-world problems faced by the system, i.e., applying learned knowledge to solve problems, such as theorem proving, intelligent control, natural language processing, vehicle action planning, and verifying the correctness of conclusions.
[0040] For each task in its own task queue, a machine needs to load the target data required to execute the task. There can be multiple target data sets. If some of the target data is already stored on the machine, it doesn't need to be loaded. If there is unstored target data, it can be downloaded from the data center or other machines. The data center is the data storage center of the task execution system; all target data required to execute tasks is stored there, so all machines can download target data from the data center. Different tasks may use partially identical target data, so multiple tasks with partially identical target data may be assigned to different machines. However, if machine A, which executes the task first, has already stored that part of the identical target data, then machine B, which executes the task later, can download that part of the target data from machine A.
[0041] When loading target data for a task, the machine can load target data for multiple tasks simultaneously. Different tasks require different amounts of target data, and the objects being loaded also differ. Therefore, the loading speed for each task's target data may vary, as does the degree of loading. The machine can adjust the execution order of tasks in the task queue based on the loading status of the target data. Specifically, tasks whose target data is loaded first can be given higher priority. For example, tasks A, B, and C might be executed sequentially, but if task C's target data is loaded before the target data for other tasks is loaded, the execution order would be C, A, B. Prioritizing tasks with completed target data reduces idle time for execution units and improves task execution efficiency.
[0042] The task execution system of this invention includes a task scheduler, a task and data scheduler, and at least one machine. Each machine includes at least one execution unit. The task scheduler sends tasks to the task and data scheduler in execution order. Upon receiving a task, the task and data scheduler adds the task to the machine's task queue based on the machine's data loading status and resource usage information. The machine loads the target data corresponding to the task in its own task queue, adjusts the task execution order based on the loading degree of the target data, and controls the execution unit to execute tasks in the order they are executed. The task and data scheduler, based on the machine's data loading status and resource usage information, can prioritize machines with more cached target data and lower resource usage to reduce the amount of target data downloaded and improve the speed and efficiency of downloading target data. It also considers load balancing between machines, ensuring that the target data corresponding to a task can be efficiently loaded after it is dispatched to a machine. Furthermore, the machine adjusts the task execution order based on the loading degree of its own target data, allowing tasks whose target data is loaded first to be executed first, without waiting for other tasks to complete loading. This improves the utilization rate of the execution unit, thereby increasing task throughput and execution efficiency.
[0043] In one alternative embodiment, the data loading state includes storing data.
[0044] Task and data scheduler, including:
[0045] The initial machine determination module is used to select machines whose task queues are not full as initial machines.
[0046] The target data determination module is used to determine the target data required to perform each task.
[0047] The target machine determination module is used to determine whether there is a backup machine storing the target data in the initial machine;
[0048] The first target machine determination module is used to determine the target machine from the backup machines based on the target data stored on the backup machines when backup machines exist.
[0049] The second target machine determination module is used to determine the target machine from the initial machine based on the resource usage information of the initial machine when there is no backup machine.
[0050] The task assignment module is used to add tasks to the task queue of the target machine.
[0051] When a machine's task queue is full, no new tasks can be added. Therefore, the task and data scheduler uses machines with incomplete task queues as initial machines. For each task's target data, the machine needs to load the required target data from other machines or data centers. If the machine already stores some or all of the task's target data, the number of data downloads can be reduced. Therefore, initial machines can be further filtered, using those that already store some or all of the task's target data as backup machines.
[0052] When a backup machine exists, the target machine is determined from the backup machines based on the target data stored on the backup machines. Specifically, the first target machine determination module is also used to: when there is only one backup machine, use the backup machine as the target machine; when there are multiple backup machines, determine the cache ratio of the target data stored on each backup machine; and determine the backup machine with the largest cache ratio as the target machine.
[0053] For a given task, the more target data stored on a backup machine, the fewer missing target data there will be. This means the machine needs to load less target data, loads faster, and consumes fewer network resources. Therefore, the machine with the highest target data caching ratio is considered more compatible with the task. Thus, when there are multiple backup machines, the machine with the highest target data caching ratio can be designated as the target machine. For example, simulation task A requires 50GB of map data, 10GB of binary code, and 40GB of traffic information. Machine a1 caches the map but not the binary code or traffic information. Therefore, backup machine a1 caches 50GB of target data, representing a 50% caching ratio. Backup machine a2 caches the binary code but not the map or traffic information. Backup machine a2 caches 10GB of target data, representing a 10% caching ratio. In this case, task A should be assigned to backup machine a1. By assigning the task to the backup machine with the highest target data caching ratio, data downloads can be reduced, thus reducing network resource consumption.
[0054] When no backup machine exists, meaning none of the initial machines store the target data for the task, the target machine is determined from the initial machines based on their resource usage information. Specifically, the resource usage information includes the total network load and the amount of network load used. The second target machine determination module is further used to: calculate the ratio of the used network load to the total network load for each initial machine to obtain the load pressure of the initial machine; and select the initial machine with the lowest load pressure as the target machine. Allocating tasks based on the load pressure of the initial machines when none of them store the target data for the task ensures load balancing among the machines.
[0055] In an alternative embodiment, the task execution system further includes a data center that stores target data required to execute the task.
[0056] Machines, including:
[0057] The missing data determination module is used to determine the missing target data for each task in the task queue based on the target data corresponding to the task and the stored data on the machine, and generate a data download request to be sent to the task and data scheduler.
[0058] The task and data scheduler also includes:
[0059] The candidate machine determination module is used to select machines that store missing target data as candidate machines when a data download request is received.
[0060] The first download target determination module is used to select the data center as the data download target when the number of candidate machines is 0.
[0061] The second download target determination module is used to determine the data download target based on the resource usage information of the data center and the candidate machines when the number of candidate machines is not zero.
[0062] The data download module is used to download the target data with missing rows from the data download object and send it back to the machine that sent the data download request.
[0063] The task and data schedulers are connected to the data center and machines, respectively. When scheduling data, the task and data schedulers are equivalent to data exchange stations between the data center and machines, and between machines.
[0064] The machine compares its stored data with all the target data of the task to identify the missing target data. Based on this identified data, it generates a data download request and sends it to the task and data scheduler. Upon receiving the download request, the task and data scheduler determines the target machine to download the data from based on the missing data. If a candidate machine exists that stores the missing data, the missing data can be downloaded from either the data center or the candidate machine. If no candidate machine exists, the missing data can only be downloaded from the data center. After downloading, the target data is sent to the machine that sent the download request.
[0065] When determining data download targets from data centers or candidate machines, resource utilization is also considered. Specifically, resource utilization information includes total network load and used network load. The second download target determination module is also used to: calculate the ratio of used network load to total network load in the data center to obtain the data center's load pressure; for each candidate machine, calculate the ratio of used network load to total network load to obtain the candidate machine's load pressure; and select the candidate machine or data center with the lowest load pressure as the data download target. Compared to all machines downloading data from the data center, determining data download targets based on load pressure can, on the one hand, rationally utilize data download resources and avoid excessive network load on data centers or machines, i.e., avoid excessive load pressure; on the other hand, downloading data from the candidate machine or data center with the lowest load pressure can improve network resource utilization and data download efficiency.
[0066] In an optional embodiment, the task execution system further includes a data center storing target data required for task execution; the task and data scheduler further includes:
[0067] The target data determination module is used to determine the target data required to perform each task.
[0068] The demand statistics module is used to calculate the demand for various target data.
[0069] The general data confirmation module is used to determine whether there is general data in the target data whose demand exceeds a preset value;
[0070] The cache machine determination module is used to determine the cache machine from the machines based on the remaining storage space and load status of the machines when general data is not stored in the machines.
[0071] The data loading module is used to load general data from the data center to the cache machine.
[0072] In cases where multiple tasks share some of the same target data, the demand for each target data point can be statistically analyzed to determine the common data, which is the data used most frequently. If this common data is not stored on any single machine, when multiple machines receive tasks requiring it, they all need to request and download that portion of the target data from the data center. This puts significant load on the data center and causes network congestion, resulting in slow download speeds for each machine. Therefore, when the common data is not stored on a machine, the task and data scheduler can first select a cache machine to cache the common data, and other machines can then download it from the cache machine, thereby reducing the load on the data center.
[0073] Specifically, resource usage information includes remaining storage space, total network load, and used network load. The cache machine determination module is also used to: when general data is not stored on the machine, designate machines with remaining storage space greater than the storage space required by the general data as backup cache machines; for each backup cache machine, calculate the ratio of used network load to total network load to obtain the load pressure of the backup cache machine; and determine the backup cache machine with the lowest load pressure as the cache machine. That is, a machine can only be used as a backup cache machine when it has enough remaining storage space to accommodate general data. Since the demand for general data is large, it means that more network resources need to be used, so the backup cache machine with the lowest load pressure can be selected as the cache machine.
[0074] It should be noted that the number of cache machines can be set according to the amount or demand of general data. When the demand or amount of general data is large, the amount of data downloaded is large. In this case, multiple cache machines can be set to reduce the load on each cache machine and make the load balanced among the machines.
[0075] In an optional embodiment, the resource occupancy information also includes remaining storage space, and the machine further includes:
[0076] The requirement data determination module is used to determine the target data required by the tasks in the task queue;
[0077] The status marking module is used to mark the status of data other than the target data as deletable.
[0078] The data deletion module is used to delete data that is deletable when the amount of new target data exceeds the remaining storage space.
[0079] As machines continuously execute tasks, they need to constantly store new task target data, causing the cache to accumulate increasingly large amounts of data. However, unlike data centers, each machine's cache has limited storage space and can only store a small amount of data. To ensure continuous execution of new tasks, data in the cache can be reduced based on its importance. For a machine, the target data corresponding to tasks in its task queue is considered important, while other data in the cache is considered unimportant. Therefore, currently unimportant data can be marked as deletable. When new target data needs to be stored and its volume exceeds the remaining storage space, the new target data becomes important. Therefore, the deletable data is deleted, providing storage space for the new target data. This embodiment, by reducing the data in the machine's cache, ensures that the cache always contains the target data required by the current task without affecting the storage of new data, allowing the execution unit to continuously retrieve target data from the cache during task execution.
[0080] In one example of this embodiment, the machine further includes:
[0081] The task preparation module is used to add tasks whose target data has been loaded to the preparation queue;
[0082] The out-of-order execution check module is used to adjust the execution order of tasks in the preparation queue to obtain the ready queue, so as to preserve the priority of tasks.
[0083] The task execution module controls idle execution units to execute tasks in the ready queue.
[0084] After the target data for a task is loaded, the task is added to the preparation queue. When adjusting the execution order of tasks in the preparation queue, the original execution order can be preserved. For example, if tasks A, B, and C are executed sequentially, with task C's target data loading first, followed by task A's, given that task A had priority over task C in the original execution order, the current task order is A, C, B. This preserves task priority, allowing higher-priority tasks to be executed first. When an execution unit is available, it can execute the tasks in the ready queue sequentially.
[0085] To clearly illustrate the roles of the various devices in the task execution system and the task execution process in this embodiment, combined with... Figure 2 To explain, Figure 2 This diagram illustrates the scheduling of tasks and data during task execution, and may include the following steps:
[0086] S1. The task scheduler receives tasks and sends them to the task and data scheduler in a certain execution order;
[0087] S2. The task scheduler determines the target machine for each task based on resource usage information and resource storage status, and assigns the task to the machine through the HTTP interface.
[0088] S3. The machine enters the preparation phase. First, it adds the target data that has been stored to the task preparation queue. Then, it determines the target data that is missing in its own task queue and generates a data download request based on the missing target data. That is, the data acquisition request is sent to the task and data scheduler.
[0089] S4, the task and data scheduler, identifies data download targets from the data center and machines, downloads the missing target data from the data download targets, and sends feedback to the machine that sent the data download request.
[0090] S5. The machine caches the received missing target data and then adds the stored target data to the task preparation queue.
[0091] S6. Adjust the order of tasks in the task preparation queue to obtain the task ready queue, so as to preserve the priority of tasks.
[0092] S7. Execute tasks in the task ready queue through the execution unit;
[0093] S8. Write the execution results to the database.
[0094] It should be noted that, for the sake of simplicity and clarity, in Figure 2 The example only illustrates the task and data scheduling process when a task is executed on a single machine. Other machines are merely alternatives for data access. In reality, each machine has the same function and can run independently, meaning it can load data and execute tasks independently.
[0095] Example 2
[0096] Figure 3 This is a flowchart of a task execution system method provided in Embodiment 1 of the present invention. This embodiment is applicable to the execution of autonomous driving simulation tasks. The method can be executed by a task execution device system, such as... Figure 1 As shown, the task execution system includes a task scheduler 1, a task and data scheduler 2, and at least one machine 3, each machine 3 including at least one execution unit 4.
[0097] like Figure 3 As shown, the task execution method includes:
[0098] S301, The task scheduler sends the tasks to the task and data scheduler in the execution order;
[0099] S302. When the task and data scheduler receives a task, it adds the task to the task queue of the machine according to the data loading status and resource usage information of the machine.
[0100] S303, The machine loads the target data corresponding to the tasks in its own task queue, adjusts the execution order of the tasks according to the loading degree of the target data, and controls the execution unit to execute the tasks according to the execution order of the tasks.
[0101] In an optional embodiment of the present invention, the data loading state includes storing data, and S302 includes:
[0102] Use the machine whose task queue is not full as the initial machine;
[0103] For each task, determine the target data required to perform the task;
[0104] Determine whether there is a backup machine in the initial machine that stores the target data;
[0105] When the backup machine exists, the target machine is determined from the backup machine based on the target data stored on the backup machine;
[0106] When the backup machine does not exist, the target machine is determined from the initial machine based on the resource usage information of the initial machine;
[0107] Add the task to the task queue of the target machine.
[0108] In an optional embodiment of the present invention, determining the target machine from the backup machine based on the target data stored on the backup machine includes:
[0109] When there is one backup machine, the backup machine is used as the target machine.
[0110] When there are multiple backup machines, determine the cache ratio of the target data stored on each backup machine;
[0111] The standby machine with the largest cache ratio is identified as the target machine.
[0112] In an optional embodiment of the present invention, the resource occupancy information includes the total network load and the used network load, and the step of determining the target machine from the initial machine based on the resource occupancy information of the initial machine includes:
[0113] For each of the initial machines, the ratio of the used network load to the total network load of the initial machine is calculated to obtain the load pressure of the initial machine;
[0114] The initial machine with the lowest load pressure is selected as the target machine.
[0115] In an optional embodiment of the present invention, the task execution system further includes a data center, the data center storing target data required for executing the task, and S303 includes:
[0116] For each task in the task queue, the machine determines the missing target data based on the target data corresponding to the task and the stored data on the machine, and generates a data download request to send to the task and data scheduler.
[0117] When the task and data scheduler receives a data download request, it will select the machine that stores the missing target data as a candidate machine.
[0118] When the number of candidate machines is 0, the data center is selected as the data download target;
[0119] When the number of candidate machines is not zero, the data download target is determined based on the resource usage information of the data center and the candidate machines;
[0120] Download the missing target data from the data download object and send it back to the machine that sent the data download request.
[0121] In an optional embodiment of the present invention, the resource occupancy information includes total network load and used network load. The step of determining the data download target based on the resource occupancy information of the data center and the candidate machines includes:
[0122] Calculate the ratio of the used network load to the total network load of the data center to obtain the load pressure of the data center;
[0123] For each candidate machine, the ratio of the used network load of the candidate machine to the total network load is calculated to obtain the load pressure of the candidate machine;
[0124] The candidate machine or the data center with the lowest load pressure will be selected as the data download target.
[0125] In an optional embodiment of the present invention, the task execution system further includes a data center, the data center storing target data required for task execution, the resource occupancy information including total network load and used network load, and the task execution method further includes:
[0126] For each task, the task and data scheduler determines the target data required to execute the task;
[0127] Calculate the required amount of each of the target data;
[0128] Determine whether there is general data in the target data whose demand exceeds a preset value;
[0129] When the general data is not stored in the machine, a cache machine is determined from the machine based on the remaining storage space of the machine and the load status;
[0130] The general data is loaded from the data center to the cache machine.
[0131] In an optional embodiment of the present invention, the resource occupancy information includes total network load and used network load, and the step of determining the cache machine from the machine based on the remaining storage space of the machine and the load status includes:
[0132] The machine with remaining storage space greater than the storage space required for the general data is designated as a backup cache machine;
[0133] For each of the backup cache machines, the ratio of the used network load to the total network load is calculated to obtain the load pressure of the backup cache machine;
[0134] The standby cache machine with the lowest load pressure is identified as the cache machine.
[0135] In an optional embodiment of the present invention, the resource occupancy information further includes remaining storage space.
[0136] The task execution method further includes: the machine determining the target data required for the tasks in the task queue;
[0137] Mark the status of all data other than the target data as deletable.
[0138] When the amount of new target data exceeds the remaining storage space, the data in the deleteable state will be deleted.
[0139] In an optional embodiment of the present invention, S303 further includes:
[0140] Add the task that has finished loading the target data to the preparation queue;
[0141] The execution order of tasks in the preparation queue is adjusted to obtain the ready queue, so as to preserve the priority of tasks;
[0142] The idle execution unit is controlled to execute the tasks in the ready queue.
[0143] The task execution device provided in the embodiments of the present invention can execute the task execution method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0144] Example 3
[0145] Figure 4 A schematic diagram of an electronic device 40 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0146] like Figure 4As shown, the electronic device 40 includes at least one processor 41 and a memory, such as a read-only memory (ROM) 42 or a random access memory (RAM) 43, communicatively connected to the at least one processor 41. The memory stores computer programs executable by the at least one processor. The processor 41 can perform various appropriate actions and processes based on the computer program stored in the ROM 42 or loaded into the RAM 43 from storage unit 48. The RAM 43 may also store various programs and data required for the operation of the electronic device 40. The processor 41, ROM 42, and RAM 43 are interconnected via a bus 44. An input / output (I / O) interface 45 is also connected to the bus 44.
[0147] Multiple components in electronic device 40 are connected to I / O interface 45, including: input unit 46, such as keyboard, mouse, etc.; output unit 47, such as various types of monitors, speakers, etc.; storage unit 48, such as disk, optical disk, etc.; and communication unit 49, such as network card, modem, wireless transceiver, etc. Communication unit 49 allows electronic device 40 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0148] Processor 41 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 41 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 41 performs the various methods and processes described above, such as task execution methods.
[0149] In some embodiments, the task execution method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 48. In some embodiments, part or all of the computer program may be loaded and / or mounted on electronic device 40 via ROM 42 and / or communication unit 49. When the computer program is loaded into RAM 43 and executed by processor 41, one or more steps of the task execution method described above may be performed. Alternatively, in other embodiments, processor 41 may be configured to execute the task execution method by any other suitable means (e.g., by means of firmware).
[0150] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0151] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0152] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0153] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0154] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0155] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0156] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0157] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A task execution system, characterized in that, It includes a task scheduler, a task and data scheduler, and at least one machine, each of which includes at least one execution unit. The task scheduler is used to send tasks to the task and data scheduler in the order of execution. The task and data scheduler is used to add the task to the machine's task queue when it receives a task, based on the machine's data loading status and resource usage information. The machine is used to load target data corresponding to tasks in its own task queue and adjust the execution order of tasks according to the loading status of the target data; And control the execution unit to execute tasks according to the task execution order; The machine also includes: The task preparation module is used to add tasks whose target data has been loaded to the preparation queue; The out-of-order execution check module is used to adjust the execution order of tasks in the preparation queue to obtain a ready queue, so as to preserve the priority of tasks. The task execution module controls the idle execution units to execute tasks in the ready queue.
2. The task execution system as described in claim 1, characterized in that, The data loading status includes the status of the data stored on the machine. The task and data scheduler includes: An initial machine determination module is used to select the machine whose task queue is not full as the initial machine; The target data determination module is used to determine the target data required to perform each task. The target machine determination module is used to determine whether there is a backup machine storing the target data in the initial machine; The first target machine determination module is used to determine the target machine from the backup machines based on the target data stored on the backup machines when the backup machines exist. The second target machine determination module is used to determine the target machine from the initial machine based on the resource occupancy information of the initial machine when the backup machine does not exist. The task allocation module is used to add tasks to the task queue of the target machine.
3. The task execution system as described in claim 2, characterized in that, The first target machine determination module is further configured to: When there is one backup machine, the backup machine is used as the target machine. When there are multiple backup machines, determine the cache ratio of the target data stored on each backup machine; The standby machine with the largest cache ratio is identified as the target machine.
4. The task execution system as described in claim 2, characterized in that, The resource usage information includes the total network load and the amount of network load already used. The second target machine determination module is further configured to: For each of the initial machines, the ratio of the used network load to the total network load of the initial machine is calculated to obtain the load pressure of the initial machine; The initial machine with the lowest load pressure is selected as the target machine.
5. The task execution system as described in claim 1, characterized in that, It also includes a data center that stores the target data required to perform the task; The machine includes: The missing data determination module is used to determine the missing target data for each task in the task queue based on the target data corresponding to the task and the stored data on the machine, and generate a data download request to be sent to the task and data scheduler. The task and data scheduler also includes: The candidate machine determination module is used to select the machine storing the missing target data as a candidate machine when the data download request is received. The first download target determination module is used to select the data center as the data download target when the number of candidate machines is 0. The second download target determination module is used to determine the data download target based on the resource occupancy information of the data center and the candidate machines when the number of candidate machines is not 0. The data download module is used to download the missing target data from the data download object and send it back to the machine that sent the data download request.
6. The task execution system as described in claim 5, characterized in that, The resource usage information includes the total network load and the amount of network load already used. The second download object determination module is further configured to: Calculate the ratio of the used network load to the total network load of the data center to obtain the load pressure of the data center; For each candidate machine, the ratio of the used network load to the total network load of the candidate machine is calculated to obtain the load pressure of the candidate machine. The candidate machine or the data center with the lowest load pressure will be selected as the data download target.
7. The task execution system as described in claim 1, characterized in that, It also includes a data center, which stores the target data required to perform the task; the resource usage information includes the total network load and the amount of network load used. The task and data scheduler also includes: The target data determination module is used to determine the target data required to perform each task. The demand statistics module is used to calculate the demand for each of the target data. A general data confirmation module is used to determine whether there is general data in the target data whose demand exceeds a preset value; A cache machine determination module is used to determine a cache machine from the machines based on the remaining storage space and load status of the machines when the general data is not stored in the machines. A data loading module is used to load the general data from the data center to the cache machine.
8. The task execution system as described in claim 7, characterized in that, The resource usage information includes the total network load and the amount of network load already used. The cache machine determination module is further configured to: The machine with remaining storage space greater than the storage space required for the general data is designated as a backup cache machine; For each of the backup cache machines, the ratio of the used network load to the total network load is calculated to obtain the load pressure of the backup cache machine; The standby cache machine with the lowest load pressure is identified as the cache machine.
9. The task execution system as described in claim 1, characterized in that, The resource usage information also includes remaining storage space. The machine also includes: The requirement data determination module is used to determine the target data required by the tasks in the task queue; The status marking module is used to mark the status of data other than the target data as deletable. The data deletion module is used to delete data that is deletable when the amount of new target data exceeds the remaining storage space.
10. A task execution method, characterized in that, Applied to a task execution system, the task execution system includes a task scheduler, a task and data scheduler, and at least one machine, each of the machines including at least one execution unit, the task execution method includes: The task scheduler sends tasks to the task and data scheduler in the order of execution. When the task and data scheduler receives a task, it adds the task to the machine's task queue based on the machine's data loading status and resource usage information. The machine loads the target data corresponding to the tasks in its own task queue, adjusts the execution order of the tasks according to the loading status of the target data, and controls the execution unit to execute the tasks in the order of task execution. Add the task that has finished loading the target data to the preparation queue; The execution order of tasks in the preparation queue is adjusted to obtain the ready queue, so as to preserve the priority of tasks; The idle execution unit is controlled to execute the tasks in the ready queue.
11. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the task execution method of claim 10.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that are used to cause a processor to execute the task execution method of claim 10.
Citation Information
Patent Citations
Content distribution network and data downloading method
CN107277092A
Intelligent cache acceleration system and method for deep learning cloud platform
CN115022405A
