1. Introduction
Currently, with the development of machine learning, deep learning, computer vision, and 5G mobile communication technologies, the Internet of Things (IoT) techniques [
1,
2] have made tremendous progress and become a closely related part of people’s lives. Consequently, the intelligent transportation technology represented by Intelligent Transportation Systems (ITSs) and autonomous driving technology has achieved tremendous development due to a growing demand for smart cities and IoT technologies in modern society. As one of the most important popular applications of IoT technologies, the Internet of Vehicles (IoV) [
3,
4] technique has become an essential data transmission and resource scheduling framework in ITSs and has attracted the attention of many researchers. Although IoT and IoV technologies have become very hot research fields and achieved tremendous development, they have faced some challenges because of their known limitations, such as restricted storage, applicability in real-time critical scenarios, load balancing, energy consumption, and so on. Artificial Intelligence (AI) [
5] technologies such as machine learning (ML), deep learning [
6] and deep neural networks, that are popular and have shown significant influence, are applied more and more in IoT and IoV fields and dramatically improve the effectiveness of IoT devices [
7,
8].
Generally, the IoV is regarded as a data transmission platform that provides information exchange service between vehicles, or a vehicle and other surrounding devices through different communication media [
9]. Through deep integration with the ITSs, the IoV builds an intelligent network to provide essential functions for transportation systems, such as intelligent traffic management, dynamic information services, intelligent vehicle control, among others [
10]. The architecture of the IoV shown in
Figure 1 is composed of three fundamental components: the inter-vehicular network (V2V), intra-vehicular network (V2I), and vehicular mobile Internet. Every vehicle in the IoV is connected with other vehicles and devices through the mobile Internet at all times. The IoV creates an interconnected network for all vehicles to enable the exchange of information about passengers, drivers, sensors and electric actuators, and the Internet by using advanced communication techniques, such as IEEE 802.11p, cellular data networks (4G/5G) directional medium access control (DMAC), vehicular cooperative media access control (VC-MAC), and others.
However, this early proposed IoV architecture faces the challenge of a real-time critical requirement. Specifically, the IoV may be susceptible to significant latency when storing or retrieving data; for example, when multiple vehicles access data simultaneously, it is limited by the data storage and processing capabilities of the vehicular cloud layer, resulting in significant latency. In this situation, the problem of network congestion often appears in IoV networks, which can cause many issues that influence the operation of the network, such as a reduction in QoS and a long time delay in data transmission [
11]. From this point of view, IoV networks are time-critical systems [
1,
12].
The main challenge of time-critical systems is to ensure that tasks with real-time constraints in the system meet their respective deadlines. This problem presents an astonishing number of challenges and research opportunities for modern computing systems, which are not specifically designed to support time criticality [
12]. However, the significant latency is the main challenge of current IoV architectures. In a cloud computing-based IoV architecture, the data sources are often far away data processes and storage servers, which is the main reason causing a long time latency and leading to slow response times [
13]. Therefore, these features limit the application of these frameworks to cases with less stringent functional requirements in terms of real-time or timely intervention, thereby limiting the scope of vehicle services that cloud-based IoT frameworks may provide [
13,
14,
15]. Over the last decade, many researchers have presented various architectural configurations for IoV services. The main targets of these paradigms are to reduce end-to-end delay by applying advanced technologies or proposing novel architectures.
Based on fog computing, ref. [
16] proposed a new paradigm for the IoV called vehicular fog computing (VFC), in which the end-to-end latency was deeply investigated. Based on the early architecture shown in
Figure 1, a special layer called fog computing was introduced to reduce the delays and improve QoS. The fog layer consisted of a large number of interconnected fog nodes which were data processing servers. Many IoV cloud-like services are provided by fog nodes using the FC technique. However, the study of VFC in the IoV is still in its early stage and there are several problems to address, such as congestion avoidance, guaranteed end-to-end delay, resources and tasks’ offloading, fault tolerance, security, and so on [
17,
18].
To reduce time delay and reach the time-critical requirement, some proposed architectures [
19,
20,
21,
22] have applied some effective methods by reducing energy consumption, end-to-end delay, and communication resources in IoV networks. However, there are several important issues such as dynamic computational costs for load balancing, minimizing IoV networks’ delay, and dynamic IoV topologies that are still at an early stage of research and require more in-depth studies [
16].
Focusing on these issues, we propose a new IoV architecture in this paper by combining the advantages of an AI-based time-critical system, deep learning approaches, and edge(fog)/cloud-based IoT technologies. Benefiting from the advantages of AI and a fog computing-based vehicle network, the proposed architecture guarantees reliable and low latency communication in a highly dynamic environment. As the edge node, the processors in each vehicle need to process large volumes of data collected from sensors and implement many tasks. In this paper, we propose a task allocation and offloading algorithm based on the SDV-F framework by applying a deep learning technique to distribute tasks and computation resource efficiently and minimize the end-to-end delay.
The main contributions of this article are as follows:
We propose an AI-based task-offloading algorithm for an IoV network based on the SDV-F framework, which can help to minimize end-to-end delay in data transmission.
We propose an AI-based time-critical task-allocation approach for an IoV network, in which AI algorithms such as DL and RL are applied to implement task offloading and resource allocation.
We propose deep network-based reinforcement learning framework for a resource-allocation and task-offloading approach in an IoV network.
The rest of this paper is organized as follows.
Section 2 introduces the background and challenges of this study.
Section 3 describes the framework of the proposed model. The evaluation criteria and simulation results are presented in
Section 4. Finally,
Section 5 gives the conclusions.
2. Background and Challenges
Over the last decade, many researchers have presented various architectural configurations for IoV services. The main targets of these paradigms are to reduce end-to-end delay by applying advanced technologies or proposing novel architectures.
An early IoV service architecture was proposed in [
23,
24], the basic architecture of which is shown in
Figure 1. In [
23,
24], the researchers combined IoT-aware technique with ML and cloud computing techniques for IoV architecture. In these kinds of early architectures, the devices of vehicles accessed the Internet from anywhere send data to a cloud computing server which implemented data processing, storage, transmission, and other facilities. To ensure seamless connectivity, the communication layer needed to apply advanced wireless communication technologies such as GSM, WiFi, 3G/4G mobile network, or others. Although various technological alternatives have been adopted to meet specific needs or application scenarios and improve the efficiency and reliability of the cloud-based IoV infrastructure, the limitations of a cloud-based architecture configuration are privacy and latency issues. These are mainly related to the centralized cloud server location and network infrastructure for communication and data transmission. As a result, when responding to the speed, accuracy, and reliability requirements, these kinds of approaches cannot achieve satisfied time-critical solution.
As the mobile communication networks used in SDV-F are more and more intelligent and efficient, one effective way to solve the shortcomings of time-critical systems is to apply advanced data transmitting technologies or propose efficient IoV architectures or approaches. With the development and popular application of 5G cellular mobile communication, Huang et al. [
25] proposed a 5G-enabled SDV network (5G-SDVN) to provide communication services on the IoV. In improving performance of the data transmission in dynamic vehicular networking environments, [
26] proposed a novel approach which was under the framework of the SDN-based medium access control (MAC) protocol. At the same time, further work was carried out in [
27], in which the authors proposed the MCH framework. This MCH (Mobile Cloud Hybrid) framework is often applied to decrease the power consumption of mobile terminals or robotic devices. At the same time, Chen et al. [
19] proposed another cloud computing framework for mobile system frameworks. By mean of these approaches, each mobile user’s independent task can be processed locally at the Computing Access Point or on a remote cloud server.
Nowadays, applying fog computing is a great improvement to decrease the time delay in data processing and transmission. The edge and fog computing-based IoV application frameworks offer better response time and privacy preservation [
16] by moving data processing and storage to the fog or edge layer to reduce distances and the significant latency. In building edge/fog computing infrastructures, the popular AI techniques including ML, DL, or reinforcement learning (RL) [
28] algorithms are widely applied, which makes the intelligent data processing possible at the edge of network. This novel technique of edge/fog computing greatly reduces the application latency and improves the privacy offered to each vehicle. In this regard, Multi-access Edge Computing (MEC) complements cloud computing and enables users to reduce latency and save energy by offloading computation towards the edge servers [
29,
30].
Recently, much work has been conducted to merge MEC technology into a vehicular network in academic and industrial fields. Specifically, vehicle fog computing (VFC) is the MEC technology associated with vehicular networks. VFC is extremely useful for carrying out computation-intensive and time-constrained tasks under vehicular networks [
31]. Through offloading complex computational tasks to VFC servers, the computing delay and energy consumption of vehicular applications can be drastically minimized while mitigating the chance of network congestion. In addition, sometimes it is not feasible to offload tasks to edge servers as it uses extra energy and consumes more time [
32]. The challenge, however, is to make the offloading decision while taking overall computation and communication costs into account. On the other hand, vehicles face certain unprecedented constraints, although they are capable of executing more computational tasks. These constraints include inadequate computing capacity and high energy consumption [
33].
Undoubtedly, recent research work offers good models or approaches to minimize latency and build time-critical systems to manage the task-offloading issues in the SDV-F architecture. However, most of these works are limited to using a multi-agent system and the horizontal fog layer resource pooling, which have been demonstrated to substantially decrease the data response latency [
7]. Focusing on the time-critical computation applied in the VSDN of IoV service architectures, in this article, we present an AI-based hierarchical framework for SDV-F. We propose an AI-based time-critical system to manage task allocation and offloading to fit real-time requirements. We also present an AI (ML, DL)-based fog computing network supporting between-fog-node, vehicles-to-fog-node, and fog-layer-to-cloud-layer tasks and traffic offloading to attain intelligent resource allocation and minimize the end-to-end latency.
3. Proposed System Architecture
Based on the analysis reported in the literature review and inspired by the solutions proposed in the previous papers, in this section, we present the architecture for an IoV service system that incorporates advanced AI-based time-critical technologies, fog computing, and deep learning approaches. The proposed architecture contains three main layers: an Intelligent Data Acquisition layer or IoV Layer, a fog computing layer, and a data visualization and AI-based SDN controller layer, as illustrated in
Figure 2.
3.1. Layers of the System Architecture
The Intelligent Data Acquisition layer is also called IoV layer and includes a large number of IoV devices. Each vehicle contains a complex computer system which processes a large volume of data from many sensors and implements and allocates multiple tasks. The vehicles are edge nodes of the edge computing network that communicate with a Base Station (BS) by using 5G mobile communications.
The fog computing layer is a fog computing network which consists of many fog computing servers providing network communications, data storage, data processing, and computing services to IoV devices. These many servers are also called fog nodes. In real-world applications, the vehicles in motion generate a large volume of data representing their real-time status at all times. The main function of the fog nodes is to process and upload that large volume of data to the control servers. Moreover, these implementations of fog nodes have to meet the real-time-critical and low-latency requirements. Obviously, it is very difficult for fog nodes to complete these tasks successfully. Therefore, it is most important for IoV systems to be able to perform distributed computing and implement a load balancing technique to control the load and reduce latency. More specifically, besides the fog computing-based network architecture, an efficient AI-based algorithm for task and resource offloading is also essential. Another aim of this paper was to propose a task and resource offloading approach by applying AI algorithms.
At the high level of the architecture is a cloud computing layer which provides AI-based SDN controlling and data visualization functions. In designing the AI-based SDN controller, we adopted a two-layer structure, i.e., the data process unit was separated from the control unit. This structure helped to improve the evolution of the system and facilitated network management. The intelligent unit implemented big-data analysis and processing and made decisions. The intelligent unit consisted of three intelligent modules: an intelligent agent module, a big-data analysis module, and a deep learning module. By taking into account the available computing resources and combining data analytic results provided by the big-data analysis module, the deep learning module offered the best model for the fog node to execute on each fog node. By using intelligent techniques, the AI unit could make intelligent decisions adaptively.
3.2. Intelligent Data Acquisition Layer (IoV Layer)
The Intelligent Data Acquisition layer includes a large number of IoV devices. Each node of the IoV layer is a complex computer system which is also divided into three layers: advanced sensors and sub-system layer; a computational, storage, and processing unit; and an Artificial Intelligence module, as shown in
Figure 3.
3.2.1. AI-Based Task-Allocation Algorithm in IoV Nodes
Advanced sensing technologies are used to collect data related to the real-time status of vehicles on motion. Multiple-sensor techniques allow the system to collect important correlating data that can be used by the AI module to make meaningful decisions, ensuring the IoV frameworks are more robust and trustworthy. The computation and data processing unit is a key part in this system. To achieve a real-time response and the forwarding of processed data to upper layers, it is necessary to equip the AI-based algorithm with a central processing unit (CPU). By applying AI techniques such as deep learning, machine learning, or reinforcement learning, the AI-based algorithms can make intelligent decisions based on data analysis. In this subsection, we propose a reinforcement learning (RL) [
34] and deep neural network (DNN)-based algorithm to fulfill task offloading and allocation for IoV networks.
The CPU is a central processing unit which manages many tasks of multiple sub-systems and makes decisions to provide distributed and efficient resource management. The responding algorithm is based on the framework of a Markov decision process (MDP) [
35], RL, and an embedding deep neural network to enable the servers to make effective decisions adaptively.
3.2.2. MDP-Based Reinforcement Learning
In this on-board system, we assume the central CPU is main agent, and other sub-systems are general agents. In the RL algorithm, three components are needed: states, actions, and rewards.
According to the principle of RL shown in
Figure 4, the CPUs of servers are regarded as agents (i.e., the central CPU is the primary agent) outputting actions to the environment based on perceived states. The environment represents the task allocation or offloading system, which evaluates the current actions and outputs the reward function and states. Based on the evaluation, a value function related to a reward based on actions records the value difference between the current and previous state–action pairs. Consequently, the long-term rewards represent the total rewards that the CPUs (i.e., the agents) can expect to accumulate over time for each environmental state. Following this process, the RL model provides a long-term value about the future states based on their corresponding rewards. With the previous reward and value function, finally, the system model evaluates the current action to optimize the best reward and value of the next state.
The theory of the Markov decision processes provides the mathematical foundation for the proposed system. We represent a Markov decision process function with a tuple of , where , , and . The symbols S, A, and R represent the set of states, actions, and rewards. Additionally, the symbol P is the transition probability, which represents the probability of a cyclic process that the current state s produces the next state under the condition of the current action. The value of the probability P is between 0 and 1. Accordingly, is the probability of a new state of the environment. This new state is generated under the environment that is represented with state s and the chosen action a. is the reward function of a new state from the current state, which is generated by the environment after the action. The reward function’s value is represented by the discount factor , where the value of the discount factor is .
The policy is a necessary component in RL and defines the behavior of agents. A policy
is a distribution over action
a given state
s:
In RL, an agent attempts to seek the optimal policy
that the agent can achieve by maximizing the sum of rewards, called utility. The utility function can be represent as follows:
where
is the discount factor, and
is the reward function.
In MDP, the dynamic programming (DP) technology is applied to solve
P and
R. DP is an optimization technique which seeks best choices by using an optimal value function. To perform RL using the MDP model, there are three functions required to be optimized, namely, the values of state (
s),
, and
.
represents the value of the action that the agent takes at the current state
. According to the principle of RL shown in
Figure 4, the agent is required to choose a new action for the current state
based on the rewards generated by the environment. Specifically, before selecting a new action, the agent computes
for each possible action and then decides the new action of the current state
according to the optimal policy. In the optimization,
is an optimal policy defined as the optimal action selection from state
s to a new state
. In this paper, we applied the Bellman equations for the optimizing target [
16]; in other words, the optimum action had to satisfy the Bellman Equation (
3).
where
and
where
represents the state–action quality pair at time
t, and
T is the time limit of the agents’ optimization problem in the proposed model.
3.2.3. Deep Q-Function Learning for Task Allocation
On the basis of RL, we applied a DQN (deep Q-function network)) to predict the value of
. In this model, the deep neural network (DNN) was used to learn the agent’s Q-function
.
where
,
) is the state–action pair at the next time slot, and
is the set of actions at the next state
.
Figure 5 illustrates the basic framework of the DQN, in which a convolutional neural network (CNN) is used as the DNN. The symbol
represents the parameters of CNN.
For training the model, the mean-squared error (MSE) was applied as the loss function of the proposed model with the CNN parameters
, which is defined as follows:
where
is the maximal sum of the future reward for the agents’ task allocation process.
3.3. Fog Computing Layer
The fog computing layer consists of a large number of fog nodes, which frequently process and upload real-time data generated by vehicles in motion to the SDN controller. To control the load and reduce latency, an efficient algorithm is vital and essential to realize distributed computing and load-balancing technique.
AI-Based Task-Offloading Algorithm in Fog Node Layer
The proposed task-offloading algorithm is also based on the RL framework introduced in previous subsections [
16]. But we improved the algorithm by proposing a novel architecture of a DNN network, reward function, and Q-function.
The aim of the approach was to optimize the offloading operations of each agent to achieve maximum utility under the condition of minimizing time latency and optimizing the allocation of IoV tasks. Therefore, we applied the reward function defined in [
16]:
where
represents the traffic load probability function of fog node
, and
indicates the end-to-end delay function. Unlike Equation (
2), the utility function is defined as:
where
is the number of tasks offloaded to fog node
, and
is the utility reward.
We applied the reward function Equation (
9) to obtain the appropriate reward value of the selected fog node for the task computation and a next state
in this proposed algorithm. Since the task to be assigned at the next fog node arrive randomly and the task size after each node’s task are also random, Poisson random variables were used in the proposed model [
36].
Following Equation (
9), the probability function
of a fog node
is computed as follows:
where the probability of
(
) is modeled by a Poisson process with the following:
where
represents the weight of the traffic load,
is the current processing tasks,
indicates the tasks’ arrival rate at fog node
. The symbol
represents the next estimated queue state of fog node
with a given state
s and action
a,
The end-to-end delay
of a task is very important in the proposed model. We computed it using the following equation:
where
is the delay weight,
is the operation delay,
is the time delay of the queue, and
is the time delay of the data transmission delay. In the proposed model,
represents the waiting time of the current node
in the queue, and
depends on the running-speed of the processor in
.
Due to the dynamic nature of the IoV network, it is hard for the controller to predict
R and
P. Based on the fact that the reward and probability distribution are stable, we also applied a DNN-based RL technique. The base framework is shown in
Figure 5. We used the U-Network (U-Net) [
6] shown in
Figure 6 as the DNN to learn Q-function
.
The architecture of our U-Net was an autoencoder with an attention module, which could make the learning process focus on important agents quickly and maximize the foreseen reward function. The architecture of the network consisted of three downsampling layers, each of which included two convolutional layers and a max-pooling layer with
pooling. Accordingly, there were three upsampling layers on the other side of network. Each of upsampling layer consisted of two convolutional layers with
upsampling. Before inputting each upsampling layer, the attention module was applied to fuse and calculate a single scalar attention value. To reduce the delay and fulfill the real-time requirement, we used a
convolutional kernel in the attention module as shown in
Figure 7.
In the optimization, the aim of the model was to select the optimal policy of
in the system. Specifically, based on a current policy
, the system foresaw the new state
and the reward by using Q-learning. Q-learning is a continuous optimization in which the Q-function is updated with each of iterations to make the best decision for the new task. The updating equation of the Q-function is as follows:
where
is the learning rate which is a factor between 0 and 1 (
), and
is the discount factor. During the optimization, the reward function
R is modified based on the new learning rate.
5. Conclusions
In this paper, we proposed a novel framework for an IoV network by considering the application and requirement of a time-critical system. Based on the requirement of a time-critical application, we first studied the problems of reliable low-latency communication and task offloading in dynamic environments in IoV networks. Focusing on these problems, we proposed an AI-based task- and resource-offloading model for IoV networks, which ensured reliable, low-latency communication, efficient task offloading in IoV networks by using an SDV-F architecture. By applying AI technologies such as RL, Markov decision process, and deep learning, the proposed model intelligently distributed the fog layer’s traffic load according to the computational power and load of each fog node. By proposing an AI-based task-allocation algorithm in the IoV layer, the proposed model effectively reduced unnecessary task allocation at the fog computing layer, thereby improving the efficiency of the distribution of tasks and resources and reducing the time delay. On the other hand, this work consisted of simulations of a small number of vehicles and in an experimental environment. In the future, we will extend our work with more complex scenarios in which precise information about the channel and vehicle state is unknown. To this end, we will examine how to integrate more machine learning techniques by incorporating SDV-F communications to improve long-term delay performance and further strengthen the task-offloading process.