Security-Aware computation offloading for Mobile edge computing-Enabled smart city

Smart city has obtained increasing attention from both academic and industry which has the potential to improve human living standards. A smart city consists of a great number of smart devices which are generating large amounts of data and emerging applications all the time. However, the computing capacity of smart devices are limited. Fortunately, the emergence of MEC can solve the above problem. However, the resources of edge servers in MEC are limited and the capabilities of edge servers are heterogeneous. It is important to improve the average resource utilization of all edge servers and keep load balancing of edge server cluster simultaneously. On the other hand, quite a few numbers of applications are delay-sensitive, it is necessary to ensure the security of these applications. In this paper, we consider joint optimization of mobile device and edge server in MEC-enabled smart city, improving the overall performance of the system. Technically, a new multi-objective computation offloading method is implemented to reduce time consumption, energy consumption, and keep load balancing of edge servers, as well as increase average resource utilization of edge servers while meeting the deadline constraint of delay-sensitive applications. Sufficient experiments have been conducted to prove the effectiveness and superiority of our proposed method in different scenarios.


Introduction
The Internet of Things (IoT) is envisioned to greatly influenced our daily lives and improve socio-economic efficiency and effectiveness through a variety of applications. One of the most promising applications is smart city which utilizes IoT devices to manage cities without any manual intervention [1][2][3][4]. Smart cities have greatly changed people's lifestyles and improved people's quality of life with the help of innovative ideas and new technologies [5,6].
The concept of smart city is originated from the vision of smart earth, which is defined formally in numerous ways [7][8][9]. The definition of smart city given by IBM is to *Correspondence: kai.peng@hqu.edu.cn 1 College of Engineering, Huaqiao University, Quanzhou, People's Republic of China Full list of author information is available at the end of the article use information and communication technology to analyze and integrate various critical information of the whole city, so as to make intelligent response of people's various needs which include people's livelihood, environmental protection, public safety, as well as industrial and commercial activities. Sensing devices and intelligent cameras, as well as computing processing units scattered in every corner of the city have facilitated many attractive applications (e.g., autonomous driving, in-vehicle virtual reality (VR), real-time positioning, machine learning, service recommendation) [10]- [17]. Additionally, these applications bring people a lot of convenience while also consuming a lot of computing resources. Meanwhile, they usually generate large amounts of data, which brings huge challenges to insufficient bandwidth [18,19].
Nevertheless, mobile devices (MDs) in smart city have finite computing capacity, while the mobile users (MUs)' Peng et al. Journal of Cloud Computing (2021) 10:47 Page 2 of 13 demand for services is usually unlimited [20]. Fortunately, mobile edge computing (MEC)-enabled smart city is regarded as a promising paradigm to solve the above issue, aiming to deploy a myriad of infrastructures (e.g., access points) and edge servers (ESs) in close proximity to mobile devices for the provision of elastic computing resources and low-latency services [21][22][23]. Among them, computation offloading is an efficient technology to augment capacity of MDs [24][25][26][27]. Meanwhile, quite a few numbers of applications are delay-sensitive, it is necessary to ensure the security of these applications [28,29].
On the other hand, the computing resources in ES are also limited, and thus it is essential to improve the average resource utilization of all ESs [30]. Additionally, the ESs are heterogeneous, namely, they have different amounts of computing resources, which inevitably increases the difficulty of computation offloading [31]. It is unreasonable to offload application to an ES randomly. From the perspective of ES, it is necessary to consider the load balancing of each ES. In view of this, we consider the joint computation offloading in MEC-enabled smart city to improve the overall performance of MEC-enabled smart city [32]. The main contributions are summarized as follows.
• Both MD and ES have been taken into consideration in this study. More specifically, the time consumption and energy consumption of MDs, as well as resource utilization and load balancing of ES cluster are regarded as the optimization objectives. • A multi-objective optimization model is built to represent the optimization problem, deadline constraint is considered to ensure the safety of delay-sensitive applications. • We implement a new optimization method on the basis of many-objective metaheuristic based on the R2 Indicator to obtain the reasonable candidate strategies. And then simple additive weighting (SAW) and multi-criteria decision-making (MCDM) are utilized to obtain the optimal computation offloading strategy. • We conduct a large number of experimental evaluations to verify the effectiveness and superiority of our proposed method in comparison with other methods in different scenarios.
The related work is introduced firstly. And then, the system model is described. Followed by is our proposed optimization method. Next, the experiments and result analysis are discussed. Finally, we present the conclusion and our future work.

