Secured Optimized Resource Allocation in Mobile Edge Computing

Department of Computer Science, Kohsar University Murree, Punjab, Pakistan Department of Information Technology, e University of Haripur, Haripur 22620, Khyber Pakhtunkhwa, Pakistan Department of Computer Science, Faculty of Science and Arts, Belqarn, Sabt Al-Alaya 61985, University of Bisha, Saudi Arabia Faculty of Computing, e Islamia University of Bahawalpur, Bahawalpur 63100, Pakistan Department of Computer System Engineering, University of Engineering and Technology Peshawar, Peshawar 25000, Khyber Pakhtunkhwa, Pakistan


Introduction
e recent increase in demand for mobile devices and the use of the cloud as virtual storage demanded the eld to evolve, named mobile edge computing (MEC). Research in MEC is performed by load balancing and o oading. To decrease resource demand in MEC architectures, a pattern of traditional clouds is used. e majority of the MECs do not consider optimization and cost factors. MEC also provides the network to use the resources that have less memory, time, and energy consumption.
MEC provides the opportunity to reduce latency while o oading tasks in the network. MEC allows the resources to o oad tasks easily and safely in the network. MEC tries to reduce the consumption of power and energy. It removes all the delays from the network. MEC designs the nodes to o oad tasks in the network to remove all the delays from the network. MEC allows the nodes to get information about the other nodes that are o oading data in the network so there will be no collision. It allows nodes to use all the resources from the network. Linear programming is the most common approach to optimize an objective function, for example, to reduce resource consumption, reduce the total execution time, reduce latency, or increase the quality of experience.
One of the recent approaches to solving the o oading problem is by using deep learning [13]. Table 1 shows an overview of di erent surveys conducted in the eld. Limitations of the surveys are also mentioned in the table.
A gap in the [14] study is that it does not consider offloading in the large-scale network, while the quality of offloading tasks in the network is not considered in [15]. Safety is not considered in [16], while task execution is difficult for the user in [17,18]. Modern facilities to use are not well-thought-out [19]. e disadvantage in [20] is that it does not consider if any virus destroys this data, then what will be sent next. e negative of [21] is that it does not consider the multiple attacks solution. e undesirable thing about [22] is that it does not consider the solution of inputting tasks easily for the user. e ploy of [23] is that it does not consider the offloading task in the network easily and more securely. e depraved thing of [24] is that it does not consider more instructions to make the system more secure. e downside of the study is that it does not consider cryptography techniques to make the network more secure [25]. Table 2 presents the critical analysis. e rest of the paper is arranged as follows. Section 2 contains a literature review. Section 3 states the problem statement while Section 4 elaborates on the proposed solution. Section 6 concludes the paper with a proper future direction.

