# Intelligent Computation Offloading Based on Digital Twin-Enabled 6G Industrial IoT
## 3 System Model
### Problem Formulation
The uplink transmission rate satisfies [PERSON]'s theorem and is related to node transmission power, wireless interference, and environmental bandwidth. Here, we consider device-to-device communication based on the shortest distance broadcast channel. The wireless communication data rate between two devices can be expressed as  
\[R_{n,i,f}=y_{i,f}^{k}.b^{k}log_{2}(1+\frac{p_{n}^{k}h_{n,i}^{k}r_{n,i}^{-\alpha }}{\sigma^{2}+I}) \tag{3}\]  
We define a binary variable \(y_{i,f}^{k}\) to represent the channel allocation status; \(y_{i,f}^{k}=\{0,1\}\) is equal to 1 if channel \(k\) is assigned to edge server \(i\) to transmit task \(f\), otherwise, it equals 0. \(b^{k}\) represents the bandwidth allocated to the \(k\) subchannel. The channel gain is denoted as \(h_{n,i}^{k}\), which can be considered to be constant, and varies with each update. \(p_{n}^{k}\) is the transmitted power of physical device \(n\) and \(\sigma^{2}\) means the power of additive Gaussian white noise. \(r_{n,i}\) means the communication distance between the sender and the receiver. \(\alpha\) is the path loss coefficient. \(I=\sum_{n^{\prime},i^{\prime}\in\mathcal{N}\setminus\{n,i\}}p_{n^{\prime},i}^{ k}h_{n^{\prime},i^{\prime}}^{k}r_{n^{\prime},i^{\prime}}^{-\alpha}\) is the communication interference between other physical devices and edge servers. Thus, we can calculate the average transmission delay as  
\[D_{n,i,f}^{trans}=\frac{\omega_{f}}{R_{n,i,f}} \tag{4}\]  
When the task \(f\) arrives at the edge server where the task is to be offloaded, it has to wait for the DT to coordinate it. We consider a global time scale, as shown by the dotted lines in Figure 2, and this global clock is updated periodically with update intervals \(\tau\). Tasks waiting to be processed by the edge server enter the DT's processing queue in the latest update:  
\[D_{n,i,f}^{update}=T_{G}(\tau)-t_{n,i,f}^{arr}+t_{i,f}^{ser} \tag{5}\]  
where \(T_{G}(\tau)\) is the global clock at time \(\tau\), \(t_{n,i,f}^{arr}\) denotes the time when the task \(f\) generated from physical device \(n\) arrives at the receiving port of edge server \(i\), and \(t_{i,f}^{ser}\) represents the start time of task processing by server \(i\). \(T_{G}\) is updated periodically, so choosing different edge servers brings different offset compensations and service queue lengths. Finally, the processing time of the task by the edge server is expressed as  
\[D_{n,i,f}^{pro}=\frac{d_{f}}{C_{i}} \tag{6}\]  
where \(C_{i}\) is the CPU cycle frequency of the edge server \(i\). Therefore, the total end-to-end delay of the task \(f\) generated by physical device \(n\) can be expressed as  
\[D_{n,i,f}^{total}=D_{n,i,f}^{que}+D_{n,i,f}^{trans}+D_{n,i,f}^{update}+D_{n,i, f}^{pro} \tag{7}\]Now, we intend to minimize the end-to-end delay by formalizing it as an optimization problem. The constraints of the optimization problem are shown in (9)-(18) according to the order of appearance of the variables. \[\text{P}:\text{ minimize }\sum_{f=1}^{F}D_{n,j,f}^{total} \tag{8}\]  
\[\text{s.t. }\sum_{i\in\mathcal{N}}x_{i,f}=1,\text{ }\forall f\in\mathcal{F} \tag{9}\]  
Figure 2:0  
Figure 2:1  
Figure 2:2  
Figure 2:3  
Figure 2:4  
Figure 2:5  
Figure 2:6  
Figure 2:7  
Figure 2:8  
Constraint (9) indicates that the computation task can be offloaded to only one edge server. Constraint (10) describes the service intensity of the physical node for task processing in unit time and ensures that it has a steady-state solution. Constraint (11) restricts the queue length on a device \(n\) to not exceed the upper limit of queue resources. Constraint (12) ensures that the allocated bandwidth is non-negative and cannot exceed the bandwidth utilization limit of the network, assuming that there are \(|K|\) subchannels over the whole bandwidth \(B\). Constraints (13) and (14) guarantee that the transmit power and computation data size are non-negative and no more than the limits of their generation nodes.