Related work
Computation offloading for MEC Computation offloading is an effective technology to augment the computing capability of MDs in MEC. Liu et al. [33] investigate the multi-objective optimization problem concerning average price cost, average execution time, and average energy consumption in MEC environment. The objective of them is to maximize the revenue of each MU. Due to the limited capacity of MDs, it is hard to compute tasks with large amounts of data effectively. Therefore, a system model consisting of the execution time and energy consumption is established in [34]. Chen et al. [35] focus on the computation offloading for multiple MUs and multiple tasks. Correspondingly, two different kinds of greedy maximal scheduling algorithms are proposed to solve such an issue. Wu et al. focus on the tradeoff between limited computing capacity and high delay, as well as ensuring the data integrity during the computation offloading. Correspondingly, blockchain technology is used to implement secure computing offloading [36]. In addition, Feng et al. [37] propose a collaborative computation offloading and resource allocation strategy in blockchain-enabled MEC. Computation offloading for Smart City Aiming at improving the overall edge computing system execution performance while preventing privacy leakage of the IoT devices during the process of service placement. A trustoriented IoT service placement approach is proposed [38]. Taking into account of the heterogeneity of ES and remote cloud servers, Wu et al. [39] consider to jointly optimize the system utility and the bandwidth resource allocation in hybrid environment composed of ES and remote cloud. A distributed deep learning computation offloading method is developed to obtain optimized offloading solutions. With the aims of preventing the privacy leakage, improving offloading efficiency, as well as promoting utility of ESs, an intelligent computation offloading approach for smart city is proposed in [40]. Different from the above research, we investigate computation offloading in MEC-enabled smart city. Considering the resources of ESs are limited and the ESs are heterogeneous, the overall performance of the system needs to taken into consideration. In view of this, both the MD and the ES have been considered. In particular, we focus on latency-sensitive applications which have a critical impact on the performance of the system. Furthermore, the energy consumption, time consumption of MD, as well as the average resource utilization of ESs and load balancing of ES cluster are considered to optimize jointly.

System model and problem formulation
In this section, MEC-Enabled smart city system model and the multi-objective problem formulation are introduced.

System model
The architecture of MEC-enabled smart city is shown in Fig. 1. Remote cloud is often deployed in suburban areas where 0 represents the computation task tk n,i is executed locally, 1 represents the task is offloaded to 1−th ES. Accordingly, s represents the task is offloaded to s-th ES. And s + 1 represents the task is offloaded to cloud center. In addition, tk n,i represents the i-th application of n-th MD.

Time consumption model
In this subsection, the time consumption model is introduced. The total time consisting four parts, namely, the execution time consumption which is represented as T E (), the waiting time consumption which is represented as T W (), and the propagation time which is represented as T P (), as well as the transmission time consumption which is represented as T T ().

Executing time
The executing time refers to the time cost of performing tasks, which is calculated as where wk n,i represents the task workload. The computation frequency of MD is represented as f end and the computation frequency of ES is represented as f edge , and f cloud represents the computation frequency of the cloud center.

Waiting time
Due to the resources of ES are limited, the computing resources of ESs are represented by a set of virtual machines(VMs). When the tasks which have been offloaded to the ES exceed the number of VMs, some of the tasks need to queue up wait for the ES to calculate the previous tasks, which causes time consumption in the waiting queue. Firstly, we use a double-tuple v s b = (work, tn) to represent b-th VM in s-th ES, where work represents a set of total tasks of the k-th VM and the tn represents the number of tasks in VM. Secondly, according to the computation offloading strategy st n,i , tk n,i is offloaded to the minimum occupancy VM in e-th ES. Then, the work is updated by work = work + wk n,i and the tn = tn + 1. Repeat this until the remaining applications are scheduled to the corresponding VM. Finally, T W (st n,i ) is calculated as where ℘ n,i,w is to estimate whether tk n,i is scheduled to the waiting queue in the q w , and the T e (pre(st n,i )) represents the execution time of previous task.

Propagation time
The propagation time consumption depends on strategy st n,i , represented by where L edge represents the propagation latency between MUs and ESs, which represents LAN. L cloud represented propagation latency between MUs and cloud center, which represents WAN.

