Task Allocation Method, Device, Equipment and Medium for Multiple Heterogeneous Edge Nodes
By decomposing the task into subtasks and constructing objective functions and constraints, the task allocation of multiple heterogeneous edge nodes is optimized, and the problems of execution time imbalance and task errors are solved, and parallel processing and throughput of device nodes are realized.
Patent Information
- Application Number
- CN202510579422.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-07
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2045-05-07
AI Technical Summary
In the prior art, the task allocation method of multiple heterogeneous edge nodes has problems such as device node failure resulting in task execution errors, execution time imbalance and data waiting.
Decompose a single task into multiple subtasks, and build the variance and throughput objective function of the execution time of the device node based on the preset number of packets, set constraints, optimize the grouping and subtask scheduling of the device nodes to achieve execution time equalization and throughput maximization.
The task allocation method of multiple heterogeneous edge nodes is realized to maintain balance in execution time, and improve the system throughput, avoiding task errors and data waiting caused by failure of a single device node.
Smart Images

Figure CN120086027B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of edge computing technology, and particularly to a task allocation method, device, equipment and medium for multi-heterogeneous edge nodes. Background Art
[0002] In the task allocation method of the related edge device node cluster, when any device node has a problem during the sequential execution of subtasks by each group of device nodes, it will cause errors in the execution of the entire task.
[0003] On the other hand, the execution of tasks by a group of device nodes takes longer than that by multiple groups of device nodes, resulting in waiting for input data. In addition, using dynamic programming and integer linear programming methods to create multiple groups of pipelines will cause uneven execution times among different groups. Summary of the Invention
[0004] In view of this, this application provides a task allocation method, device, equipment and medium for multi-heterogeneous edge nodes.
[0005] This application discloses a task allocation method for multi-heterogeneous edge nodes, which includes:
[0006] Decompose a single task into multiple subtasks;
[0007] When grouping multiple device nodes, based on a preset number of groups, construct the variance of the execution times of each group of device nodes, and use the variance and the throughput of all grouped device nodes to construct an objective function with the goal of balanced execution times of all subtasks by each grouped device node and the maximum throughput of all grouped device nodes.
[0008] Set constraint conditions for each device node and each subtask respectively, and use the objective function and the constraint conditions to determine the grouping of the multiple device nodes and the corresponding subtasks, and schedule the corresponding subtasks for each device node.
[0009] Further, the constructing the variance of the execution times of each group of device nodes based on a preset number of groups includes:
[0010] Use the preset number of groups to construct the variance of the execution times of each group of device nodes through the following formula:
[0011]
[0012] Where K represents the preset number of groups, represents the execution time of the k-th group of device nodes, and D represents the variance of the execution times of all K groups.
[0013] Furthermore, with the goal of balancing the execution times of all subtasks performed by each grouped device node and maximizing the throughput of all grouped device nodes, a target function is constructed using the variance and the throughput of all grouped device nodes, including:
[0014] Using the sum of the reciprocals of the execution times of each group of device nodes, the following throughput is constructed:
[0015]
[0016] where S represents the throughput of all K groups;
[0017] Using the variance and the throughput of all grouped device nodes, the following target function is constructed:
[0018] .
[0019] Furthermore, the expression for the execution time of the k-th group of device nodes is:
[0020]
[0021] where M represents the total number of subtasks, N represents the total number of device nodes in all groups, indicates whether the i-th subtask corresponds to the j-th device node during scheduling, indicates whether the j-th device node belongs to the k-th group, represents the computing time for the i-th subtask to be executed on the j-th device node, indicates whether the i - 1-th subtask corresponds to the th device node during scheduling, represents the th device node belongs to the k-th group, represents the communication time for the execution result of the i - 1-th subtask to be output from the device node to the device node j.
[0022] Furthermore, The expression of is:
[0023]
[0024] where, in response to determining that the i - 1-th subtask and the i-th subtask are assigned to the same device node, then ; in response to determining that the i - 1-th subtask and the i-th subtask are assigned to different device nodes, then ; is the output size of the i - 1-th subtask, is the network bandwidth between the th device node and the j-th device node.
[0025] Furthermore, constraint conditions are respectively set for each device node and each subtask, including:
[0026] Set corresponding first constraint conditions for each subtask, so that any subtask can only be assigned to one device node in each group of device nodes, and it is expressed as:
[0027]
[0028] And according to the following formula, the number of each subtask is constrained:
[0029]
[0030] Where, M represents the number of each subtask, N represents the total number of device nodes in the k-th group of device nodes, represents whether the i-th subtask corresponds to the j-th device node during scheduling, represents whether the j-th device node belongs to the k-th group.
[0031] Furthermore, constraint conditions are respectively set for each device node and each subtask, including:
[0032] Set corresponding second constraint conditions for each device node, so that the memory requirement of the subtasks scheduled to any device node is less than or equal to the memory capacity of this device node. The expression of the second constraint condition is:
[0033]
[0034] Where, M represents the number of each subtask, N represents the total number of device nodes in the k-th group of device nodes, represents whether the i-th subtask corresponds to the j-th device node during scheduling, represents the memory requirement of the i-th subtask, represents the memory capacity of the j-th device node;
[0035] And set corresponding third constraint conditions for each device node, so that when any device node is not assigned any subtasks, it does not belong to any group, and when it is assigned any subtasks, it only belongs to a single group. The expression of the third constraint condition is:
[0036]
[0037] Where, represents the binary auxiliary variable of the j-th device node. In response to determining that the j-th device node is assigned any subtasks, then takes the value of 1; in response to determining that the j-th device node is not assigned any subtasks, then takes the value of 0.
[0038] The present application also discloses a task allocation device for multi - heterogeneous edge nodes, which implements the task allocation method for multi - heterogeneous edge nodes described in any one of the above, and includes:
[0039] A task decomposition module, configured to decompose a single task into multiple subtasks;
[0040] A target function construction module, when grouping multiple device nodes, based on a preset number of groups, constructs the variance of the execution time of each group of device nodes, with the goal of balancing the execution time of all subtasks by each group of device nodes and maximizing the throughput of all groups of device nodes, and constructs a target function using the variance and the throughput of all groups of device nodes;
[0041] A task allocation module, configured to set constraint conditions for each device node and each subtask respectively, and use the target function and the constraint conditions to determine the grouping of the multiple device nodes and the corresponding subtasks, and schedule the corresponding subtasks for each device node.
[0042] The present application also discloses an electronic device, including a memory, a processor, and a computer program stored on the memory and executed by the processor. When the processor executes the computer program, it implements the task allocation method for multi - heterogeneous edge nodes described above.
[0043] The present application also discloses a non - transitory computer - readable storage medium. The non - transitory computer - readable storage medium stores computer instructions, and the computer instructions are used to cause a computer to execute the task allocation method for multi - heterogeneous edge nodes described above.
[0044] Due to the adoption of the above - mentioned technical solution, the present application has the following advantages: Based on dividing a complete single task into multiple subtasks, and taking the balance of the execution time of each group of device nodes for task execution as an optimization goal while also taking the throughput of all groups as an optimization goal, the present application constructs a target function and corresponding constraint conditions, so that when scheduling subtasks for each device node, each group of device nodes can process all subtasks in parallel simultaneously and maintain balance in execution time. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present application. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings.
[0046] Figure 1 It is a scenario diagram of the task allocation for multi - heterogeneous edge nodes in the embodiments of the present application;
[0047] Figure 2 This is a flowchart of the task allocation method for multi - heterogeneous edge nodes according to an embodiment of the present application;
[0048] Figure 3 This is a subtask scheduling diagram of a device node according to an embodiment of the present application;
[0049] Figure 4 This is a collaborative flowchart of a device node according to an embodiment of the present application;
[0050] Figure 5 This is a schematic structural diagram of a task allocation device for multi - heterogeneous edge nodes according to an embodiment of the present application;
[0051] Figure 6 This is a schematic structural diagram of an electronic device according to an embodiment of the present application. Detailed implementation manners
[0052] The present application will be further described in conjunction with the accompanying drawings and embodiments. The described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art shall fall within the scope of protection of the embodiments of the present application.
[0053] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present application shall have the ordinary meanings understood by those of ordinary skill in the art in the field to which the present application belongs. The terms such as "including" used in the embodiments of the present application mean that the elements or objects appearing before this word cover the elements or objects listed after this word and their equivalents, without excluding other elements or objects.
[0054] As described in the background art section, the related task allocation methods are still difficult to meet the actual usage needs.
[0055] The applicant found during the implementation of the present application that the main problem existing in the related task allocation methods is that when any device node has a problem during the sequential execution of subtasks by the device nodes in each group, it will cause errors in the execution of the entire task.
[0056] On the other hand, when a group of device nodes executes a task compared to multiple groups of device nodes, it will result in a long task execution time, causing waiting for input data. In addition, using dynamic programming and integer linear programming methods to create multiple groups of pipelines will cause uneven execution times for each group.
[0057] Based on this, one or more embodiments in the present application provide embodiments of a task allocation method for multi - heterogeneous edge nodes.
[0058] In the embodiments of the present application, Figure 1In the specific scenario shown, multiple devices are arranged, and each device serves as a device node (which will also be simply referred to as a device node in this application), and an edge computing platform end (which will also be simply referred to as the platform end in this application) and a client are set up.
[0059] Among them, the client submits a task to the platform end and sends the data related to the task to the platform end.
[0060] Optionally, the platform end decomposes the task and, according to the specific situation of each subtask and each device node, such as Figure 1 shown, forms groups based on a preset number of groups. Each group includes a pipeline composed of one or more device nodes. The scheduling algorithm is used to group the device nodes and schedule subtasks for each device node in the group, so that each group can concurrently complete each subtask decomposed from the complete task and output the execution result.
[0061] The embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0062] Refer to Figure 2 , a task allocation method for multi - heterogeneous edge nodes according to an embodiment of the present application includes the following steps:
[0063] Step S201: Decompose a single task into multiple subtasks.
[0064] In the embodiments of the present application, the platform end decomposes each complete task to be processed into multiple subtasks, and constructs objective functions and constraint conditions for each subtask and each device node, thereby completing the grouping of each device node.
[0065] In Figure 1 the specific example shown, the complete task is decomposed into 3 subtasks, and the memory requirements, output size, and execution time of each subtask are obtained.
[0066] Optionally, based on 7 pre - set devices, that is, device nodes, the memory capacity and network bandwidth of each device node are determined.
[0067] Step S202: When grouping multiple device nodes, based on a preset number of groups, construct the variance of the execution time of each group of device nodes. With the goal of making the execution time of each group of device nodes for all subtasks balanced and the throughput of all grouped device nodes the largest, construct an objective function using the variance and the throughput of all grouped device nodes; based on the multiple decomposed subtasks and the preset number of groups, when constructing the objective function, make the execution time of all subtasks between groups balanced and the throughput of all grouped device nodes the largest as the optimization goal. Among them, in this embodiment, the throughput is defined as the sum of the reciprocals of the execution times of each group of device nodes.
[0068] In some specific embodiments, the number of device nodes is preset to N, the task T is decomposed into M subtasks, the number of groups is preset to K, and the output size of the determined i-th subtask is expressed as , and the memory requirement of the i-th subtask is expressed as , and the memory capacity of the j-th device node is expressed as , and the device node and the network bandwidth for communication between device node j are expressed as .
[0069] Among them, .
[0070] Based on this, the goal of grouping can be expressed as: forming N device nodes into K groups, and each group can independently complete task T, that is, independently complete M subtasks. At the same time, when completing each subtask, the time for each of the K groups to complete task T, that is, to complete M subtasks, is balanced, that is, the execution time is balanced, and the throughput of the K groups is maximized.
[0071] Among them, as Figure 1 shown, when each group executes task T, each device node in the group executes at least 1 subtask, and after the device node completes the subtask, it sends the execution result of the subtask to the next device node. Therefore, the execution time for each group to complete task T can specifically include: the calculation time when each device node executes its respective subtask, and the communication time between two device nodes when transmitting the execution result of the subtask.
[0072] Optionally, the calculation time for device node j to execute the i-th subtask is expressed as , and the communication time for device node to send the execution result of the (i - 1)-th subtask to device node j is expressed as , where device node is the device node that executes the (i - 1)-th subtask, and device node j is the device node that executes the i-th subtask.
[0073] In this embodiment, the communication time for transmitting the execution result of the i-th subtask between device node and device node j is specifically determined by the network bandwidth between device node and device node j and the output size It is jointly determined that in some cases, if both the (i - 1)-th subtask and the i-th subtask are executed by the same device node j, then when the execution result of the (i - 1)-th subtask is output from the device node executing this subtask to the device node executing the next subtask i, the communication time is 0.
[0074] Based on this, the device node that executes the (i - 1)-th subtask The communication time for transmitting the execution result of subtask i - 1 to device node j is expressed as follows:
[0075]
[0076] Among them, when the device node and device node j are the same device node, that is , then the communication time is 0. When the device node and device node j are different device nodes, then the communication time is ; is the output size of the (i - 1)-th subtask, is the network bandwidth between the
[0077] Based on this, the execution time after integrating the calculation time and communication time of each group can be expressed as the following formula:
[0078]
[0079] Among them, represents the execution time of the k-th group of device nodes, and are both binary variables. represents whether the i-th subtask corresponds to the j-th device node during scheduling, that is, whether subtask i is assigned to device node j. If subtask i is assigned to device node j, then takes the value of 1. If subtask i is not assigned to device node j, then takes the value of 0; represents whether the j-th device node belongs to the k-th group, that is, whether device node j belongs to group k. If it belongs, then takes the value of 1. If it does not belong, then takes the value of 0; represents the calculation time for executing the i-th subtask on the j-th device node; represents whether subtask i - 1 is assigned to device node ; represents whether the device node belongs to group k; Indicates the communication time for the execution result of the (i - 1)-th subtask to be output from the device node to the device node j.
[0080] Based on this, according to the pre-determined number of groups, construct the variance representing the execution times of all K groups as shown below:
[0081]
[0082] where K represents the pre-set number of groups, and D represents the variance of the execution times of all K groups. Optionally, the throughput of the k-th group can be expressed as , and then the throughput of all K groups is expressed as the sum of the reciprocals of the execution times of each group, that is, the throughput:
[0083] .
[0084] where S represents the throughput of all K groups.
[0085] Accordingly, the objective function can be constructed as:
[0086]
[0087] Step S203: Set constraint conditions for each device node and each subtask respectively, use the objective function and the constraint conditions to determine the grouping of multiple device nodes and the corresponding subtasks, and schedule the corresponding subtasks for each device node.
[0088] In this embodiment, based on the above constructed objective function, when grouping, it is also necessary to set constraint conditions for it.
[0089] Specifically, when grouping, for each group, each subtask in it can only be assigned to one device node in the group.
[0090] Based on this, set the following first constraint condition for each subtask:
[0091]
[0092] In some embodiments, constraint conditions for the number of subtasks can also be set as shown below:
[0093]
[0094] where M represents the number of each subtask, N represents the total number of device nodes in the k-th group of device nodes, indicates whether the i-th subtask corresponds to the j-th device node during scheduling, indicates whether the j-th device node belongs to the k-th group.
[0095] This constraint condition specifically indicates that: for each group, the sum of the number of subtasks is equal to the total number M of subtasks decomposed from task T.
[0096] Optionally, for each device node, when allocating subtasks to any device node, it is necessary to ensure that the memory requirement of the subtask is less than or equal to the memory capacity of the device node.
[0097] Based on this, the following second constraint condition is set for each device node:
[0098]
[0099] where M represents the number of each subtask, N represents the total number of device nodes in the k-th group of device nodes, indicates whether the i-th subtask corresponds to the j-th device node during scheduling, represents the memory requirement of the i-th subtask, represents the memory capacity of the j-th device node.
[0100] In this embodiment, when at least 1 subtask has been allocated to any device node, then this device node can only belong to 1 group. If no subtask has been allocated to this device node, then this device node does not belong to any group.
[0101] Based on this, a binary auxiliary variable with a value of 0 or 1 is set for each device node, and the following third constraint condition is set for each device node accordingly:
[0102]
[0103] where represents the binary auxiliary variable of device node j. When any subtask is allocated to device node j, then takes a value of 1; when no subtask is allocated to device node j, then takes a value of 0.
[0104] Optionally, for the binary auxiliary variable the following constraint condition can be constructed:
[0105]
[0106] where, when any subtask is allocated to device node j, therefore, takes a value of 0 or 1. At this time, is a fraction less than 1 and greater than 0. Therefore can only be 1, thus restricting the value of to 1.
[0107] Optionally, when no subtasks are assigned to device node j, therefore, takes a value of 0. At this time, is 0, so can only be 0 either, thus constraining the value to 0.
[0108] Optionally, based on the determined objective function and each constraint condition above, by solving the objective function, a solution for grouping each device node and assigning subtasks to each device node is obtained.
[0109] Specifically, for example, the Gurobi solver can be used for solving (the Gurobi solver is a large-scale mathematical programming optimizer).
[0110] In some specific embodiments, when the number of device nodes N = 7, the number of subtasks M = 3, the number of groups K = 2, and specifically, the scenario is as follows: the memory requirements of subtask 0, subtask 1, and subtask 2 are (4, 6, 2) in sequence, and the computing times when executed on each device node are (10, 12, 8, 9, 11, 10, 12), (7, 9, 5, 6, 8, 7, 9), and (6, 8, 4, 5, 7, 6, 8) in sequence, and the output sizes are (5, 7, 3); the memory capacities of device node 0, device node 1, device node 2, device node 3, device node 4, and device node 5 are (8, 10, 6, 7, 9, 8, 12) in sequence, and the network bandwidths between device node 0, device node 1, device node 2, device node 3, device node 4, device node 5, and device node 6 and other device nodes are: (0, 2, 2, 3, 1, 2, 1), (2, 0, 1, 2, 3, 2, 1), (2, 1, 0, 1, 2, 1, 2), (3, 2, 1, 0, 2, 2, 1), (1, 3, 2, 2, 0, 1, 2), (2, 2, 1, 2, 1, 0, 3), and (1, 1, 2, 1, 2, 3, 0) in sequence.
[0111] After solving using the Gurobi solver, the obtained grouping solution is: device node 2 and device node 4 are in the first group, and device node 5 and device node 0 are in the second group.
[0112] Optionally, in the first group, subtask 0 is assigned to device node 2, and subtask 1 and subtask 2 are both assigned to device node 4; in the second group, subtask 0 is assigned to device node 5, and subtask 1 and subtask 2 are both assigned to device node 0.
[0113] Among them, the execution time of the first group is 25.5, and the execution time of the second group is also 25.5. It can be seen that the difference in execution time is 0, and the throughput is 0.784313725490196.
[0114] In the embodiments of the present application, based on the determined groups and the subtasks corresponding to each device node, multiple groups of edge device node clusters can be constructed, and the interaction between each device node and the platform side can be established.
[0115] In Figure 1 In a specific example, after the solution is completed, multiple groups of edge device node clusters as shown in Figure 1 can be constructed. For example, device 2, device 1, and device 7 are divided into one group, and device 4, device 5, and device 3 are divided into one group. Among them, device 2 and device 4 execute subtask 1, device 1 and device 5 execute subtask 2, and device 7 and device 3 execute subtask 3.
[0116] Among them, when a single task is decomposed into multiple subtasks, the execution order of each subtask as shown in Figure 1 will be determined, that is, subtask 1 is executed first, subtask 2 is executed next, and subtask 3 is executed last. And in each group of edge device node clusters after grouping, each subtask is executed according to this execution order.
[0117] In this embodiment, Kubernetes (an open-source system for automatically deploying, scaling, and containerizing application programs) can be used to construct a distributed edge device node cluster, and connections are established between each device node in the edge device node cluster through the Transmission Control Protocol. In each subtask, multiple threads are created to respectively receive, process, and transfer data.
[0118] Based on this, the platform side can use the Client-Java library (client library) in Kubernetes to implement the interaction with each device node in the edge device node cluster to obtain the relevant data of each device node.
[0119] In this embodiment, as shown in Figure 3 , Figure 3 the management side in
[0120] that is, the platform side, after receiving the task data from the client, decomposes it into multiple subtasks, and packages each subtask to be executed into a container image, that is, a subtask image. For example, the subtask is packaged into a docker image (an open-source application container engine).
[0121] Optionally, the determined subtasks are mirror-uploaded to the mirror repository, and operations such as deletion and modification of the subtask images can be performed through the mirror repository.
[0122] In this embodiment, based on the aforementioned determined grouping scheme and mirror repository, device nodes can be selected from the pre-built device node list to form a group, and each subtask image can be selected from the mirror repository, and each subtask image is scheduled to the corresponding device node for execution.
[0123] Among them, when scheduling each subtask image, the platform end creates a Deployment object (deployment object) by establishing a connection with Kubernetes. When creating the Deployment object, an environment variable field needs to be added to it to be used to point to the device node IP (device node address) and subtask image port of each device node, and pass it to the container of Kubernetes for subsequent communication.
[0124] Optionally, a Service object (service object) that is uniquely corresponding to the Deployment object is created for the Deployment object, and the field type of the Service object is set to the port type so that the subtask image can be accessed from outside the edge device node cluster.
[0125] Optionally, after creating the Service object, as described above, the subtask image port can be obtained, and a ConfigMap (a kind of port object) is created to store the device node IPs and corresponding service ports of each device node, and added to the environment variable field of the Deployment object.
[0126] Based on this, each subtask image can be scheduled to the corresponding device node in the edge device node cluster. After the scheduling of each subtask image is completed, the coordination relationship between each device node is further established. Among them, the execution relationship represents the execution order of each device node in the same group and their respective network communication ports.
[0127] Specifically, the IP of the next device node participating in the calculation and the subtask image port are added to the environment variable field of the Deployment object so that in the subtask code, the transfer of the execution result of the current device node is realized through the IP of the next device node participating in the calculation and the subtask image port.
[0128] Optionally, after the scheduling of the subtask image and the construction of the coordination relationship are completed, the platform end has information such as the subtask IP (subtask address) of each subtask, the subtask image port, the next device node in the coordination relationship, and the data volume of the subtask.
[0129] Based on this, as Figure 4The platform side as shown distributes the task data of the corresponding subtask image to the first device node of each group according to the collaboration relationship among the device nodes in each group, and enables the client to establish communication with this device node, and sends the user data, user IP (user side address), and user port of the user side to this device node.
[0130] Optionally, as Figure 4 shown, the device nodes in each group execute their respective subtask images in sequence according to the collaboration relationship, and after the last device node completes the calculation of the subtask image, the execution result is returned to the client through the client IP and client port.
[0131] In this embodiment, when each device node executes each subtask image according to the collaboration relationship, after the first device node of each group receives the relevant data, each group processes each subtask image in parallel.
[0132] Among them, the multiple threads included in each subtask image can specifically be, for example: a thread for receiving the execution result of the subtask image of the previous device node, a thread for executing the subtask image, and a thread for passing the execution result of the subtask image to the next device node.
[0133] Optionally, after each device node deployed with a subtask image receives the execution result of the subtask image of the previous device node, it is placed into the local receive message queue of this device node, and the corresponding data of the subtask image is sequentially taken out from the local receive message queue and executed at the current device node, and the execution result is placed in the local result message queue, and the execution result is passed to the next device node in accordance with the order of the local result message queue.
[0134] It can be seen that the task allocation method for multi-heterogeneous edge nodes in the embodiments of the present application is based on dividing a complete single task into multiple subtasks, taking the balance of the execution time of each group of device nodes for executing tasks as an optimization goal, and also taking the throughput of all groups of device nodes as an optimization goal, thereby constructing an objective function and corresponding constraint conditions, so that when scheduling subtasks for each device node, each group can process all subtasks in parallel simultaneously and maintain balance in execution time.
[0135] It should be noted that the method in the embodiments of the present application can be executed by a single device, such as a computer or a server, etc. The method in this embodiment can also be applied to a distributed scenario and completed by multiple devices cooperating with each other. In this case of a distributed scenario, one of these multiple devices can only execute one or more steps in the method in the embodiments of the present application, and these multiple devices will interact with each other to complete the described method.
[0136] It should be noted that some embodiments of the present application are described above. In some cases, the actions or steps recorded in the present application can be executed in a different order from those in the above embodiments and still achieve the desired results. Additionally, the processes depicted in the drawings do not necessarily require the specific order or consecutive order shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0137] Based on the same inventive concept, corresponding to the method of any of the above embodiments, an embodiment of the present application further provides a task allocation device for multi - heterogeneous edge nodes.
[0138] Referring to Figure 5 , the task allocation device for multi - heterogeneous edge nodes includes: a task decomposition module 501, an objective function construction module 502, and a task allocation module 503;
[0139] Among them, the decomposition module 501 is configured to decompose a single task into multiple subtasks;
[0140] The objective function construction module 502 is configured to, when grouping multiple device nodes, based on a preset number of groups, construct the variance of the execution time of each group, with the goal of making the execution time of all subtasks executed by each group balanced and the throughput of all grouped device nodes maximized, and construct an objective function using the variance and the throughput of all grouped device nodes.
[0141] The task allocation module 503 is configured to set constraint conditions for each device node and each subtask respectively, determine the grouping of multiple device nodes and the corresponding subtasks using the objective function and the constraint conditions, and schedule the corresponding subtasks for each device node.
[0142] For the convenience of description, when describing the above device, it is divided into various modules according to functions and described separately. Of course, when implementing the embodiments of the present application, the functions of each module can be implemented in the same or multiple software and / or hardware.
[0143] The device in the above embodiment is used to implement the corresponding task allocation method for multi - heterogeneous edge nodes in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be elaborated here.
[0144] Based on the same inventive concept, corresponding to the method of any of the above embodiments, an embodiment of the present application further provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the task allocation method for multi - heterogeneous edge nodes as described in any of the above embodiments when executing the program.
[0145] Figure 6FIG. 0 shows a more specific schematic diagram of the hardware structure of the electronic device provided in this embodiment. The device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. Among them, the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are communicatively connected to each other inside the device through the bus 1050.
[0146] The processor 1010 may be implemented by using a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, etc., and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application.
[0147] The memory 1020 may be implemented in the form of a ROM (Read Only Memory), a RAM (Random Access Memory), a static storage device, a dynamic storage device, etc. The memory 1020 may store an operating system and other application programs. When implementing the technical solutions provided in the embodiments of the present application through software or firmware, the relevant program codes are stored in the memory 1020 and are called and executed by the processor 1010.
[0148] The input / output interface 1030 is used to connect to an input / output module to implement information input and output. The input / output module may be configured as a component in the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Among them, the input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.
[0149] The communication interface 1040 is used to connect to a communication module (not shown in the figure) to implement communication interaction between this device and other devices. Among them, the communication module may implement communication in a wired manner (such as USB, network cable, etc.) or in a wireless manner (such as mobile network, WIFI, Bluetooth, etc.).
[0150] The bus 1050 includes a path for transmitting information between various components of the device (such as the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040).
[0151] It should be noted that although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040, and the bus 1050, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, those skilled in the art can understand that the above device may also only include the components necessary to implement the solution of the embodiments of the present application, and does not necessarily include all the components shown in the figure.
[0152] The electronic device in the above embodiment is used to implement the corresponding task allocation method for multiple heterogeneous edge nodes in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be elaborated here.
[0153] Based on the same inventive concept, corresponding to the method in any of the above embodiments, the present application also provides a non-transitory computer-readable storage medium storing computer instructions for causing the computer to execute the task allocation method for multiple heterogeneous edge nodes as described in any of the foregoing embodiments.
[0154] The computer-readable medium in this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette tapes, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible by a computing device.
[0155] The computer instructions stored in the storage medium in the above embodiment are used to cause the computer to execute the task allocation method for multiple heterogeneous edge nodes as described in any of the foregoing embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be elaborated here.
[0156] Based on the same concept, corresponding to the method in any of the above embodiments, the present application also provides a computer program product including computer program instructions, which when running on a computer, cause the computer to execute the task allocation method for multiple heterogeneous edge nodes as described in any of the foregoing embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be elaborated here.
[0157] Those of ordinary skill in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of the present application is limited to these examples; under the concept of the present application, the technical features in the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations in different aspects of the embodiments of the present application as described above, and they are not provided in detail for the sake of brevity.
[0158] In addition, for simplicity of explanation and discussion, and in order not to make the embodiments of the present application difficult to understand, the well-known power / ground connections to integrated circuit (IC) chips and other components may or may not be shown in the provided drawings. Further, the devices may be shown in block diagram form in order to avoid making the embodiments of the present application difficult to understand, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform on which the embodiments of the present application are to be implemented (i.e., these details should be fully within the understanding of those skilled in the art). In cases where specific details (such as circuits) are set forth to describe exemplary embodiments of the present application, it will be apparent to those skilled in the art that the embodiments of the present application may be implemented without these specific details or with variations of these specific details. Therefore, these descriptions should be considered illustrative rather than restrictive.
[0159] Although the present application has been described in connection with specific embodiments of the present application, many alternatives, modifications, and variations of these embodiments will be apparent to those of ordinary skill in the art based on the foregoing description. For example, other memory architectures (such as dynamic RAM (DRAM)) may be used with the embodiments discussed.
[0160] The embodiments of the present application are intended to cover all such alternatives, modifications, and variations that fall within the broad scope of the present application. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the embodiments of the present application shall be included within the protection scope of the present application.
Claims
1. A task allocation method for multi - heterogeneous edge nodes, characterized in that, Including: Decompose a single task into multiple subtasks; When grouping multiple device nodes, based on a preset number of groups, construct the variance of the execution times of each group of device nodes. With the goal of balanced execution times for all subtasks executed by each group of device nodes and maximum throughput for all groups of device nodes, construct an objective function using the variance and the throughput of all groups of device nodes; Set constraint conditions for each device node and each subtask respectively. Using the objective function and the constraint conditions, determine the grouping of the multiple device nodes and the corresponding subtasks, and schedule the corresponding subtasks for each device node; The step of constructing an objective function using the variance and the throughput of all groups of device nodes with the goal of balanced execution times for all subtasks executed by each group of device nodes and maximum throughput for all groups of device nodes includes: Construct the following throughput using the sum of the reciprocals of the execution times of each group of device nodes; Among them, S represents the throughput of all K groups, and K represents the preset number of groups. represents the execution time of the k-th group of device nodes; Construct the following objective function using the variance and the throughput of all groups of device nodes: Where D represents the variance of the execution times of all K groups; The step of setting constraint conditions for each device node and each subtask respectively includes: setting a corresponding first constraint condition for each subtask to ensure that any subtask can only be assigned to one device node in each group of device nodes; setting a corresponding second constraint condition for each device node to ensure that the memory requirement of the subtasks scheduled to any device node is less than or equal to the memory capacity of that device node; and setting a corresponding third constraint condition for each device node to ensure that when any device node is not assigned any subtasks, it does not belong to any group, and when it is assigned any subtasks, it only belongs to a single group.
2. The task allocation method for multiple heterogeneous edge nodes according to claim 1, wherein The step of constructing the variance of the execution times of each group of device nodes based on a preset number of groups includes: Using the preset number of groups, construct the variance of the execution times of each group of device nodes through the following formula: where K represents the preset number of groups, represents the execution time of the k-th group of device nodes, and D represents the variance of the execution times of all K groups.
3. The task allocation method for multiple heterogeneous edge nodes according to claim 2, wherein The expression for the execution time of the k-th group of device nodes is: Among them, M represents the total number of subtasks, and N represents the total number of device nodes in all groups. Indicates whether the i-th subtask corresponds to the j-th device node during scheduling. Indicates whether the j-th device node belongs to the k-th group. Represents the computing time for executing the i-th subtask on the j-th device node. Indicates whether the (i - 1)-th subtask corresponds to the j-th device node during scheduling. Indicates the j-th device node belongs to the k-th group. Represents the communication time for the execution result of the (i - 1)-th subtask to be output from the device node to the device node j.
4. The task allocation method for multiple heterogeneous edge nodes according to claim 3, characterized in that, The expression is: Wherein, in response to determining that the (i-1)-th sub-task and the i-th sub-task are assigned to the same device node, then ; in response to determining that the (i-1)-th sub-task and the i-th sub-task are assigned to different device nodes, then ; is the output size of the (i-1)-th sub-task, is the network bandwidth between the j-th device node and the j-th device node.
5. A task allocation method for multiple heterogeneous edge nodes according to claim 1, characterized in that The expression for the first constraint condition is: And constrain the number of each subtask according to the following formula: where M represents the number of each subtask, and N represents the total number of device nodes in the k-th group of device nodes. indicates whether the i-th subtask corresponds to the j-th device node during scheduling. indicates whether the j-th device node belongs to the k-th group.
6. The task allocation method for multiple heterogeneous edge nodes according to claim 1, characterized in that The expression for the second constraint condition is: Among them, M represents the number of each subtask, and N represents the total number of device nodes in the k-th group of device nodes. Indicates whether the i-th subtask corresponds to the j-th device node during scheduling. Represents the memory requirement of the i-th subtask. Represents the memory capacity of the j-th device node. The expression for the third constraint condition is: wherein, indicates whether the j-th device node belongs to the k-th group, represents the binary auxiliary variable of the j-th device node. In response to determining that the j-th device node is assigned any subtask, it takes the value of 1; in response to determining that the j-th device node is not assigned any subtask, it takes the value of 0.
7. A task allocation device for multi - heterogeneous edge nodes, which implements the task allocation method for multi - heterogeneous edge nodes according to any one of claims 1 to 6, characterized in that, Including: A task decomposition module for decomposing a single task into multiple subtasks; An objective function construction module for constructing the variance of the execution times of each group of device nodes based on a preset number of groups when grouping multiple device nodes. With the goal of balanced execution times for all subtasks executed by each group of device nodes and maximum throughput for all groups of device nodes, construct an objective function using the variance and the throughput of all groups of device nodes; A task allocation module for setting constraint conditions for each device node and each subtask respectively. Using the objective function and the constraint conditions, determine the grouping of the multiple device nodes and the corresponding subtasks, and schedule the corresponding subtasks for each device node.
8. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executed by the processor, characterized in that When the processor executes the computer program, it implements a task allocation method for multi - heterogeneous edge nodes as described in any one of claims 1 to 6.
9. A non-transitory computer-readable storage medium, characterized in that, The non-transitory computer-readable storage medium stores computer instructions for causing a computer to execute a task allocation method for multiple heterogeneous edge nodes according to any one of claims 1 to 6.
Citation Information
Patent Citations
Cloud computing task scheduling method based on response time optimization
CN103841208A
Server load balancing method based on genetic algorithm
CN105704255A