# Intelligent Computation Offloading Based on Digital Twin-Enabled 6G Industrial IoT
## 3 System Model
### Computation Offloading Model  
The first step in creating a DT is to develop an accurate and comprehensive virtual model from the collected field data. After the DT is created, the DT model can be updated in real time with the data collected by the industrial equipment through the edge servers, and the decisions in the DT can be mapped to the physical entity.  
A directed graph \(G(\mathcal{N},\mathcal{L})\) is used to represent the physical device network, where \(\mathcal{N}=\{1,2,\cdots,n,\cdots,N\}\) is the set of physical devices (including smart machines, switches or access points), and \(\mathcal{L}\) is the set of links. Accordingly, the virtual topology in the DT model can be represented as \(G^{DT}(\mathcal{N}^{DT},\mathcal{L}^{DT})\). Let \(\mathcal{F}\) be the set of tasks in the network, where \(\mathcal{F}=\{1,2,\cdots,f,\cdots,F\}\) and \(F\) is the total number of tasks. A task \(f\in\mathcal{F}\) is defined as a quadruple \(f\triangleq\left\{d_{f},\omega_{f},\tau_{f},n\right\}\), where \(d_{f}\) represents the computational requirement to process the task, \(\omega_{f}\) represents the transmitted data size of task \(f\), \(\tau_{f}\) is the maximum delay bound of task \(f\), \(n\in\mathcal{N}\) is the location of the task. A DT model refers to a network consisting of DT nodes (i.e., virtualized physical nodes) where the packets forwarding delay in transmission and processing delay on edge servers are computable. The centralized computation offloading scheme provides deterministic and easily computable latency services. In the DT model, the delay caused by forwarding packets consists of the following parts:  
1. Queuing delay, which is the waiting time in the output port queue due to the accumulation of packets generated by different applications to the same output port.
2. Transmission delay, which is the time consumed to put the packet on the wireless link and send it from the source to the destination.
3. Update delay, which refers to the delay caused by synchronizing heterogeneous physical devices when updating the global DT model.
4. Processing delay, which is the time consumption associated with completing a computation task and can be measured in terms of the number of CPU cycles.  
In 6G scenarios, physical devices are mobile and may be in the coverage range of multiple APs. Computation offloading between physical devices and edge servers is realized through wireless channels. To simplify the research, we only consider the uplink transmissions without backhaul, and do not consider communication interference between devices. Some advanced industrial applications, such as digitalized operations and predictive maintenance, require interconnection and cooperation of IIoT devices. When these tasks are offloaded to the edge server, the local time will deviate from the global time due to the heterogeneity of the physical devices. In order to ensure coherent data processing on digital twins, they need offset compensation before processing. For an IIoT device, the appropriate edge server will be selected to offload the task based on a set of criteria, including its physical location, the computing capabilities of the edge server, and the channel state information. As illustrated in Figure 2, more communication resources can be allocated to device 2 to mitigate the imbalance in communication performance. Servers with more computing resources can also be allocated to the computationally-heavy device 3 to reduce its processing delay.