Task scheduling method and device, electronic equipment and computer readable storage medium
By constructing hypergraphs in distributed edge computing and using deep reinforcement learning, the problem of inefficient parallel computing of scheduling decisions obtained by relying on single or multiple DAG planning is solved, and more efficient task scheduling is achieved.
Patent Information
- Application Number
- CN202411817533.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2044-12-11
AI Technical Summary
In distributed edge computing, scheduling decisions obtained by relying on single or multiple directed acyclic graphs (DAG) planning have problems with inefficient parallel computing when executed, especially when computing tasks increase significantly in generative artificial intelligence applications.
A task scheduling method is proposed. By obtaining directed acyclic graphs of multiple task requests, a hypergraph is constructed, and a hypergraph is used to process the hypergraph to obtain task graph embeddings, and a target scheduling decision is generated through deep reinforcement learning to optimize the delay and energy consumption of task scheduling.
By constructing hypergraphs and using deep reinforcement learning, the generated scheduling decisions have higher parallel computing efficiency when executed, and can more effectively handle multiple dependencies and higher-order attribute correlations, which is better than the method that only depends on DAG planning.
Smart Images

Figure CN119781924A_ABST
Abstract
Description
Background Art
[0002] Distributed Edge Computing (DEC) enhances parallel processing across user devices (UDs), reducing computation time and overall energy consumption. For example, in autonomous driving applications, tasks such as vehicle motion analysis and image feature extraction can be assigned to nearby idle resource pools (RPs) to speed up the computation process while saving energy.
[0003] In related technologies, tasks in applications exhibit significant parallelism and sequential dependencies, so most studies use directed acyclic graphs (DAGs) to represent the task requests of applications to plan task scheduling.
[0004] However, with the rise of generative artificial intelligence applications, computing tasks have increased significantly, which has put higher requirements on the parallel computing efficiency of DEC. Scheduling decisions that only rely on one or more DAG plans have the problem of low parallel computing efficiency during execution. Summary of the invention
[0005] The present application provides a task scheduling method, device, electronic device and computer-readable storage medium, which at least to some extent overcome the problem of low parallel computing efficiency when executing scheduling decisions obtained by relying on one or more DAG plans in related technologies.
[0006] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.
[0007] According to one aspect of the present application, a task scheduling method is provided, which is applied to a task scheduling system, wherein the task scheduling system includes N RPs and M UDs, where N and M are both integers not less than 1, and includes: obtaining at least one directed acyclic graph of L task requests generated by the M UDs, where L is an integer greater than 1; constructing a hypergraph of the L task requests according to the at least one directed acyclic graph, wherein a vertex set of the hypergraph includes the L task requests, a hyperedge set of the hypergraph includes a sequential hyperedge set, and the sequential hyperedge set includes edges in the at least one directed acyclic graph; processing the hypergraph through a hypergraph neural network to obtain a task graph embedding; taking the task size, execution result size, task graph embedding and scheduling decision of each task request as states, taking the scheduling decision as an action of reinforcement learning, setting a reward with reducing the delay and energy consumption of task scheduling as the goal of reinforcement learning, performing deep reinforcement learning, and generating a target scheduling decision; and performing task scheduling on the L task requests on the N RPs and the M UDs according to the target scheduling decision.
[0008] In some embodiments, the superedge set also includes: the superedge set also includes: at least one of an attribute hyperedge set, a distance hyperedge set and a hypergraph partition hyperedge set; wherein the attribute hyperedge set is obtained by clustering the L task requests according to the network properties of the M UDs, the distance hyperedge set includes a hyperedge composed of each vertex in the at least one directed acyclic graph and a vertex with a preset directed distance, and the hypergraph partition hyperedge set is obtained by performing hypergraph partitioning on the sequential hyperedge set, the distance hyperedge set and the attribute hyperedge.
[0009] In some embodiments, the reward is expressed as the following formula:
[0010]
[0011] Where t represents the time step, R t is the reward for scheduling the i-th task request according to the scheduling decision at time t; Δ(.) indicates that the content in (.) is a negative increment; when the i-th task request belongs to the task request on the critical path, σ m =1, when the i-th task request is not a task request on the critical pathσ m =0; is the discriminator, To judge σ m Is it equal to 1? If σ m =1 The value of is equal to 1, if σ m ≠1 The value of is equal to 0; To judge σ m Is it equal to 0? If σ m =0 The value of is equal to 1, if σ m ≠0 The value of is equal to 0; is the execution location from the 1st task request to the ith task request, is the execution position of the i-th task at time step t , the time when the i-th task request is completed; w h 、w l are weight coefficients, and w h >w l ; is the total energy consumption of completing the 1st to ith task requests at time step t; is the total energy consumption for completing the 1st to i-1th task requests when the time step is t; the critical path is the path with the longest time required to complete all the task requests among the paths included in the at least one directed acyclic graph.
[0012] In some embodiments, the total delay of the L task requests to complete scheduling is calculated by the following formula:
[0013]
[0014] in, The total delay for completing the scheduling of the L task requests; The execution position from the 1st task request to the Lth task request; is a set of task requests that have no subsequent task requests among the L task requests; The requested completion time for the i-th task; is the available time of the execution location where the i-th task request is located; AL(i) is the parent task set that has been executed before the i-th task request; is the requested completion time of the jth task, represents the latest completion time among the completion times corresponding to AL(i); The computation delay requested for the i-th task; is the transmission delay requested by the i-th task; z i is the execution location requested by the i-th task, z k The execution location requested for the kth task; In z i =z k The value is 1 at z i ≠z k The value is 0 when f m is the CPU frequency of the mth UD, f n is the CPU frequency of the nth RP; D i The task size requested for the i-th task; is the latency of uploading the i-th task request to RP, The delay for downloading the execution result of the i-th task request; is the transmission rate of data uploaded from UD to RP, R is the download rate of data transmitted from UD to RP; i The size of the execution result requested for the i-th task; The wireless bandwidth when UD downloads data from RP; It is the wireless bandwidth when UD uploads data to RP; represents the variance of white noise in a complex Gaussian channel; represents the forward transmission power; represents the forward channel gain; represents the backward transmission power; represents the backward channel gain.
[0015] In some embodiments, the total energy consumption for completing the i-th task request is expressed as follows:
[0016]
[0017] Among them, E i The total energy consumption requested to complete the i-th task; The computing energy consumption required to complete the i-th task request; The transmission energy consumption for completing the i-th task request; z i is the execution location requested by the i-th task, z i = 0 means that the i-th task request is executed locally on UD, z i =n means that the i-th task request is executed on the n-th RP; is the energy consumption of uploading to RP for the i-th task request, The energy consumption for downloading the execution result of the i-th task request; The time used to download the execution result of the i-th task request, is the time used to upload the i-th task request to the RP; q is the execution location of the i-th task request, which is one of the N RPs or the UD that generates the i-th task request; ρ q is the power coefficient q; f n,m (q) is the CPU frequency of q; α q is the dynamic power index of q; The time taken to execute the i-th task request.
[0018] In some embodiments, both the encoder and decoder used in deep reinforcement learning are gated recurrent units (GRU).
[0019] According to another aspect of the present application, a task scheduling device is also provided, which is applied to a task scheduling system, wherein the task scheduling system includes N RPs and M UDs, where N and M are both integers not less than 1, and includes: an acquisition module, used to acquire at least one directed acyclic graph of L task requests generated by the M UDs, where L is an integer greater than 1; a hypergraph construction module, used to construct a hypergraph of the L task requests based on the at least one directed acyclic graph, wherein the vertex set of the hypergraph includes the L task requests, and the hyperedge set of the hypergraph includes a sequential hyperedge set, and the sequential hyperedge set includes the an edge in at least one directed acyclic graph; a processing module, used to process the hypergraph through a hypergraph neural network to obtain a task graph embedding; a generation module, used to take the task size, execution result size, the task graph embedding and scheduling decision of each task request as states, take the scheduling decision as an action of reinforcement learning, set a reward for reducing the delay and energy consumption of task scheduling as the goal of reinforcement learning, perform deep reinforcement learning, and generate a target scheduling decision; a scheduling module, used to schedule the L task requests on the N RPs and the M UDs according to the target scheduling decision.
[0020] According to another aspect of the present application, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any one of the above-described task scheduling methods by executing the executable instructions.
[0021] According to another aspect of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the task scheduling method described in any one of the above is implemented.
[0022] According to another aspect of the present application, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, any one of the above-mentioned task scheduling methods is implemented.
[0023] The technical solutions provided in the embodiments of the present application include at least the following intended effects:
[0024] The technical solution provided in the embodiment of the present application uses at least one directed acyclic graph corresponding to L task requests to construct a hypergraph including a sequential hyperedge set, which can better describe the multiple dependencies between the L task requests when at least one directed acyclic graph is a plurality of directed acyclic graphs, and can better represent the sequential relationship between the tasks through the sequential hyperedge set. By processing the hypergraph using a hypergraph neural network, the high-order attribute correlation in the multiple dependencies of the task requests can be captured, thereby providing richer contextual information for the subsequent generation of scheduling decisions through reinforcement learning, so that the generated scheduling decisions can have higher parallel computing efficiency when executed compared to the scheduling decisions obtained by relying solely on at least one directed acyclic graph planning. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0026] Figure 1 A schematic diagram showing a task scheduling system in one embodiment of the present application is shown;
[0027] Figure 2 A schematic diagram showing a task scheduling system in another embodiment of the present application is shown;
[0028] Figure 3 A flowchart of a task scheduling method in one embodiment of the present application is shown;
[0029] Figure 4 A schematic diagram showing two directed acyclic graphs in one embodiment of the present application is shown;
[0030] Figure 5 A schematic diagram of a task scheduling device in one embodiment of the present application is shown;
[0031] Figure 6 A structural block diagram of an electronic device in one embodiment of the present application is shown. DETAILED DESCRIPTION
[0032] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more comprehensive and complete and fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0033] In addition, the accompanying drawings are only schematic illustrations of the present application and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0034] It should be noted that the acquisition, storage, use, and processing of data in the technical solution of this application are in compliance with the relevant provisions of national laws and regulations.
[0035] The specific implementation of the embodiment of the present application is described in detail below in conjunction with the accompanying drawings.
[0036] Figure 1 FIG. 1 is a schematic diagram of a task scheduling system in one embodiment of the present application. Figure 1 As shown, the system may include: N RPs 11 and M UDs 12 .
[0037] Among them, the set composed of N RP 11 is Index n represents the nth RP 11. M UDs 12 form a set of The index m indicates the m-th UD 12 .
[0038] Each UD 12 has a set of task requests The task request of M UD 12 is The i-th task can be represented as a tuple {D i ,R i}, where D i and R i Indicates the task size and execution result size.
[0039] The computing node consists of N RPs 11 and M UDs 12. The CPU frequency of the computing node is Among them, f n is the CPU frequency of the nth BP 11, f m is the CPU frequency of the mth UD 12,
[0040] The execution location of each task in can be expressed as Here, 0 indicates that the task request is executed locally on the UD 12 .
[0041] It should be noted that, in each implementation of the present application, an example is used to illustrate that each UD is unable to execute a task request generated by other UDs.
[0042] In one embodiment, Figure 2 As shown, the task scheduling system includes, in addition to N RPs 11 and M UDs 12 , a scheduling decision device 13 .
[0043] Each of the M UDs 12 may send information of a task request to the scheduling decision device 13 , where the information may include a task size and an execution result size of the task request.
[0044] The scheduling decision device 13 can receive the task request information generated by the M UDs 12. The scheduling decision device 13 also stores Alternatively, the information of the task request sent by the UD 12 to the scheduling decision device 13 includes the CPU frequency of the UD 12 .
[0045] The execution of some task requests depends on the completion of their parent task requests. Therefore, the scheduling decision device 13 can schedule the task requests according to the dependency relationship between the task requests. The task requests included in the graph are used as vertices, and the dependency relationships between parent and child task requests are used as directed edges to construct at least one directed acyclic graph.
[0046] Afterwards, the scheduling decision device 13 may construct a hypergraph according to the at least one directed acyclic graph, wherein the vertex set of the hypergraph includes The task request in the hypergraph includes the sequential hyperedge set ε DAG , distance super edge set Attributed hyperedge set One or more hyperedge sets in ; or including: ε DAG , and At least one of DAG , and The hypergraph partition hyperedge set ε obtained by hypergraph partitioning pt .
[0047] The scheduling decision device 13 can use a hypergraph neural network (HGNN) to process the constructed hypergraph to obtain a task graph embedding.
[0048] And according to The task size, execution result size, and task graph embedding of each task request in and scheduling decisions Build Status Collection The execution position of the first task request to the i-th task request is represented by . And, the scheduling decision is used as the action of reinforcement learning in Also, rewards are set as the goal of reinforcement learning to reduce the delay and energy consumption of task scheduling, and deep reinforcement learning is performed to generate target scheduling decisions.
[0049] Afterwards, the scheduling decision device 13 makes a scheduling decision on the N RPs 11 and the M UDs 12 according to the target scheduling decision. Get the task request and perform task scheduling.
[0050] The network is used as a medium to provide a communication link between the N RPs 11, the M UDs 12 and the scheduling decision device 13, and may be a wired network or a wireless network.
[0051] Optionally, the wireless network or wired network described above uses standard communication technology and / or protocol. The network is usually the Internet, but it can also be any network, including but not limited to a local area network (LAN), a metropolitan area network (MAN), a wide area network (WAN), a mobile, wired or wireless network, a dedicated network or any combination of a virtual private network). In some embodiments, the data exchanged through the network is represented by technologies and / or formats including Hyper Text Mark-up Language (HTML), Extensible Markup Language (XML), etc. In addition, conventional encryption technologies such as Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Network (VPN), Internet Protocol Security (IPSec) can also be used to encrypt all or some links. In other embodiments, customized and / or dedicated data communication technologies can also be used to replace or supplement the above data communication technologies.
[0052] The UD 12 may be a variety of electronic devices, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, smart speakers, smart watches, wearable devices, augmented reality devices, virtual reality devices, etc.
[0053] Optionally, the client of the application installed in different UDs 12 is the same, or the client of the same type of application based on different operating systems. Based on the different terminal platforms, the specific form of the client of the application can also be different, for example, the application client can be a mobile client, a PC client, etc.
[0054] RP 11 may be a server that provides various services, such as a background management server that provides support for devices operated by users using terminal device 101. The background management server may analyze and process received request data, and feed back the processing results to the terminal device.
[0055] Optionally, the server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), as well as big data and artificial intelligence platforms.
[0056] RP 11 may also be an edge computing node.
[0057] The scheduling decision device 13 may be a server or a terminal, and this application does not impose any limitation on this.
[0058] Those skilled in the art will know that Figure 1 The number of UDs and RPs in the example is only illustrative, and any number of UDs and RPs may be provided according to actual needs, which is not limited in the present embodiment of the application.
[0059] Under the above system architecture, an embodiment of the present application provides a task scheduling method, which can be executed by any electronic device with computing and processing capabilities. For example, the electronic device is a scheduling decision device.
[0060] Figure 3 A flow chart of a task scheduling method in an embodiment of the present application is shown as follows: Figure 3 As shown, the task scheduling method provided in the embodiment of the present application includes the following S301 to S305. The task scheduling method is applied to a task scheduling system, and the task scheduling system includes N RPs and MUDs, where N and M are both integers not less than 1.
[0061] S301, obtaining at least one directed acyclic graph of L task requests generated by M UDs, where L is an integer greater than 1.
[0062] In one embodiment, the execution of some task requests depends on the completion of their parent task requests. Therefore, the scheduling decision device can construct at least one directed acyclic graph based on the dependency relationship between the task requests, using L task requests as vertices and the dependency relationship between the parent and child task requests as directed edges.
[0063] After constructing the at least one directed acyclic graph, obtaining of the at least one directed acyclic graph is completed.
[0064] The embodiments of the present application do not limit how the scheduling decision device obtains the sequential execution dependency of the L task requests. For example, each UD can send task request information to the scheduling decision device, and the task request dependency is recorded in the information.
[0065] The embodiment of the present application does not limit the specific number of task requests as to the number of L task requests. Figure 4 As shown, L is 7, and the L task requests are A1, A2, A3, A4, B1, B2, and B3, respectively. A1 is the parent task request of A2 and A3, A2 is the parent task request of A4, B1 is the parent task request of B2, and B2 is the parent task request of B3. Then the 7 task requests can construct two directed acyclic graphs. Among them, the vertex set of one directed acyclic graph is {A1, A2, A3, A4}, and the edge set is {(A1, A2), (A1, A3), (A2, A4)}; the vertex set of the other directed acyclic graph is {B1, B2, B3}, and the edge set is {(B1, B2), (B2, B3)}.
[0066] The embodiments of the present application do not limit the at least one directed acyclic graph to specifically be several directed acyclic graphs, and the directed acyclic graphs may be determined based on the dependency relationship between the L task requests.
[0067] S302, constructing a hypergraph of L task requests according to the at least one directed acyclic graph, wherein the vertex set of the hypergraph includes the L task requests, the hyperedge set of the hypergraph includes a sequential hyperedge set, and the sequential hyperedge set includes edges in the directed acyclic graph.
[0068] At least one directed acyclic graph is two directed acyclic graphs, and the two directed acyclic graphs are directed acyclic graphs with vertex sets {A1, A2, A3, A4} and edge sets {(A1, A2), (A1, A3), (A2, A4)}, and directed acyclic graphs with vertex sets {B1, B2, B3} and edge sets {(B1, B2), (B2, B3)}.
[0069] In the hypergraph constructed based on the two directed acyclic graphs, the vertex set includes {A1, A2, A3, A4, B1, B2, B3}, and the sequential hyperedge set includes {(A1, A2), (A1, A3), (A2, A4), (B1, B2), (B2, B3)}.
[0070] In one embodiment, in addition to the sequential hyperedge set, the superedge set also includes at least one of an attribute hyperedge set, a distance hyperedge set, and a hypergraph partition hyperedge set; wherein the attribute hyperedge set is obtained by clustering the L task requests according to the network attributes of the M UDs.
[0071] In one embodiment, L task requests are clustered according to network properties of M UDs, including: clustering the UDs according to the network properties of the M UDs to obtain multiple clusters, taking the task requests generated by the UDs included in each cluster as a hyperedge, multiple clusters corresponding to multiple hyperedges, and the multiple hyperedges corresponding to the multiple clusters constitute an attribute hyperedge set.
[0072] The embodiments of the present application do not limit what network attributes the network attributes of the UD specifically include. For example, the network attributes include: bandwidth, bit rate, operating system, mobility, and the like.
[0073] The embodiments of the present application do not limit the clustering method used to cluster the M UDs. For example, K-means clustering, hierarchical clustering, DBSCAN (Density-Based Spatial Clustering of Applications with Noise), grid clustering, etc. may be used.
[0074] By adding attribute hyperedge sets to the hyperedge sets of the hypergraph, the dependencies between network attributes of each task request can be reflected, further increasing the description of the dependencies between each task request. This is conducive to further mining more complex high-order attribute correlations through the hypergraph neural network, and is conducive to embedding the task graph after the hypergraph is processed by the hypergraph neural network, and generating a scheduling strategy with better parallel computing efficiency during execution.
[0075] The distance hyperedge set includes hyperedges consisting of each vertex in at least one directed acyclic graph and vertices with directed distances of preset values.
[0076] The directed distance refers to the distance between any vertex and the direction of the directed edge in the directed acyclic graph. The specific value of the preset value is not limited in the embodiment of the present application. For example, the preset value is 2, or the preset value is 3, etc.
[0077] If there is no other vertex at a position where the directed distance of any vertex is a preset value, then the vertex does not serve as a hyperedge.
[0078] At least one directed acyclic graph such as Figure 4 As shown, with the preset value of 2, the distance hyperedge set is {(A1, A4), (B1, B3)}.
[0079] The hypergraph partitioned hyperedge set is obtained by partitioning the hypergraph on the sequential hyperedge set, the distance hyperedge set and the attribute hyperedge.
[0080] S303, processing the hypergraph through a hypergraph neural network to obtain a task graph embedding.
[0081] S304, taking the task size, execution result size, task graph embedding and scheduling decision of each task request as the state, taking the scheduling decision as the action of reinforcement learning, setting rewards with reducing the delay and energy consumption of task scheduling as the goal of reinforcement learning, performing deep reinforcement learning, and generating target scheduling decisions.
[0082] Among them, the task size, execution result size, task graph embedding and scheduling decision of each task request are taken as the states, which can be expressed as represents the execution position from the 1st task request to the ith task request, D i represents the task size of the i-th task request, R i Indicates the size of the execution result of the i-th task request, is the task graph embedding. The i-th task corresponds to
[0083] Taking scheduling decision as the action of reinforcement learning, it can be expressed as in It means that at time step t, the i-th task request is executed locally.
[0084] In setting rewards with the goal of reducing delays and energy consumption in task scheduling as reinforcement learning, the embodiments of the present application do not limit how the rewards are set.
[0085] In one embodiment, the reward is expressed as Formula 1 below.
[0086]
[0087] Where t represents the time step, R t is the reward for scheduling the i-th task request according to the scheduling decision at time t; Δ(.) indicates that the content in (.) is a negative increment; when the i-th task request belongs to the task request on the critical path, σm =1, when the i-th task request is not a task request on the critical pathσ m =0; is the discriminator, To judge σ m Is it equal to 1? If σ m =1 The value of is equal to 1, if σ m ≠1 The value of is equal to 0; To judge σ m Is it equal to 0? If σ m =0 The value of is equal to 1, if σ m ≠0 The value of is equal to 0; is the execution location from the 1st task request to the ith task request, is the execution position of the i-th task at time step t , the time when the i-th task request is completed; w h 、w l are weight coefficients, and w h >w l ; is the total energy consumption of completing the 1st to ith task requests at time step t; It is the total energy consumption of completing the 1st to i-1th task requests at time step t.
[0088] The critical path is a path including the at least one directed acyclic graph and having the longest time required for completing all task requests.
[0089] About w h 、w l The specific value is not limited in the embodiments of the present application. h =10w l .
[0090] The time for the i-th task to be completed. The calculation of can refer to the following calculation method of the total delay of completing the scheduling of L task requests.
[0091] In one embodiment, the total delay for completing the scheduling of L task requests is calculated by the following formula 2-formula 10.
[0092]
[0093]
[0094] In formula 2, The total delay for completing the scheduling for L task requests; The execution position from the 1st task request to the Lth task request; is a set of task requests that have no subsequent task requests among L task requests; The requested completion time for the i-th task.
[0095] In formula 3, is the available time of the execution location where the i-th task request is located; AL(i) is the parent task set that has been executed before the i-th task request; is the requested completion time of the jth task, represents the latest completion time among the completion times corresponding to AL(i); The computation delay requested for the i-th task; The transmission delay requested for the i-th task.
[0096] In formula 4, z i is the execution location requested by the i-th task, z k The execution location requested for the kth task; In z i =z k The value is 1 at z i ≠z k The value is 0.
[0097] In formula 5, f m is the CPU frequency of the mth UD, f n is the CPU frequency of the nth RP; D i The requested task size for the i-th task.
[0098] Formula 6-Formula 8, is the latency of uploading the i-th task request to RP, The delay for downloading the execution result of the i-th task request; is the transmission rate of data uploaded from UD to RP, R is the download rate of data transmitted from UD to RP; i The execution result size requested for the i-th task.
[0099] Formula 9-Formula 10, The wireless bandwidth when UD downloads data from RP; It is the wireless bandwidth when UD uploads data to RP; represents the variance of white noise in a complex Gaussian channel; represents the forward transmission power; represents the forward channel gain; represents the backward transmission power; represents the backward channel gain.
[0100] In formula 1, The result is the energy consumption of completing the i-th task request. In one embodiment, the total energy consumption of completing the i-th task request is expressed as follows:
[0101] Formula 15.
[0102]
[0103] Among them, E i The total energy consumption requested to complete the i-th task; The computing energy consumption required to complete the i-th task request; The transmission energy consumption for completing the i-th task request; z i is the execution location requested by the i-th task, z i = 0 means that the i-th task request is executed locally on UD, z i =n means that the i-th task request is executed on the n-th RP.
[0104] is the energy consumption of uploading to RP for the i-th task request, The energy consumption for downloading the execution result of the i-th task request; The time used to download the execution result of the i-th task request, The time taken to upload the i-th task request to the RP.
[0105] q is the execution location of the i-th task request, which is one of the N RPs or the UD that generates the i-th task request; ρ q is the power coefficient q; f n,m (q) is the CPU frequency of q; α q is the dynamic power index of q; The time taken to execute the i-th task request.
[0106] The embodiments of the present application do not limit the specific model used in the process of generating target scheduling decisions through deep reinforcement learning.
[0107] In one embodiment, the encoder and decoder used in deep reinforcement learning are both GRU. Using GRU can enable both the encoder and decoder to process sequences of any length. The number of task requests that need to be scheduled at different times is different. Using GRU can enable the encoder and decoder of deep reinforcement learning to better handle the scheduling decision problem when there are different numbers of task requests.
[0108] S305 , performing task scheduling on the L task requests on the N RPs and the M UDs according to the target scheduling decision.
[0109] The technical solution provided in the embodiment of the present application uses at least one directed acyclic graph corresponding to L task requests to construct a hypergraph including a sequential hyperedge set, which can better describe the multiple dependencies between the L task requests when at least one directed acyclic graph is a plurality of directed acyclic graphs, and can better represent the sequential relationship between the tasks through the sequential hyperedge set. By processing the hypergraph using a hypergraph neural network, the high-order attribute correlation in the multiple dependencies of the task requests can be captured, thereby providing richer contextual information for the subsequent generation of scheduling decisions through reinforcement learning, so that the generated scheduling decisions can have higher parallel computing efficiency when executed compared to the scheduling decisions obtained by relying solely on at least one directed acyclic graph planning.
[0110] In order to reflect the progressiveness of the technical solution provided by the embodiments of the present application, the results of comparing the task scheduling method in the embodiments of the present application with other scheduling methods will be described below.
[0111] The experimental data of the task scheduling method in the embodiment of the present application, as well as DTODRL (a task scheduling method), GT-SAC (a task scheduling method), E-HEFT (a task scheduling method), greedy, random, local and remote, a total of 7 other scheduling methods, are shown in Table 1 below.
[0112] DTODRL: This method uses a pre-trained graph neural network to capture the information of a traditional directed acyclic graph.
[0113] GT-SAC: This method uses a soft actor-critic algorithm to minimize the weighted sum of latency and energy consumption;
[0114] E-HEFT: The enhanced heterogeneous earliest finish time heuristic algorithm schedules tasks to the earliest available RP;
[0115] Greedy: Schedule tasks to the RP with the best performance while taking load balancing into consideration;
[0116] Random: Tasks are randomly scheduled to RPs;
[0117] Local: All tasks are executed locally;
[0118] Remote: All tasks are scheduled to a random RP.
[0119] Table 1
[0120]
[0121] As can be seen from Table 1, compared with seven other models with different numbers of tasks, the task scheduling method in the embodiment of the present application shows better delay and energy consumption reduction. Specifically, compared with GTODRL, the average delay of the task scheduling method in the embodiment of the present application is reduced by 28.76%, 41.06%, 42.39%, 32.79% and 35.61% respectively in the case of 20-60 task requests, and the completion time is shortened more as the number of task requests increases. In addition, the energy efficiency of the task scheduling method in the embodiment of the present application is better than the seven other models, reducing by 10.49%, 22.08%, 18.12%, 12.81% and 15.12% respectively. This dual advantage highlights the ability of the task scheduling method in the embodiment of the application to handle increased task dependencies more effectively than GTODRL and GT-SAC. By utilizing the hyperedge set of task attributes, the task scheduling method in the embodiment of the present application can more effectively represent and capture high-order data dependencies compared with traditional GNN (Graph Neural Network). E-HEFT focuses on the completion time by selecting a more powerful but more energy-consuming RP, while the task scheduling method in the embodiment of the present application optimizes the trade-off between latency and energy consumption.
[0122] Based on the same inventive concept, the present application also provides a task scheduling device in the embodiment, as described in the following embodiment. Since the principle of solving the problem in the device embodiment is similar to that in the above method embodiment, the implementation of the device embodiment can refer to the implementation of the above method embodiment, and the repeated parts will not be repeated.
[0123] Figure 5 A schematic diagram of a task scheduling device in an embodiment of the present application is shown. Figure 5 As shown, the device is applied to a task scheduling system, which includes N RPs and M UDs, where N and M are both integers not less than 1, and includes: an acquisition module 51, which is used to acquire at least one directed acyclic graph of L task requests generated by M UDs, where L is an integer greater than 1; a hypergraph construction module 52, which is used to construct a hypergraph of L task requests based on at least one directed acyclic graph, wherein the vertex set of the hypergraph includes the L task requests, the hyperedge set of the hypergraph includes a sequential hyperedge set, and the sequential hyperedge set includes an edge in at least one directed acyclic graph; a processing module 53, which is used to process the hypergraph through a hypergraph neural network to obtain a task graph embedding; a generation module 54, which is used to take the task size, execution result size, task graph embedding and scheduling decision of each task request as a state, take the scheduling decision as an action of reinforcement learning, set a reward for reducing the delay and energy consumption of task scheduling as the goal of reinforcement learning, perform deep reinforcement learning, and generate a target scheduling decision; a scheduling module 55, which is used to schedule the L task requests on N RPs and M UDs according to the target scheduling decision.
[0124] The technical solution provided in the embodiment of the present application uses at least one directed acyclic graph corresponding to L task requests to construct a hypergraph including a sequential hyperedge set, which can better describe the multiple dependencies between the L task requests when at least one directed acyclic graph is a plurality of directed acyclic graphs, and can better represent the sequential relationship between the tasks through the sequential hyperedge set. By processing the hypergraph using a hypergraph neural network, the high-order attribute correlation in the multiple dependencies of the task requests can be captured, thereby providing richer contextual information for the subsequent generation of scheduling decisions through reinforcement learning, so that the generated scheduling decisions can have higher parallel computing efficiency when executed compared to the scheduling decisions obtained by relying solely on at least one directed acyclic graph planning.
[0125] It should be noted that the acquisition module 51, the hypergraph construction module 52, the processing module 53, the generation module 54 and the scheduling module 55 correspond to S301 to S305 in the method embodiment, and the examples and application scenarios implemented by the modules and the corresponding steps are the same, but are not limited to the contents disclosed in the method embodiment. It should be noted that the modules as part of the device can be executed in a computer system such as a set of computer executable instructions.
[0126] Those skilled in the art will appreciate that various aspects of the present application may be implemented as a system, method or program product. Therefore, various aspects of the present application may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to as "circuit", "module" or "system" herein.
[0127] Refer to the following Figure 6 The electronic device 600 according to this embodiment of the present application is described. Figure 6 The electronic device 600 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0128] like Figure 6 As shown, the electronic device 600 is in the form of a general computing device. The components of the electronic device 600 may include but are not limited to: at least one processing unit 610, at least one storage unit 620, and a bus 630 connecting different system components (including the storage unit 620 and the processing unit 610).
[0129] The storage unit stores program codes, which can be executed by the processing unit 610, so that the processing unit 610 performs the steps of various exemplary embodiments of the present application described in the above "Exemplary Method" section of this specification. For example, the processing unit 610 can perform the following steps of the above method embodiment: S301-S305.
[0130] The storage unit 620 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 6201 and / or a cache memory unit 6202 , and may further include a read-only memory unit (ROM) 6203 .
[0131] The storage unit 620 may also include a program / utility 6204 having a set (at least one) of program modules 6205, such program modules 6205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0132] Bus 630 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0133] The electronic device 600 may also communicate with one or more external devices 640 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 600, and / or communicate with any device that enables the electronic device 600 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 650. Furthermore, the electronic device 600 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 660. As shown, the network adapter 660 communicates with other modules of the electronic device 600 via a bus 630. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0134] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation methods of the present application.
[0135] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart may be implemented as a computer program product, which includes: a computer program, which implements the above-mentioned task scheduling method when executed by a processor.
[0136] In an exemplary embodiment of the present application, a computer-readable storage medium is also provided, which may be a readable signal medium or a readable storage medium. The computer-readable storage medium stores a program product capable of implementing the above method of the present application.
[0137] In some possible implementations, various aspects of the present application may also be implemented in the form of a program product, which includes a program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps of various exemplary implementations of the present application described in the above “Exemplary Method” section of this specification.
[0138] More specific examples of computer-readable storage media in the present application may include, but are not limited to, an electrical connection having one or more conductors, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0139] In the present application, a computer readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, wherein a readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A readable signal medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0140] Alternatively, the program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0141] In specific implementation, the program code for performing the operation of the present application can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and also conventional procedural programming languages such as "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, as an independent software package, partially on the user computing device and partially on the remote computing device, or completely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).
[0142] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0143] In addition, although the steps of the method in the present application are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0144] Through the description of the above implementation modes, it is easy for those skilled in the art to understand that the example implementation modes described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation mode of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation mode of the present application.
[0145] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the appended claims.
Claims
1. A task scheduling method, characterized in that: Applied to a task scheduling system, the task scheduling system includes N resource pools RP and M user devices UD, where N and M are both integers not less than 1, including: Obtain at least one directed acyclic graph of L task requests generated by the M UDs, where L is an integer greater than 1; According to the at least one directed acyclic graph, construct a hypergraph of the L task requests, wherein a vertex set of the hypergraph includes the L task requests, a hyperedge set of the hypergraph includes a sequential hyperedge set, and the sequential hyperedge set includes edges in the at least one directed acyclic graph; Processing the hypergraph through a hypergraph neural network to obtain a task graph embedding; Taking the task size of each task request, the execution result size, the task graph embedding and the scheduling decision as the state, taking the scheduling decision as the action of reinforcement learning, setting the reward with reducing the delay and energy consumption of task scheduling as the goal of reinforcement learning, performing deep reinforcement learning, and generating the target scheduling decision; According to the target scheduling decision, the L task requests are scheduled on the N RPs and the M UDs.
2. The method according to claim 1, characterized in that The super edge set further includes: at least one of an attribute super edge set, a distance super edge set, and a super graph partition super edge set; Among them, the attribute hyperedge set is obtained by clustering the L task requests according to the network attributes of the M UDs, the distance hyperedge set includes the hyperedges composed of each vertex in the at least one directed acyclic graph and the vertices with directed distances of preset values, and the hypergraph partitioned hyperedge set is obtained by hypergraph partitioning the sequential hyperedge set, the distance hyperedge set and the attribute hyperedge.
3. The method according to claim 1, characterized in that The reward is expressed as the following formula: Where t represents the time step, R t is the reward for scheduling the i-th task request according to the scheduling decision at time t; Δ(.) indicates that the content in (.) is a negative increment; when the i-th task request belongs to the task request on the critical path, σ m =1, when the i-th task request is not a task request on the critical pathσ m =0; is the discriminator, To judge σ m Is it equal to 1? If σ m =1 The value of is equal to 1, if σ m ≠1 The value of is equal to 0; To judge σ m Is it equal to 0? If σ m =0 The value of is equal to 1, if σ m ≠0 The value of is equal to 0; is the execution location from the 1st task request to the ith task request, is the execution position of the i-th task at time step t , the time when the i-th task request is completed; w h 、w l are weight coefficients, and w h >w l ; is the total energy consumption of completing the 1st to ith task requests at time step t; is the total energy consumption of completing the 1st to i-1th task requests at time step t; The critical path is the path that takes the longest time to complete all task requests among the paths included in the at least one directed acyclic graph.
4. The method according to claim 3, characterized in that The total delay of the L task requests to complete the scheduling is calculated by the following formula: in, The total delay for completing the scheduling of the L task requests; The execution position from the 1st task request to the Lth task request; is a set of task requests that have no subsequent task requests among the L task requests; The requested completion time for the i-th task; is the available time of the execution location where the i-th task request is located; AL(i) is the parent task set that has been executed before the i-th task request; is the requested completion time of the jth task, represents the latest completion time among the completion times corresponding to AL(i); The computation delay requested for the i-th task; The transmission delay requested for the i-th task; z i is the execution location requested by the i-th task, z k The execution location requested for the kth task; In z i =z k The value is 1 at z i ≠z k The value is 0 when f m is the CPU frequency of the mth UD, f n is the CPU frequency of the nth RP; D i The task size requested for the i-th task; is the latency of uploading the i-th task request to RP, The delay for downloading the execution result of the i-th task request; is the transmission rate of data uploaded from UD to RP, R is the download rate of data transmitted from UD to RP; i The size of the execution result requested for the i-th task; The wireless bandwidth when UD downloads data from RP; It is the wireless bandwidth when UD uploads data to RP; represents the variance of white noise in a complex Gaussian channel; represents the forward transmission power; represents the forward channel gain; represents the backward transmission power; represents the backward channel gain.
5. The method according to claim 3 or 4, characterized in that: The total energy consumption to complete the i-th task request is expressed as follows: Among them, E i The total energy consumption requested to complete the i-th task; The computing energy consumption required to complete the i-th task request; The transmission energy consumption required to complete the i-th task request; z i is the execution location requested by the i-th task, z i = 0 means that the i-th task request is executed locally on UD, z i =n means that the i-th task request is executed on the n-th RP; is the energy consumption uploaded to RP for the i-th task request, The energy consumption for downloading the execution result of the i-th task request; The time used to download the execution result of the i-th task request, The time used to upload the i-th task request to RP; q is the execution location of the i-th task request, which is one of the N RPs or the UD that generates the i-th task request; ρ q is the power coefficient q; f n,m (q) is the CPU frequency of q; α q is the dynamic power index of q; The time taken to execute the i-th task request.
6. The method according to claim 1, characterized in that Both the encoder and decoder used in deep reinforcement learning are gated recurrent units (GRUs).
7. A task scheduling device, characterized in that: Applied to a task scheduling system, the task scheduling system includes N resource pools RP and M user devices UD, where N and M are both integers not less than 1, including: An acquisition module, used to acquire at least one directed acyclic graph of L task requests generated by the M UDs, where L is an integer greater than 1; A hypergraph construction module, configured to construct a hypergraph of the L task requests according to the at least one directed acyclic graph, wherein a vertex set of the hypergraph includes the L task requests, a hyperedge set of the hypergraph includes a sequential hyperedge set, and the sequential hyperedge set includes edges in the at least one directed acyclic graph; A processing module, used for processing the hypergraph through a hypergraph neural network to obtain a task graph embedding; A generation module is used to take the task size of each task request, the execution result size, the task graph embedding and the scheduling decision as the state, take the scheduling decision as the action of reinforcement learning, set the reward for reducing the delay and energy consumption of task scheduling as the goal of reinforcement learning, perform deep reinforcement learning, and generate the target scheduling decision; A scheduling module is used to schedule the L task requests on the N RPs and the M UDs according to the target scheduling decision.
8. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to execute the task scheduling method according to any one of claims 1 to 6 by executing the executable instructions.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the task scheduling method according to any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the task scheduling method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Task processing method and device, equipment and storage medium
CN114625926A
Hypergraph partition-based computing power network task unloading method
CN118113367A
System and method for designing integrated circuits based on deep reinforcement learning using partitioning
KR102454202B1
Cited By
Emergency task scheduling method and device in limited space
CN121094375A