Literature Review
e authors of [26] found that cloudlets offload the task easily by using the techniques of DOTA, CBL, and FATO. Mobile devices request for the transmission of information by making sure the message is in the network so there will be no collision.
MCC provides the facility to store large data over the network, and it also ensures the sending of large amounts of data on the network. Mobile edge computing improves the speed of the node by removing the slow node PCs from the network and adding the neighbor PCs. It is found in the paper that a single node makes the network so busy that it increases. DOTA, CBL, and FATO are used for dividing tasks in cloudlets. e limitation is that less energy consumption having less cost technique is not developed. It also provides good efficiency to the nodes in the network. So the nodes will offload tasks in the network with good quality. SDN provides the facility for MEC to divide the task into nodes. e nodes will offload tasks in the network sequentially. So there will be no loss of data in the network. MEC also provides the service of offloading tasks in the wireless network [51].
Wang et al. proposed a new architecture for computation and storage offloading based on fog computing and found that COCA offloads the task from the smartphone to the fog server [27]. e result was deduced that with the enactment of the cloud upgrade, uploading data became fast. In this research, no technique was used for uploading large amounts of data. More resources must be added due to the hinging of the network.
In [28], local computing (mobile device) combined with the computing system and found system loss function (SYLF) minimization problem. Markov Table 1: Survey-based analysis.
Year [paper] Topic discussion and overview Limitation February 2019 [1] Machine and deep learning techniques are mostly used in papers of this survey. Machine and deep learning are used to detect the encryption traffic in offloading tasks in the network.
ere are grand challenges in edge computing security.
March 2017 [2] Network virtualization and Lyapunov optimization-based dynamic computation offloading (LODCO) algorithm is used. Network virtualization manages the flexibility of the virtual representation provided by the MEC.
Dynamic resources are added while offloading tasks in the network.
Resources that are added to offload tasks in the network increase delay. Markov-based techniques reduce the time and redundancy while offloading tasks in the network. January 2017 [4] Machine learning advanced communication techniques are used to offload tasks in the network. Slow processing increases time delay.
June 2017 [5] Advanced communication techniques are used. Refraction and reflection increase delay.
May 2018 [6] Migrating running service technique and compression algorithm are used. Migrating running service technique is used for migrating the task in the network. e size of the task is not reduced, so there is a delay in the network.
2007 [7] IDS is used to interpret the traffic while offloading tasks in the network. e cost factor is not considered 2007 [8] e pushback technique is used to aggregate the traffic while offloading tasks in the network.
A comparison of complexity analysis is not performed.
2014 [9] RTT communication and task scheduling algorithms are used. RTT communication is used to handle the traffic while offloading data in the network and divide the task in the node to remove the delay.
Processing delay is not entertained.
2020 [10] VM migration and genetic algorithm are used. VM migration is used to migrate the task in the network and makes the performance better. ere is delay in resource consumption.
2017 [11] e virtual machine is used to migrate the task virtually in the network and make the performance better. ere is time delay.
2015 [12] Lyapunov optimization and online control algorithm are mostly used in the research paper of this survey. Lyapunov optimization is used to run the online program to offload tasks in the network.
Maximization of resource usage is not performed. Deployed cloudlets used for dividing the resources in k nodes A single node makes the network so busy that increase. DOTA, CBL, and FATO are used for dividing tasks in cloudlets.

Mobile Information Systems
Cloudlets offload the task easily by using the techniques of DOTA, CBL, and FATO.
Less energy consumption having less cost technique is not developed.
October 2018 [27] New architecture for computation and storage offloading based on fog computing New architecture for computation and storage offloading based on fog computing COCA offloads the task from the smartphone to the fog server.
e enactment of the cloud upgraded, uploading data become fast.
August 2020 [28] Local computing (mobile device) that combines with the computing system Local computing (mobile device) combines with the computing system.
System problem loss function (SYLF) minimization problem QLCOF scheme effectively reduces the SYLF.
Pairing-free multiserver authentication protocol Secure mutual authentication, anonymity, and scalability are achieved.

