Task unloading and heterogeneous computing system and computing resource allocation method

By using the multi-head decision-making PPO model and SDN controller in IoT devices, combined with the resources of edge and cloud servers, task offloading and efficient allocation of heterogeneous computing resources in IoT devices are achieved, solving resource shortage and delay problems. , which improves computing power.

CN118819827AInactive Publication Date: 2024-10-22CHINA UNIV OF MINING & TECH

Patent Information

Application Number
CN202410800029.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-20
Publication Date
2024-10-22
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

IoT devices lack resources for processing computing-intensive and delay-sensitive tasks. Traditional mobile cloud computing and edge computing cannot effectively meet the needs of high-concurrency large-scale computing tasks. In particular, deep learning model training and inference tasks cannot be effectively processed.

Method used

Using task offloading and heterogeneous computing systems, through the SDN controller and computing orchestrator, the multi-head decision-making PPO model is used to optimize task offloading and CPU-GPU resource allocation, and combines the computing resources of edge servers and cloud servers to minimize long-term average time Delayed computing resource allocation strategy.

Benefits of technology

In IoT scenarios with limited computing resources, efficient task offloading and CPU-GPU heterogeneous computing resource allocation are achieved, reducing long-term average latency, improving computing capabilities, and supporting the processing of complex tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118819827A_ABST
    Figure CN118819827A_ABST
Patent Text Reader

Abstract

The invention relates to a task unloading and heterogeneous computing system and a computing resource allocation method, and the method comprises the steps: carrying out the allocation of task unloading and heterogeneous computing resources through a first optimization target and a multi-head decision PPO model, and obtaining a task unloading and heterogeneous computing resource allocation scheme, and the first optimization target is the minimum long-term average time delay; and scheduling the computing task generated by the Internet of Things equipment to the edge computing server and the cloud server according to the scheme. According to the method, an efficient task unloading and CPU-GPU heterogeneous computing resource allocation strategy can be trained by taking minimization of long-term average time delay as an optimization target in an Internet of Things scene with limited computing resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technology, and in particular to a task offloading and heterogeneous computing system and a computing resource allocation method. Background Art

[0002] With the development of 5G and the gradual commercial application of technologies such as artificial intelligence and AR, IoT applications have exploded, such as high-precision assembly and intelligent control. However, the inherent resource-scarce nature of IoT devices makes them unable to cope with computationally intensive and latency-sensitive tasks. Mobile cloud computing (MCC) alleviates this problem by sending tasks to cloud servers with a large amount of computing resources, but the network transmission conditions of the wide area network are changeable and will introduce high transmission delays, which cannot meet the latency requirements of IoT applications. Multi-access edge computing (MEC) usually deploys edge computing servers at the same location as base stations or access points, and provides computing resources for applications and ensures low computing latency by offloading tasks to computing nodes at the edge of the network. However, the computing resources of edge computing devices are still limited, so MEC cannot cope with a large number of high-concurrency computing tasks. The cloud-edge collaborative architecture combines the advantages of MCC and MEC, and the computing resources of edge servers (ES) and cloud servers (CS) provide low-latency computing services for computing-intensive tasks.

[0003] At present, deep learning technology is widely used in applications such as machine vision in IoT scenarios, and more and more model training and reasoning tasks are deployed on mobile devices. Therefore, the general CPU computing architecture can no longer handle such special computing requirements intelligently and efficiently. Some complex tasks often require an effective combination of multiple computing resources (such as CPU+GPU, etc.) to complete. It is very necessary to study task offloading and heterogeneous resource allocation strategies based on the CPU-GPU heterogeneous computing framework, that is, to select appropriate computing nodes for tasks and allocate reasonable CPU and GPU resources according to the task computing requirements and the resource availability information of each computing node in the system. Summary of the invention

[0004] The purpose of the present invention is to provide a task offloading and heterogeneous computing system and a computing resource allocation method, which aims to train an efficient task offloading and CPU-GPU heterogeneous computing resource allocation strategy in an IoT scenario with limited computing resources, with the minimization of long-term average latency as the optimization goal.

[0005] To achieve the above object, the present invention provides the following solutions:

[0006] On the one hand, a task offloading and heterogeneous computing system is provided, including:

[0007] IoT devices, several wireless access points, edge computing servers, cloud servers, SDN controllers, and computing orchestrators;

[0008] The computing scheduler is used to allocate task offloading and heterogeneous computing resources through a first optimization goal and a multi-head decision-making PPO model to obtain a task offloading and heterogeneous computing resource allocation plan, wherein the first optimization goal is to minimize the long-term average delay;

[0009] The SDN controller is used to schedule the computing tasks generated by the IoT device to the edge computing server and the cloud server according to the scheme, wherein the IoT device is connected to the edge computing server by wire through a plurality of wireless access points;

[0010] The edge computing server and the cloud server are used to calculate the computing task, and both the edge computing server and the cloud server are configured with CPU and GPU computing resources.

[0011] On the other hand, a method for task offloading and computing resource allocation of a heterogeneous computing system includes:

[0012] Obtaining a first optimization goal and a first optimization goal constraint condition, and obtaining a virtual queue based on a constraint condition of a virtual queue in which a task execution time is less than a maximum tolerable delay of the task in the first optimization goal constraint condition, wherein the first optimization goal is to minimize the long-term average delay;

[0013] Based on the virtual queue, obtaining a merged queue of the real queue and the virtual queue;

[0014] Based on the Lyapunov function, the real queue and the virtual queue merge the queue to obtain a first model;

[0015] Based on the first model and the drift minimization plus penalty algorithm, the first optimization objective is converted into a second optimization objective and a constraint condition of the second optimization objective is obtained;

[0016] Based on converting the second optimization objective into a Markov decision process, and converting the constraints of the second optimization objective into implicit constraints related to actions and rewards;

[0017] Based on the converted second optimization objective and the constraint conditions of the second optimization objective, a multi-head decision-making PPO model is used to allocate task offloading and heterogeneous computing resources.

[0018] Optionally, the long-term average delay is:

[0019]

[0020] in, is the average execution delay of tasks generated by all IoT devices in N time slots, is the total number of time slots, n is time slot n, M is the total number of IoT devices, m is the number of IoT devices, The task execution time.

[0021] Optionally, the first optimization objective is:

[0022]

[0023] The first optimization objective constraint condition is:

[0024]

[0025] in, is the average execution delay of tasks generated by all IoT devices in N time slots, The unloading mode of the mth IoT device in time slot n, and When allocating CPU and GPU computing resources to tasks, the number of CPU cores and GPU cores allocated are respectively, is the set of all wireless access points, b is the bth wireless access point, is the total number of time slots, is the total number of IoT devices, is the maximum tolerable delay of the task, is the task execution time, The maximum number of CPU resources that can be allocated to the cloud server. is the maximum amount of CPU resources that can be allocated to the edge server. is the maximum number of GPU resources that can be allocated to the cloud server. is the maximum number of GPU resources that can be allocated to the edge server, To have expectations for *, is the amount of computation waiting in the CPU and GPU queues of the edge computer, The amount of computing time waiting in the CPU and GPU queues of the cloud server.

[0026] Optionally, the second optimization objective is:

[0027]

[0028] Among them, V is a control factor that balances queue length and execution delay. and They represent the computing amount of the CPU and GPU waiting queues of the b-th edge computing server, For the task The proportion of floating-point operations consumed in the calculation phase to the total floating-point operations of the task, For the task The proportion of floating-point operations consumed by GPU computing tasks during the calculation phase, For the task The number of floating-point operations required for execution, and are the computing amount of the CPU and GPU waiting queues of the cloud server, Z m (n) for Related virtual queues;

[0029] The second optimization objective constraint is:

[0030]

[0031] Optionally, converting the second optimization objective into a Markov decision process includes:

[0032] Get the state space s(n):

[0033]

[0034] in, is the status information of all IoT devices in the nth time slot, and They are the CPU and GPU resource idleness of edge computing servers and cloud servers, and They are the waiting queue backlogs of the edge computing server and the cloud server at time slot n, respectively;

[0035] Get the action space a(n):

[0036]

[0037] in, and Assigned to The number of CPU cores and GPU cores;

[0038] According to the environment, obtain the transition probability, and preset the reward function and the preset discount factor;

[0039] Based on the state space, the action space, the transition probability, the preset reward function and the preset discount factor, the second optimization objective is converted into a Markov decision process, and a third optimization objective and the constraints of the third optimization objective are obtained. The third optimization objective is used as the objective function of the PPO model of multi-head decision-making, wherein the third optimization objective is the optimal action strategy that maximizes long-term rewards, and the constraints of the third optimization objective are the same as the constraints of the second optimization objective.

[0040] Optionally, the third optimization objective is:

[0041]