Transmission time
Let T T (st n,i ) be the transmission latency which can be calculated by

Total time consumption
The total time consumption T(st) is obtained by the offloading strategy of i-th application in n-th MD, calculated as

Energy consumption model
There are four kinds of energy consumption, namely, the execution energy consumption E E (), the waiting energy  The computing frequency of the ESs 800 MHz The number of ESs in multi-user experiment 5 The number of ESs in multi-application experiment 5 The number of ESs in large-scale application experiment 20 The value of the time constraint for each application 4.8

The maximum number of VMs in ES 25
The minimum number of VMs in ES 15 consumption E W (), the propagation energy consumption E P (), and the transmission energy consumption E T ().

Executing energy consumption
Executing energy consumption represents the energy consumption of task executing which can be obtained by multiplying the power by the execution time. And it can be calculated as where the execution time can be calculated by Eq. (2), p a represents active energy, and p i represents idle energy.

Waiting energy consumption
The waiting energy consumption refers to the energy consumption generated by tasks of MD in a waiting queue. When the waiting time is calculated, it is easier to obtain the waiting energy consumption. In addition, the waiting time consumption is calculated by Eq. (3), and the waiting energy consumption is equal to waiting time multiplying ideal energy consumption.

Propagation energy consumption
In this part, the propagation energy consumption calculated by

Transmission energy consumption
Energy consumption of transmission is represented by E T (). The transmission energy consumption of MDs is related to the transmission time and can be calculated as where p t is represented the energy consumption of transmission.

Total energy consumption
Based on the above analysis, the total energy consumption E(st) can be calculated as

Resource utilization model
The computing resources of ESs are limited. Visualization technology [41] is used to represent the resources of ES. Thus, Resource utilization can be calculated by the usage of VMs. The VMs in the ESs are instantiated as multiple VM instances with heterogeneous computing capacity. The resource utilization can be measured by the number of the active VM instances in the VM pool. It is assumed that vm m is the number of VM instances of the m-th ES e m . The resource utilization could be expressed as A binary flag F m is utilized to represent the status of the ES e m which is calculated by hereafter, the number of the employed ESs can be calculated by Above all, the average resource utilization can be calculated by

Load balancing model
Different from the average resource utilization, load balancing is a negative indicator. When its value is lower, the state of the ES cluster is much better. Additionally, based on the average resource utilization illustrated in Eq. (17), the average load balancing value can be obtained by

Problem formulation
The aim of this paper is to minimize the time consumption and energy consumption of MDs and load balancing of ESs, and maximize the resource utilization of ES. The multi-objective optimization issue can be formulated as where T(st) represents the time-constraint which means that the total time consumption should not overstepping the given deadline.

Algorithm design
In this section, we describe our proposed method, namely, a multi-objective collaborative optimization for smart city (MOCOSC)based on the multi-objective optimization genetic algorithm MOMBI [42]. Different from the traditional multi-objective optimization algorithm, the MOMBI uses the R2 indicator instead of a non-dominated sort. R2 indicator focuses on the Pareto front rather than the edge, which can achieve an elite solution set. By correcting the inherent deviation of the R2 indicator, MOCOSC achieves different sets of Pareto approximate solutions as computation offloading strategies. The main steps of MOCOSC are shown as follows. Firstly, some initialization work needs to be completed. Secondly, new populations are created by crossover and mutation operations. Then, solutions are ranked by R2 ranking and selected to the next population using tournament selection. Finally, the optimal solution is selected by using SAW [43] and MCDM [44] in the set of the solution in the Pareto front.

Initialization
Firstly, some parameters are initialized, such as the size of population N p , the size of archive set N arc , the probability of crossover P c , the probability of mutation P m , the number of iterations G max , and current iteration index G cur .
After setting the above parameters, the algorithm is ready to run. The first population should be generated randomly, represented by pop 1 , and create an empty archive arc 1 to keep archive set of population.

Crossover and mutation
The aim of crossover operation is to retain the characteristics of the parent population. In the crossover operation, through the crossover operation at the cross point, a new offspring population is generated while maintaining the characteristics of the parent population. In crossover points, the crossover operation is to exchange the corresponding value of two offloading strategies. An example of crossover operation is shown in Fig. 2. It can be seen that the crossover operation occurs between 1 and 5, as well as between 7 and 3.
The aim of mutation operation is to maintain the diversity of the population. An example of mutation operation is shown in Fig. 3. The offloading strategy is mutated from 1 to 3 which means the 3−th ES is selected to provide services rather than 1−th ES. Similarly, the 3 on the right side of the figure is mutated to 6 indicating that the 6−th ES will replace 3−th to provide services.
After these two operators, the new offspring N n p ew is generated and served as the population for the next iteration.