None
May 2020 [31] Comparison technique (proposed MUMACO with benchmark) Offloading of all applications is done to the cloudlets, but a fraction of cloudlets is idle.
Time consumption, energy consumption, and load balancing are optimized.
Multiobjective is performed. Optimization cannot be performed January 2020 [32] Offloading algorithm (hybrid intelligent optimization algorithm) Optimization of task delay and resource consumption e proposed algorithm effectively improves the offloading utility as compared to baseline.
Offloading in the uncertain network is not available.
March 2020 [14] Comparison and optimizing technique (offloading) Performance and energy of mobile device can be improved by edging.
Proposed HIQCO provides accurate results and then compared the algorithm.
Storage cannot be considered in the comparison to HIQCO and baseline algorithms.
August 2019 [33] MCOWA technique used for uploading tasks on the network easily By using MCOWA technique, algorithm problem is solved as it solved the complexity of the network.
Time and energy are consummated so the network becomes fast.
None 2018 [34] Analysis technique used for the scalability and performance of an edge cloud system Interedge is unchanged. Bandwidth should remain.
If capacity is added to the existing edge network deprived of increasing the interedge bandwidth, then it will pay for networkwide congestion.
Increasing distance and low bandwidth will increase the load.
March 2020 [35] Cloud modeling operator introduced that deals with the execution of packets in the network By using this strategy, the performance of computing resources improves.
Time and energy are consummated. Also, improve the utilization of computing resources and ensure the QoS, and this is critical to edge-cloud computing business models.
e problems such as management resources of MEC and the cloud are not improved and considered.
April 2020 [36] FL technique introduced for round communication between the nodes in the network e nodes will only send a message from one node to other when they receive a message that the network is free.
By using the FL technique, the network becomes safe from the collaboration of messages. us, the packets will not be lost.
Privacy is not considered and improved to make the network secure.
April 2020 [37] GPS technique used for measuring frequency and sending the signals even from the satellite GPS technique is used for sending the signals from satellite to the user. So the user can easily send a message from Earth to satellite, and vice versa. e offloading task increases if the user sends a message to the satellite. ere will be no interruption of other networks as the nodes only send one packet at one time.
No technique is used to make the signal powerful as if the signal is weak, the packet will be lost.
January 2021 [38] DECCO technique used for maintaining signals from a long distance Long distance creates the network slow. us, the packet delay. Energy and power consumption.
DECCO used that maintain the long distances plackets. us energy, time, power and quality consumption.
Many computing capabilities are not considered. Sending a large amount of data is not considered.
September 2019 [40] Edge-centric IoT used that is responsible for offloading data safely in the network Security is very important for offloading tasks in the network.
If there is no security in the network, then the delay will occur, and the data can also be hijacked.
If data is hijacked and caught by a virus, then no technical solution is considered here.
January 2019 [41] GMaxEOQU and GMinEOIP used in the network GMaxEOQU and GMinEOIP are used to minimize the quality errors in the network.
If there are less nodes present in the network, then there will be a delay in the network.
Offloading times by multiple nodes are not considered.
February 2020 [42] QMPOS technique used in the network QMPOS technique is used to derive the result in the network and evaluate the performance of VN.
By balancing the load of VN, the task will offload within time. e network becomes burdenless.
e cost of VNs is not considered.
June 2020 [43] Fog computing used in the network Fog computing provides management, security, and availability of resources that helps offload tasks.
Offloading tasks becomes too easy and secure. Nodes will get many resources for offloading tasks in the network.
e cost of resources is not considered.
June 2020 [44] SMSC and RAMWS used in the web servers SMSC works to control the requests that arrive on web servers, and RAMWS works to overcome the request time out in the web server.
e web server provides the resources to the users to use the resources and offload their tasks. It also provides the user the facility to get information from the websites.
Protection of web servers is not considered.
August 2020 [41] Skippy technique used Serverless is used in the network that provides all resources to offload the task in the network, and Skippy helps serverless do this.
A large amount of data is able to send in the network by using serverless.
If any unauthorized network hacks the data, then a large amount of data will have lost in the network.
March 2019 [45] Pervasive technique used Pervasive helps the computer provide all resources to the nodes to the nodes offload their task.
Pervasive helps the user find anything from the computer by using it. It also provides the user to interact with the computer easily.
Security is not considered.
August 2018 [46] Routers used in the wireless network Routers develop the communication between the two networks and make communication possible.
Wireless network also provides the facility to the nodes and make communication easy like space.
Cost is not considered. decision process (MDP) designed a state loss function (STLF) to measure the quality of experience. In it, multioperator multiverge cloud state was not considered. Slow nodes must remove because multiusers increase the cost. Mobility management is the reason for the disconnected link between the devices and the edge network. It manages horizontal and vertical mobility. Heterogeneity deals with the wireless network interface, for example, Wi-Fi. Low delay and high bandwidth are the main challenges. Decrease in price by adding neighbors to offload tasks early is the main challenge. MEC provides the service of offloading tasks in the network by using the Internet. MEC allows users to download anything from the Internet keeping the security in the mobile devices. MEC provides the service of using passwords on mobile devices. It provides the facility of storing data on the Internet so that when the user accesses the Internet, he will easily access the information without any delay. MEC provides biometric security so that when the user enters his data in biometrics, his data will remain safe and will not leak to anyone. MEC makes it possible that when the person will enter his fingerprint, all his data will come out. is data will not be accessible to anyone because MEC provides security. MEC provides security to the nodes when the nodes will offload data in the network. e data will be safe and will not be disclosed to anyone. MEC provides security to the nodes by using passwords and keys that will not be shared with anyone.
In [29], the authors used mixed integer programming to find NP-hard problems and EcoMD. EcoMD provides improved performance in terms of resources. But resources must be stable because increasing nodes will increase the cost. However, there are some other solutions as well that do not fit our study [52][53][54][55]. e authors of [30] used the elliptic curve cryptosystem and MSA protocol for the MCC environment to find a pairing-free multiserver authentication protocol and achieved secure mutual authentication, anonymity, and scalability, but there was no mechanism of security proposed in it.
In [31], the authors used the comparison technique (proposed MUMACO with benchmark) to find offloading of all applications to the cloudlets, but a fraction of cloudlets was idle. Time consumption, energy consumption, and load balancing were optimized but multiobjective optimization cannot be performed, and less cost and energy consumption resources must be used.
In [32], the authors proposed offloading algorithm (hybrid intelligent optimization algorithm) and found optimization of task delay and resource consumption. e proposed algorithm effectively improves the offloading utility as compared to the baseline algorithm, but offloading in an uncertain network is not available [56].
In [14], the authors introduced a cloud modeling operator that deals with the execution of packets in the network by using this strategy; the performance of computing resources improves. Also, they improve the utilization of computing resources and ensure the QoS and thus are critical to edge-cloud computing business models [57].
In [33], the FL technique was introduced for round communication between the nodes in the network. e nodes will only send messages from one node to another when they receive a message that the network is free. By Do not consider a secure and easy offloading task.
2019 [24] AES-based cryptography approach FPGA No collision will happen to destroy the data.
Do not consider a more secure system. 2020 [25] AES-based cryptography approach LLCA Encrypt and decrypt data exactly in the network.
Do not consider more cryptographies to make the network more secure.
2020 [48] AES-based cryptography approach LSM Protect the data of user from not being able to hack for the other person.
Do not consider an easy and secure offloading task network.
2020 [49] AES-based cryptography approach RSA Criminal record update from time to time Do not consider more functions to offload tasks in the network.

