A non-real-time resource scheduling method and device for heterogeneous computing resources

By generating and selecting the optimal deployment scheme and storing resource scheduling data, the problem of low resource scheduling efficiency of heterogeneous resources in autonomous driving platforms is solved, and efficient resource utilization and scheduling are achieved.

CN114064258BActive Publication Date: 2025-11-11YAOYAO
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010766038.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-08-03
Publication Date
2025-11-11
Estimated Expiration
2040-08-03

AI Technical Summary

Technical Problem

In autonomous driving platforms, the differences between heterogeneous resources make it difficult to achieve a unified resource modeling approach, resulting in low resource scheduling efficiency.

Method used

This paper presents a non-real-time resource scheduling method for heterogeneous computing resources. By receiving tasks to be processed and optimizing performance indicators, it generates all possible deployment schemes, selects the optimal scheme based on performance indicators, stores data during the resource scheduling process to reduce scheduling overhead, and uses a multi-branch tree structure to quickly search the database and eliminates failed deployment scheme combinations.

Benefits of technology

It improves the efficiency and accuracy of resource scheduling, reduces redundant testing, optimizes resource utilization, and adapts to the periodicity and low variability of tasks in autonomous driving platforms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114064258B_ABST
    Figure CN114064258B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a non-real-time resource scheduling method and device for heterogeneous computing resources. The method comprises: receiving a to-be-processed task and an optimized performance index sent by a request end; determining target computing resources corresponding to each subtask in the current available computing resources; constructing all deployment schemes according to the correspondence between each subtask and each target computing resource; determining the value of each performance index corresponding to each deployment scheme, and determining the optimal deployment scheme in each deployment scheme and returning to the request end. By applying the scheme provided by the embodiments of the present application, the characteristics of the tasks in the automatic driving platform can be targeted, that is, the tasks on the automatic driving platform have less variability, and periodic tasks are usually deployed, and the scheduling time has no effect on the execution efficiency. When the to-be-processed task is received, all possible deployment schemes are generated, and the performance index corresponding to each deployment scheme is determined, so that the optimal deployment scheme can be selected according to the user's optimized performance index.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of heterogeneous computing technology, and more specifically, to a non-real-time resource scheduling method and apparatus for heterogeneous computing resources. Background Technology

[0002] In heterogeneous computing platforms, effective resource management strategies can improve resource utilization and reduce task overhead. Known resource scheduling methods typically involve resource modeling for scheduling.

[0003] However, the differences between heterogeneous resources in autonomous driving platforms make it difficult to achieve a unified resource modeling approach. Therefore, a resource scheduling method is urgently needed to schedule resources for autonomous driving platforms. Summary of the Invention

[0004] This invention provides a non-real-time resource scheduling method and apparatus for heterogeneous computing resources, for resource scheduling of an autonomous driving platform. The specific technical solution is as follows.

[0005] In a first aspect, embodiments of the present invention provide a non-real-time resource scheduling method for heterogeneous computing resources, the method being applied to a resource scheduling server, the method comprising:

[0006] The system receives pending tasks and performance optimization metrics sent by the requesting end. The pending tasks are periodic tasks, and each pending task includes multiple sub-tasks.

[0007] Based on the pre-set computing resource selection constraints corresponding to each type of task, determine the target computing resources corresponding to each sub-task from the currently available computing resources;

[0008] Based on the correspondence between each subtask and each target computing resource, all deployment schemes are constructed; each deployment scheme includes a mapping combination of each subtask and target computing resource.

[0009] The values ​​of each performance metric corresponding to each deployment scheme are determined, and the optimal deployment scheme is determined among the deployment schemes and returned to the requesting end based on the values ​​of the optimized performance metrics corresponding to each deployment scheme.

[0010] Optionally, the step of determining the values ​​of each performance metric corresponding to each deployment scheme includes:

[0011] For each of the aforementioned deployment schemes, a search is performed in the preset database to determine if the deployment scheme exists.

[0012] When the deployment scheme does not exist in the preset database, the test interface is called to run the deployment scheme and obtain the values ​​of each performance indicator corresponding to the deployment scheme.

[0013] When the deployment scheme exists in the preset database, the values ​​of each performance indicator corresponding to the deployment scheme are obtained from the preset database.

[0014] Optionally, after calling the test interface to run the deployment scheme and obtaining the values ​​of each performance metric corresponding to the deployment scheme, the method further includes:

[0015] The deployment scheme and the corresponding performance index values ​​are stored in the preset database in a multi-branch tree structure; wherein, the root node of the multi-branch tree is where all the subtasks use 0 computing resources, and each sub-node includes computing resource information used by each subtask.

[0016] Optionally, the step of calling the test interface to run the deployment scheme and obtaining the values ​​of each performance metric corresponding to the deployment scheme includes:

[0017] According to the execution order of each subtask, the test interface is called to run each subtask included in the deployment scheme in sequence, and it is determined whether a test failure result for any subtask is received.

[0018] When a test failure result is received, the deployment scheme is terminated and all deployment schemes that include the mapping combination of the subtask and the corresponding target computing resources are removed; when no test failure result is received, the performance indicators corresponding to the deployment scheme are obtained after the execution of each subtask.

[0019] Optionally, the step of determining the optimal deployment scheme and returning it to the requesting end based on the values ​​of the optimization performance indicators corresponding to each deployment scheme includes:

[0020] When the optimized performance metric includes a target performance metric, the deployment scheme with the best target performance metric is selected from the deployment schemes and returned to the requesting end as the optimal deployment scheme.

