# Intelligent Computation Offloading Based on Digital Twin-Enabled 6G Industrial IoT
## 3 System Model
### Problem Formulation  
In this section, we first define a total end-to-end delay for a task and then describe it with mathematical formulations. Our goal is to minimize this total delay while ensuring the maximum delay bound of this task. The important symbols and variables used in this article are shown in Table 2. As described earlier, the end-to-end delay consists of four parts, a queuing delay, transmission delay, synchronization delay, and processing delay. The physical device generates running data and synchronizes it with the corresponding digital twin running on the server. For a physical device \(n\), its digital twin \(DT_{n}\) is modeled in its nearby server, as shown in (1)  
\[DT_{n}=\left\{M_{n},q_{n,f},s_{n},\Delta s_{n}\right\} \tag{1}\]  
The server collects operational data from the physical device and constructs the DT model \(M_{n}\) of the device \(n\). \(q_{n,f}\) represents the quality of service (QoS) requirements to process task \(f\), \(s_{n}\) is the essential state data required to run digital twin applications, and \(\Delta s_{n}\) is the estimated deviation from data updating. \begin{table}
\begin{tabular}{l l} \hline \hline \multicolumn{1}{c}{**Symbol**} & \multicolumn{1}{c}{**Description**} \\ \hline \(G(\mathcal{N},\mathcal{L}),G^{DT}(N^{DT},\mathcal{L}^{DT})\) & Network topology \\ \(DT_{n}\) & The DT model for a physical device \(n\) \\ \(M_{n},q_{n,f},s_{n},\Delta s_{n}\) & DT attribute element of \(n\) to process task \(f\): DT model, QoS requirements, essential state, deviation \\ \(\mathcal{F}=\{1,2,\cdots,f,\cdots,F\}\) & The set of tasks \\ \(d_{f},\omega_{f},\tau_{f}\) & Task attribute element of task \(f\): computation requirement, transmitted data size, maximum delay bound \\ \(\mathcal{N}=\{1,2,\cdots,n,\cdots,N\}\) & The set of nodes in the network \\ \(\mu_{n,f}\) & Queue parameter \\ \(b_{k}^{\prime},P_{n,i}^{k},b_{n,i}^{\prime},\sigma^{2},r_{n,i,i}\) & Wireless communication parameters \\ \(L_{n}^{\prime},P_{n}^{\prime},D_{n}^{\prime\prime},C_{n}^{\prime\prime}\) & Resource upper limits for various nodes \\ \(T_{G}\) & Environmental bandwidth in DT model \\ \(T_{G}\) & DT global clock \\ \(t_{n,i,f}^{\prime\prime}\) & Task arrival time \\ \(t_{i,f}^{\mathrm{s}\prime\prime}\) & Processing start time \\ \(x_{i,f},y_{i,f}^{\prime}\) & Boolean variable \\ \(D_{n,i,f}^{\mathrm{t}\prime\prime},D_{n,i,f}^{\mathrm{t}\prime\prime}\) & The composition of total end-to-end delay \\ \((\mathcal{S},\mathcal{A},\mathcal{P},\mathcal{R},\mathcal{V})\) & MDP attribute element: state, action, transition matrix, reward, discount factor \\ \(c(t),p(t),b(t)\) & Distribution of network resources at the current time \\ \(\pi\) & Deterministic policy \\ \(\mu,\mu^{\prime}\) & Parameters of the Actor network \\ \(\theta,\theta^{\prime}\) & Parameters of the Critic network \\ \(Q_{\theta}(s_{n},a_{n})\) & Maximum Q-value \\ \(\rho\) & A small step factor \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Explanation of symbols and variables. Figure 2: An illustration of computation offloading processes. For simplicity, we assume that there is only one queue on the output port of one AP. We use the queuing theory to model the queuing delay as an M/M/1 queuing system. We define a binary variable \(x_{i,f}\) to represent edge server \(i\in\mathcal{N}\) that is selected to offload the computation task of \(f\); \(x_{i,f}=\{0,1\}\) is equal to 1 if task \(f\) is offloaded to edge server \(i\), otherwise, it equals 0. For a task \(f\), its queuing delay is denoted as:  
\[D_{n,j,f}^{que}=x_{i,f}.\frac{1}{\mu_{n}-\lambda_{f}} \tag{2}\]  
Here, the arrival time intervals of task \(f\) obeys a negative exponential distribution of with parameter \(\lambda_{f}\), and the node's processing time for the task also has a negative exponential distribution with parameter \(\mu_{n}\). The transmission delay is closely related to the uplink rate, which is affected by the amount of traffic and the transmission distance.