[50]
Blockchain ACO algorithm Make the system more secure to offload data in the network.
Do not consider more systems to make offloading tasks in the network more secure and easy.
using the FL technique, the network becomes safe from the collaboration of messages. us, the packets will not be lost. Privacy is not considered and improved to make the network secure.
In [34], the GPS technique is used for measuring frequency and sending the signals even from the satellite. GPS technique is used for sending the signals from satellite to the user. So the user can easily send messages from Earth to satellite, and vice versa. e offloading task increases if the user sends a message to the satellite. ere will be no interruption of other networks as the nodes only send one packet at one time. No technique is used to make a signal powerful as if the signal is weak, the packet will be lost. MEC does the encryption and decryption task in the network. e nodes will encrypt data in the network. MEC makes this task possible that regardless of what the user sends for encryption, the network will decrypt the same data in the network without any delay. MEC also makes the money transaction possible and safe by using the keys such as ATM keys and PINs. e PIN is only known by the user who uses the ATM.
us, the data and the money will be safe. MEC provides security to the criminal record. If the person does any crime, then the record will be written in the file. is file will not leak to anyone and will be updated from time to time. It is possible due to MEC. MEC provides the security and privacy for storing data in the network that when the user wants to access the data, MEC makes the task present in the network.
is removes the delay from the network to access the network.
In [35], the authors used the DECCO technique for maintaining signals from a long distance. Due to long distance, the network becomes slow resulting in high packet delays, energy, and power consumption. DECCO maintains the long-distance packets. us energy, time, power, and quality consumption are achieved. Cloud servers are far away from mobile devices that create signal issues, so the resources become weak. e authors in [36] used edge-centric IoT that is responsible for offloading data safely in the network. Its security is very important for offloading tasks in the network. If there is no security in the network, then the delay will occur, and the data can also be hijacked. If data is hijacked and caught by a virus, then no technical solution is considered here. If there is no security and privacy in the network, then the data will create delay and be hijacked. e network must be protected by passwords, and the password must be secure. e password is not shared by anyone [58,59].
In [37], the authors used GMaxEOQU and GMinEOIP in the network, and they are used to minimize the quality errors in the network. If there are less nodes present in the network, then there will be a delay in the network. Offloading time by multiple nodes is not considered. If there are less nodes used in the network, then the delay will occur [60,61]. e authors in [38] used the Skippy technique. e server is less used in the network that provides all resources to offload the task in the network, and Skippy helps serverless do this. A large amount of data is able to be sent to the network by using serverless. If any unauthorized network hacks the data, then all large amounts of data will have been lost in the network. e data must be protected by using a password, and some keys so a large amount of data will be safe.
In [39], the authors used the pervasive technique. Pervasive helps the compute provide all resources to the nodes to offload their task. If any unauthorized user hacks the data, then it will give the wrong information and data to the users.
In [40], the authors used load balancing (virtual machines) Apache JMeter (Tool). e majority of MCC do not consider cost factors. For multiple users, one virtual machine architecture is most suitable. e time to execute a task increases by 23 times while the resource utilization decreases by two-third. Execution time is more for projected architecture [51].
In [41], the authors discussed that today, the Internet is too common, while using Internet security is also needed to offload tasks from the Internet, download anything from the Internet, and so on. Also, information on the Internet must be secure so that the user can access it at any time and access it without delay.
AES is a part of the block symmetric cipher. AES provides the facility for MEC to offload the message in the network by using nodes. AES also provides the facility to encrypt and decrypt the data in the network without creating any delay in the network. AES has the ability to use different keys such as 128, 192, and 256 bits. Each bit has different features [42]. AES is required in every field where security is needed. AES provides the encryption and decryption of data from one field to the other field easily and without delay in the network [62].
In paper [44], cloud computing provides the security to the user to offload tasks in the network. AES provides the facility of encryption and decryption in the cloud computing network. AES provides the facility of security to the network to exchange information without any delay [43]. As today the Internet is too common, while using the Internet, security is also needed to offload tasks from the Internet, download anything from the Internet, and so on. Also, information on the Internet must be secure so that the user can access it at any time and access it without delay [41]. AES divides the task into two portions, that is, one is the offloadable and the other is the un-offloadable program so the offloadable task can be offloaded easily in the network without any delay. AES provides some security and divides tasks into the un-offloadable task so the task can easily offload in the network without delay [45]. AES provides the security to the users to offload tasks in the network without any interference from a virus or delay in the network. AES helps the user provide antivirus to the user so the virus will not attack and destroy the user data and offload in the network without delay [46]. Edge computing became top popular as it removes the delay from the network while offloading data using the Internet. Also, it makes all Internet applications secure for offloading data. While offloading the data using the Internet, the drastic event that can happen is an attack by an attacker. Malicious attackers do the collision in the information present in the network. e collision in the information makes the information lost; thus, the data are lost and destroyed because of malicious attacks. ese attacks happen due to the recovery of the secret key of AES [63]. All the internal collisions are detected by the AES, but the linear collision is not detected by the AES. S-box gives the output that talks about the collision happening internally [23]. e issue with the proposals and techniques discussed above is that during the offloading process of the data from the Internet, there can be malicious attackers who can intervene in the communication and perform different kinds of attacks. To cope with these issues, we devise a mechanism through MEC that can help mitigate such attacks. Also, the response time, resource utilization, and fair usage of mobile devices are increased.

