Task allocation method and device for multi-heterogeneous edge nodes, equipment and medium
By decomposing tasks into subtasks and optimizing device node grouping, the problems of task execution errors, long time and unbalanced in edge device node clusters are solved, and the time balance of task execution and throughput are maximized.
Patent Information
- Application Number
- CN202510579422.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-07
- Publication Date
- 2025-06-03
- Estimated Expiration
- 2045-05-07
AI Technical Summary
In the prior art, in the task allocation of edge device node clusters, there are problems such as task execution errors, long task execution time, and unbalanced packet execution time.
By decomposing a single task into multiple subtasks and constructing the variance of the execution time of each group of device nodes based on the preset number of packets, the objective function is optimized to achieve the equalization of the execution time of each group of device nodes and maximize the throughput, and then determining the packet and subtask scheduling of the device nodes.
It realizes time balance between each group of device nodes when executing tasks, and improves the throughput of the entire system, avoiding task execution errors and waiting.
Smart Images

Figure CN120086027A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of edge computing technology, and in particular, 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 an error 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, the present application provides a task allocation method, device, equipment and medium for multi - heterogeneous edge nodes.
[0005] The present application discloses a task allocation method for multi - heterogeneous edge nodes, which includes: 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 of all subtasks by each group of device nodes and the maximum throughput of 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.
[0006] Further, the 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:
[0007] 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.
[0008] Further, the constructing an objective function using the variance and the throughput of all groups of device nodes with the goal of balanced execution times of all subtasks by each group of device nodes and the maximum throughput of 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;
[0009] where S represents the throughput of all K groups; Construct the following objective function using the variance and the throughput of all grouped device nodes: .
[0010] Furthermore, the expression for the execution time of the k-th group of device nodes is:
[0011] 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 executing the i-th subtask on the j-th device node, indicates whether the (i - 1)-th subtask corresponds to the th device node during scheduling, indicates 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.
[0012] Furthermore, The expression of is:
[0013] 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.
[0014] Furthermore, set constraint conditions for each device node and each subtask respectively, including: Set corresponding first constraint conditions for each subtask to ensure that any subtask can only be assigned to one device node in each group of device nodes, and it is expressed as:
[0015] And according to the following formula, the number of each subtask is constrained:
[0016] where M represents the number of each subtask, N represents the total number of device nodes of 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.
[0017] Furthermore, constraint conditions are respectively set for each device node and each subtask, including: A corresponding second constraint condition is set for each device node to make the memory requirement of the subtasks scheduled to any device node less than or equal to the memory capacity of the device node. The expression of the second constraint condition is:
[0018] where M represents the number of each subtask, N represents the total number of device nodes of 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; And a corresponding third constraint condition is set for each device node to make any device node not belong to any group when no subtask is assigned to it, and only belong to a single group when any subtask is assigned to it. The expression of the third constraint condition is:
[0019] where, represents the binary auxiliary variable of the j-th device node. In response to determining that any subtask is assigned to the j-th device node, then takes a value of 1; in response to determining that no subtask is assigned to the j-th device node, then takes a value of 0.
[0020] This application also discloses a task allocation device for multi-heterogeneous edge nodes, which implements a task allocation method for multi-heterogeneous edge nodes described in any one of the above, and includes: A task decomposition module, which is used to decompose a single task into multiple subtasks; A target function construction module, which is used to construct the variance of the execution time of each group of device nodes based on a preset number of groups when grouping multiple device nodes, with the goal of making the execution time of all subtasks executed by each grouped device node balanced and the throughput of all grouped device nodes the largest, and constructs a target function by using the variance and the throughput of all grouped device nodes; A task allocation module is used to set constraint conditions for each device node and each subtask respectively, and determine the grouping of the multiple device nodes and the corresponding subtasks by using the objective function and the constraint conditions, and schedule the corresponding subtasks for each device node.
[0021] 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, the above-mentioned task allocation method for multi-heterogeneous edge nodes is implemented.
[0022] 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 above-mentioned task allocation method for multi-heterogeneous edge nodes.
[0023] Due to the adoption of the above technical solutions, 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 the optimization goal, while also taking the throughput of all groups as the optimization goal, the objective function and corresponding constraint conditions are constructed, 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. Description of the Drawings
[0024] 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 in the following description 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.
[0025] Figure 1 It is a scenario diagram of task allocation for multi-heterogeneous edge nodes in an embodiment of the present application; Figure 2 It is a flowchart of the task allocation method for multi-heterogeneous edge nodes in an embodiment of the present application; Figure 3 It is a subtask scheduling diagram of device nodes in an embodiment of the present application; Figure 4 It is a collaborative flowchart of device nodes in an embodiment of the present application; Figure 5 It is a schematic structural diagram of a task allocation device for multi-heterogeneous edge nodes in an embodiment of the present application; Figure 6 It is a schematic structural diagram of an electronic device in an embodiment of the present application. Detailed Embodiments
[0026] 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.
[0027] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present application should have the ordinary meaning understood by those of ordinary skill in the art 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.
[0028] As described in the background art section, the related task allocation methods are still difficult to meet the actual use requirements.
[0029] The applicant found in the process of implementing the present application that the main problem existing in the related task allocation method 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.
[0030] On the other hand, having a group of device nodes execute tasks compared to multiple groups of device nodes will result in a longer 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.
[0031] Based on this, one or more embodiments in the present application provide embodiments of a task allocation method for multi-heterogeneous edge nodes.
[0032] In the embodiments of the present application, in Figure 1 the specific scenario shown, there are multiple devices arranged, and each device serves as a device node (which will also be simply referred to as a device node in the present application), and an edge computing platform side (which will also be simply referred to as the platform side in the present application) and a client are set up.
[0033] Among them, the client submits a task to the platform side and sends the data related to the task to the platform side.
[0034] Optionally, the platform side decomposes the task and forms groups based on the specific situation of each subtask and each device node, as Figure 1 shown, based on a preset number of groups. Each group includes a pipeline composed of one or more device nodes, uses a scheduling algorithm to group the device nodes, and schedules subtasks for each device node within the group, so that each group can simultaneously and parallelly complete the subtasks decomposed from the complete task and output the execution results.
[0035] The embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0036] Referring to Figure 2 , a task allocation method for multi - heterogeneous edge nodes according to an embodiment of the present application includes the following steps: Step S201: Decompose a single task into multiple subtasks.
[0037] 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, so as to complete the grouping of each device node.
[0038] 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.
[0039] Optionally, based on 7 pre - set devices, that is, device nodes, determine the memory capacity and network bandwidth of each device node respectively.
[0040] Step S202: When grouping multiple device nodes, based on the 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 all subtasks executed by each group of device nodes balanced and the throughput of all groups of device nodes the largest, construct an objective function using the variance and the throughput of all groups of device nodes; based on the multiple decomposed subtasks and the preset number of groups, when constructing the objective function, take the balance of the execution time of all subtasks between groups and the largest throughput of all groups of device nodes as the optimization goal. Wherein, in this embodiment, the throughput is defined as the sum of the reciprocals of the execution times of each group of device nodes.
[0041] In some specific embodiments, the number of device nodes is preset as N, the task T is decomposed into M subtasks, and the preset number of groups is K. The output size of the determined i - th subtask is represented as the memory requirement of the i - th subtask is represented as the memory capacity of the j - th device node is represented as , for device node and the network bandwidth for communication between device node and device node j is represented as
[0042] Wherein, .
[0043] Based on this, the objective during grouping can be expressed as: forming K groups from N device nodes, where 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.
[0044] Among them, as Figure 1 shown, when each group executes task T, each device node in the group respectively 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.
[0045] 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.
[0046] 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 of the i-th subtask. 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 that executes the subtask to the device node that executes the next subtask i, the communication time is 0.
[0047] Based on this, the communication time for device node that executes the (i - 1)-th subtask to transmit the execution result of subtask i - 1 to device node j can be expressed as follows:
[0048] Among them, when device node and device node j are the same device node, that is, , then the communication time is 0. When device node and device node j are different device nodes, then the communication time is ; is the output size of the (i - 1)-th sub-task, is the network bandwidth between the -th device node and the j-th device node. Based on this, the execution time after integrating the computation time and communication time of each group can be expressed as the following formula:
[0049] where, represents the execution time of the k-th group of device nodes, and are both binary variables. represents whether the i-th sub-task corresponds to the j-th device node during scheduling, that is, whether sub-task i is assigned to device node j. If sub-task i is assigned to device node j, then takes the value of 1. If sub-task 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 computation time for executing the i-th sub-task on the j-th device node; represents whether sub-task i - 1 is assigned to device node ; represents device node whether it belongs to group k; represents the communication time for the execution result of the (i - 1)-th sub-task to be output from device node to device node j.
[0050] Based on this, according to the pre-determined number of groups, construct the variance representing the execution times of all K groups as follows:
[0051] 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, throughput: .
[0052] where S represents the throughput of all K groups.
[0053] Accordingly, the objective function can be constructed as:
[0054] Step S203: Set constraint conditions for each device node and each subtask, determine the grouping of multiple device nodes and the corresponding subtasks by using the objective function and the constraint conditions, and schedule the corresponding subtasks for each device node.
[0055] In this embodiment, based on the above constructed objective function, constraint conditions also need to be set during grouping.
[0056] Specifically, during grouping, for each group, each subtask therein can only be assigned to one device node in the group.
[0057] Based on this, the following first constraint condition is set for each subtask:
[0058] In some embodiments, constraint conditions can also be set for the number of subtasks as follows:
[0059] Wherein, M represents the total number of all subtasks decomposed from task T, 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.
[0060] This constraint condition specifically indicates that: for each group, the sum of the number of subtasks is the total number M of all subtasks decomposed from task T.
[0061] Optionally, for each device node, when assigning a subtask 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.
[0062] Based on this, the following second constraint condition is set for each device node:
[0063] Wherein, M represents the total number of all subtasks, 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.
[0064] In this embodiment, when any device node has been assigned at least 1 subtask, then the device node can only belong to 1 group. If the device node has not been assigned any subtasks, then the device node does not belong to any group.
[0065] 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:
[0066] In , represents the binary auxiliary variable of device node j. When device node j is assigned any subtask, then has a value of 1; when device node j is not assigned any subtask, then has a value of 0.
[0067] Optionally, for the binary auxiliary variable the following constraint condition can be constructed:
[0068] Among them, when device node j is assigned any subtask, therefore, has 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 constraining the value of to 1.
[0069] Optionally, when device node j is not assigned any subtask, therefore, has a value of 0. At this time, is 0. Therefore can also only be 0, thus constraining the value of to 0.
[0070] 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.
[0071] Specifically, for example, the Gurobi solver can be used for solving (the Gurobi solver is a large-scale mathematical programming optimizer).
[0072] 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 the specific scenario is as follows: the memory requirements of subtask 0, subtask 1, and subtask 2 are (4, 6, 2) in sequence, 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) in sequence; 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.
[0073] After solving using the Gurobi solver, the obtained grouping scheme is: device node 2 and device node 4 are the first group, and device node 5 and device node 0 are the second group.
[0074] Optionally, in the first group, subtask 0 is assigned to device node 2, and both subtask 1 and subtask 2 are assigned to device node 4; in the second group, subtask 0 is assigned to device node 5, and both subtask 1 and subtask 2 are assigned to device node 0.
[0075] 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.
[0076] In the embodiments of the present application, based on the above-determined grouping 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.
[0077] In Figure 1 the specific example of Figure 1The multiple groups of edge device node clusters shown, for example, divide device 2, device 1, and device 7 into one group, and divide device 4, device 5, and device 3 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.
[0078] Among them, when decomposing a single task into multiple subtasks, the execution order of each subtask as shown Figure 1 will be determined, that is, first execute subtask 1, then execute subtask 2, and finally execute subtask 3. And in each group of edge device node clusters after grouping, each subtask is executed according to this execution order.
[0079] In this embodiment, Kubernetes (an open-source system for automatically deploying, scaling, and containerizing application programs) can be used to build 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 transmit data.
[0080] Based on this, the platform side can use the Client-Java library (client library) in Kubernetes to implement interactions with each device node in the edge device node cluster to obtain relevant data of each device node.
[0081] In this embodiment, as shown Figure 3 shown, Figure 3 the management side, that is, the platform side, after receiving the task data from the client, decomposes it into multiple subtasks, and encapsulates 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).
[0082] Optionally, build an image repository and use the corresponding application programming port to implement the interaction between the platform side and the image repository.
[0083] Optionally, upload the determined subtask images to the image repository, and operations such as deleting and modifying each subtask image can be performed through the image repository.
[0084] In this embodiment, based on the foregoing determined grouping scheme and image repository, device nodes can be selected from a pre-built device node list to form a group, and each subtask image can be selected from the image repository, and each subtask image is scheduled to the corresponding device node for execution.
[0085] Among them, when scheduling each sub-task image, the platform creates a Deployment object (deployment object) by establishing a connection with Kubernetes. When creating the Deployment object, it is necessary to add an environment variable field to it to point to the device node IP (device node address) and sub-task image port of each device node, and pass it to the container of Kubernetes for subsequent communication.
[0086] Optionally, create a Service object (service object) that uniquely corresponds to the Deployment object, and set the field type of the Service object to the port type, so that the sub-task image can be accessed from outside the edge device node cluster.
[0087] Optionally, after creating the Service object, as described above, the sub-task image port can be obtained, and a ConfigMap (a kind of port object) can be created to store the device node IP and the corresponding service port of each device node, and added to the environment variable field of the Deployment object.
[0088] Based on this, each sub-task image can be scheduled to the corresponding device node in the edge device node cluster. After the scheduling of each sub-task 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.
[0089] Specifically, add the IP of the next device node participating in the calculation and the sub-task image port to the environment variable field of the Deployment object, so that in the sub-task code, the transmission of the execution result of the current device node can be realized through the IP of the next device node participating in the calculation and the sub-task image port.
[0090] Optionally, after completing the scheduling of the sub-task image and the construction of the coordination relationship, the platform has information such as the sub-task IP (sub-task address) of each sub-task, the sub-task image port, the next device node in the coordination relationship, and the data volume of the sub-task.
[0091] Based on this, as Figure 4 shown, the platform sends the task data of the corresponding sub-task image to the first device node of each group according to the coordination relationship of each device node in each group, and instructs the client to establish communication with the device node, and sends the user data of the user end, its user IP (user end address) and user port to the device node.
[0092] Optionally, as Figure 4As shown, each device node in each group executes its respective sub-task image in sequence according to the cooperation relationship, and after the last device node completes the calculation of the sub-task image, the execution result is returned to the client through the client IP and client port.
[0093] In this embodiment, when each device node executes each sub-task image according to the cooperation relationship, after the first device node in each group receives the relevant data, each group processes each sub-task image in parallel.
[0094] Among them, the multiple threads included in each sub-task image can specifically be, for example: a thread for receiving the execution result of the sub-task image of the previous device node, a thread for executing the sub-task image, and a thread for passing the execution result of the sub-task image to the next device node.
[0095] Optionally, each device node deployed with a sub-task image, after receiving the execution result of the sub-task image of the previous device node, puts it into the local receive message queue of the device node, and sequentially takes out the data of the corresponding sub-task image from the local receive message queue, executes it at the current device node, places the execution result in the local result message queue, and passes the execution result to the next device node in accordance with the order of the local result message queue.
[0096] It can be seen that the task allocation method for multi-heterogeneous edge nodes in the embodiments of the present application divides a complete single task into multiple sub-tasks, and while taking the balance of the execution time of each group of device nodes for task execution as the optimization goal, also takes the throughput of all grouped device nodes as the optimization goal, thereby constructing the objective function and corresponding constraint conditions, so that when scheduling sub-tasks for each device node, each group can process all sub-tasks in parallel simultaneously and maintain balance in execution time.
[0097] 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 the 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.
[0098] It should be noted that some embodiments of the present application have been described above. In some cases, the actions or steps recorded in the present application can be executed in a different order from that in the above embodiments and still achieve the desired result. Additionally, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired result. In certain embodiments, multi-task processing and parallel processing are also possible or may be advantageous.
[0099] 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.
[0100] 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; Among them, the decomposition module 501 is configured to decompose a single task into multiple subtasks; 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, aiming at the balance of the execution time of all subtasks by each group and the maximum throughput of all grouped device nodes, and construct an objective function by using the variance and the throughput of all grouped device nodes; 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 by using the objective function and the constraint conditions, and schedule the corresponding subtasks for each device node.
[0101] For the convenience of description, when describing the above device, it is divided into various modules according to functions for separate description. Of course, when implementing the embodiments of the present application, the functions of each module can be implemented in one or more software and / or hardware.
[0102] The device of 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.
[0103] 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.
[0104] Figure 6 FIG. 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.
[0105] The processor 1010 can be implemented in the form of 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.
[0106] The memory 1020 can 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 can 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 called and executed by the processor 1010.
[0107] The input / output interface 1030 is used to connect to the input / output module to implement information input and output. The input / output module can 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 can include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device can include a display, a speaker, a vibrator, an indicator light, etc.
[0108] 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 can implement communication through a wired method (such as USB, network cable, etc.) or through a wireless method (such as a mobile network, WIFI, Bluetooth, etc.).
[0109] 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).
[0110] 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, this 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 for implementing the solutions of the embodiments of the present application, and does not necessarily include all the components shown in the figure.
[0111] The electronic device of 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.
[0112] Based on the same inventive concept, corresponding to the method of any of the above embodiments, the present application also provides 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 the computer to execute the task allocation method for multi - heterogeneous edge nodes as described in any of the foregoing embodiments.
[0113] The computer - readable medium of 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 - transitory medium that can be used to store information that can be accessed by a computing device.
[0114] The computer instructions stored in the storage medium of the above embodiment are used to cause the computer to execute the task allocation method for multi - 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.
[0115] Based on the same concept, corresponding to the method of any of the above embodiments, the present application also provides a computer program product, including computer program instructions. When the computer program instructions run on a computer, the computer is caused to execute the task allocation method for multi - heterogeneous edge nodes as described in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be elaborated here.
[0116] Those of ordinary skill in the art should understand that: the discussion of any of the above embodiments is only exemplary and is not intended to imply that the scope of the present application is limited to these examples; under the idea 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, which are not provided in detail for the sake of brevity.
[0117] In addition, for simplicity of explanation and discussion, and so as not to make the embodiments of the present application difficult to understand, 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 details of the implementation of such 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 entirely 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 practiced without these specific details or with variations of these specific details. Accordingly, these descriptions should be considered illustrative rather than restrictive.
[0118] Although the present application has been described in connection with specific embodiments thereof, many alternatives, modifications, and variations of these embodiments will be apparent to those of ordinary skill in the art in light of the foregoing description. For example, other memory architectures (such as dynamic RAM (DRAM)) may be used with the embodiments discussed.
[0119] 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. Accordingly, 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 multiple heterogeneous edge nodes, characterized in that: include: Break down a single task into multiple subtasks; 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 balancing the execution time of all subtasks executed by each group of device nodes and maximizing the throughput of all grouped device nodes, and constructing an objective function using the variance and the throughput of all grouped device nodes; Constraints are set for each device node and each subtask respectively, the objective function and the constraints are used to determine the grouping of the plurality of device nodes and the corresponding subtasks, and the corresponding subtasks are scheduled for each device node.
2. A method for allocating tasks to multiple heterogeneous edge nodes according to claim 1, characterized in that: The method of constructing the variance of the execution time of each group of device nodes based on the preset number of groups includes: Using the preset number of groups, the variance of the execution time of each group of device nodes is constructed using the following formula: Where K represents the preset number of groups. represents the execution time of the kth group of device nodes, and D represents the variance of the execution time of all K groups.
3. The method for allocating tasks to multiple heterogeneous edge nodes according to claim 1, characterized in that: The objective is to balance the execution time of all subtasks executed by each grouping device node and maximize the throughput of all grouping device nodes, and to construct an objective function using the variance and the throughput of all grouping device nodes, including: The following throughput is constructed using the sum of the inverse execution time of each group of device nodes; Where S represents the throughput of all K groups, K represents the number of preset groups, represents the execution time of the kth group of device nodes, and D represents the variance of the execution time of all K groups; Using the variance and the throughput of all grouped device nodes, the following objective function is constructed: 。 4. The method for allocating tasks to multiple heterogeneous edge nodes according to claim 2, characterized in that: The expression of the execution time of the kth group of device nodes is: 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 when scheduled. Indicates whether the jth device node belongs to the kth group. represents the computation time of executing the i-th subtask on the j-th device node, Indicates whether the i-1th subtask corresponds to the first device nodes, Indicates Whether the device node belongs to the kth group, Indicates the execution result of the i-1th subtask from the device node Output the communication time to device node j.
5. A method for allocating tasks to multiple heterogeneous edge nodes according to claim 4, characterized in that: The expression is: In response to determining that the i-1th subtask and the i-th subtask are assigned to the same device node, In response to determining that the i-1th subtask and the i-th subtask are assigned to different device nodes, then ; is the output size of the i-1th subtask, For the The network bandwidth between the jth device node and the jth device node.
6. The method for allocating tasks to multiple heterogeneous edge nodes according to claim 1, characterized in that: The constraints are set for each device node and each subtask, including: A corresponding first constraint condition is set for each subtask so that any subtask can only be assigned to one device node in each group of device nodes, and is expressed as: And according to the following formula, constrain the number of each subtask: Among them, M represents the number of each subtask, N represents the total number of device nodes in the kth group of device nodes, Indicates whether the i-th subtask corresponds to the j-th device node when scheduled. Indicates whether the j-th device node belongs to the k-th group.
7. The method for allocating tasks to multiple heterogeneous edge nodes according to claim 1, characterized in that: The constraints are set for each device node and each subtask, including: A corresponding second constraint is set for each device node so that the memory requirement of the subtask scheduled to any device node is less than or equal to the memory capacity of the device node. The expression of the second constraint is: Among them, M represents the number of each subtask, N represents the total number of device nodes in the kth group of device nodes, Indicates whether the i-th subtask corresponds to the j-th device node when scheduled. represents the memory requirement of the ith subtask, Indicates the memory capacity of the jth device node; A corresponding third constraint condition is set for each device node, so that any device node does not belong to any group when it is not assigned any subtask, and only belongs to a single group when it is assigned any subtask. The expression of the third constraint condition is: in, Indicates whether the jth device node belongs to the kth group. A binary auxiliary variable representing the jth device node, in response to determining that the jth device node is assigned any subtask, then The value is 1; in response to determining that the jth device node is not assigned any subtask, The value is 0.
8. A task allocation device for multiple heterogeneous edge nodes, implementing a task allocation method for multiple heterogeneous edge nodes as claimed in any one of claims 1 to 7, characterized in that: include: Task decomposition module, used to decompose a single task into multiple subtasks; An objective function construction module is used to construct the variance of the execution time of each group of device nodes based on a preset number of groups when grouping multiple device nodes, with the goal of balancing the execution time of all subtasks executed by each group of device nodes and maximizing the throughput of all grouped device nodes, and construct the objective function using the variance and the throughput of all grouped device nodes; The task allocation module is used to set constraints for each device node and each subtask, determine the grouping of the multiple device nodes and the corresponding subtasks using the objective function and the constraints, and schedule the corresponding subtasks for each device node.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executed by the processor, characterized in that: When the processor executes the computer program, the method for allocating tasks to multiple heterogeneous edge nodes as described in any one of claims 1 to 7 is implemented.
10. A non-transitory computer-readable storage medium, characterized in that: The non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute a task allocation method for multiple heterogeneous edge nodes according to any one of claims 1 to 7.
Citation Information
Patent Citations
Cloud computing task scheduling method based on response time optimization
CN103841208A
Server load balancing method based on genetic algorithm
CN105704255A
Scheduling method for correlation tasks in mobile edge computing
CN114546615A
Systems, methods, computing platforms, and storage media for administering a distributed edge computing system utilizing an adaptive edge engine
US20210297355A1
Cited By
Data query method and device based on edge calculation, medium, equipment and product
CN120994702A