Joint Resource Allocation Optimization of Wireless Sensor Network Based on Edge Computing

,


Introduction
Wireless sensor networks (WSN) are a kind of distributed sensor network.Its terminal is the sensor that can sense and check the outside world.e sensors in WSN communicate through wireless mode, so the network settings are flexible, the location of devices can be changed at any time, and they can also connect with the Internet in wired or wireless mode.Because of its multihop, self-organization, low cost, and wide coverage area, it is widely used in military, computer, and communications, aerospace, and other fields.e application prospect of wireless sensor network is very broad, which can be widely used in environmental monitoring and forecasting, health care, smart home, building condition monitoring, complex machinery monitoring, urban traffic, space exploration, large workshop, and warehouse management, as well as airport, large industrial park safety monitoring, and other fields [1][2][3].erefore, scholars draw on the model of cloud computing and propose a computing model of cloud computing, which expands the physical medium of the device, so that it can meet the resource requirements of various applications.
e resources in wireless sensor networks usually refer to limited resources such as channels, energy, time slots, and radio frequencies [4].
e resource allocation of wireless sensor networks refers to the coordination of various resources through resource allocation schemes under limited resource constraints and then achieves improved resource utilization, reduced interference, improved service quality, and maximized network throughput and network capacity the goal of.Literature [5,6] studied the stepwise algorithm of joint power control and rate adjustment.After the node is forwarding power allocation ratio was determined, the algorithm studied the iterative price method to stimulate the node to cooperate with other nodes.Literature [7] proposed a power-interference pricing model for multichannel networks, using a pricing mechanism based on optimal utility, and based on this model, proposed a stepwise related joint optimization algorithm.
e power price and interference price adjust the channel and power allocation of the link to maximize the network utility.Literature [8][9][10][11] comprehensively considered factors such as link effective capacity, network interference and flow conservation, and established a congestion avoidance model for joint power control and channel allocation.Furthermore, a congestion avoidance mechanism based on genetic algorithm is proposed.However, the algorithm needs to collect global information, which increases the computational complexity of the algorithm and has a relatively large communication delay.In order to better reduce interference and balance network energy consumption, literature [12,13] established a game model, which integrates interference and residual energy into the revenue function.Literature [14] not only considers the impact of power control and channel allocation on network performance but also considers the impact of node rate allocation and layer network frequency on the network and proposes a cross-layer resource configuration joint design method.
Many classic problems in cloud computing still exist in the field of edge computing.Management is one of the research hotspots, researching how to improve power efficiency, shorten task execution time, and increase task success rate through efficient resource management.However, unlike resource management in cloud computing, resource management in edge computing needs to combine its own characteristics and formulate corresponding management strategies [15].From the perspective of research goals, although devices have developed rapidly in recent years, the battery life is always an unbreakable bottleneck, which largely restricts the development of devices.To this end, it is possible to further optimize resource management under the edge computing architecture, reasonably allocate resources to improve power efficiency, and use limited power as much as possible to perform more tasks.From the perspective of resource optimization methods, resource management in edge computing usually requires joint optimization of computing and communication resources.Unlike cloud computing, it has more access to cloud service providers through the Internet [16][17][18].As a key technology to solve bottlenecks in 5G, edge computing has developed rapidly in recent years and has received extensive attention.Literature [19] proposed the fistulous system, which provides a dynamic and automatically configurable "multidevice cloud system" that expands Cloudlet by coordinating multiple devices.Use nearby unused devices to provide computing services at the edge of the network, thereby reducing network delays in migrating computing to traditional cloud computing centres.Literature [20] considered that, in a scenario where multiple users with different computing workloads and local computing capabilities share an edge server, a convex optimization algorithm is used to control the size and time distribution of unloaded data is obtained.To minimize the energy consumption and delay cost of a multiuser MEC system with multiple tasks for each user, Literature [21] used a separable semidefinite relaxation method to optimize the cost of processing.Upload decisions, communication resources, and computing resources.

