# PECSA: Practical Edge Computing Service Architecture Applicable to Adaptive IoT-Based Applications
## 4 Materials and Methods
### Three Basic Service Types and the Associated Cost Evaluation Schemes
#### 4.2.2 The Minimum Price Evaluation  
Generally, a service provider needs to pay for equipment leasing, broadband connection, and information security measures during the business operation period. Thus, the total service price \(S_{P}\) can be generally computed by the service provider using the following formula:  
\[S_{p}=P_{security}+P_{transmission}+P_{calculation} \tag{14}\]  
where \(P_{security}\) is the price of security measures, e.g., encryption and digital signature. We denote the unit price of node \(i\) on a security operation as \(p_{s}\). Thus, \(P_{security}\) can be calculated as follows:  
\[P_{security}=\sum_{i=1}^{m}p_{s_{i}}\cdot da_{i} \tag{15}\]  
\(P_{transmission}\) is the price of data transmission. In order to attract users, broadband billing models are varied in various countries. The three most popular means are flat rate billing, billing by flow, and billing by time. If the flat rate billing is adopted, the broadband Internet fee is a constant. The transmission price of the 4G network can be calculated as follows:  
\[P_{transmission-1_{4G}}=p_{cs4}, \tag{16}\]  
The transmission price of the 5G network can be denoted as follows:  
\[P_{transmission-1_{5G}}=p_{cs5}, \tag{17}\]  
where \(p_{cs4}/p_{cs5}\) denotes the monthly fee, which is a constant. When the flow charge model is adopted, the broadband price is proportional to the data volume. Moreover, the unit price in the 4G network, which we denote by \(p_{4f}\), is assumed to be different from that in the 5G network, denoted by \(p_{5f}\). The data amounts transmitted by the 4G link and 5G link are denoted by \(da_{4G}\) and \(da_{5G}\), respectively. Then, the transmission price can be calculated as follows:  
\[P_{transmission-2}=p_{4f}\cdot da_{4G}+p_{5f}\cdot da_{5G}, \tag{18}\]  
We ignore the price evaluation of 3G and 2G because of their low rate and low market competitiveness compared with 4G and 5G. Without loss of generality, we assume that the data associated with the \(i\)th subtask, with \(i\in\{1,2,\cdots,F\}\), is transmitted using the 4G link and that the data associated with the \(i\)th subtask, with \(i\in\{F+1,F+2,\cdots,m\}\), is transmitted using the 5G link. We can obtain that  
\[P_{transmission-2}=p_{4f}\cdot\sum_{i=1}^{F}da_{i}+p_{5f}\cdot\sum_{i=F+1}^{m} da_{i} \tag{19}\]  
The price evaluation of the mixture of the flow charge model and time charge model is easy to obtain by adding the two estimation formulas above; therefore, we omit it for brevity. The above estimation formulas of the transmission price can be merged into a single formula:  
\[P_{transmission} =\gamma\cdot da_{4G}+\delta\cdot da_{5G}+\epsilon \tag{20}\] \[=\gamma\cdot\sum_{i=1}^{F}da_{i}+\delta\cdot\sum_{i=F+1}^{m}da_{i}+\epsilon\]  
where \(\gamma,\delta,\epsilon\geq 0\) are constant coefficients determined by the billing models above. \((\gamma,\delta,\epsilon)=(0,0,p_{c4}/p_{c55})\) if the flat rate billing model is adopted, or \((\gamma,\delta,\epsilon)=(p_{4f},p_{5f},0)\) if the flow charge model is adopted. We denote the unit calculation price of the \(i\)th edge node by \(pc_{i}\), \(i\in\{1,2,\cdots,m\}\). The calculation price of the \(i\)th subtask can be computed as \(pc_{i}\cdot a_{i}/cp_{i}\). Two tasks with the same data size often require different calculation times; therefore, the calculation costs of the two tasks are quite different. In order to better estimate the various costs of edge computing services, such as computation costs, transportation costs, and storage overhead, we must carefully analyze the relationship between the amount of computation and the amount of data. Referring to Assumption 1, we assume that the computation amount is proportional to the data size transported from the users' side to the edge nodes and the scale factor is denoted by \(l\). The scale factor \(l\) varies with the task.