Data Offloading in the Internet of Vehicles Using a Hybrid Optimization Technique

The Internet of Vehicles (IoV) is utilized for collecting enormous real time information driven traffics and alert drivers depending on situations. In recent times, all smart vehicles are developed with IoT devices. These devices communicate with a radio access unit (RAU) at road side. Moreover, a 5G system is equipped with a base station and connection interfaces that use optic fiber for their effective communication. For a fast mode of communication, the IoV must offload its data to the nearest edge nodes. The main problem with the IoV is that it generates enormous data which is offloaded randomly during the journey. This data exceeds the memory of the edge or road side unit (RSU) devices. This feature also causes substantial energy usage and high storage cost. To overcome the above issues, hybrid optimization techniques are suggested to offload the data with an energy efficient destination. In this research, the Clustered Block Chain Based Grasshopper Optimizer (BC-GAO) Based Task Offloading is implemented for a green IoV. The block chain provides a secure environment for sharing extensive data. The IoV data are clustered according to the vehicle location, and the grasshopper optimization is employed in selecting the RSU to offload the data. The result for the proposed technique is evaluated using OPNET Modulator and MATLAB. The simulated results are compared with the other existing techniques such as Random Offloading, Full Offloading, Mobility Aware Task Offloading, and the Lyapunov-based Dynamic Offloading Decision algorithm. The proposed algorithm computed 100 tasks in 33.27 s by consuming 19.23 joule energy, a value which is lower than all other existing techniques.


Introduction
Nowadays, innovations in communication systems make vehicular communication more intelligent. The development of the IoT causes the Internet of vehicles (IoV) to emerge fast in the system of Data which is broadcasted in the network is shared among user according to the participants' trust in the block chain technology [7]. This circumstance has made the block chain technology significant in the IoV field for the transmission of data user management [8]. Presently, the mobility-based open block chain initiative is highly used by the researchers in IoV [9]. Data collision in the network during broadcasting, the management of resources, and privacy preservation [10] are the major challenges that are identified in the IoV. A vehicular block chain efficiently managed the challenges of IoV in the recent developments. The main usage of block chain technology is the protection of data in the network from various cyberattacks and the secured distribution of the IoV. The chief concern about the block chain technology is that it consumes more energy in the transmission of data from peer to peer or peer to multi smart peers. The computation cost of the system is duly increased given its pivotal role [11,12]. This research aims at improving the block chain technology with the help of grasshopper optimization algorithm.
The grasshopper algorithm is typically used for clustering the nodes of the IoV in the network. Node clustering is performed according to the direction, area, network links, capacity of the network, density, and range. To the best of the researcher's knowledge, the block chain-based grasshopper optimization algorithm was first implemented in vehicular ad hoc networks (VANETs). The swarming action of the grasshopper was designed mathematically pertinent to the social attraction phenomena and the repulsive action of the individual. The following are identified as the main contributions of this study.
1. Proposed hybrid algorithms such as the block chain with a grasshopper optimizer for the IoV. 2. Offloading of IoV data is performed depending on the energy efficient computation. 3. The selection of the cluster head from the cluster will reduce the overall cost of the operation with energy efficient approaches.
The rest of the article is organized in five sections. Section 2 describes the literature survey. Section 3 details the proposed design and working principle. Section 4 describes the implementation and evaluation of the results of the proposed method. Section 5 concludes the paper with its advantages and provides some suggestions for future work.