Related Theories and Technologies
2.1.Overview of Edge Computing.Edge computing (EC) was first proposed by ETSI in 2014.5G is regarded as the most closely related edge computing access network, 5G will be widely used in edge use cases, and the support rate is far higher than other network access technologies.Edge computing provides services for users.
e system is characterized by short distance, low latency, and high bandwidth.It will provide localized cloud computing function and realtime wireless network and context information.On the one hand, EC can improve user experience and save bandwidth resources.On the other hand, EC can compute power to mobile edge server.By providing third-party application integration, it is possible for the service innovation of mobile edge.e latest development of edge computing, together with the clear goal of the new technology frontier of ecological positioning in China, has laid a solid foundation for the further development of edge computing.However, a lot of work needs to be done to tap the long-term potential of edge computing.
e EC reference architecture given by ETSI in the white paper is shown in Figure 1. e architecture can be divided into four parts: user equipment layer (UE), EC system level management layer, EC server level management layer, and EC server layer.
e user equipment running the application can directly access the EC system, and it supports third-party customers such as commercial enterprises to access the EC system through CFS portal.Whether it is the user equipment or the third-party user, the access first arrives at the MEC system level.In this layer, the application submitted by the user device first arrives at the application lifecycle, which is responsible for mediating requests, such as starting, terminating, or relocating the application of the user device in the EC system [22].Next, the OSS decides whether to authorize the request and sends the authorized request to the mobile edge choreographer.Mobile Edge choreographer is mainly responsible for maintaining the global available resource view and EC services.
e enabling technologies of edge computing mainly include three aspects: cloud and virtualization, large capacity server, application, and service ecosystem.
is transformation successfully decouples app, software platform, and lower hardware resources with supervision program.In one platform, multiple virtual machines can be deployed to share hardware resources in a controlled and flexible way.Cloud and virtualization technology has been used by telecom cloud and network function virtualization.
ey are changing the transformation mode of IT industry in the past 10 years and are the key technology of edge computing.High-capacity server refers to the hardware level, because edge computing is to move the centralized cloud platform, so the dependence of edge computing on server performance cannot be ignored.High-capacity IT hardware can promote the business success of edge computing.

Basic Framework and Application of Edge Computing.
With the maturity and improvement of architecture design, EC technology continues to meet the diversified application needs in various fields.Several EC application scenarios are given in ETSI white paper [23], including content optimization and caching, video stream analysis, Internet of things, and Internet of vehicles, as shown in Figure 2.

Content Optimization and Caching.
Content optimization refers to the dynamic optimization of the content according to the information provided by the network, such as cell ID, cell load, link quality, and data throughput, to improve the network efficiency.Video caching saves the bandwidth and processing time of the core network when the terminal requests video playback.

Augmented Reality.
AR is a kind of technology to enhance or expand the real-world image that users see by using the additional elements generated by the device, including sound, picture, and video.AR application has the characteristics of large amount of data processing and high demand for computing power of equipment.It needs to obtain the user's position and angle information to realize image superposition.

Video Stream Analysis.
Video stream analysis is a kind of computer vision technology, which is based on the separation of background and target in video scene, to achieve target tracking and recognition and to extract the characteristic attributes of the target or judge its behavior.e application of video stream is expressed: license plate recognition, face recognition, and security monitoring.Video analysis and detection algorithms usually have a high computational complexity.

Internet of ings.
e IoT is a kind of network that connects goods with network through various intelligent technologies to transfer and exchange information effectively, to realize efficient management and intelligent control of goods.Unloading the computing intensive tasks generated by IOT devices to EC server is helpful to simplify IOT devices and reduce energy consumption, to extend the lifetime of devices.EC server usually has certain computing resources and the ability to collect distributed information within the coverage.
e introduction of EC technology into the Internet of things can help the Internet of things devices free from the dilemma that they must have strong computing capacity to realize their functions.

