## 2 Materials and Methods
### Preliminary Knowledge
#### 2.1.2 Introduction of Model Components  
* Transmission model  
This paper assumes that in a MEC network, the server uses the orthogonal frequency division multiple access (OFDMA) protocol to allocate network resources. Here, the number of users is M, the uplink and downlink channels have N independent resources and every channel has an equal bandwidth W. Thus, the transmission capacity provided by uplink resource i and downlink resource j between user device m and the base station can be expressed as follows:  
\[\mathrm{U_{m,i}(u_{m,i},v_{m,i})}=u_{m,i}W\log_{2}\left(1+\frac{v_{m,i}h_{m,i} }{\sigma^{2}}\right), \tag{1}\]  
\[\mathrm{D_{m,j}(d_{m,j},\ w_{m,j})}=d_{m,j}W\log_{2}\left(1+\frac{w_{m,j}h_{m, j}}{\sigma^{2}}\right), \tag{2}\]  
where \(u_{m,i}\) and \(d_{m,j}\), respectively, indicate whether resources i and j are allocated to user m, with 1 and 0 representing allocated/non-allocated status, and \(v_{m,i}\) and \(w_{m,j}\) represent the transmission power of uplink resource i and downlink resource j. In order to simplify the model and the simulation of a practical scenario, power allocation is not continuous here. It is divided into G gears for selection. In addition, \(h_{m,i}\) and \(h_{m,j}\) represent the gain on the channels. This model operates under two assumptions. Firstly, the channel gain during edge computing only changes between adjacent time slots. The denominator \(\sigma^{2}\) of the logarithm term is the variance of additive white Gaussian noise. In addition, the channel is quasi-static in each millisecond time slot because of the strict delay requirement in the MEC network. After obtaining the transmission capacity provided by each channel from Formulas (1) and (2), the total transmission capacity of each user can be obtained using the following equations:  
\[\mathrm{U_{m}}\left(\overrightarrow{u_{m}},\overrightarrow{v_{m}}\right)= \sum_{i=1}^{N}U_{m,i}(u_{m,i},v_{m,i}), \tag{3}\]  
\[\mathrm{D_{m}}\left(\overrightarrow{d_{m}},\overrightarrow{w_{m}}\right)= \sum_{j=1}^{N}D_{m,j}\left(d_{m,j},w_{m,j}\right), \tag{4}\]  
In these formulas, the four vectors \(u_{m}\), \(v_{m}\), \(d_{m}\) and \(w_{m}\) are the vectors of the uplink resource allocation, uplink power allocation, downlink resource allocation and downlinkpower allocation of user m, respectively. Taking um as an example, \(\mathrm{u_{m}}=[\mathrm{u_{m,1}}\ \mathrm{u_{m,2}}\ \ldots\ \mathrm{u_{m,N}}]\); others are the same. * Delay model  
In this model, based on the conditions of the network frame, a necessary assumption is that all users serially, independently and almost synchronously send their requests. Within each time slot, each user requests only one task with no mutual interference. Thus, the delay of the three kinds of tasks can be modeled as follows:  
For a downlink task, the user sends a request for content stored in the network. After receiving the content, the MEC server performs pre-processing, such as encoding and compression, on the corresponding data. Finally, the server will transmit this content to the user via allocated downlink channels. In this task, the user's request is generally very short; thus, the model does not have to consider its related items. The delay can be expressed as:  
\[\mathrm{t_{\varphi=1,m}}\bigg{(}\overrightarrow{\mathrm{d_{m}}},\overrightarrow {\mathrm{w_{m}}}\bigg{)}=\frac{\omega_{\varphi=1,m}\mathrm{B_{m}}}{\mathrm{F_{ s}}}+\frac{\mathrm{cB_{m}}}{\mathrm{D_{m}}\bigg{(}\overrightarrow{\mathrm{d_{m}}}, \overrightarrow{\mathrm{w_{m}}}\bigg{)}}, \tag{5}\]  
where \(\mathrm{F_{s}}\) is the CPU frequency of the MEC server; \(\omega_{\varphi=1,m}\) indicates the number of CPU cycles required by the MEC server to compute this kind of task (per bit); \(\mathrm{B_{m}}\) represents the task bytes requested by user m; and c is the compression ratio of the content after pre-processing. The terms on the right-hand side represent the computation time of the server processing the task and the time required for the downlink transmission.