Literature Review
Huang et al. [13] proposed a dynamic offloading method for the uplink transmission from vehicles to road side unit (RSU) in the IoV network. The offloading decision was made purely on the basis of the subtasks. The computing resources were allocated to the mobile edge computing. This approach would decrease the energy consumption of the system because of the computation intensity differences and vehicle transmission queue. That proposed work was called the Lyapunov-based dynamic offloading decision model and was the combination of the dynamic task offloading decision and computation resource allocation methods. Liu et al. [14] put forward an offloading method according to a distributed computation which guaranteed the quality of experience. The method would maximize the mobile edge computing (MEC) server utility. Wu et al. [15] proposed a machine learning algorithm called a Support Vector Machine (SVM) based offloading algorithm which would reduce the delay and latency of highspeed vehicles. Sun et al. [16] developed a machine learning-based algorithm that ensures the feedback from the neighboring vehicles. That particular approach could share storage and resources with nearby vehicles and would thus reduce the delay in transmission.
Sherazi et al. [17] proposed a heterogeneous structure of data forwarding the methods for the IoV. The specified architecture consisted of a combination of wireless interfaces such as the wireless access vehicular environment (WAVE), WiFi, and 4G/LTE which are connected through an optical fiber. It could make the VANET scalable and adaptable in the IoV environment. The architecture uses the best interface selection to make the communication reliable for vehicle to infrastructure (V2I) communication.
Ahsan et al. [18] proposed a grasshopper optimization based offloading algorithm for VANET with an optimal cluster head choice. The algorithm could reduce the node density overhead. The authors also compared the algorithms with the grey wolf optimizer, ant colony optimization, and dragonfly algorithms. The grasshopper-based optimization algorithm is a recent swarm-based research approach which processes two swarming attitudes in two different cycles of the grasshoppers. The evaluated results were in line with parameters such as the cluster number, network area, and node density. The resulting transmission range would prove that the proposed algorithm is a better choice than the existing approaches. Moreover, the flying ad hoc network was discussed in detail regarding the next generation networking architectures.
Aadil et al. [19] suggested a binary artificial bee colony (BABC)-based offloading algorithm for VANETs. This method was similar to the spanning tree structure with the minimum spanning tree for improving the communication system. The simulation environment of that work used 16 nodes with one prediction parameter. With the comparative analysis of the Kruskal algorithm, the BABC was productive for vehicle to roadside (V2R) infrastructure. To increase the stability of the network infrastructure, a software-defined network that used 5G VANET was proposed by Gajare et al. [20]. The model chose two cluster heads for the enhancement of network function. The specified 5G-VANET was recognized for its better solution for 5G enabled networks relative to the methods without the clustering approach and centralized clustering algorithm [21].
Wang et al. [22] provided an overview of the energy management for green IoV systems and the current related research topics. An intelligent energy saving algorithm was developed for the vehicle to roadside infrastructure for green IoV systems. Additionally, the Stackelberg game was developed and increased the utilization of RSU and EV in the V2I structure. Chen et al. [23] explored the architecture and challenges of green IoV with the approaches for minimizing energy consumption and maximizing the utilization of the resource. Moreover, 5G technology, MEC, and deep reinforcement learning of green IoV were discussed. All the existing approaches were compared in relation to the metrics of energy consumption with the research scopes.
Mughees et al. [24] reviewed 5G network energy efficient approaches based on machine learning algorithms. Main discussions were carried out on machine learning algorithms which, in turn, improved the energy efficiency of 5G networks and also solved several related issues. The challenges and possible solutions were detailed for the improvement of energy saving mechanisms based on machine learning algorithms with efficient resource optimization and power allocation.

Proposed IoV Data Offloading Methodology
This section proposes an energy efficient IoV environment with a developed hybrid algorithm, specifically a blockchain with a grasshopper optimizer (GAO). The overview of the proposed system model is shown in Fig. 1. Generally, every moving vehicle is equipped with IoT devices for communication through wireless interfaces. These wireless devices communicate through a radio access unit (RAU) equipped with a RSU. The RAU is responsible for transferring the information from the vehicle to the base station. This connection interface is connected through the optical fiber in the 5G network with blackhaul connectivity. This architecture consists of three components: the IoV as the bottom layer which is responsible for communicating within the vehicle through the sensor nodes [25], the middle layer which is responsible for the connection between the vehicle to the control/base station (CS) through the RAU, and the top layer which is the cloud layer responsible for handling all IoV services with mass storage, virtualization, and interactions between entities.
Clustering mechanisms are used to solve the issues in terms of network scalability and efficient route finding of the vehicle which are dynamically changed in the environment. A minimum number of clusters with a cluster head and cluster members will increase the efficiency of the communication services. The cluster head is responsible for sharing the information to cluster members. The cluster head was also selected for the efficient task offloading among the clusters using the proposed block chain with a GAO. The components of the proposed system are presented below.