[0042] Among them, q π (s(n), a(n) is the expected long-term cumulative reward for selecting action a(n) in state s(n), r(n) is the reward value of the nth time slot, and U is the discount factor.

[0043] Optionally, converting the constraint condition of the second optimization objective into an implicit constraint related to the action and the reward includes:

[0044] The constraints middle Optimize to discrete integers, and set the action output of the PPO algorithm to discrete output;

[0045] The constraints In and Multiply by the continuous resource allocation factor κ;

[0046] Introduce penalty terms into the reward function to obtain the reward function of task delay, energy and actual queue length.

[0047] Optionally, the multi-head decision-making PPO model includes an Actor network and a Critic network, the Actor network contains an Encoder and several output decision heads, the Encoder uses an MLP network to encode state information, and the actions output by the several output decision heads are combined into a complete action, wherein the complete action is a task offloading and heterogeneous computing resource allocation solution.

[0048] Optionally, the comprehensive loss function of the PPO model of multi-head decision-making is:

[0049]

[0050] in, To take the expectation of * in the nth time slot, is the truncation loss of the PPO algorithm in the nth time slot, θ is the network parameter of the Actor in the PPO algorithm, and c1 is L V The weighting coefficient of (ω), L V (ω) is the mean square error of the value function of the PPO algorithm, c2 is The weighting coefficient of is the action entropy.

[0051] The beneficial effects of the present invention are as follows: SDN, as a key enabling technology in B5G and 6G networks, separates the control plane of the network from the forwarding plane to more efficiently manage resources in the network. It is worth noting that SDN technology can collect information such as channels, server loads, task computing requests, etc. in the entire network through the SDN controller, and provide data and command interfaces to specific applications through the northbound interface. Therefore, SDN can be naturally integrated with MEC technology to complete the efficient orchestration of cloud-edge-end collaborative computing, that is, by building a collaborative computing orchestrator (CCO) on the application plane of SDN to efficiently generate task execution decisions. In the IoT scenario with limited computing resources, the present invention takes minimizing the long-term average delay as the optimization goal, and trains efficient task offloading and CPU-GPU heterogeneous computing resource allocation strategies.

[0052] The present invention adopts the MH-PPO algorithm to efficiently train the optimal strategy of joint task offloading and heterogeneous resource allocation. Through the multi-head output action design, the decision variables can share global features while outputting actions through local features. Such a network design enables each decision variable to have a separate decision head, reducing the interference between multiple decision variables during the training process. At the same time, MH-PPO has high versatility. Since each decision head is separated, the network supports the output of mixed action space, that is, continuous actions and discrete actions are output simultaneously, so that MH-PPO can cope with complex decision spaces. Compared with the network structure that outputs multiple actions simultaneously through one network, the multi-head design supports the selection of multiple different types of activation functions as needed before the action output, thereby outputting mixed actions suitable for the scene. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0054] Figure 1 The SDN-enabled heterogeneous computing model of the Internet of Things according to the embodiment of the present invention;

[0055] Figure 2 It is a sub task of the heterogeneous computing model of an embodiment of the present invention;

[0056] Figure 3 It is a joint task offloading and CPU-GPU resource allocation algorithm strategy training framework based on MH-PPO in an embodiment of the present invention. DETAILED DESCRIPTION

[0057] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0058] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0059] Embodiment 1

[0060] A task offloading and heterogeneous computing system, comprising:

[0061] IoT devices, several wireless access points, edge computing servers, cloud servers, SDN controllers, and computing orchestrators;

[0062] The computing scheduler is used to allocate task offloading and heterogeneous computing resources through a first optimization goal and a multi-head decision-making PPO model to obtain a task offloading and heterogeneous computing resource allocation plan, wherein the first optimization goal is to minimize the long-term average delay;

[0063] The SDN controller is used to schedule the computing tasks generated by the IoT device to the edge computing server and the cloud server according to the scheme, wherein the IoT device is connected to the edge computing server by wire through a plurality of wireless access points;

[0064] The edge computing server and the cloud server are used to calculate the computing task, and both the edge computing server and the cloud server are configured with CPU and GPU computing resources.

[0065] Implementation II

[0066] like Figure 1 As shown, the present invention discloses a method for task offloading and computing resource allocation of a heterogeneous computing system, comprising:

[0067] In the IoT scenario Figure 1The SDN-enabled CPU-GPU heterogeneous computing architecture shown in the figure consists of M IoT devices, multiple wireless access points, edge computing servers with the same number of wireless access points, cloud servers, SDN controllers and computing orchestrators. Among them, IoT devices, edge computing servers and cloud servers have both CPU and GPU computing resources. IoT devices can generate computing-intensive and delay-sensitive tasks and are fully covered by wireless access points in the area. Wireless access points are connected by wires, and each wireless access point is directly connected to an edge computing server by a wired connection. The computing resources of edge computing servers are more abundant than those of IoT devices, but they are still limited, so they cannot meet the computing needs of all IoT devices. Cloud servers refer to remote cloud servers that have more computing resources than edge computing servers. It is assumed that computing devices of the same type have the same computing resources. The computing orchestrator is an upper-layer application of the SDN controller. When it receives a task computing request, it generates task offloading and heterogeneous computing resource allocation decisions based on the status information of each node in the system. Finally, the SDN controller arranges tasks to the corresponding devices for computing based on the decision results. The IoT device is represented as A time slot system model is adopted to divide the system time into N time slots of equal length, represented as {1,2,…,N}, where the length of each time slot n is τ. At the beginning of each time slot t, all IoT devices independently and randomly generate a computing task (may or may not be generated) and send a computing request to the computing scheduler. The computing scheduler then generates task offloading and heterogeneous computing resource allocation decisions based on the QoS service quality of the task and system status information. Finally, the SDN controller arranges the task to the corresponding device for computing. Assume They represent the number of CPU cores, CPU single-core computing power (in FLOPS), CPU dynamic power, and CPU static power of the mth IoT device; related parameters of GPU Similarly. The computing tasks of the present invention are inseparable tasks (such as image classification, etc.), so the binary computing offloading method is adopted in the model, that is, the tasks are completely offloaded to the edge computing server or cloud server for execution. In addition, it is stipulated that at least one CPU core is occupied when the task is executed, each GPU core can only be assigned to one GPU subtask, and the frequency utilization of the CPU and GPU can reach 100% when the task is executed.

