## 3 System Model
### Prediction Model  
#### 3.5.1 Task Prediction Model  
In computational offloading systems, a decision process is required after task generation, and there will be a certain time delay from task generation to give a decision. Although task generation is a dynamic and random process, considering the long-term nature of the task, it will have a strong correlation with time.  
Therefore, based on the history of user devices, we can predict the tasks that will be generated in the next network time slot of user devices, and load the service packages in advance before the real tasks are coming (e.g., allocate the best computation nodes in advance through the decision model). For example, for any MD with task data \(D_{t}\in\{D_{1},D_{2},\cdots D_{T}\}\), taking \(D_{1},D_{2},\cdots D_{t-1}\) as the input sequence, into the trained LSTM prediction model to predict the next time slot task data \(D_{t}^{\sim}\). Therefore, the optimization goal of the prediction model is \(|D_{t}-D_{t}^{\sim}|\propto 0\), i.e., to improve the accuracy of task data feature prediction as much as possible.  
As shown in Figure 2, in a real scenario, we can predict the information of the future task by the prediction model, and determine the decision and allocate computing resources for the task. When the real task arrives, if the error between the real task and the predicted task is within the allowed threshold, the task is directly offloaded and computed according to the assigned decision information. Otherwise, the offloading decision is given using the decision model and the information of the new task is added to the historical data as training samples. By training the LSTM network, the weights and biases of each gate in the network are updated to improve the accuracy of the prediction model.  
\begin{table}
\begin{tabular}{c c} \hline
**Notation** & **Definition** \\ \hline \(\mathcal{M}\) & Set of terminal layer devices \\ \(\mathcal{N}\) & Set of edge layer servers \\ \(\mathcal{T}\) & Set of time slots for task generation \\ \(\lambda_{m}(t)\) & Task generated by terminal device \(m\) at time slot \(t\) \\ \(\lambda_{m,n}(t)\) & Task of device \(m\) are offloaded to edge node \(n\) \\ \(x_{m}^{t}\) & Device \(m\) offloading its task in time slot \(t\) while \(x_{m}^{t}=1\), Otherwise, \(x_{m}^{t}=0\) \\ \(y_{m,n}^{t}\) & The task is offloaded to the edge server while \(y_{m,n}^{t}=1\), Otherwise, \(y_{m,n}^{t}=0\) \\ \(\tau_{m,\text{wait}}^{t}\) & Terminal layer device waiting delay in the task queue \\ \(\tau_{m,\text{ee}}^{t}\) & Terminal layer device processing delay in the computation queue \\ \(\tau_{m,\text{MD}}^{t}\) & Total time delay of the task generated by terminal devices \(m\) at time slot \(t\) \\ \(P_{m,\text{ee}}^{\text{wait}}\) & Processing power of the task generated by terminal devices \(m\) at time slot \(t\) \\ \(P_{m}^{\text{wait}}\) & Waiting power of the terminal devices \(m\) \\ \(P_{m}^{\text{device}}\) & Energy consumption of the device \(m\) \\ \(\tau_{m,n}^{t}\), ee & Processing delay in the computation queue of the Edge server \(n\) \\ \(\tau_{m,nEC}^{t}\) & Total time delay of the edge server \(n\) \\ \(P_{m,n}^{\text{train}}\) & Transmission power of the device \(m\) offload to edge server \(n\) \\ \(P_{m,n}^{\text{ee}}\) & Transmission delay of the device \(m\) offload to edge server \(n\) \\ \(P_{m,n}^{\text{ee}}\) & Processing power of the edge server \(n\) \\ \(P_{m,n}^{\text{edge}}\) & Energy consumption of the edge sever \(n\) \\ \(\alpha,\beta\) & The trade off weight between energy consumption and delay in the system cost \\ \hline \end{tabular}
\end{table}
Table 1: Table of main notations.