Internet of Vehicles.
e Internet of vehicles is a communication system that realizes the information exchange between vehicles and network through the interaction between vehicles, vehicles and pedestrians, and vehicles and roadside units.By giving the roadside base station computing and storage capacity, the vehicular application service can be transferred from CN to the network edge node for processing.To reduce the round-trip delay of Complexity data processing, EC server can receive, analyse, and process the information of nearby vehicles and roadside sensors, early warn the road danger, and timely inform other vehicles in the area, so that the driver can respond in advance.e application of this technology also makes automatic driving possible.en, the information is transmitted to the data processing centre or base station through wireless mode and finally sent to the observer to realize the connection of physical world, computer world, and human society.Wireless sensor networks usually include sensor nodes, sink nodes, and management nodes, as shown in Figure 3.

Related
Wireless sensor network is mainly composed of a sensor unit, data processing unit, wireless receiving unit, and battery unit.It has the advantages of multifunction, low energy consumption, high utilization rate, and low cost.In the process of practical use, a large number of sensor nodes are distributed in the middle of the monitoring area, forming a good network system through selforganization.At this time, the monitoring data collected by the sensor nodes can be transmitted through the nearby sensor nodes.
ese data may be processed by multiple sensor nodes and gathered in the nodes after multiple transmission, Finally, through the satellite or Internet channel to the management node, the technical personnel configure and manage the data in the management node, obtain the monitoring data, and analyse the monitoring results.Combined with the actual situation of wireless sensor network, we can find that it has some characteristics.In the process of practical application, in order to obtain the most accurate information in the largest range, technicians often arrange a large number of sensor nodes in the monitoring area, set up thousands of nodes, and form a large scale of sensor network nodes, Technicians usually need to place sensor nodes in the area without infrastructure.ey can connect with the surrounding sensor nodes to form a node network, build a topology control mechanism, automatically form a sensor monitoring data network system, and give play to the advantages of selforganization.In the process of practical application, the running state of sensor network is not invariable but will gradually change with the change of the surrounding environment and the passage of time, which is dynamic.Data are one of the important elements in the process of sensor network operation.Sensor network is a task-based network structure, which mainly uses the data information obtained by sensor nodes to complete the operation task.

MRMC-WSN Resource Allocation
Model.Most of the models are based on single interface multichannel environment, which is not suitable for multi-interface multichannel network.In such case, this section takes the interference and conflicts of links as constraints, for purpose of extending the network life, maximizing the network capacity, and improving the balance of resource allocation and constructs a multiobjective optimization model of resource allocation.e formula is as follows: In the above model, equation ( 1) represents the maximum network lifetime, where i represents the lifetime of the node, and the expression is shown in the following equation: where E(i) means the energy consumption of node i in a slot period.In general, the definition of network lifetime can be roughly divided into two kinds.e first one can define network lifetime as the duration of network until the percentage of dead nodes is lower than a given threshold.e second one can be defined as the lifetime of wireless sensor network, which is the lifetime of the sensor node that is the first to fail due to the depletion of battery energy.Using the second definition method, we first calculate the node with the minimum lifetime and then optimize the function to maximize the node with the minimum lifetime.In order to ensure the consistency of objective function in multiobjective optimization, equation ( 1) is transformed into a minimization problem, as shown in e purpose of Equation ( 2) is to maximize the network capacity, where w ij is the link capacity of link e ij and the solution of link capacity w ij is described in equation ( 9). e network capacity reflects the quality of communication to a certain extent.Similarly, equation ( 1) is transformed into the minimization problem shown in the following equation:  Complexity Equation ( 3) shows the balance of the total capacity of all links communicating in each time slot.If the resource allocation is not balanced, it will lead to the waste of resources and even network congestion, resulting in network communication delay.e standard deviation of the total capacity in each slot is used to represent the balance of resource allocation.
Equation ( 4) represents the interface constraints of each node.Each node has a limited number of interfaces, which are less than the number of orthogonal channels.e limited number of interfaces will make the links associated with nodes share the same interface, and two links on an interface cannot transmit in the same time, where Link(i) is the set of all communication links of node i and M u,v represents the number of interfaces of node i. Equation ( 5) is the interference constraint.In order not to affect the normal communication, all links in the network should meet the SNR conditionc ij ≥ c th .
In MRMC-WSN, with the increase of interfaces, multiple links of a node can communicate at the same time.However, with the raise of the number of links communicating at the same time, the interference and communication conflicts in the network will also increase, which will lead to excessive energy consumption, limited network capacity, unbalanced resource allocation, and other problems.e resource allocation problem is shown in Figure 4.By analysing the interaction among slot scheduling, the energy consumption model of joint slot scheduling, information distribution and power adjustment, the interference and network capacity model, and the load balancing evaluation model are established.