[0021] When the optimized performance metrics include multiple target performance metrics, the weight of each target performance metric is determined. Based on the weight of each target performance metric and the value of each target performance metric corresponding to each deployment scheme, the performance value of each deployment scheme is calculated, and the deployment scheme with the highest performance value is returned to the requesting end as the optimal deployment scheme.

[0022] Secondly, embodiments of the present invention provide a non-real-time resource scheduling device for heterogeneous computing resources, the device being applied to a resource scheduling server, the device comprising:

[0023] The task receiving module is used to receive pending tasks and performance optimization indicators sent by the requesting end. The pending tasks are periodic tasks and include multiple sub-tasks.

[0024] The resource determination module is used to determine the target computing resources corresponding to each subtask from the currently available computing resources, based on the pre-set computing resource selection constraints corresponding to each type of task.

[0025] The scheme construction module is used to construct all deployment schemes based on the correspondence between each subtask and each target computing resource; each deployment scheme includes a mapping combination of each subtask and target computing resource;

[0026] The resource scheduling module is used to determine the values ​​of each performance indicator corresponding to each deployment scheme, and based on the values ​​of the optimized performance indicators corresponding to each deployment scheme, determine the optimal deployment scheme among the deployment schemes and return it to the requesting end.

[0027] Optionally, the resource scheduling module includes:

[0028] The scheme search submodule is used to search the preset database for each of the deployment schemes to see if the deployment scheme exists.

[0029] The solution testing submodule is used to call the test interface to run the deployment solution when the deployment solution does not exist in the preset database, and obtain the values ​​of each performance indicator corresponding to the deployment solution.

[0030] The indicator acquisition submodule is used to obtain the values ​​of each performance indicator corresponding to the deployment scheme from the preset database when the deployment scheme exists in the preset database.

[0031] Optionally, the device further includes:

[0032] The data storage module is used to store the deployment scheme and the corresponding performance index values ​​in a multi-branch tree structure to the preset database; wherein, the root node of the multi-branch tree is where all the subtasks use 0 computing resources, and each sub-node includes computing resource information used by each subtask.

[0033] Optionally, the solution testing submodule is specifically used for:

[0034] According to the execution order of each subtask, the test interface is called to run each subtask included in the deployment scheme in sequence, and it is determined whether a test failure result for any subtask is received.

[0035] When a test failure result is received, the deployment scheme is terminated and all deployment schemes that include the mapping combination of the subtask and the corresponding target computing resources are removed; when no test failure result is received, the performance indicators corresponding to the deployment scheme are obtained after the execution of each subtask.

[0036] Optionally, the resource scheduling module includes:

[0037] The scheme selection submodule is used to select the deployment scheme with the best target performance indicator from the various deployment schemes when the optimized performance indicator includes a target performance indicator, and return it to the requesting end as the optimal deployment scheme;

[0038] The performance calculation submodule is used to determine the weight of each target performance indicator when the optimized performance indicator includes multiple target performance indicators, calculate the performance value of each deployment scheme based on the weight of each target performance indicator and the value of each target performance indicator corresponding to each deployment scheme, and return the deployment scheme with the highest performance value as the optimal deployment scheme to the requesting end.

[0039] As can be seen from the above, the non-real-time resource scheduling method and apparatus for heterogeneous computing resources provided in this embodiment of the invention can address the characteristics of tasks in autonomous driving platforms, namely, tasks on autonomous driving platforms have relatively low variability, are typically deployed as periodic tasks, and scheduling time has no impact on execution efficiency. Upon receiving a task to be processed, the method generates all possible deployment schemes and determines the performance indicators corresponding to each deployment scheme, thereby selecting the optimal deployment scheme based on the user-inputted optimization performance indicators. Of course, implementing any product or method of this invention does not necessarily require simultaneously achieving all the advantages described above.

[0040] The innovative aspects of this invention include:

[0041] 1. Considering the characteristics of tasks in autonomous driving platforms, namely that tasks on autonomous driving platforms have little variability, are usually deployed periodically, and scheduling time has no impact on execution efficiency, when a task to be processed is received, all possible deployment schemes are generated and the performance indicators corresponding to each deployment scheme are determined. Thus, the optimal deployment scheme can be selected based on the optimization performance indicators input by the user.

[0042] 2. The data generated during storage resource scheduling, namely the storage deployment plan and the corresponding performance index values, can be used directly for the same task in subsequent resource scheduling processes, reducing scheduling overhead.

[0043] 3. By storing each deployment scheme and its corresponding performance index value in a multi-branch tree structure, the system can quickly search the database to see if each deployment scheme is stored during subsequent resource scheduling, thereby improving the efficiency of resource scheduling.

[0044] 4. When testing a deployment scheme, if any subtask in the deployment scheme fails to execute, it indicates that the target computing resources included in the deployment scheme cannot successfully run the subtask. In addition, other deployment schemes that include the subtask and the target computing resources will also fail to run. In this case, removing all deployment schemes that include the mapping combination of the subtask and the corresponding target computing resources can avoid testing these deployment schemes and thus improve resource scheduling efficiency. Attached Figure Description

[0045] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are merely some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.

[0046] Figure 1 A flowchart illustrating a non-real-time resource scheduling method for heterogeneous computing resources provided in an embodiment of the present invention;

[0047] Figure 2 This is a schematic diagram of a directed acyclic graph in an embodiment of the present invention;

[0048] Figure 3 This is a schematic diagram of a non-real-time resource scheduling device for heterogeneous computing resources provided in an embodiment of the present invention. Detailed Implementation

[0049] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0050] It should be noted that the terms "comprising" and "having," and any variations thereof, in the embodiments and drawings of this invention are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the steps or units listed, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices.

[0051] This invention discloses a non-real-time resource scheduling method and apparatus for heterogeneous computing resources, which can generate optimal deployment schemes for tasks in an autonomous driving platform. The embodiments of this invention are described in detail below.