R2 ranking and reference points
In this section, we introduce R2 ranking of MOMBI. R2 ranking is based on R2 indicator. R2 indicator divides the non-dominated layer by measuring the utility function. The utility function represents the value of each objective which is obtained by the weighted Tchebycheff method. The weighted Tchebychef is defined as where W represents the weight of each fitness function, A is the set of Pareto approximation and μ represents the utility functions. In Eq. (23), the utility functions μ need to be updated in each ranking. The utility function is updated by the reference point and the objective function. The updating method of the reference point can be obtained by where z max t and z min t are the maximum and minimum objective function value in pop t .
Combing with Eqs. (23) and (24), the R2 ranking of MOMBI can be defined as

Selection
In this section, the selection operation of MOMBI is described. The goal of selection operation is to select the solution with optimal characteristics as the parent population for the next generation population. MOMBI uses the tournament selection to select solutions. Firstly, two solutions with the same probability are selected. Then, the better one is selected as the next generation parent population by comparing their objective function values. To repeat the above steps until enough next-generation populations are generated.

Optimal selection
After the maximum iteration, a set of Pareto solutions is generated, and SAW [43] and MCDM [44] are exploited to select the optimal solution as the computation offloading strategy. According to the core idea of these two methods, the normalized form of the four goals can be expressed as follows.
Time consumption of i-th application in n-th MD can be normalized as Similarly, the energy consumption can be normalized as The resource utilization can be normalized as The load balancing can be normalized as In order to select the optimal solution, we need to consider four objectives together. Correspondingly, we use α t , α e , α u and α l to represent weight of each objective, respectively. And the constraint of four vectors is defined as α t + α e + α u + α l = 1. And then, we define the maximum utility value of chromosome in the optimal population V max which is expressed as

Method overview
Algorithm 6 illustrates the procedure of MOCOSC, the goal of MOCOSC is to reduce the time and energy consumption of MDs, and the load balancing while increasing the resource utilization of ESs. Firstly, the first generation population of offloading strategies is initialised as POP 1 (Line 1). Secondly, evaluate four objectives of population by Algorithm 1-4. Algorithm 1 and Algorithm 2 calculate the time and energy consumption of MDs, and Algorithm 3 and Algorithm 4 calculate the resource utilization and load balancing of ESs (Lines 2-5). Then, calculate reference points of objective functions (Line 6). Afterwards, R2 ranking is executed to divide non-dominated solution set by Algorithm 5. After performing these steps, a set of reference points and a population are generated, and the reference points and populations are iterated. Then, the tournament selection is executed to find best solution (Line 9), and the mutation and crossover are performed to generate next generation (Lines 7-8). Repeat the following steps until the maximum number of iterations is reached. Namely, evaluate population and update the reference point and execute the R2 ranking by Algorithm 5 (Lines 10-13). Finally, the population size is reduced to N pop (Line 14). After that, MOCOSC adopt SAW and MCDM method to select an optimal offloading strategy (Line 17).

Comparison and analysis of experimental results
In this section, we conduct experiments to prove the effectiveness and superiority of MOCOSC. Firstly, the experimental setting is described. Followed by is the experimental evaluation and discussions.

Experimental setting
In our experiment, by default, it is supposed there are 5 ESs providing service, each of which has heterogeneous computing capacity. We design three sets of experiments. The first one is an experiment with different numbers of MUs, which is set from 2 to 20 and each MU has 10 Algorithm 1 Time consumption calculation Input: Offloading strategy st Output: Time consumpiton T(st) 1: for n= 1 to N do 2: for i= 1 to |TK n | do for i= 1 to |TK n | do applications. A second one is an experiment with different application scales, which is set from 10 to 50, and the number of MUs is fixed at 2. The last one is conducted to test the situation of large number of applications, the number of MUs is set from 100 to 300. Under this situation, the number of ESs has also increased to 20 accordingly. Each experiment is performed 10 times, and the results of the experiment are the average value of the 10 experiments. More detailed experimental parameters are shown in Table 1.
Two comparison methods named FCFS and Benchmark are introduced, the details of which are shown as follows.
• Benchmark All applications are executed locally, or are offloaded to ES cluster, or cloud randomly. Especially, the first task and last task of each MU are executed locally by MD. • First Come First Service (FCFS) All applications are executed sequentially, namely, the first one is executed locally, the second one is executed in ES1, Sort the population POP rank ← 1 10: if Number of(S t )< N pop then pop.rank ← rank 11: end if 12: rank ← rank+1 13: end while and so on, the N + 1−th one is executed in cloud. Similarly to Benchmark, the last task of each MU are executed locally.
The experiments are processed in Eclipse based on JAVA language on a PC with 8 Intel Core i7-10850H 2.7GHz processors with 16GB RAM and the operating system is Win10 64bit.

