The present disclosure relates to vehicle edge computing, and specifically relates to a method of optimizing dependent task offloading in an Internet of Vehicles using deep reinforcement learning.
With the dramatic growth in the number of vehicle users worldwide and the increasing demand for services from vehicle users, telematics networks have endured more business challenges such as high transmission bandwidth requirements of the network, high transmission reliability and strong data processing capabilities. Internet of vehicles (IoV) integrates traditional vehicle Ad Hoc Network and telematics, and thus can effectively improve vehicle service capability. In IOV, intelligent vehicles can execute a variety of applications, such as collision warning, autonomous driving, and auto-navigation. However, these applications require a large amount of computational and storage resources and have strong delay requirements. It is a challenging task to execute these applications on resource-limited vehicles under low delay constraints.
In-vehicle edge computing that integrates Mobile Edge Computing (MEC) into IoV is a promising solution to effectively address the above problems. In-vehicle edge computing may improve vehicle quality of service by deploying computation of MEC servers and storage resources in the vicinity of vehicles. Compute-intensive and delay-sensitive tasks may be loaded onto the MEC servers for execution over a wireless network. Although in-vehicle edge computing may reduce the delay of task execution, the edge servers have limited computation and storage capacity and thus cannot guarantee load balancing. Therefore, an effective offloading strategy may reduce the processing delay of tasks and improve the quality of service for users.
Current in-vehicle edge computing mainly study the computational optimization of individual tasks and lack consideration of the dependencies between tasks, and thus limits the application scope and effectiveness of in-vehicle edge computing technologies. In addition, considering the environmental protection factors, most vehicles are electric vehicles, and energy consumption is crucial for the use of electric vehicles. In practical applications, vehicles or infrastructures providing computing services usually require corresponding incentive compensation, but existing studies rarely focus on energy consumption in computing and corresponding incentive compensation. To address these issues, the present disclosure aims to minimize the energy consumption and the incentive compensation paid during computation while satisfying the demand for computation services of an application, and thereby improve the quality of service for the user. Specifically, the present invention proposes a system and method for optimizing the offloading of dependent tasks in the IOV using deep reinforcement learning, taking into account the dependency relationships between the tasks so as to ensure that the delay constraints are satisfied while minimizing the energy consumption in the computation process and the incentive compensation paid to the vehicle or infrastructure for the computation service. Specifically, the computational resources, energy costs and incentive compensation of vehicles and infrastructures are first mathematically modeled, and then corresponding task scheduling and offloading strategies are developed using deep reinforcement learning techniques and incorporating the dependencies between tasks. This ensures that the delay constraints are satisfied while minimizing the energy consumption in the computation process and the incentive compensation paid to the vehicles or infrastructures providing the computation services.
In summary, the present disclosure proposes a novel in-vehicle edge computing technology that may better solve the computational offloading problem of dependencies between tasks, energy costs and incentive compensation, and improve the efficiency and quality of computing services.
An objective of the present disclosure to provide a method of optimizing dependent task offloading in an Internet of Vehicles using deep reinforcement learning, so as to overcome the shortcomings of the prior art.
In order to achieve the above objective, the present disclosure provides a method of optimizing dependent task offloading in an Internet of Vehicles using deep reinforcement learning, comprising the following steps:
Compared to the prior art, the present disclosure has the following technical effects.
This disclosure is applicable to V2I and V2V collaborative offloading scenarios in an IoV environment. The method decouples the nonlinear integer programming problem into two subproblems: the associated subtask scheduling problem and the task offloading problem. Combining the allocation of predecessor tasks of the subtasks and the dynamic network environment, the method prioritizes the set of ready subtasks and then solves the offloading problem using deep reinforcement learning based on value functions and policy functions. The method optimizes the task offloading problem, and minimizes the energy consumption during computation and the incentive compensation paid to the vehicles or infrastructures with the computation service, while ensuring task dependency and the constraints of delay. The present disclosure does not require excessive a priori knowledge, has good reusability in similar application scenarios, and thus is of high practical value.
The present disclosure provides a method for dependent task offloading in V2I and V2V collaborative edge computing based on deep reinforcement learning, effectively minimizes the weighted sum of the energy consumption and the incentive compensation paid to the client-side vehicle under the constraints of delay, and thereby improve the user experience. The process of the present disclosure is standardized, and is easy to operate. Moreover, the present disclosure also has strong practical value and reusability, and has a wide range of application prospects in similar application scenarios.
The present disclosure is further described below in connection with the drawings and specific embodiments so that those skilled in the art may better understand the present disclosure and be able to allow implementation, but the cited implementations are not intended to be a limitation of the present disclosure.
An agent takes an action in the current state to obtain a reward from the environment, and then enters the next state. Through continuous interaction, the agent may gradually learn the optimal offloading strategy. In this process, the agent constantly updates its value function to better estimate the value of each action. At the same time, the agent also continuously adjusts strategy in order to better explore the search space and find the optimal offloading decision.
In order to minimize the weighted sum of energy consumption and incentive compensation while satisfying delay constraints in an IoV edge computing scenario combining Vehicle-To-Infrastructure (V2I) offloading and Vehicle-To-Vehicle (V2V) offloading, the present disclosure provides a method for dependent task offloading based on deep reinforcement learning.
The edge computing scenario described in the present disclosure refers to vehicle nodes in an IoV network communication system combining V2I offloading and V2V offloading. These vehicle nodes may carry out V2I communication with edge Mobile Edge Computing (MEC) servers and may carry out V2V communication with other vehicle nodes. In this scenario, the vehicle that generates the application program is called a client-side vehicle and the vehicles that provide computational services to the application program are called server-side vehicles. The application program includes a series of indivisible subtasks with temporal dependencies and data dependencies that can be represented using a directed acyclic graph (DAG). These subtasks can be executed locally, transferred to server-side vehicles for execution, or uploaded to Rode side Units (RSUs) next to the highway for execution. In order to achieve minimizing the weighted sum of energy consumption and incentive compensation in this scenario, this disclosure provides a method for dependent task offloading based on deep reinforcement learning, which requires very little a priori knowledge and simple interactions with the environment to gain learning experience and obtains a near-optimal solution for minimizing the weighted sum of energy consumption and incentive compensation.
As shown in
S1: Constructing a vehicle system network.
The proposed vehicle system network includes MEC servers, RSUs and vehicular user sides connected in sequence. A plurality of vehicle user sides is connected to each other via V2V transmission links to realize inter-vehicle communication and collaborative computing. Vehicle user sides and RSUs are connected via V2I transmission links to realize the communication between vehicles and the network. The MEC servers, as edge computing resource providers providing resources such as computation, storage and network, may provide edge computing services for the vehicle user sides. RSUs, as the infrastructures of the network, provide information such as network connection and road conditions and provide data and collaborative computation support for the vehicle user sides. The whole vehicle system network constitutes a distributed edge computing platform, and realizes cooperative computing and communication between vehicles and between vehicles and networks.
As shown in
S2: Constructing a task model for the application program:
Tasks with temporal dependencies and data dependencies are modeled as a DAG task model, and the DAG task is modeled as G=(V, E), where the vertex set V={ϕi|1≤i≤N}, N denotes number of subtasks in V, the triad is defined as ϕi=(wi, di, τi), wi, di, τi denote the computational workload, the data size, and the maximum completion time tolerance delay of the task ϕi respectively, E denotes the set of edges, and each edge eϕ
S3: Constructing the task load model: based on the vehicle network system and the task model, calculating the delay, energy consumption and incentive compensation for the three offloading methods, namely, local computing, offloading to nearby vehicles, and offloading to nearby RSUs, respectively
S301: Interdependent subtasks executed at different vehicle nodes require data transfer. Specifically, it takes some time to transfer the computation results of subtask ϕj executed on vehicle node m to subtask ϕi executed on vehicle node n, and this data transfer time is defined as follows:
S302: Calculating the time to execute the task locally.
Specifically, for the case of executing the task locally, the completion time of the subtask ϕi includes the waiting time tilocal,wait and the compution time tilocal,compution.
Where Vc denotes the client-side vehicle, avail(Vc) denotes the time when the client-side vehicle finishes all the scheduled tasks, wi denotes the amount of computation required by the subtask ϕi, and fc denotes the computational power of the client-side vehicle.
For the case of executing tasks on RSUj, the completion time of subtask ϕi includes upload time tiRSU
Where rV
Similarly, the time to execute task on the server-side vehicles includes transmission time tiV
Where rV
S303: Calculating the energy consumption for executing tasks locally:
Where ξ is a coefficient related to the architecture of the computer chip, and there is no incentive compensation because it is executed locally;
C
V
,ϕ
=w
iρk (17),
S304: The time ti, the energy consumption ei and the cost ci to be paid for executing a subtask ϕi are:
Total incentive compensation cost, i.e., the incentive compensation to be paid to the client-side vehicle to complete all tasks, is denoted as:
Total energy consumption cost, i.e., the energy consumption of the client-side vehicle to complete all tasks, denoted as:
Where X denotes the offloading decision vector and N denotes the number of tasks.
These formulas describe the relationship between task offloading decisions, execution time, energy consumption, and incentive compensation, and can be used to optimize the task offloading scheme to minimize the total energy consumption and total incentive compensation.
S305: In order to make the optimal offloading decision, an optimization problem considering the energy consumption and incentive compensation for completing the tasks is created:
The optimization problem may be decomposed into two subproblems: task priority determination and offloading decision. First, the task priority determination is to determine the execution order of each subtask in order to satisfy the constraints of delay and task dependency. Then, the task scheduling order is used for offloading decisions, the deep reinforcement learning is used to decide whether each subtask is executed locally, offloaded to the RSUs, or offloaded to the server-side vehicles to minimize the weighted sum of energy consumption and incentive compensation.
S4: Determining task priority: first determining the priority of each subtask according to the allocation of the predecessor node of the subtask combining with the dynamic network environment, and then scheduling according to the multi-queue algorithm.
S401: Starting subtasks, assuming that RankD(ϕready)=0, determining the priority of the successor subtasks based on the scheduling arrangement of the predecessor subtasks, determining the ranking of the existing subtasks ϕi∈ϕready, and computing the value of the dynamic down-ranking as follows:
S402: Task scheduling depends not only on priority but also on dependencies between tasks. A subtask can only be executed when all its predecessor subtasks are completed. Therefore, it is necessary to maintain a queue of ready subtasks, Qready, and a queue of executing subtasks, Qexe, along with a queue of computed subtasks, Qfinished, and a set of all subtasks in the application program, Ttask.
Initially, ϕentry subtasks are placed into Qready from the set Ttask, the tasks in Qready are sorted in ascending order according to the subtask priority determination formula, the queue head element is removed to place the tasks into the queue Qexe, of executing subtasks, and if there are completed tasks in queue Qexe, the completed tasks are placed into the Qfinished queue. This may generate new ready subtasks, and if all predecessor node subtasks of a subtask ϕi in the set Ttask are in the queue Qfinished, the subtask ϕi becomes a ready subtask, which is placed in the queue Qready, and the above steps are repeated until the set Ttask is empty. In the whole process of subtask priority determination, the ready subtasks are dynamically determined according to the execution results of the subtask predecessor, and thus the priority of the ready subtasks is determined.
S5: Finding the optimal offloading strategy by using deep reinforcement learning, each subtask selects the corresponding execution device to complete the task offloading, so as to minimize energy consumption and incentive compensation under constraints of delay, thereby improving the quality of service for users, as shown in
In deep reinforcement learning methods, the design of actions, states, and reward values plays a crucial role. In order to adapt to the system environment and enable the agent to output the optimal action based on the current environmental state. The state space, action space, and reward function are designed as follows:
State space S: the state is represented in vector form, indicating the state of the client-side vehicle, including task information, location, available computing resources, and connection time. State space St={T, N}, where T and N respectively represent the set of candidate vehicles and the set of ready subtasks available within the communication range of the road side unit RSUj,
Action space A: the action is a decision made by the requester through the offloading strategy π: A←S, and has a direct impact on the external environment. The action at time t is denoted as At={xilocal, xiRSU
Reward function R: intuitively speaking, the Reward R←(S, A), the feedback obtained by the agent during the offloading process, directly determines the strategy. The optimization goal is to minimize energy consumption and overhead costs, but in reality, each decision can only serve one subtask. Therefore, the cost of one subtask m at time t is represented as Rt(s, a)=−(ei+ci).
S501: Initializing the experience replay buffer and defining the maximum number of executions and initial episodes for training and evaluation.
S502: After initialization, initializing the parameters μ and θ of the current actor and current critic. This is because before starting training, the network parameters need to be initialized to some random values in order to avoid getting stuck in local optima during the learning process.
S503: Initializing the target actor's parameters μ′←μ and the target critic parameters θ′←θ separately. These networks are used during the algorithm training process to calculate TD errors and update the parameters of the current network.
S504: Obtaining the initial state st of the environment is an important step in the algorithm. At the same time, it is necessary to prepare the initial random noise nt for action exploration. Through such exploration, more pairs of states and actions can be discovered, and the network can better converge to the optimal solution.
S505: From time t=1 until t=n (where n represents the number of indivisible subtasks in the application program). at is obtained based on the output of the Actor-C network of the current network and the random noise nt:
S506: Executing action at, receiving reward rt, and the environment state changing to st+1.
S507: Storing (st, at, rt, st+1) in the experience replay buffer, utilizing the historical data in the experience replay buffer for offline training and improving the stability and robustness of the model.
S508: Sampling N tuples {(st, at, rt, st+1)} a from the experience replay buffer for training the target network and updating the current network, where usually, random sampling is used to ensure the randomness of the sample.
S509: Using the target network to calculate the target value for each tuple yt, where yt is a value related to the current state st and action at, yt includes the current reward rt and the target predicted value of the next state s_(t+1). Specifically, the target value is calculated using the following formula:
S510: updating the parameter θ of the current critic by minimizing target loss L(θ), where L(θ) is calculated from the mean squared error (MSE) loss function as follows:
S511: Updating the Actor of the current network by calculating the sampled policy gradient, where Q(s, a|θ) represents the predicted values of the current critic for state s and action a, ∇aQ(s, a|θ) represents the action gradient on the predicted values, φu(s|μ) represents the action output of the current actor for state s, ∇uφu(s|μ) represents the parameter gradient for the action output. The calculation formula for the gradient of this strategy is a Monte Carlo method that estimates the expected value using sampled tuple data.
S512: if the current iterative times t can be divided by C, i.e. t % C==0, updating the network parameters, where θ′ and u′ respectively represent the parameters of the target critic and the target actor, and v is a hyperparameter less than 1 used for smoothly updating:
S513: t=t+1, repeating S505 to S512.
S514: If the current iterative times t is equal to n, that is, the maximum execution count has been reached, then episode=episode+1, then repeating S504 to S513 until the training process is complete and the optimal offloading strategy is obtained.
It should be noted that the parts not elaborated in this description belong to the existing technology. Relevant technical personnel should understand that the above implementation is only intended to assist readers in understanding the principles and implementation methods of this disclosure, and the scope protected by this disclosure is not limited to such embodiments. Any equivalent substitution made on the basis of this disclosure is within the scope of protection of the rights of this disclosure.
| Number | Date | Country | Kind |
|---|---|---|---|
| 202310522700.6 | May 2023 | CN | national |
This application is a continuation of PCT/CN2024/081842, filed on Mar. 15, 2024 and claims priority of Chinese Patent Application No. 202310522700.6, filed on May 10, 2023, the entire contents of which are incorporated herein by reference.
| Number | Date | Country | |
|---|---|---|---|
| Parent | PCT/CN2024/081842 | Mar 2024 | WO |
| Child | 19032177 | US |