Our Contributions to the Field
Design and implementation of a novel task placement framework that does the following.
(1) Reduces response time of processing tasks, (2) Un-usable resources become useful, (3) Demand of mobile device will increase, and (4) Usage of mobile resources as a replacement of cloud servers.

Problem Statement
When MEC requests to buy computer resources while executing a task, it faces a delay in request and response to and from MEC, so this delay increases time. Similarly, many mobile resources were being wasted by users despite having 4 to 8 GB RAM and 128 GB plus storage.
In this section, we briefly state the three main problems to highlight the problem scenario and drawbacks that can occur due to these problems.

Problem I: Utilization of Mobile Idle
Resources. MEC provides the facility of low delay rate, low cost, and high efficiency of offloading tasks in the network. So mobile resources can be used to make a local edge cloud for working in an efficient manner.

Problem II: Task Execution Delay.
When MEC requests to buy computer resources while executing a task, it faces a delay in request and response to and from MEC and computer resources. is paper is basically solving a problem as per a scenario in which a user wants to process a huge amount of data at that time and users have mobile devices with either them or with their friends, so users can make the local cloud without having remote servers. e following research questions are formed from the above problems: (1) Question 1: How to reduce the response time of processing by making an edge instead of waiting for a single device?
(2) Question 2: How to save wastage of resources on mobile, and how will they be utilized in a timely and effective manner?