[0068] The unloading method of the mth IoT device in time slot n is defined as:

[0069]

[0070] in, Represents the set of all wireless access points. It means that the task is transmitted to the wireless access point through the wireless channel, and then transmitted to the cloud server through the switching node. The cloud server is responsible for executing the calculation process. It means that after the task is transmitted to the wireless access point through the wireless channel, it is then transmitted to the edge computing server connected to the bth wireless access point to perform the calculation process. Assuming that the transmission delay from the wireless access point to the edge computing server is negligible and the edge computing servers connected to all wireless access points have the same computing power, the transmission bandwidth between wireless access point nodes is represented as W AP (unit: bps), and computing resources are expressed as is the number of CPU cores of the edge computing server, The single-core computing capability of the CPU of the edge computing server. is the number of GPU cores of the edge computing server, is the GPU single-core computing power of the edge computing server. When a computing task is generated, the IoT device first sends a computing request to the SDN controller, and then the SDN controller determines the computing node to execute the task based on the resource requirements of the computing task, the tolerable delay and other system status information, that is, one of the edge computing server and the cloud server. In this process, the amount of task request information and offloading control information is usually very small, so the present invention does not consider the transmission delay of this part of information. Assume that the bandwidth from each wireless access point to the cloud server is the same, expressed as W CS , and the computing resources of the cloud server are represented as

[0071] like Figure 2 As shown in the figure, heterogeneous computing tasks are used as the main computing tasks generated by IoT devices. In the task decomposition stage, the CPU decomposes the task into CPU subtasks and GPU subtasks. In the calculation stage, the above two parts of the task are calculated by the GPU and CPU respectively, and the CPU subtask results and GPU subtask results are generated. In the result aggregation stage, the CPU is used to further process the two parts of the calculation results to obtain the final result of the original task. It should be noted that in the calculation stage, the CPU subtasks and GPU subtasks must be calculated before entering the task merging stage. The task generated by the mth IoT device in time slot n Represented as a quintuple in Indicates the size of the task data (in bits). Indicates the number of floating point operations (FLOPs) required to execute the task. Indicates the task ε represents the ratio of the floating-point operations consumed by the task in the calculation phase to the total floating-point operations of the task, and ξ represents the ratio of the floating-point operations consumed by the GPU calculation task in the calculation phase.

[0072] The corresponding execution delay and energy consumption are given for the case where the task executes the calculation process in ES and CS. Assume that the wireless access point connected by device m through the wireless channel in time slot n is When the task is offloaded to When the edge computing server is wired The execution delay of the task is the sum of the wireless channel transmission delay, queuing delay and computing delay. When the task is offloaded to the edge computing server or cloud server connected to other wireless access points, When Transmit to the destination edge computing server or cloud server Therefore, when the task is offloaded to the edge computing server, The transmission delay to the destination server can be expressed as:

[0073]

[0074] in, Assume that the signal-to-noise ratio of the wireless channel between the IoT device and the wireless access point is:

[0075]

[0076] Among them, p m is the transmission power, is the channel gain, considering path loss, multipath effect, Rayleigh fading and log-normal shadow, then in is the distance between the mth IoT device and the wireless access point at the nth time slot, λ, β, g, ζ represent the path loss coefficient, path loss index, Rayleigh fading coefficient and log-normal shadow respectively. Since the moving distance of IoT devices in each time slot is very small, the state of the wireless channel in each time slot is almost unchanged, that is, the signal-to-noise ratio in each time slot can be regarded as a constant. Define the bandwidth W allocated by the wireless access point to the IoT device I , then the transmission rate of the wireless channel for:

[0077]

[0078] Computational tasks From the mth IoT device to The transmission time is:

[0079]

[0080] in, is the wireless transmission rate of the mth IoT device in the nth time slot.

[0081] The total computation time consumed in the task decomposition and merging phase is:

[0082]

[0083] The calculation phase time is:

[0084]

[0085] Among them, the CPU time consumed by the task in the calculation phase And the GPU time consumed by the task in the calculation phase They are:

[0086]

[0087] When computationally intensive tasks are scheduled to be executed by an ES with limited computing resources, a single time slot cannot complete the computation process, which results in a computation waiting queue on the device. If a newly arrived computation task cannot be executed immediately, it will wait in the computation queue until sufficient computing resources are released by the executing task. Therefore, the queuing waiting time during task execution must be considered. Assuming that the waiting queue is infinite and the execution order is first-come, first-served (FCFS) mode, Represent the computing amount of the CPU and GPU waiting queues of the b-th edge computing server respectively, and we can get:

[0088]

[0089] as well as

[0090]

[0091] Similarly, and are the number of CPU cores and GPU cores that are idle in the bth edge computing server at the nth time slot, and it is stipulated that only one task can be offloaded to the edge computing server or cloud server in each time slot, so the task The queue waiting time executed at the bth edge computing server for:

[0092]

[0093] At the same time:

[0094]

[0095] The data volume of the task processing result is usually much smaller than the size of the task data uploaded during the offloading process, so the delay of the task result returning from the edge computing server to the IoT device can be ignored. In addition, the edge computing server and the cloud server have reliable infrastructure power supply, so the energy overhead of the edge computing server and the cloud server is not considered. The total latency calculated at the bth edge computing server and the total energy consumed by the mth IoT device are:

[0096]

[0097] When tasks are offloaded to cloud servers When executed, the task starts from The transmission delay to the destination server is:

[0098]

[0099] The total computation time consumed in the task decomposition and merging phase is:

[0100]

[0101] In the calculation stage, the calculation time of the CPU subtask and the GPU subtask can be expressed as:

[0102]

[0103] Therefore the task The total time spent in the calculation phase is:

[0104]

[0105] Depend on Representing the computing amount of the CPU and GPU waiting queues of the cloud server respectively, we can get:

[0106]

[0107] as well as

[0108]

[0109] Task The average queue waiting time for execution on the cloud server is:

[0110]

[0111] Task The total latency of executing the computation on the cloud server is:

[0112]

[0113] Most tasks in the IoT scenario are sensitive to execution delay. The optimization target is determined as the average execution delay of tasks generated by all IoT devices within N time slots, that is, the long-term average delay:

[0114]

[0115] in, is the average execution delay of tasks generated by all IoT devices in N time slots, is the total number of time slots, n is time slot n, M is the total number of IoT devices, m is the number of IoT devices, The task execution time.

[0116]

[0117] is the computing time of the nth task of the mth IoT device on the edge server, The unloading mode of the mth IoT device in time slot n, is the computing time of the nth task of the mth IoT device on the cloud server.

[0118] The task execution time needs to be less than the maximum tolerable delay of the task, so:

[0119]

[0120] in, is the task execution time, the maximum tolerable delay of the task, The task execution time.

[0121] When allocating CPU and GPU computing resources to tasks, the number of CPU cores allocated The number of GPU cores The maximum value of the computing resources of the edge computing server and cloud server cannot be exceeded, that is, the following conditions are met:

[0122]

[0123] in, Unloading method of the mth IoT device in time slot n.

[0124] To ensure system stability, the computation waiting queues of all nodes must meet the queue stability conditions:

[0125]

[0126] in, The maximum number of CPU resources that can be allocated to the cloud server. is the maximum amount of CPU resources that can be allocated to the edge server. is the maximum number of GPU resources that can be allocated to the cloud server. is the maximum number of GPU resources that can be allocated to the edge server, To have expectations for *.

[0127] Therefore, the optimization problem is:

[0128]

[0129] Obviously, due to the optimization variable The value of is an integer, so the optimization problem is a nonlinear integer programming (NIP) problem, and NIP problems are usually NP-hard problems. And and The value range depends on the variable This makes it impossible for traditional linear programming methods to handle this type of problem. In addition, the increase in the number of IoT devices will lead to excessive computational complexity, and the optimal solution cannot be obtained through exhaustive methods.

[0130] Since the optimization problem has not only delay constraints but also computing queue stability constraints, the Lyapnov optimization method is used to transform the original problem. By defining the virtual queue Z associated with constraint (26) m (n), the inequality constraints of the problem can be transformed into a queue stability problem, and then the optimization objective can be minimized by solving the queue stability problem. m (n) is updated as definition Merge the queues for real and virtual queues. For simplicity of representation, the CPU computation queue of ES is Compute queues with GPU Merge and write The same is true for the CPU and GPU computing queues of cloud servers. The Lyapunov function is defined as Then the Lyapunov condition drift is Then the Lyapunov drift plus penalty function of each time slot n is obtained as:

[0131]

[0132] Among them, V is a control factor that balances the queue length and execution delay. According to Lyapunov theory, the upper bound of drift plus penalty, i.e., the first model, can be written as:

[0133]

[0134] Where ζ>0 and is a constant. Ignoring the constant term in (32), the problem is solved by minimizing the drift plus penalty algorithm. Convert to

[0135]

[0136] Among them, V is a control factor that balances queue length and execution delay. and They represent the computing amount of the CPU and GPU waiting queues of the b-th edge computing server, For the task The proportion of floating-point operations consumed in the calculation phase to the total floating-point operations of the task, For the task The proportion of floating-point operations consumed by GPU computing tasks during the calculation phase, For the task The number of floating point operations required for execution (in FLOPs), Z m (n) for and constraints Related virtual queues;

[0137] According to the minimized drift plus penalty algorithm, in each time slot n, by observing the system state H(n) and the random task-related Variables such as , are used to make task offloading and CPU-GPU resource allocation strategies. Reinforcement learning (RL) is one of the most commonly used methods to solve optimization problems. Introducing deep neural networks (DNN) into RL can alleviate the problem that traditional value-based RL methods cannot handle huge action and state spaces to a certain extent. At the same time, it can also improve the policy fitting ability and generalization ability of policy-based RL algorithms. Therefore, an algorithm based on deep reinforcement learning (DRL) is used to solve this problem.

