## 3 System Model  
We assume the number of all MTs and MEC-NBS is \(M\) and \(K\), respectively. The \(i\)th (\(i\in\mathcal{M}=\{1,2,\ldots,M\}\)) MT is defined as \(m_{i}\), and \(k\)th (\(k\in\mathcal{K}=\{1,2,\ldots,K\}\)) MEC-NBS is defined as \(n_{k}\). An MT can run multiple mobile applications at the same time, and each application may contain multiple tasks. The number of all types of tasks is assumed to be \(R\), the \(j\)th (\(j\in\mathcal{R}=\{1,2,\ldots,R\}\)) type of tasks is defined as \(r_{j}\). Moreover, the data storage of MEC-BS and \(n_{k}\) is defined as \(d\) and \(d_{k}\) (\(k\in\mathcal{K}\)), respectively. We consider that the request from each MT is a Poisson process, and \(\epsilon_{i}\) represents the request rate of \(m_{i}\), that is, \(\epsilon_{i}\) tasks are generated by \(m_{i}\) per second. The request ratio of \(m_{i}\) to the task \(r_{j}\) is \(p_{i,j}\) (\(p_{i,j}\in[0,1]\)), and the proportion is different for different tasks. Note that \(\sum_{j\in\mathcal{R}}p_{i,j}=1\) because \(p_{i,j}\) actually represents the proportion of \(r_{j}\) in the tasks generated by \(m_{i}\). We assume that the request message length and the response message length are fixed and roughly equal in the offloading signal transmission or data caching transmission among the MT, MEC-BS, MEC-NBS, and C. Each task \(r_{j}\) is profiled by an ordered vector \(<c_{j},v_{j},w_{j},z_{j},q_{j}>\), which is characterized by: (1) \(c_{j}\), the amount of computation needed to complete \(r_{j}\); (2) \(v_{j}\), the size of the offloading request (including necessary description and parameters of \(r_{j}\)) for \(r_{j}\); (3) \(w_{j}\), the size of the offloading response (including the result of \(r_{j}\)'s execution) for \(r_{j}\); (4) \(z_{j}\), the size of the data caching request (including necessary description and parameters of the data required to execute \(r_{j}\)) for \(r_{j}\); (5) \(q_{j}\), the size of the data caching response (including the data required to execute \(r_{j}\)) for \(r_{j}\). The computing task \(r_{j}\) has 2 ways to completing : execute it at C or offload it to MEC stations. If task \(r_{j}\) is determined to execute at C, it will increase the computing load of the mobile cloud and affect the performance of the cloud server. It will also suffer the offloading-signal transmission delay from the MT to the MEC-BS and the MEC-BS to C. If the MEC-BS chooses to offload \(r_{j}\) to MEC stations, it will greatly alleviate the cloud pressure, and MEC stations have a certain degree of computational power, the efficiency of the computing task can also be guaranteed, but, at the same time, it may suffer from the time consumption caused by data request and response transmission between MEC stations and C. If the MEC-BS chooses to cache the data at MEC stations in advance, it will avoid the time consumption of the offloading-signal and data-signal transmission. However, data caching will take time, and MEC stations have limited storage space. When \(r_{j}\) is offloaded to MEC stations, it can be executed at MEC-BS, or be further offloaded to a MEC-NBS( the offloading probability of all the \(n_{k}\) is equal). For task \(r_{j}\), we define the offloading probability from \(m_{i}\) to MEC-BS as \(\alpha_{i,j}|(i\in\mathcal{M},\ j\in\mathcal{R})\) and from \(m_{i}\) to \(n_{k}\) as \(\beta_{i,j,k}|(i\in\mathcal{M},\ j\in\mathcal{R},\ k\in\mathcal{K})\), so that the offloading probability from \(m_{i}\) to C is \((1-\alpha_{i,j}-\sum_{k\in\mathcal{K}}\beta_{i,j,k})\). Moreover, we define the caching probability from C to MEC-BS as \(\sigma_{j}|(j\in\mathcal{R})\), from C to MEC-NBS as \(\pi_{j,k}|(j\in\mathcal{R},\ k\in\mathcal{K})\). There are many symbols used by our system model, so we add notions to distinguish them. \"O\" means \"Offloading\", \"D\" means \"Data caching\", and \"2\" means \"to\". For example, \"ONBS2 BS\" expresses the symbol is related to the issue \"computation Offloading from a MEC-NBS to the MEC-BS\".