[0052] Figure 1 This is a flowchart illustrating a non-real-time resource scheduling method for heterogeneous computing resources provided in an embodiment of the present invention. The method is applied to a resource scheduling server. Specifically, the method includes the following steps.

[0053] S110: Receive the pending tasks and performance optimization indicators sent by the requesting end. The pending tasks are periodic tasks and include multiple sub-tasks.

[0054] The aforementioned performance optimization metrics refer to the performance metrics that users wish to optimize. These performance metrics may include at least one of the following: execution time, cost, power consumption, and bandwidth usage. Optimization metrics may be one or more of these.

[0055] S120: Based on the pre-set computing resource selection constraints corresponding to each type of task, determine the target computing resources corresponding to each subtask from the currently available computing resources.

[0056] In heterogeneous computing platforms, different computing resources can handle different types of tasks. Therefore, in this embodiment of the invention, the correspondence between each task and each computing resource can be pre-defined. That is, for each type of task, it is possible to specify which computing resources can execute that task. For example, computing resources 1, 2, and 3 can be assigned to task a; computing resources 4 and 5 can be assigned to task b, and so on.

[0057] For example, when the task to be processed includes subtasks a and b, the computing resources corresponding to subtask a are 1, 2, and 3, and the computing resources corresponding to subtask b are 4 and 5, and the computing resources 1, 2, 4, and 5 are currently available, the electronic device can determine that the target computing resources corresponding to subtask a are 1 and 2, and the target computing resources corresponding to subtask b are 4 and 5.

[0058] S130: Construct all deployment schemes based on the correspondence between each subtask and each target computing resource; each deployment scheme includes a mapping combination of each subtask and target computing resource.

[0059] The electronic device constructs all deployment schemes, that is, it constructs the correspondence between all subtasks and target computing resources. For example, when the electronic device determines that the target computing resources corresponding to subtask a are 1 and 2, and the target computing resources corresponding to subtask b are 4 and 5, the resulting deployment schemes are as follows:

[0060] a-1, b-4;

[0061] a-1, b-5;

[0062] a-2, b-4;

[0063] a-2, b-5.

[0064] S140: Determine the values ​​of each performance metric corresponding to each deployment scheme, and based on the values ​​of the optimized performance metrics corresponding to each deployment scheme, determine the optimal deployment scheme among all deployment schemes and return it to the requesting end.

[0065] In one implementation, to improve resource scheduling efficiency, when an electronic device receives a deployment plan for any task, it can store the deployment plan in a preset database. In subsequent resource scheduling processes, when a previously scheduled task is received, the deployment plan can be directly retrieved from the database, reducing scheduling overhead and improving resource scheduling efficiency.

[0066] Specifically, when determining the performance index values ​​for each deployment scheme, the electronic device can search the preset database for each deployment scheme to see if the deployment scheme exists. If the deployment scheme does not exist in the preset database, the test interface is called to run the deployment scheme and obtain the values ​​of each performance index corresponding to the deployment scheme. If the deployment scheme exists in the preset database, the values ​​of each performance index corresponding to the deployment scheme are retrieved from the preset database.

[0067] When an electronic device searches the database to see if any deployment scheme exists, it can search the database for each deployment scheme to see if there is a deployment scheme in the database that has the same tasks and computing resources as that deployment scheme. When a solution is found, it can be determined that the deployment scheme exists in the database.

[0068] The aforementioned test interfaces can include Interface 1 and Interface 2. Interface 1 is the modelregister interface, used to send the software module and its required operating environment to the electronic device in advance. Interface 2 is the performance testing interface, used to test the performance of several modules running concurrently.

[0069] It is understandable that different deployment schemes may include some identical subtasks and mapping combinations of target computing resources. In one implementation, to improve resource scheduling efficiency, when testing any deployment scheme, the electronic device can call the test interface to run each subtask included in the deployment scheme sequentially according to the execution order of each subtask, and determine whether a test failure result is received for any subtask; when a test failure result is received, the execution of the deployment scheme is terminated, and all deployment schemes that include the mapping combination of that subtask and the corresponding target computing resource are removed; when no test failure result is received, the performance indicators corresponding to the deployment scheme are obtained after the execution of each subtask.

[0070] When testing a deployment scheme, if any subtask in the deployment scheme fails to execute, it indicates that the target computing resources included in the deployment scheme cannot successfully run the subtask. In addition, other deployment schemes that include the subtask and the target computing resources will also fail to run. In this case, removing all deployment schemes that include the mapping combination of the subtask and the corresponding target computing resources can avoid testing these deployment schemes and thus improve resource scheduling efficiency.

[0071] In one implementation, after the electronic device calls the test interface to run the deployment scheme and obtains the values ​​of each performance indicator corresponding to the deployment scheme, the deployment scheme and the values ​​of each performance indicator can be stored in a preset database in a multi-branch tree structure. The root node of the multi-branch tree is where all subtasks use 0 computing resources, and each sub-node includes the computing resource information used by each subtask.

[0072] The data generated during storage resource scheduling—namely, the deployment schemes and corresponding performance metrics—can be used directly for the same tasks in subsequent resource scheduling processes, reducing scheduling overhead. Furthermore, storing each deployment scheme and its corresponding performance metric value in a multi-branch tree structure allows for quick lookup of the database to determine if each deployment scheme exists during subsequent resource scheduling, improving scheduling efficiency.