[0138] First, the optimization problem P2 is converted into MDP (Markov decision process), and then the joint constraint transformation and reward design are carried out. Finally, the allocation plan is obtained based on the joint task offloading and CPU-GPU resource allocation algorithm of MH-PPO, where MH-PPO (algorithm) is the PPO model of multi-head decision-making.

[0139] When the calculation process of the task cannot be completed within a time slot, it will cause a backlog in the calculation waiting queue, resulting in the task unloading and resource allocation results in one time slot affecting the task unloading and resource allocation decisions in subsequent time slots. Therefore, the problem is converted into an MDP to minimize the drift plus penalty optimization objective of each time slot. The MDP consists of a five-tuple {S, A, P, R, Υ}, where S represents the state space, A represents the action space, P represents the state transfer matrix, R represents the reward function, and Υ∈[0,1] represents the discount factor. At the beginning of each time slot, the agent perceives the current system state s(t)∈S and selects the action a(t)∈A to be performed. After the action a(t) is completed, the system state is updated to s(t+1), and the agent obtains a reward r(t) from the environmental feedback. The five-tuple in the MDP is designed as follows:

[0140] 1) State space s(n): At the beginning of each time slot, the agent observes the state information of the IoT environment. The state can be expressed as:

[0141]

[0142] in, The status information of all IoT devices in the nth time slot includes the amount of task data generated, the amount of task calculation, the maximum tolerable delay of the task, the proportion of calculation in the calculation stage, and the proportion of parallel calculation in the calculation stage; They are the CPU and GPU resource idleness of edge computing servers and cloud servers respectively; They are the waiting queue backlogs of edge computing servers and cloud servers at time slot n respectively.

[0143] 2) Action space a(n): In each time slot, the agent takes the following actions based on the state space s(n) of the IoT environment:

[0144]

[0145] in, For the task How to uninstall, and Assigned to The number of CPU cores and GPU cores.

[0146] 3) Transition probability P(s(n+1)|s(n),a(n)): The state transition probability represents the probability distribution of s(n+1) given the state s(n) and action a(n). It should be noted that the state transition is completely determined by the environment, and the agent has no prior knowledge of the state transition probability.

[0147] 4) Reward function r(t): The reward function is the reward given by the environment after the agent selects action a(n) in state s(n). The reward function needs to be designed jointly with the state space and is usually given based on experience.

[0148] 5) Discount factor Υ: The discount factor is a weight factor between 0 and 1, which can determine the weight of future rewards in the current time slot and is usually given based on experience.

[0149] Based on the above analysis, the problem is transformed into solving the optimal action strategy to maximize long-term rewards That is, maximize the cumulative discount reward:

[0150]

[0151] Among them, q π (s(n), a(n)) is the expected long-term cumulative reward of selecting action a(n) in state s(n), which can be expressed as:

[0152]

[0153] Where r(n) is the reward function of the nth time slot, U is the discount factor, and q π (s(n+1)) is the long-term cumulative expected reward when the state is s(n+1).

[0154] In order to meet the constraints of the optimization problem P3, the explicit constraints are transformed into implicit constraints related to actions and rewards through reward and action space design, and the optimal joint task offloading and resource allocation strategy is trained through reinforcement learning method.

[0155] 1) In constraint (1), the optimization variable is a discrete-valued integer, so the action output of the PPO algorithm is set to a discrete output.

[0156] 2) In constraints (27) and (28), the variable The value space is too large for the DRL training process to converge. Therefore, the network is first used to output a continuous resource allocation factor k, and then k is multiplied by the maximum number of resources of the corresponding computing node and rounded up to get the resource allocation factor k allocated to the task. The amount of CPU-GPU resources.

[0157] therefore, and It can be expressed as: as well as because and Therefore 0<κ≤1.

[0158] 3) By introducing a penalty term in the reward function to ensure the stability of the real queue and the virtual queue, the reward function of task delay, energy and real queue length is defined as follows:

[0159]

[0160] Among them, coef t pel <0, and r t pel is the time penalty function, is the queue length penalty function, coef t pel and They are the time penalty coefficient and queue length penalty coefficient respectively.

[0161] The SOTA algorithm PPO in deep reinforcement learning is used to solve the problem of joint task offloading and heterogeneous computing resource allocation in the Internet of Things environment. In the field of reinforcement learning, the goal of the agent is to maximize the long-term cumulative reward (corresponding to P3) through interaction with the environment. The PPO algorithm is based on the Actor-Critic framework and optimizes the decision-making process of the agent by estimating the value function and strategy. The value function is used to evaluate the long-term reward of a state or state-action pair, while the strategy is used to determine the action that the agent should take in a specific state. In order to maximize the long-term reward, the reinforcement learning algorithm usually uses some form of loss function to measure the difference between the predicted value function or strategy and the true value, and adjusts the parameters of the value function and strategy through back propagation to minimize the difference between the predicted value function or strategy and the true value, ultimately enabling the agent to obtain the maximum cumulative reward in the long run. This optimization process involves predicting and discounting future rewards so that the agent can take long-term benefits into account in current decisions. Therefore, the PPO algorithm can achieve the goal of maximizing long-term cumulative rewards by optimizing its loss function.