Optimization Algorithm of MRMC-WSN Resource Allocation Based on Edge Computing.
e joint resource optimization algorithm in wireless sensor network can improve the resource utilization, avoid the network communication conflict, reduce the interference, and improve the communication quality and network throughput.However, traditional resource allocation models and algorithms are designed for single interface single channel or single interface multichannel wireless sensor networks.With the introduction of sensor nodes with multiple RF interfaces into wireless sensor networks, the number of simultaneous communication links in the network will increase with the increase of interfaces.erefore, the application of multiinformation distribution technology can improve the network throughput.However, while improving all aspects of network performance, it also means that the complexity of resource allocation algorithm for wireless sensor networks is improved.
erefore, this section proposes a joint optimization algorithm of resource allocation based on edge computing for wireless sensor networks (ECROA), which solves the problem of communication conflict between links.e analysis shows that transforming communication graph into conflict graph for solving the TDMA slotscheduling problem, but this transformation process is based on single interface wireless sensor network.In this section, a joint allocation optimization scheme is to solve the previously proposed MRMC-WSN slot-scheduling model.Firstly, the adjacent links of nodes are coloured to avoid slot redundancy caused by out of order scheduling.In addition, it can not only increase the utilization of resources but also consider the fairness of slot allocation.Use g(x) to indicate the number of links allocated with slot x.When slot τ is allocated to link m, the fairness can be expressed as e joint resource allocation optimization method with edge computing in this paper is summarized as shown in Figure 5.As is shown in the figure, the purpose of edge computing is to use the strategy of computing migration, which mainly migrates computing intensive tasks to the cloud computing centre with sufficient resources for implementation.But for massive edge devices and massive data, transmission is an important factor affecting its computing power, so the migration strategy of edge computing model is to reduce the amount of network transmission data for the purpose of migration strategy rather than the migration of computing intensive tasks to edge devices.In the process of sensor network distribution, it can solve the resource calculation of sensor network and improve the efficiency of calculation.

Simulation Results and Performance Analysis
In order to verify the performance of resource joint allocation optimization algorithm (ECROA) based on edge computing, MATLAB is used in this section to implement various performance simulation comparisons.First, by analysing the energy consumption, the load balancing constraint is determined.Secondly, using the joint control and optimization algorithm of Information distribution (PCOA), multichannel multihop algorithm (MCMH) and time division multiple access (TDMA) in the wireless sensor network to compare with the algorithm in this paper, the advantages of the algorithm in this paper ECROA are analysed.Finally, the influence of different edge computing resources on the allocation efficiency of the algorithm proposed in this paper is analysed.realizes conflict-free communication between links, and the number of links in each time slot is equal.is is because fairness is considered when allocating time slots.

Complexity
A large number of experiments show that the scheme has no capability of converging due to the narrowing of the selection range, when δ ≤ 400.erefore, they are set to 400, 450, 500, and 550, respectively, and 10 experiments are carried out for each parameter.It can be seen from the graph that the smaller the energy consumption will lead to larger network capacity.
is is because all above factors are interacting and contradictory, and the greater is the impact.erefore, the removal of load balancing constraints will improve network capacity and decrease energy consumption.erefore, considering the above factors, it can be taken as δ � 500.
Since the methods are various, the influence of different dominated solutions on network performance is analysed.e formula of the equilibrium solution mentioned above is obtained from the Pareto solution set already obtained.e results are shown in Figure 7.Among them, the left and right graphs, respectively, represent figures under the solution with the best network capacity and the nondominated solution with the best energy consumption.In the figure, the numbers {1, 2, ..., 30} indicate the link ID, and different channels are represented by different identifiers.It can be found from the figure that multifarious schemes are completely multifarious.
Comparison of Different Optimization Algorithms.In this section, first analyse the interference situation of each link in the network of the edge computing-based optimization algorithm of WSN resource allocation ECROA and algorithm PCOA, MCMH and TDMA, and the interference situation of each link in the network as shown in Figure 8(a).
It can be seen from the figure that the link interference of the ECROA algorithm is lower than that of the PCOA, MCMH [24], and TDMA [25] algorithms.In the ECROA algorithm, even some links have almost zero interference.
is is because the ECROA algorithm jointly optimizes time slot scheduling.In order to further analyse the interference situation in the network, the average interference of all links in the network is recorded when the number of nodes gradually changes from 5 to 30, as shown in the Figure 8(b).e average interference in the PCOA, MCMH, and TDMA algorithms also increase, but in the ECROA algorithm, the average interference hardly changes with the number of nodes.In addition, the average interference of ECROA algorithm is always lower than that of PCOA, MCMH, and TDMA algorithms.

