# PECSA: Practical Edge Computing Service Architecture Applicable to Adaptive IoT-Based Applications
## 3 Preliminary
### Novel Service Architecture  
Figure 1 shows the framework of an edge computing service for IoT-based applications that includes three layers, i.e., the IoT layer, the edge network layer, and the cloud layer. The IoT layer consists of users who need to submit computing tasks. The edge network layer mainly corresponds to edge clouds deployed near the IoT users. The cloud layer comprises the data processing center deployed far from the users. The cloud and the edge networks accept service requests from users.  
IoT applications usually collect a lot of raw data and initiate various service requirements. Trust management, in the IoT layer, is mainly used to monitor the historical behavior of users and distinguish malicious users. All requirements of legitimate users are processed by edge networks and/or the cloud, and the results should be returned as soon as possible. The cloud is responsible for trust management, task allocation, data processing, and edge resource management. For reasons of cost control and response time, many tasks are delegated to the edge cloud.  
Edge networks consist of six primary functions:  
1. Trust management: unlike IoT nodes, the trust values of the edge nodes are focused on the available resources.
2. Edge resource management: in edge networks, all the available resources are managed by edge servers. The trust value, runtime resources, and tasks of every device in the edge cloud are reported to the servers periodically.
3. Evaluation of the minimum service time: for time-sensitive users, their service requests need to be processed as soon as possible, regardless of the price costs.
4. Evaluation of the minimum service price: many users want to obtain the results of their requirements with a minimum price, although this service type results in longer wait times.
5. Evaluation of the minimum price within a given time: users want to achieve a tradeoff between service time and price.
6. Task allocation: based on the above functions, each task is divided into several parts and sent to the appropriate edge nodes. The cloud mainly performs the following functions:  
1. Trust management: the cloud develops trust management strategies and methods for calculating trust values in edge networks and the IoT, respectively.
2. Edge resource management: the cloud cooperates with edge servers to manage the resources and coordinate resources among different edge servers.
3. Task allocation: the cloud participates in task allocation and data processing if the edge servers cannot meet stringent user demands.  
Computation costs and transportation costs are the two most important factors for a task allocation scheme. Generally, all the data transmitted to the edge nodes are used for some computation. Thus, we make an assumption about the relationship between data size and computation amount as follows.  
**Assumption 1**.: _In an edge computation, the computation amount is proportional to the size of the data transported from the users' side to the edge nodes._  
Figure 1: Edge computing service architecture for IoT-based applications.  
The assumption is used in our model construction and performance evaluation. This assumption is rational since the data transmitted from the user end to the edge network usually need to be processed--data irrelevant to calculation is not transferred for efficiency reasons. The scale factor between data size and computation amount is set as \(l\).