[0162] The PPO algorithm uses DNN to fit the value network, and its optimization objective can be written as:

[0163]

[0164] Where v(·) represents the value network, ω represents its parameter set, and v π* (·) represents the unknown true value network. The update method of the policy network is to first calculate the estimated value of the policy gradient and then update it using stochastic gradient ascent. The estimated value of the policy gradient is expressed as:

[0165]

[0166] Among them, π is a random strategy, is the advantage function estimate at the nth time step. PPO uses a general advantage function estimation method to estimate the advantage function, and weighs the variance and bias of the advantage estimate during the estimation. The estimator of GAE can be expressed as:

[0167]

[0168] Where φ represents the trade-off factor between variance and bias, It is expressed as:

[0169]

[0170] The PPO algorithm learns a random policy π by minimizing a truncated objective θ (s), can be expressed as:

[0171]

[0172] Among them, the truncation function clip(r n (θ),1-,1+) will r n (θ) is truncated to between 1-∈ and 1+∈, where ∈ is a hyperparameter that controls the truncation range. n (θ) is the probability ratio of the new and old strategies, defined as:

[0173]

[0174] In addition, in order to improve the exploration ability of the algorithm, PPO introduces action entropy based on the original proxy optimization objective, which can be expressed as:

[0175]

[0176] Therefore, the comprehensive loss function of the MH-PPO algorithm can be expressed as:

[0177]

[0178] Among them, c1 and c2 represent the coefficients of the loss function and action entropy respectively.

[0179] Figure 3It is a joint task offloading and heterogeneous resource allocation training framework based on the MH-PPO algorithm. The input of the algorithm is the Actor network, the Critic network, the cloud-edge heterogeneous computing system environment, the experience replay pool, and the network initialization parameters θ and ω. The output is the joint task offloading and heterogeneous resource allocation strategy. The role of the Critic network is to estimate the value of the "state" and use it in the subsequent algorithm update process. The joint task offloading and CPU-GPU resource allocation algorithm strategy training framework based on MH-PPO includes the Actor network, the Critic network, the cloud-edge heterogeneous computing system environment, and the experience replay pool. In order to improve the training stability, the Actor network used contains an Encoder and multiple output decision Heads. Among them, the Encoder part uses an MLP network (MLP network usually refers to a multilayer perceptron network) to encode state information, and the action decision output network consists of four independent MLP networks, and each decision Head outputs the corresponding optimization variables. These decision output Head networks share the initial fully connected layer to extract state features, and then each Head generates a separate policy network, that is, and Respectively represent variables and The corresponding policy network (used to output decision actions) finally combines the actions output by all decision heads into a complete action, which is the task offloading and heterogeneous computing resource allocation solution. and They obey different distributions instead of a joint distribution, so the parameter update process is relatively independent, reducing the interference caused by other action outputs, thereby improving training stability.

[0180] The embodiments described above are only descriptions of the preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Without departing from the design spirit of the present invention, various modifications and improvements made to the technical solutions of the present invention by ordinary technicians in this field should all fall within the protection scope determined by the claims of the present invention.

Claims

1. A task offloading and heterogeneous computing system, characterized in that: include: IoT devices, several wireless access points, edge computing servers, cloud servers, SDN controllers, and computing orchestrators; The computing scheduler is used to allocate task offloading and heterogeneous computing resources through a first optimization goal and a multi-head decision-making PPO model to obtain a task offloading and heterogeneous computing resource allocation plan, wherein the first optimization goal is to minimize the long-term average delay; The SDN controller is used to schedule the computing tasks generated by the IoT device to the edge computing server and the cloud server according to the task offloading and heterogeneous computing resource allocation scheme, wherein the IoT device is connected to the edge computing server by wire through the plurality of wireless access points; The edge computing server and the cloud server are used to calculate the computing task, and both the edge computing server and the cloud server are configured with CPU and GPU computing resources.

2. A method for task offloading and computing resource allocation in heterogeneous computing systems, characterized in that: include: Obtaining a first optimization goal and a first optimization goal constraint condition, and obtaining a virtual queue based on a constraint condition of a virtual queue in which a task execution time is less than a maximum tolerable delay of the task in the first optimization goal constraint condition, wherein the first optimization goal is to minimize the long-term average delay; Based on the virtual queue, obtaining a merged queue of the real queue and the virtual queue; Based on the Lyapunov function, the real queue and the virtual queue merge the queue to obtain a first model; Based on the first model and the drift minimization plus penalty algorithm, the first optimization objective is converted into a second optimization objective and a constraint condition of the second optimization objective is obtained; Based on converting the second optimization objective into a Markov decision process, and converting the constraints of the second optimization objective into implicit constraints related to actions and rewards; Based on the converted second optimization objective and the constraint conditions of the second optimization objective, a multi-head decision-making PPO model is used to allocate task offloading and heterogeneous computing resources.