[0073] In one implementation, when the electronic device determines the optimal deployment scheme among the deployment schemes and returns it to the requesting end based on the values ​​of the optimized performance indicators corresponding to each deployment scheme, specifically, when the optimized performance indicator includes a target performance indicator, the electronic device can select the deployment scheme with the best target performance indicator among the deployment schemes and return it to the requesting end as the optimal deployment scheme; when the optimized performance indicator includes multiple target performance indicators, the electronic device can determine the weight of each target performance indicator, calculate the performance value of each deployment scheme based on the weight of each target performance indicator and the values ​​of each target performance indicator corresponding to each deployment scheme, and return the deployment scheme with the highest performance value as the optimal deployment scheme to the requesting end.

[0074] The weights of each target performance metric can be input by the user. The performance value of each deployment scheme can be obtained by weighting the values ​​of each target performance metric corresponding to that deployment scheme with their respective weights.

[0075] As can be seen from the above, this embodiment can target the characteristics of tasks in autonomous driving platforms, namely, tasks on autonomous driving platforms have little variability, are usually deployed periodically, and scheduling time has no impact on execution efficiency. When a task to be processed is received, all possible deployment schemes are generated and the performance indicators corresponding to each deployment scheme are determined. Thus, the optimal deployment scheme can be selected based on the optimization performance indicators input by the user.

[0076] The non-real-time resource scheduling method for heterogeneous computing resources provided by the present invention will be specifically described below with reference to a specific embodiment.

[0077] The resource scheduling server in this embodiment of the invention may include a non-real-time scheduling module, a performance testing module, and a data storage module.

[0078] The non-real-time scheduling module's entry point is the service interface, receiving two parameters: a list of heterogeneous computing resources and a list of software modules to be deployed, i.e., the tasks to be processed. Internally, the module first generates all possible hardware-software mapping combinations based on the hardware selection constraints of the software modules. Second, it generates deployment schemes for each permutation of the software modules on the hardware, forming a solution space. The permutation of the solution space can be changed according to the solution search algorithm; currently, a multi-branch tree structure is used. During solution space generation, the performance of each solution is tested. Testing first queries the database; if the solution does not exist in the database, the performance testing module is called, and the returned test results are saved in the database. The search module traverses the hardware-software mapping combinations, searching for a locally optimal solution for each combination in the solution space. Finally, it responds to the service requester with the optimal solution among all locally optimal solutions.

[0079] The specific operating steps are as follows:

[0080] 1. Generate all deployment schemes and save all deployment schemes for each type of heterogeneous device using a multi-branch tree structure: The root node of the multi-branch tree is where all tasks are executed using 0 threads. The multi-branch tree is built recursively. Each recursion generates the child nodes of the tree node corresponding to the previous recursion level. The child nodes include how many threads each task uses.

[0081] 2. Searching the solution space: Using a branch and bound approach, the tree-structured solution space is traversed. When traversing each deployment scheme, if the performance metrics for that scheme already exist in the database, it is skipped; otherwise, the performance testing module is called.

[0082] 3. If the performance test module returns the overhead, the execution time, cost, power consumption, bandwidth usage, and other indicators will be stored in the database;

[0083] 4. If the performance testing module returns a test failure, then the entire subtree will be stored in the database as if it failed.

[0084] 5. Optimal Solution Selection: If the user requires single-mode scheduling, that is, only the optimal value of a single metric is pursued, then the optimal solution is directly found in the database; if multi-mode scheduling is required, then weights need to be set for each metric, the solution value is represented by a polynomial, and then the optimal solution is further searched in the database.

[0085] The performance testing module consists of two interfaces: Interface 1 is the model register interface, used to send the software module and its required runtime environment to the device in advance. Interface 2 is the performance testing interface, used to test the performance of several modules running concurrently. The concurrency control module calls multiple software models one by one. When the device utilization threshold module allows the activation of a new module, the new software module is invoked within that software module's environment.

[0086] The test execution steps are as follows:

[0087] 1. Task Registration: Receive the task code and deployment script, and check the task registration list.

[0088] If a task has already been registered, it will not be registered again.

[0089] Otherwise, execute the deployment script to complete the deployment of the task on the execution device;

[0090] 2. Concurrency Control: Receive the parallelism of this test from the scheduling module, including which tasks are selected and how many threads are used for each task;

[0091] 3. Threshold Detection: Based on the tasks to be executed and their degree of parallelism, check whether the CPU and memory on the device will be overloaded during parallel task execution, potentially causing system crashes.

[0092] If the set threshold is reached, return directly;

[0093] Otherwise, continue testing;

[0094] 4. Parallel execution: Execute tasks in parallel, collect relevant metrics, and return the metrics to the caller.

[0095] Data storage module: This module consists of multiple serialization tools and a backend database. It is the core module and stores the information of devices and software modules registered in the service as templates. It is also stored in the device table and the model table respectively. The performance data generated during the scheduling process is stored in the scheme table to prevent duplicate testing.

[0096] In one embodiment of the present invention, the electronic device can employ different schemes for resource scheduling based on different types of tasks. Specifically, the resource scheduling process may include the following steps:

[0097] Step 1: Receive the pending task sent by the requesting end; the pending task includes multiple subtasks.

[0098] Step 2: Determine whether the task to be processed is a preset type of task.

[0099] In practical applications, some types of tasks have high time requirements, while others have low time requirements. In this embodiment of the invention, resource scheduling can be carried out according to the different time requirements of the tasks.

[0100] The aforementioned preset task types can be tasks with low time requirements, and the specific type can be set by the user according to actual needs. This embodiment of the invention does not impose specific limitations on this.