Analysis of Optimal Benefits of Different Edge Resource
Scheduling.In order to more intuitively compare the impact of different edge resources on the joint allocation efficiency of wireless sensor network resources, here N � 5000, N f � 2, λ n � 0.00003, and λ f � 0.0004 are used as the benchmark test scenarios in Figure 9 base solid line).Similarly, the life cycle of perception applications is still 100 seconds.By changing the two different parameters, it can be seen that the curve change trend in the figure is very different.In these two figures, the abscissa represents the execution time of the mobile swarm intelligence application used for edge computing.e ordinate represents the amount of sensing data that the wireless sensor can receive at the current time point.erefore, the graph can intuitively reflect the stage during the execution of the edge-computing server that can harvest the most perceptual data.At the same time, the area of the graph formed by the curve and the horizontal axis in the figure is the total amount of sensory 8 Complexity data collected under the corresponding scene parameters.e analysis results of the influence of various parameters on the efficiency of joint allocation of wireless sensor network resources are shown in Figure 9.
By comparing Figures 9(a) and 9(b), it can be found that the number of servers used for edge computing will affect the total amount of sensing data and the sensing efficiency.It is not the same as renting more base stations as the edge.It is obviously more cost-effective to serve nodes and increase the communication frequency of base stations and wireless sensor networks.When the communication frequency between the base station and the mobile device reaches a certain bottleneck, more base stations are rented as edge servers at this time, which is more cost-effective.On the other hand, renting more base stations means that the wireless sensor network covers a larger area.As the target area expands, increasing the number of mobile devices participating in-group intelligence perception can significantly improve the execution efficiency of group intelligence perception.

Conclusions
Aiming at the problem of resource allocation optimization in WSN, a resource allocation optimization algorithm is adopted.rough the analysis and understanding of the resource allocation tasks of wireless sensor networks, a multi-interface and multichannel sensor network is first proposed.At the same time, mobile edge computing and mobile cloud computing have many similarities and can even be regarded as a special form of mobile cloud computing.It disperses computing resources at the edge of the network and replaces centralized data centres.Combining these advantages of edge computing, our optimization algorithm model is employed.e simulation results exhibit that, compared with the traditional distribution algorithm, it can further guarantee the user's service quality and extend the equipment use time.

Figure 2 :
Figure 2: Main application scenarios of mobile edge computing.

6 ComplexityFigure 6
Figure 6(a).e number of nodes and links are 28 and 27.Numbers {1, 2, . .., 30} represent the position represented by the node.It can be seen from the figure that this algorithm

Figure 4 : 1 Figure 5 :
Figure 4: Analysis of joint resource allocation.(a) Communication conflict between links.(b) Communication interference between links.(c) Channel allocation without slot allocation.(d) Joint channel allocation and slot allocation.

Figure 6 :
Figure 6: Topology structure of WSN and distribution of nondominated solutions.(a) Topology structure of WSN; (b) distribution of nondominated solutions.

Figure 7 :Figure 8 :
Figure 7: Channel allocation results under different dominance solutions.(a) Optimal channel allocation results for network capacity (b) Channel allocation results with the best energy consumption.