Comparison of time consumption
The total time consumption can be obtained by Eq. (7). Figure 4 illustrates the comparison results of the total time consumption of the above three methods under different number of MDs and different number of applications. Time consumption comparison results of these three methods under different numbers of applications are shown in Fig. 4a. The result of the impact of different applications performed by each MU on the total time consumption is shown in Fig. 4b and Fig. 4c. It can be seen that MOCOSC outperforms other two approaches from the perspective of different situations. More specifically, MOCOSC can widely used for different application scales. The main reason is that MOCOSC can comprehensively consider various factors to allocate application more reasonably to reduce the total time consumption in comparison to Benchmark and FCFS. In sum, we can conclude that MOCOSC is more stable and effective.

Comparison of energy consumption
The total energy consumption can be obtained by Eq. (12).  Fig. 5a. The result of the impact of different tasks performed by each MU on the total energy consumption is shown in Fig. 5b and Fig. 5c. It can be seen that MOCOSC outperforms the other two approaches in terms of different situations. More specifically, MOCOSC can widely used for different application scales. The main reason is that MOCOSC can comprehensively consider various factors to allocate application more reasonably to reduce the total energy consumption in comparison to Benchmark and FCFS. In conclusion, MOCOSC is the most energy-efficient method among those methods.

Comparison of average resource utilization
The average resource utilization is an essential standard to measure the performance of the ESs. The resource utilization is measured by the quantity of active VM instances in the VM pool of each ES. When all the computing applications have been offloaded to ESs via the offloading method, the occupation of the VM instances is achieved. Higher resource utilization means fewer idle VM instances in the VM pool. The resource utilization can be obtained by Eq. (17). Figure 6 illustrates the comparison results of the average resource utilization of the above three methods under different number of MDs and under different number of  Fig. 6a. The result of the impact of different applications performed by each MU on the average resource utilization is shown in Fig. 6b and Fig. 6c. It can be seen that MOCOSC outperforms other two approaches in terms of different situations. More specifically, MOCOSC can widely used for different application scales. The main reason is that MOCOSC can comprehensively consider various factors to allocate application more reasonably to improve the average resource utilization in comparison to Benchmark and FCFS. Above all, MOCOSC can be widely used for the different situations.

Comparison of load balancing
Similar to the average resource utilization, load balancing is also an essential standard to measure the performance of the ESs. Different from the former one, load balancing is a negative criteria. When its value is lower, the state of the ES cluster is much better. According to the previous mode, Load balancing can be obtained by Eq. (18).  Fig. 7b and Fig. 7c. It can be seen that MOCOSC outperforms the other two approaches in terms of different situations. Moreover, as the number of user applications increases or the number of users increases, the final load balancing values of the three methods are basically the same. That is because the resources of all ESs are occupied, each ES is in a balanced state. Above all, MOCOSC can be widely used for the different situations.

Conclusion
The combination of smart city and MEC is a promising way to improve our daily life. In this study, we have studied computation offloading for MEC-enabled smart city. Aiming at improve the overall performance of the smart city system, both the MU and ES have been taken into consideration. More specifically, we not only augment the performance of MDs, but also make full use of the resources of ES cluster. For ES, we not only improve the average resource utilization of ES, but also keep the load of the ES cluster in a balanced state. Corresponding, a multi-objective optimization mode is established and a new optimization method is proposed to address this mode. Sufficient experiments and analysis have validated that our proposed method is effective and superior in comparison to the other methods in different situations. In future work, we will focus on privacy-aware computation offloading for scientific workflow application and transmission control in MEC-enabled vehicular networks [45][46][47].