[0101] Step 3: When the task to be processed is a preset type of task, receive the optimized performance indicators sent by the requesting end, and determine the target computing resources corresponding to each sub-task from the currently available computing resources according to the pre-set computing resource selection restrictions corresponding to each type of task; construct all deployment schemes according to the correspondence between each sub-task and each target computing resource; each deployment scheme includes a mapping combination of each sub-task and target computing resources; determine the value of each performance indicator corresponding to each deployment scheme, and determine the optimal deployment scheme among the deployment schemes according to the value of the optimized performance indicators corresponding to each deployment scheme and return it to the requesting end.

[0102] Step 4: When the task to be processed is not a preset type of task, a Directed Acyclic Graph (DAG) is generated based on the dependencies between the multiple subtasks; the resource quantity of each computing resource is obtained, and a heterogeneous resource pool is constructed; the heterogeneous resource pool includes the resource quantity of each computing resource; each computing resource is a heterogeneous computing resource; based on the pre-set correspondence between each task and each computing resource, computing resources are allocated to each subtask in the heterogeneous resource pool with the code quantity of each subtask in the DAG as the initial weight, to obtain an initial resource allocation scheme; and the initial resource allocation scheme is taken as the optimal scheme; each subtask included in the DAG is executed according to the optimal scheme, and the execution time of each subtask is recorded; based on the execution time of each subtask, the critical path in the DAG is determined, and the subtask A with the longest execution time in the critical path is identified, the critical path being the path with the longest execution time; starting from the subtask A corresponding to... A unit of computing resource K is randomly selected from the computing resources, and a non-critical path with more than one unit of computing resource K is identified. One unit of computing resource K is then allocated from the non-critical path to the subtask A to obtain the current resource allocation scheme. It is then determined whether a preset termination condition is met. If the preset termination condition is met, the current resource allocation scheme is adopted as the final resource allocation scheme. If the preset termination condition is not met, each subtask included in the DAG is executed according to the current resource allocation scheme, and the execution time of each subtask is recorded. The current value corresponding to the current resource allocation scheme and the optimal value corresponding to the optimal scheme are calculated according to a preset evaluation function. If the current value is less than the optimal value, the optimal scheme is updated using the current resource allocation scheme. Finally, the process returns to the step of executing each subtask included in the DAG according to the optimal scheme and recording the execution time of each subtask.

[0103] If there is an undirected acyclic graph (DAG) where a path from point A to B, through point C, and back to A forms a cycle, changing the direction of the edge from C to A to A to C transforms it into a DAG. For example, consider a task containing subtasks a, b, c, d, and e. When a and b complete their computations, they send their output to c; when c completes its computation, it sends its output to d and e. Figure 2 As shown, the graph structure formed by the subtasks a, b, c, d, and e is a DAG with two inputs and two outputs.

[0104] For example, an electronic device can send resource acquisition requests to various heterogeneous computing resources. After receiving the resource acquisition request, each heterogeneous computing resource can send its own resource allocation to the electronic device. This resource allocation can include CPU free space, hardware free space, etc.

[0105] In heterogeneous computing platforms, different computing resources can handle different types of tasks. Therefore, in this embodiment of the invention, the correspondence between each task and each computing resource can be pre-defined. That is, for each type of task, it is possible to specify which computing resources can execute that task. For example, computing resources 1, 2, and 3 can be assigned to task a; computing resources 4 and 5 can be assigned to task b, and so on.

[0106] For example, when the task to be processed contains subtasks a, b, c, d, and e, and the computing resources corresponding to subtask a are 1, 2, and 3, the computing resource with the highest resource quantity can be selected from computing resources 1, 2, and 3, such as 2, as the computing resource corresponding to subtask a; similarly, the corresponding computing resources can be allocated to subtasks b, c, d, and e, such as 4, 8, 11, and 15 respectively, resulting in the initial resource allocation scheme: a-2, b-4, c-8, d-11, e-15.

[0107] Taking the above example, this means that subtask a can be run by computing resource 2, subtask b by computing resource 4, subtask c by computing resource 8, subtask d by computing resource 11, and subtask e by computing resource 15. The execution time of each subtask is the total time required for the corresponding computing resource to run that subtask.

[0108] exist Figure 2 In the DAG shown, the execution time of path ac-ce is the sum of the execution times of subtasks a, c, and e; the execution time of path ac-cd is the sum of the execution times of subtasks a, c, and d; the execution time of path bc-ce is the sum of the execution times of subtasks b, c, and e; and the execution time of path bc-cd is the sum of the execution times of subtasks b, c, and d.

[0109] Among all paths, the path with the longest execution time is identified as the critical path. In this embodiment of the invention, in order to balance the usage of various computing resources and shorten the execution time of the critical path, the computing resources in the critical path can be scheduled.

[0110] It is understood that scheduling the subtask with the longest execution time in the critical path can effectively shorten the execution time of the critical path. Therefore, in this embodiment of the invention, the electronic device can determine the subtask A with the longest execution time in the critical path. For example, when the critical path is ac-cd, subtask A can be task c.

[0111] The subtask A with the longest execution time may correspond to multiple computing resources. In this embodiment of the invention, when scheduling subtask A, the electronic device can randomly select one unit of computing resource K from the computing resources corresponding to subtask A, determine a non-critical path with more than one unit of computing resource K, and allocate one unit of computing resource K from the non-critical path to subtask A, thus obtaining the current resource allocation scheme.

[0112] In one implementation, before allocating a unit of computing resource K from a non-critical path to subtask A, the electronic device can first determine whether there exists a non-critical path with more than one unit of computing resource K. If such a non-critical path exists, a unit of computing resource K is allocated from that path to subtask A, resulting in the current resource allocation scheme. If no non-critical path exists with more than one unit of computing resource K, computing resources are allocated to each subtask from a heterogeneous resource pool, using the execution time of each subtask on the critical path as a weight, resulting in the current resource allocation scheme.