Control/Base station (CS):
The CS is responsible for allocating the frequency for communication, processing, modulation, and demodulation and reduces the overhead of the RAU. This CS is connected to the cloud server. These connections are built through the multi-mode optical fiber with increased Radio Access Unit: (RAU) This unit involves the antenna that connects the RSU to the CS. The RAU receives the signal from the RSU and converts the electrical signal into optical signal and vice versa. This network system creates a simple network plan because of the low inter channel interference and strong battery [26].
Road Side Unit (RSU): The RSU is responsible for providing network access to the vehicles. Batteryenabled RSUs have been employed on the roads in many countries recently. Given the limited number of RSUs and the battery consumption involved, the next charging cycle is a challenging issue for the current research. This energy consumption is minimized with the nearby vehicle that communicates to the RSU relative to the consumption with a vehicle that is far away. Accordingly, an efficient and effective offloading scheme is a challenging task. A cluster-based blockchain with GAO proposed in this work will improve the offloading task through a cluster head which is nearest to the RSU. Thus, the energy consumption is also reduced.
Smart grid: The grid is responsible for providing electric supplies to the IoV environment with electric charges and involves two renewable energy sources, such as a solar system and wind turbines.

Proposed Clustered Block Chain Based Grasshopper Optimizer (BC-GAO) Based Task Offloading
In this optimal model, the nodes (vehicles) are clustered, including the cluster head and cluster members. These cluster members form a clustered matrix. The selection of the cluster head from the cluster will reduce the overall cost of the operation with energy efficient approaches. Let T denote the set of vehicles that operates a set (S) of applications that are needed for the blockchain operations. The total energy consumption of the ith vehicle of the set |S| is represented as (2) b ðtÞ P ¼ Hð where R_M is the number of records updated per transaction; ε_R is the energy consumption of each record; H is the intermediate hops number; ε_M is the energy consumption request per transaction; γ is the number of requests; and k is the kind of messages such as send, acknowledgement, and receive. This network model calculates the sustaining rate of the network when no additional resources and batteries are provided to the IoV. The variation of this network is denoted using the Heston model [27] which is represented as where BC ðtÞ S;i are the energy consumption initial values, λ is the number of block chain requests per unit of time, ε is the rate of excessive energy, σ is the standard deviation of the energy required vs. the energy utilized, and dBC 0 dt is the rate of change requests. The vehicle location is denoted as L = f(x, y), and the maximum distance to connect the vehicle to the RSU is denoted as R. The transfer function of this model is represented as where P ðRÞ c is the probability of the receiver, and P(f(p) is the probability of the vehicle being in the range with the movement function f(p). The energy consumption model of this proposed network is expressed as maxðT t Þ8C; 8I; 8S The received signal to interference plus noise ratio of the vehicle i at t of the transfer function T t is calculated as where H_i^n (t) are the channel gains between the vehicle and RSU n at t, R_i (t) is the received interference power, N_0 is the noise power, and B is the bandwidth [28]. From all these calculations, the uplink transmission rate is denoted as Algorithm 1: Cluster head selection using the block chain algorithm is followed.

Input: network metrics and initial values S x p;i
Output: set with initial head and slots w, t Step 1: while (t<=r, Eqs. (6) and (7)) Step 2: energy ratings of the vehicle is calculated S x t;i Step 3: if S x t;i < S x p;i then Step 4: change cluster head Step 5: end if Step 6: noise rate and transmission rate are calculated using Eqs. (8) and (9) Step 7: return new Cluster head and offloading t-w for S x tÀw;i < S x p;i .

Optimization Using Grasshopper Optimizer
The selected cluster head using the block chain approach has been optimized with the GAO in the selection of the optimal solution so as to reduce energy consumption. The clustering is based on the grasshopper swarm behavior. Each agent represents the route containing the vehicle ID which is selected by the cluster head. All the parameters such as the vehicle location in the highway; vehicle direction, speed, and velocity; inter vehicle distance; and grasshopper search space are initialized. The set of random positions is used to start a node at a random direction. The search space is created, and the fitness function is calculated to form the cluster. For each iteration, the vehicle position and weight were updated. The output of the process is the optimal clusters that are near the RSU. The operators used in the GAO are as follows: where φa-position of the a th agent,

Sf a -social attraction and repulsion force
Gf a -gravity force The operators are based on the random behavior of the swarm with the random numbers r1, r2, and r3 with the interval of [0,1]. Hence, the equation is rewritten as The operators are declared as follows: social force sðcÞ ¼ fi Â e Àp À e Àc (13) gravitational force Gf a ¼ ÀG Â E g (14) air drift Ad a ¼ Dc Â E w (15) where dpj-distance between pth and jth agent, l = length scale fi-attraction intensity Initially, the agents have no wings and are moved through the direction of the wind. For each agent i, the operators are replaced in Eq. (10) as shown in Eq. (16). The stages of grasshopper development and its social behavior are shown in Fig. 2. The workflow of the proposed energy efficient IoV method is shown in Fig. 3. Input: cluster head from Algorithm 1, initialize all the parameters Output: optimal cluster that is close to the RSU for task offloading.
Step 1: initialize Cmin and Cmax Step 2: calculate the fitness value of the swarm initialized using Eq. (17) where w1 = w2 = 0.7, F1 of Function 1 is the Δ difference between the cluster head and the length of the route α. F2 or Function 2 is the sum of the distance between the cluster member and cluster head for all the clusters. The functions are expressed as follows.
where abs is the absolute value, CM i is the current cluster member i from the cluster length α, and q is the cluster.

F2ðsum of distanceÞ
Step 3: for iteration = 1 to 15 (stall iteration) Step 4: while (nodes! = empty) Step 5: node cluster = all nodes (vehicle) Step 6: end while Step 7: while 1<= iterations Step 8: for i = 1 to population Step 9: update C using Eq. (14) Step 9: distance normalization, position update using Eq. (16) Step 10: bring all the agents under lower and upper bound of the cluster Step 11: end for Step 12: update best route cost Step 13: iteration= iteration+1 Step 14: end While Step 15: return best route cost Step 16: end for Thus, the proposed cluster-based offloading scheme for the IoV is efficient in terms of saving energy and utilizing resources. The cluster head selection on the basis of the block chain will help in identifying the appropriate head among the clusters for communication between the RSU and CS. The execution of the task is offloaded with the optimization algorithm called GAO. This proposed hybrid approach outperforms other techniques to save the energy of the network.

Simulation Results and Discussions
This section discusses the simulation results of the proposed energy efficient offloading algorithm called BC-GAO with the simulation parameters. The performance of the proposed approach was compared with the existing algorithms such as random offloading (RO), full offloading (FO), mobility aware task offloading (MATO) [29] and the Lyapunov-based dynamic offloading decision algorithm (LDOD) [13]. The energy and execution time of the proposed and the existing algorithms were evaluated and compared. The simulation parameter settings of the proposed work are shown in Tab   Tab. 2 and Fig. 4 indicate that the proposed BC-GAO algorithm consumed less energy than the other algorithms. The existing algorithms offloaded all the tasks into the network, thereby consuming more energy from the IoV. By contrast, the tasks were offloaded to the nearest cluster through the cluster head in the proposed algorithm. The cluster head selection was made according to the proposed algorithm. Accordingly, the energy of the overall system was reduced compared to the existing algorithms such as the RO, FO, MATO, and LDOD. The proposed cluster-based BC-GAO consumed only 54.71 J for 500 tasks, which was the minimum value for all the energy efficient algorithms.
Tab. 4 and Fig. 5 reveal that the proposed BC-GAO algorithm required less execution time than the other algorithms. The existing algorithms offloaded all tasks into the network, a process which consumes more time for the IoV. By contrast, the tasks were offloaded to the nearest cluster through the cluster head in the proposed algorithm. The cluster head selection was made according to the proposed algorithm. Accordingly, the execution cost of the overall system was reduced with less resource involvement relative to the existing algorithms such as RO, FO, MATO, and LDOD. Moreover, the proposed cluster-based BC-GAO consumed only 78.93 s for the execution of 500 tasks, which was the minimum among all the energy efficient algorithms. Hence, the proposed algorithm was efficient in terms of energy and execution time compared to all contemporary algorithms.

Conclusions
The IoV is an emerging technology through which more research are carried out for reducing computational cost and energy consumption. This work investigated the energy efficient task offloading in the IoV. The rate of data that drops in the nodes is highly improved. Cluster head selection using the block chain will help in the identification of the appropriate head among the clusters for communication between the RSU and CS. The execution of the task is offloaded with the optimization algorithm called GAO. This proposed hybrid approach outperforms others to save the energy of the network by 90% to 95% relative to other existing algorithms. The tasks are effectively classified using block chain properties and clustered efficiently using the GAO technique. Efficient data offloading generates greater user interest towards the IoV and would increase IoV usage in future. Designing an intelligent RSU for an intelligent IoV is recommended and is a challenging issue for future research.
Funding Statement: The authors received no specific funding for this study.

Conflicts of Interest:
The authors declare that they have no conflicts of interest to report regarding the present study.