3. The method for task offloading and heterogeneous computing resource allocation according to claim 2, characterized in that: The long-term average delay is: in, is the average execution delay of tasks generated by all IoT devices in N time slots, N is the total number of time slots, n is time slot n, M is the total number of IoT devices, and m is the number of IoT devices. The task execution time.

4. The method for task offloading and heterogeneous computing resource allocation according to claim 2, characterized in that: The first optimization goal is: The first optimization objective constraint condition is: in, is the average execution delay of tasks generated by all IoT devices in N time slots, The unloading mode of the mth IoT device in time slot n, and When allocating CPU and GPU computing resources to tasks, the number of CPU cores and GPU cores allocated are respectively, is the set of all wireless access points, b is the bth wireless access point, is the total number of time slots, is the total number of IoT devices, is the maximum tolerable delay of the task, is the task execution time, The maximum number of CPU resources that can be allocated to the cloud server. is the maximum amount of CPU resources that can be allocated to the edge server. is the maximum number of GPU resources that can be allocated to the cloud server, is the maximum number of GPU resources that can be allocated to the edge server, To have expectations for *, is the amount of computation waiting in the CPU and GPU queues of the edge computer, The amount of computing time waiting in the CPU and GPU queues of the cloud server.

5. The method for task offloading and heterogeneous computing resource allocation according to claim 4, characterized in that: The second optimization objective is: Among them, V is a control factor that balances queue length and execution delay. and They represent the computing amount of the CPU and GPU waiting queues of the b-th edge computing server, For the task The proportion of floating-point operations consumed in the calculation phase to the total floating-point operations of the task, For the task The proportion of floating-point operations consumed by GPU computing tasks during the calculation phase, For the task The number of floating-point operations required for execution, and are the computing amount of the CPU and GPU waiting queues of the cloud server, Z m (n) for Related virtual queues; The second optimization objective constraint is:

6. The method for task offloading and heterogeneous computing resource allocation according to claim 4, characterized in that: Converting the second optimization objective into a Markov decision process includes: Get the state space s(n): in, is the status information of all IoT devices in the nth time slot, and They are the CPU and GPU resource idleness of edge computing servers and cloud servers, and They are the waiting queue backlogs of the edge computing server and the cloud server at time slot n, respectively; Get the action space a(n): in, and Assigned to The number of CPU cores and GPU cores; According to the environment, obtain the transition probability, and preset the reward function and the preset discount factor; Based on the state space, the action space, the transition probability, the preset reward function and the preset discount factor, the second optimization objective is converted into a Markov decision process, and a third optimization objective and the constraints of the third optimization objective are obtained. The third optimization objective is used as the objective function of the PPO model of multi-head decision-making, wherein the third optimization objective is the optimal action strategy that maximizes long-term rewards, and the constraints of the third optimization objective are the same as the constraints of the second optimization objective.

7. The method for task offloading and heterogeneous computing resource allocation according to claim 6, characterized in that: The third optimization goal is: Among them, q π (s(n), a(n) is the expected long-term cumulative reward for selecting action a(n) in state s(n), r(n) is the reward value of the nth time slot, and U is the discount factor.

8. The method for task offloading and heterogeneous computing resource allocation according to claim 5, characterized in that: Transforming the constraints of the second optimization objective into implicit constraints related to actions and rewards includes: The constraints middle Optimize to discrete integers, and set the action output of the PPO algorithm to discrete output; The constraints In and Multiply the continuous resource allocation factor k; Introduce penalty terms into the reward function to obtain the reward function of task delay, energy and actual queue length.

9. The method for task offloading and heterogeneous computing resource allocation according to claim 2, characterized in that: The multi-head decision-making PPO model includes an Actor network and a Critic network. The Actor network contains an Encoder and several output decision heads. The Encoder uses an MLP network to encode state information. The actions output by the several output decision heads are combined into a complete action, wherein the complete action is a task offloading and heterogeneous computing resource allocation solution.

10. The method for task offloading and heterogeneous computing resource allocation according to claim 2, characterized in that: The comprehensive loss function of the PPO model of multi-head decision-making is: in, To take the expectation of * in the nth time slot, is the truncation loss of the PPO algorithm in the nth time slot, q is the network parameter of the Actor in the PPO algorithm, and c1 is L V The weighting factor of (w), L V (w) is the mean square error of the value function of the PPO algorithm, c2 is The weighting coefficient of is the action entropy.

Citation Information

Patent Citations

  • MEC network-oriented fine-grained task unloading and resource allocation method

    CN116112488A

Cited By

  • Task scheduling method based on dynamic cloud edge collaboration

    CN121029434A

  • Multi-task edge computing method for Internet of Things

    CN122064430A