[0113] In other words, we can define the subtask with the highest time cost in the critical path as A, randomly select one type of resource required by A and denote it as K, and randomly select a node from the non-critical path nodes that have more than one unit of K computing resources, and allocate one unit of the K resources owned by that node to A. If all computing tasks belong to the critical path or the non-critical path nodes all have only one unit of computing resources, then the computing resources of each subtask on the critical path are reallocated based on the execution time of each subtask on the critical path.

[0114] The aforementioned preset termination conditions may include: the number of repetitions reaching the maximum number of repetitions, or the number of consecutive times the change in the optimal value calculated according to the preset evaluation function between two adjacent iterations falling within a set range reaches a preset number. Setting preset termination conditions can prevent excessively long loop times and ensure the efficiency of resource scheduling.

[0115] When the preset termination conditions are met, the resource allocation process ends. In this case, the electronic device can use the current resource allocation scheme as the final resource allocation scheme.

[0116] When it is determined that the preset termination condition is not met, the electronic device can continue to optimize the resource allocation scheme. Specifically, the electronic device can execute each sub-task included in the DAG according to the current resource allocation scheme and record the execution time of each sub-task. It can calculate the current value corresponding to the current resource allocation scheme and the optimal value corresponding to the optimal scheme according to the preset evaluation function. When the current value is less than the optimal value, the optimal scheme is updated using the current resource allocation scheme.

[0117] In other words, the current resource allocation scheme can be compared with the optimal scheme, and if the current resource allocation scheme is better, the current resource allocation scheme can be used to replace the optimal scheme.

[0118] The aforementioned preset evaluation function is:

[0119]

[0120] L k L is the execution duration of subtask k. u Let N be the average execution time of each subtask, and N be the total number of subtasks.

[0121] In this embodiment, in the currently obtained optimal solution, the subtask with the longest execution time in the critical path is scheduled to the corresponding computing resources in other non-critical paths. This reduces the total execution time of all tasks in the critical path. Through multiple iterations, the resource allocation scheme with the shortest execution time can be obtained, thereby reducing the time consumption of heterogeneous computing and improving computing speed. Furthermore, allocating computing resources with the code size of each subtask as the initial weight allows each computing resource to be in a working state to the maximum extent according to the resource granularity it can provide, making full use of each computing resource. For the same subtask, the execution time of computing resources with larger resource sizes is shorter than that of computing resources with smaller resource sizes. Therefore, when scheduling the subtask with the longest execution time in the critical path, if there is no non-critical path with corresponding computing resources, the computing resources of each subtask in the critical path are reallocated based on the execution time of each subtask in the critical path. That is, the subtask with the longer execution time can be assigned to the computing resources with larger resource sizes, thereby obtaining the resource allocation scheme with the shortest execution time and improving computing speed. Furthermore, it can balance the working time of each computing resource, prevent local aging caused by long-term use of local computing resources, average the aging rate of computing resources, and improve the lifespan of computing resources.

[0122] like Figure 3 As shown, this invention provides a non-real-time resource scheduling device for heterogeneous computing resources. The device is applied to a resource scheduling server and may include:

[0123] The task receiving module 310 is used to receive the pending tasks and performance optimization indicators sent by the requesting end. The pending tasks are periodic tasks and include multiple sub-tasks.

[0124] The resource determination module 320 is used to determine each target computing resource corresponding to each subtask from the currently available computing resources based on the pre-set computing resource selection restrictions corresponding to each type of task.

[0125] The scheme construction module 330 is used to construct all deployment schemes according to the correspondence between each subtask and each target computing resource; each deployment scheme includes a mapping combination of each subtask and target computing resource;

[0126] The resource scheduling module 340 is used to determine the values ​​of each performance indicator corresponding to each deployment scheme, and based on the values ​​of the optimized performance indicators corresponding to each deployment scheme, determine the optimal deployment scheme among the deployment schemes and return it to the requesting end.

[0127] Optionally, the resource scheduling module 340 includes:

[0128] The scheme search submodule is used to search the preset database for each of the deployment schemes to see if the deployment scheme exists.

[0129] The solution testing submodule is used to call the test interface to run the deployment solution when the deployment solution does not exist in the preset database, and obtain the values ​​of each performance indicator corresponding to the deployment solution.

[0130] The indicator acquisition submodule is used to obtain the values ​​of each performance indicator corresponding to the deployment scheme from the preset database when the deployment scheme exists in the preset database.

[0131] Optionally, the device further includes:

[0132] The data storage module is used to store the deployment scheme and the corresponding performance index values ​​in a multi-branch tree structure to the preset database; wherein, the root node of the multi-branch tree is where all the subtasks use 0 computing resources, and each sub-node includes computing resource information used by each subtask.

[0133] Optionally, the solution testing submodule is specifically used for:

[0134] According to the execution order of each subtask, the test interface is called to run each subtask included in the deployment scheme in sequence, and it is determined whether a test failure result for any subtask is received.

[0135] When a test failure result is received, the deployment scheme is terminated and all deployment schemes that include the mapping combination of the subtask and the corresponding target computing resources are removed; when no test failure result is received, the performance indicators corresponding to the deployment scheme are obtained after the execution of each subtask.

[0136] Optionally, the resource scheduling module 340 includes:

[0137] The scheme selection submodule is used to select the deployment scheme with the best target performance indicator from the various deployment schemes when the optimized performance indicator includes a target performance indicator, and return it to the requesting end as the optimal deployment scheme;

[0138] The performance calculation submodule is used to determine the weight of each target performance indicator when the optimized performance indicator includes multiple target performance indicators, calculate the performance value of each deployment scheme based on the weight of each target performance indicator and the value of each target performance indicator corresponding to each deployment scheme, and return the deployment scheme with the highest performance value as the optimal deployment scheme to the requesting end.