Proposed Solution
e particle swarm optimization technique is used and modified according to MEC requirements to gain efficiency by finding the optimal nodes, which will be used in the MEC. To find the best node, we will check its previous record of connecting time delay and its distance from its master device. We will provide a list of nodes to the swarm algorithm, and it will compare the first node with other nodes and will place the node having less connecting time and a short distance from the master device. At the first index, the comparison will continue till we sequence the list in the best node in ascending order in the FCFS list position. So we will have the best device and the best mobile edge for task execution. To overcome the problem of time delay, it is better that the MEC server should remain connected with MEC clients so that the delay of connection would not appear when a task appears as MEC is already connected so it will start executing the task without having the connection delay.
To overcome the problem of resource wastage, the solution is to use mobile resources if it is available and ready to use. MEC uses multiple mobiles to compute multiple complex tasks, which are nearly impossible to compute on a single device.
is study aims to propose and implement a novel framework to cover challenges raised by application execution on resource-constrained devices. Two main tasks that the proposed solution is performing are task allocation and task execution. Breakdowns of these tasks are given below.

Task Allocation
(1) Secured resource discovery of mobile devices for connecting to edge servers (2) Secured resource allocation algorithms used for checking device capability (whether the device is capable of executing the task); optimization methods will be used (3) Secured resource allocation algorithms used for making an effective offloading communication that will make sure that offloading resource communication is secure (4) Transfer of data from a mobile device to the edge nodes

Task Execution
(1) Scheduling of tasks at the edge nodes by the offloaded device (2) Offloading of task by the offloaded device (sending task) (3) Transfer of results back to the source mobile device Mobile Information Systems (4) Edge server that will gather results and perform integration of it Figure 1 shows the ow diagram of the scheme.

5.4.
Algorithms. Algorithms 1 and 2 represent problems I and II, while for optimization, we present Algorithm 3.

