## 3 Preliminaries: Network Model and Problem Definition
### Offloading Decision and Resource Allocation Problem Modeling  
The cost of computing task in this paper can be expressed as follows:  
\[Z\left(x_{t}^{i}\right)=\varphi_{1}\frac{T_{i,t}^{\text{total}}}{\tau_{i,t}}+ \varphi_{2}\frac{E_{i,t}^{\text{total}}}{\mu_{1}\lambda_{i,t}\rho_{i,t}}+drop_{ i,t} \tag{11}\]  
where \(T_{i,t}^{\text{total}}\) is the total processing delay of task \(x_{t}^{i}\) and \(E_{i,t}^{\text{total}}\) is the total energy consumption of \(x_{t}^{i}\). \(\rho_{i,t}\) is the calculated density of \(x_{t}^{i}\). \(\lambda_{i,t}\) is the amount of input data for \(x_{t}^{i}\). \(\tau_{i,t}\) is the upper limit of the tolerable delay of \(x_{t}^{i}\). The constant \(\mu_{1}\) is the scaling factor, so that \(0<\frac{E_{i,t}^{\text{total}}}{\mu_{1}\lambda_{i,t}\rho_{i,t}}\leq 1\). In order to achieve the effect of normalization, variable \(drop_{i,t}\) is defined as follows:  
\[drop_{i,t}=\left\{ \begin{array}{ll}1\,,\,\,x_{t}^{i}\text{ {is discarded}}\\ 0\,,\,\,x_{t}^{i}\text{ completes the calculation}\end{array} \right. \tag{12}\]  
For each task in this paper, \(\varphi\) is set as follows. The optimization target for high-priority tasks does not include energy consumption, so there is \(\varphi_{2}=0\) for high-priority tasks. The optimization target for critical mission only considers the drop rate, so there is \(\varphi_{1}=\varphi_{2}=0\) for critical missions. The optimization goal of low-priority tasks does not include delay, so there is \(\varphi_{1}=0\) for low-priority tasks. The optimization of routine tasks needs to comprehensively consider the delay, energy consumption, and drop rate, so there is \(\varphi_{1}=\varphi_{2}=1\) for routine tasks. The goal of this paper is to optimize the task offloading decision of each decision-making device and the bandwidth allocation decision of the server to the user equipment, so as to minimize the sum of all system task costs in a long period of time. Thereby reducing network delay, drop rate and user energy consumption. The above optimization problem can be modeled as follows:  
\[ \begin{array}{l}\underset{D,\,\#\,\#\,\#\,\#\,\#\,}{min}\left[\sum\limits _{1\leq l\leq m}\sum\limits_{t\in T_{i}^{\text{task}}}Z\left(x_{t}^{i}\right) \right]\\ \text{s. t. C1}:D_{i,t}^{k}\in\{0,1\}\,\forall i\leq m,\ \forall t\in T_{i}^{\text{task}} \\ \text{C2}:\sum\limits_{k=0}^{n+2}D_{i,t}^{k}=1\,,\ \forall i\leq m,\ \forall t\in T_{i}^{\text{task}} \\ \text{C3}:ff_{i,t}^{\text{t}}\in[0,1],x_{t}^{i}\text{ is calculated in }en_{j},\ \forall i\leq m,\ \forall t\in T_{i}^{\text{task}} \\ \text{C4}:qf_{i,t}\in[0,1],\ \forall i\leq m,\ \forall t\in T_{i}^{\text{task}} \\ \text{C5}:bf_{j,t}\in[0,1],\ \text{communication between }ud_{i}\text{ and }en_{j},\ \forall i\leq m,\ \forall j\leq n\\ \text{C6}:q_{i}^{\text{cache}}+q_{i}^{\text{comp}}+q_{i}^{\text{tran}}\leq R _{i}^{\text{t}}\,\ \forall i\leq m\\ \text{C7}:q_{i}^{\text{en-comp}}+q_{i}^{\text{en-tran}}\leq R^{\text{en}}\,\ \forall j\leq n\\ \text{C8}:T_{i,t}^{\text{total}}\leq\tau_{i,t}\,,\ \forall i\leq m,\ \forall t\in T_{i}^{\text{task}} \\ \text{C9}:d_{i,j}\leq r\,\text{ {communication between }}ud_{i}\text{ and }en_{j},\ \forall i\leq m,\ \forall j\leq n \\ \end{array}  \tag{13}\]  
where \(D\) is the set of offloading decision vectors \(D_{i,t}\) corresponding to all tasks. \(ff\) is the set of weights \(ff_{i,t}^{j}\) assigned to the computing power corresponding to all tasks. \(gf\) is the set of queue priority weights corresponding to all tasks. \(bf\) is the set of queue priority weights \(bf_{i,t}\) for all users. \(T_{i,t}^{\text{total}}\) is the total delay for task processing. Setting \(T_{i}^{\text{task}}\) contains all the moments that generate tasks within the system runtime. Constraint C1 indicates that each task has only two states for offloading the target device: completing offloading and no offloading. Constraint C2 indicates that each task has and only has one offloading decision result.