[0139] As can be seen from the above, this embodiment can target the characteristics of tasks in autonomous driving platforms, namely, tasks on autonomous driving platforms have little variability, are usually deployed periodically, and scheduling time has no impact on execution efficiency. When a task to be processed is received, all possible deployment schemes are generated and the performance indicators corresponding to each deployment scheme are determined. Thus, the optimal deployment scheme can be selected based on the optimization performance indicators input by the user.

[0140] The above-described apparatus embodiments correspond to the method embodiments and have the same technical effects. For detailed explanations, please refer to the method embodiments. The apparatus embodiments are derived from the method embodiments; detailed explanations can be found in the method embodiments section, and will not be repeated here.

[0141] In one embodiment of the present invention, the resource scheduling device can employ different schemes to schedule resources for different types of tasks. Specifically, the resource scheduling device may include:

[0142] The task receiving module is used to receive pending tasks sent by the requesting end; the pending task includes multiple subtasks.

[0143] The type determination module is used to determine whether the task to be processed is a preset type task;

[0144] The first scheduling module is used to, when the task to be processed is a preset type of task, receive the optimized performance indicators sent by the requesting end, determine the target computing resources corresponding to each sub-task from the currently available computing resources according to the preset computing resource selection restrictions corresponding to each type of task, construct all deployment schemes according to the correspondence between each sub-task and each target computing resource, each deployment scheme includes a mapping combination of each sub-task and target computing resources, determine the value of each performance indicator corresponding to each deployment scheme, and determine the optimal deployment scheme among the deployment schemes and return it to the requesting end according to the value of the optimized performance indicators corresponding to each deployment scheme.

[0145] The second scheduling module is used to: generate a directed acyclic graph (DAG) based on the dependencies between the multiple subtasks when the task to be processed is not a preset type of task; obtain the resource quantity of each computing resource and construct a heterogeneous resource pool; the heterogeneous resource pool includes the resource quantity of each computing resource; each computing resource is a heterogeneous computing resource; allocate computing resources to each subtask in the heterogeneous resource pool according to a pre-set correspondence between each task and each computing resource, using the code quantity of each subtask in the DAG as the initial weight, to obtain an initial resource allocation scheme; and take the initial resource allocation scheme as the optimal scheme; execute each subtask included in the DAG according to the optimal scheme and record the execution time of each subtask; determine the critical path in the DAG and the subtask A with the longest execution time in the critical path according to the execution time of each subtask, the critical path being the path with the longest execution time; and start from the subtask... Randomly select one unit of computing resource K from the computing resources corresponding to A, and determine the non-critical paths with more than one unit of computing resource K. Allocate one unit of computing resource K from the non-critical paths to the subtask A to obtain the current resource allocation scheme. Determine whether a preset termination condition is met. If the preset termination condition is met, use the current resource allocation scheme as the final resource allocation scheme. If the preset termination condition is not met, execute each subtask included in the DAG according to the current resource allocation scheme and record the execution time of each subtask. Calculate the current value corresponding to the current resource allocation scheme and the optimal value corresponding to the optimal scheme according to a preset evaluation function. If the current value is less than the optimal value, update the optimal scheme using the current resource allocation scheme. Return to the step of executing each subtask included in the DAG according to the optimal scheme and recording the execution time of each subtask.

[0146] Optionally, the preset evaluation function is:

[0147]

[0148] L k L is the execution duration of subtask k. u Let N be the average execution time of each of the subtasks, and N be the total number of the subtasks.

[0149] Optionally, the second scheduling module is specifically used to determine whether there is a non-critical path with more than one unit of computing resources K; when the path determination module determines that there is a non-critical path with more than one unit of computing resources K, it determines one unit of computing resources K from the non-critical path and allocates it to the subtask A to obtain the current resource allocation scheme.

[0150] Optionally, the second scheduling module is specifically used to allocate computing resources to each of the subtasks in the heterogeneous resource pool when the path judgment module determines that there is no non-critical path with more than one unit of computing resources K, using the execution time of each subtask in the critical path as a weight, to obtain the current resource allocation scheme.

[0151] Optionally, the preset termination condition includes: the number of repetitions reaches the maximum number of repetitions, or the number of consecutive times the change value of the optimal value calculated according to the preset evaluation function is within a set range reaches a preset number.

[0152] In this embodiment, in the currently obtained optimal solution, the subtask with the longest execution time in the critical path is scheduled to corresponding computing resources in other non-critical paths. This reduces the total execution time of all tasks in the critical path. Through multiple iterations, the resource allocation scheme with the shortest execution time can be obtained, thereby reducing the time consumption of heterogeneous computing and improving computing speed. Furthermore, allocating computing resources with the code size of each subtask as the initial weight allows for maximizing the availability of each computing resource based on its granularity, ensuring full utilization of all computing resources.

[0153] The above-described apparatus embodiments correspond to the method embodiments and have the same technical effects. For detailed explanations, please refer to the method embodiments. The apparatus embodiments are derived from the method embodiments; detailed explanations can be found in the method embodiments section, and will not be repeated here.

[0154] Those skilled in the art will understand that the accompanying drawings are merely schematic diagrams of one embodiment, and the modules or processes shown in the drawings are not necessarily essential for implementing the present invention.

[0155] Those skilled in the art will understand that the modules in the apparatus of the embodiments can be distributed in the apparatus of the embodiments as described in the embodiments, or they can be located in one or more devices different from this embodiment with corresponding changes. The modules of the above embodiments can be combined into one module, or they can be further divided into multiple sub-modules.