Implementation
Steps. e following steps are performed while implementing the proposed solution: (1) We will make a connection between o oader and o oadies devices using a nearby API and distribute the task in form of bytes. ere are strategies such as P2P, P2Cluster, and others to create a connection among the devices. We will be using connection P2Star because it suits our scenario. P2Star will o oad tasks in the local cloud more quickly than other connections strategies. Algorithms are used in this connection for making the handling of the o oading tasks better. (2) After choosing a strategy, the o oader device will start discovering the o oadies, and o oadies will start advertising so that they are discoverable, and a connection can be established among the devices. (3) Now as o oadies are discoverable, o oader will start connecting with the o oadies one by one and accept their connection of o oadies to work as a slave for the master device and to compute the task provided by the o oader devices and send back the results. (4) After establishing the connection between the oloadies, these devices will send their speci cation information and available resource information so that the o oader can decide which devices are capable of serving the master device and which oloadies are not capable. (5) After discovering the ability of devices on the basis of RAM, CPU, battery, and available RAM, the oloader will lter the devices and ignore the rest of the devices [56]. (6) Now, the o oader will split the task into a number of available devices and send the task to available devices for the sake of processing. In our case, the task is image processing; however, it also depends upon the application requirements of the user [64][65][66]. (7) e o oadies will process the image processing task on their end using the OpenCV library using their own power and processing power.
(8) After processing, each o oadies will send back the result to the o oader device, and the o oader will use that result for its own use.  (7) for each Device d do (8) Calculate the Compatibility check using FCompatibleDevice (), add the device to the Cd list (9) end for (10) for each Cd do (11) Rs � Output {task} (12) end for ALGORITHM 2: Algorithm for problem II. Connection Request (Cr), Task (T),

Simulation and Results
is section thoroughly describes the equations, simulation, and results of the study.

Equations.
e following generalized equations are formed:     where Rs,t is reserved resources of server at t-th time location, Rc,t is reserved resources of the client at t-th time location, and Uc,t is unused resources of the clients at t-th time location.
where R s,t is reserved resources of server at t-th time location, Rc,t is reserved resources of the client at t-th time location, and UWc,t. is unused-wholesaled resources of clients at t-th time location.
where R s,t is reserved resources of server at k-th time location, R c,t is reserved resources of the client at k-th time location, and U B is unused-buyback resources of clients at the k time location Equations (1)- (3) show the generalized working of the proposed solution by seeing results that total resource utilization occurred in this pattern, while the following equation is showing the total time that is consumed in executing a task: where total consumption time for all tasks � T T, communication delay � CD, tasks list � Ts, and number of devices � DL.

Results without Optimization.
It can be seen in Table 3 that without optimization the time consumption is 4 seconds for a task. It is due to the lack of a particle swarm algorithm. Also, the CPU percentage is high with relatively high memory in use. Table 3 represents the results without optimization.

Results of Proposed Solution (after Optimization).
Previously, time consumption was 4 seconds for a task, and now after optimization, 1 second decreases because we have chosen the device, which is nearest by applying the particle swarm algorithm. Similarly, for three devices, the time was 2.5 previously, and now, it is 1.5 seconds. e memory usage also decreased. While CPU consumption previously in 1 device was 7%, after optimization, it is 2%, and for 3 devices, it is 3.5%, and after optimization, it is 2.5%. Table 4 presents the results of the proposed solution after optimization.

Simulation Results.
In Figures 2-4, simulation results are clearly showing that the results without optimization are improved by applying optimization techniques of particle swarm. Moreover, adding a greater number of devices improved the results significantly.

Conclusion and Future Work
Hence, it is concluded that in this paper, selection of optimized resources and then their allocation in mobile edge computing decreased time, energy, and memory while executing tasks. ese tasks if executed on a single device can increase these resources in a linear order. Complex and tedious tasks can easily be executed by making a mobile edge, and resources can be utilized in a better way. Edge can reduce consumption delay (CD) by adding N number of devices, which will improve the utilization of resources and will ensure the quality of service. Mobile edge shares resources to other edges by wholesale (sending resources) and buyback (receiving resources) scheme. In the future, wholesale and buyback resources from edge-to-edge servers will be used for profit maximization. Experimentation research techniques will be used to optimize resource allocation between two MECs, and algorithms will be designed for optimal memory, CPU, time, and power consumption between two MECs. Besides this, mobile edge computing has still faced a lot of challenges, and these are mobility management, heterogeneity, price, scalability, and security. We will also work on these mentioned sides in the future.

Data Availability
e data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
e authors declare that there are no potential conflicts of interest.