[0156] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A non-real-time resource scheduling method for heterogeneous computing resources, characterized in that, The method is applied to a resource scheduling server, and the method includes: The system receives pending tasks and performance optimization metrics sent by the requesting end. The pending tasks are periodic tasks, and each pending task includes multiple sub-tasks. Based on the pre-set computing resource selection constraints corresponding to each type of task, determine the target computing resources corresponding to each sub-task from the currently available computing resources; Based on the correspondence between each subtask and each target computing resource, all deployment schemes are constructed; each deployment scheme includes a mapping combination of each subtask and target computing resource. Determine the values ​​of each performance metric corresponding to each deployment scheme, and based on the values ​​of the optimized performance metrics corresponding to each deployment scheme, determine the optimal deployment scheme among the deployment schemes and return it to the requesting end; The steps for determining the values ​​of each performance metric corresponding to each deployment scheme include: For each of the aforementioned deployment schemes, a search is performed in the preset database to determine if the deployment scheme exists. When the deployment scheme does not exist in the preset database, the test interface is called to run the deployment scheme and obtain the values ​​of each performance indicator corresponding to the deployment scheme. When the deployment scheme exists in the preset database, the values ​​of each performance indicator corresponding to the deployment scheme are obtained from the preset database; The step of calling the test interface to run the deployment scheme and obtaining the values ​​of each performance metric corresponding to the deployment scheme includes: calling the test interface to run each of the sub-tasks included in the deployment scheme in sequence according to the execution order of each sub-task, and determining whether a test failure result for any sub-task is received; when a test failure result is received, terminating the execution of the deployment scheme and eliminating all deployment schemes that include the mapping combination of the sub-task and the corresponding target computing resources; when no test failure result is received, obtaining each performance metric corresponding to the deployment scheme after the execution of each sub-task.

2. The method according to claim 1, characterized in that, After calling the test interface to run the deployment scheme and obtaining the values ​​of each performance metric corresponding to the deployment scheme, the process also includes: The deployment scheme and the corresponding performance index values ​​are stored in the preset database in a multi-branch tree structure; wherein, the root node of the multi-branch tree is where all the subtasks use 0 computing resources, and each sub-node includes computing resource information used by each subtask.

3. The method according to claim 1 or 2, characterized in that, The step of determining the optimal deployment scheme and returning it to the requesting end based on the values ​​of the optimization performance indicators corresponding to each deployment scheme includes: When the optimized performance metric includes a target performance metric, the deployment scheme with the best target performance metric is selected from the deployment schemes and returned to the requesting end as the optimal deployment scheme. When the optimized performance metrics include multiple target performance metrics, the weight of each target performance metric is determined. Based on the weight of each target performance metric and the value of each target performance metric corresponding to each deployment scheme, the performance value of each deployment scheme is calculated, and the deployment scheme with the highest performance value is returned to the requesting end as the optimal deployment scheme.

4. A non-real-time resource scheduling device for heterogeneous computing resources, characterized in that, The device is used in a resource scheduling server, and the device includes: The task receiving module is used to receive pending tasks and performance optimization indicators sent by the requesting end. The pending tasks are periodic tasks and include multiple sub-tasks. The resource determination module is used to determine the target computing resources corresponding to each subtask from the currently available computing resources, based on the pre-set computing resource selection constraints corresponding to each type of task. The scheme construction module is used to construct all deployment schemes based on the correspondence between each subtask and each target computing resource; each deployment scheme includes a mapping combination of each subtask and target computing resource; The resource scheduling module is used to determine the values ​​of each performance indicator corresponding to each deployment scheme, and based on the values ​​of the optimized performance indicators corresponding to each deployment scheme, determine the optimal deployment scheme among the deployment schemes and return it to the requesting end. The resource scheduling module includes: The scheme search submodule is used to search the preset database for each of the deployment schemes to see if the deployment scheme exists. The solution testing submodule is used to call the test interface to run the deployment solution when the deployment solution does not exist in the preset database, and obtain the values ​​of each performance indicator corresponding to the deployment solution. The indicator acquisition submodule is used to obtain the values ​​of each performance indicator corresponding to the deployment scheme from the preset database when the deployment scheme exists in the preset database; The solution testing submodule is specifically used to: call the test interface to run each of the sub-tasks included in the deployment solution in sequence according to the execution order of each sub-task, and determine whether a test failure result for any sub-task is received; when a test failure result is received, terminate the execution of the deployment solution and remove all deployment solutions that include the mapping combination of the sub-task and the corresponding target computing resources; when no test failure result is received, obtain the performance indicators corresponding to the deployment solution after the execution of each sub-task.

5. The apparatus according to claim 4, characterized in that, The device further includes: The data storage module is used to store the deployment scheme and the corresponding performance index values ​​in a multi-branch tree structure to the preset database; wherein, the root node of the multi-branch tree is where all the subtasks use 0 computing resources, and each sub-node includes computing resource information used by each subtask.

6. The apparatus according to claim 4 or 5, characterized in that, The resource scheduling module includes: The scheme selection submodule is used to select the deployment scheme with the best target performance indicator from the various deployment schemes when the optimized performance indicator includes a target performance indicator, and return it to the requesting end as the optimal deployment scheme; The performance calculation submodule is used to determine the weight of each target performance indicator when the optimized performance indicator includes multiple target performance indicators, calculate the performance value of each deployment scheme based on the weight of each target performance indicator and the value of each target performance indicator corresponding to each deployment scheme, and return the deployment scheme with the highest performance value as the optimal deployment scheme to the requesting end.

Citation Information

Patent Citations

  • Resource pool allocation method and resource scheduler

    CN105468452A

  • Resource allocation method and device based on blockchain system, equipment and storage medium

    CN111209111A