## 3 Cross-Layer Controller Tasking Scheme
### IIoT System Setup  
The IIoT system is defined using two phases, namely the task grouping assignment and cross-layer control. The task grouping assignment is responsible for gathering similar tasks for completion, whereas cross-layer control administers dissimilar tasks, from which the re-tasking is scheduled inside and outside the group. The task grouping assignment communicates with a set of edge devices/machinery symbolized as \(\mathit{Ed}=\{1,2,\ldots n\}\); these edge devices are capable of allocating and processing tasks from all the industrial \begin{table}
\begin{tabular}{c c c c} \hline
**Symbol** & **Description** & **Symbol** & **Description** \\ \hline \(\mathit{Ed}\) & Edge Devices & \(\mathit{TM}_{group}\) & Completion Time of a Group \\ \(N\) & Tasks & \(\dalC_{\mathit{Lyc}}\) & Cross-Layer Controls \\ \(\mathit{TM}\) & Time Slot & \(\mathit{R}_{n}\) & Reputation Factor \\ \(\mathit{Fgd}\) & Tasked \(\mathit{Ed}\) & \(\in_{o}\) & Operations/Layer \\ \(\mu_{G}\) & Task Group & \(\theta_{o}\) & Computed \(\dalC_{\mathit{Lyc}}\) \\ \(\mathit{fal}_{\mathit{Lyc}}\) & False Group & \(\exists\) & Mapping/Assignment Rate \\ \(\mathit{fail}_{\mathit{ctrl}}\) & Failed Controls & \(\mathit{TAE}_{r}\) & Task Acceptance Error \\ \(\Delta\) & Layers & \(\mathbb{R}\) & Range of Assigned and Re-tasked \\ \(\mathbb{C}_{\mathit{task}}\) & Sequence of Task Allocation & \(\dalC_{\mathit{Lyc}}\) & Completed Tasks \\ \(\mathbb{C}_{\mathit{tsd}}\) & Distribution Count & \(\mathit{Task}_{\mathit{roll}}\) & Task Volume \\ \(\mathit{Task}_{\mathit{pi}}\) & Prolonged Time & & \\ \hline \end{tabular}
\end{table} 
Table 1: Symbols and descriptions. Figure 2: Functions of CLCTS. layers of smart industry. The variable \(Task=\{1,2,\ldots N\}\) indicates the number of tasks in different time intervals \(TM=\{1,2,\ldots i\}\). Assume that \(Fgd\) shows the tasked devices that are used in the smart industry layers. Based on the above, the number of task allocations and processing per unit of time is \(\Delta\) such that the task grouping \((\mu_{G})\) is given as  
\[\mu_{G}= \begin{cases}\begin{array}{c}Task_{N}\cdot\Delta\cdot i,\ \ \forall\ Task_{N}\in\ TM,\ if\ Fgd=0\\ \end{array}\\ \end{cases}  \tag{1}\]  
Such that  
\[Task_{N}::TM=\sum_{i=1}^{Task_{N}}\Delta_{i} \tag{2}\]  
and  
\[(Task_{N},Fgd)::TM=\sum_{i=1}^{n}\Delta_{i}-\mathit{fal}_{\mathit{tkg}}{\sum_{ i=1}^{Fgd}}\Delta_{i} \tag{3}\]  
where  
\[\mathit{fal}_{\mathit{tkg}}=\frac{\mathit{fail}_{\mathit{ctrl}}}{\mathit{Task }_{N}+\Delta} \tag{4}\]  
From Equations (1)-(4) above, the variables \(\mathit{fal}_{\mathit{tkg}}\) and \(\mathit{fail}_{\mathit{ctrl}}\) represent the false task grouping and failed cross-layer controller in any industrial layer. In the above equation, \(\mathit{Task}_{N}::TM\) and \((Task_{N},Fgd)::TM\) illustrates the mapping of all industrial layers \(\Delta\) communicated with the edge devices in different time intervals \(TM\). In Algorithm 1, the task grouping process is presented. ```
Inputs : N, Ed, TM Step 1 : Initialize controllers connected to Ed Step 2 : for \(i=1\) to TM loop Step 3 : Check if \(F_{\mathrm{gd}}=0\ \forall\mathrm{\text{m}}\in\mathrm{N}\) and \(\mathrm{Task}_{i}=1\) Step 4 : Assign n to controller; \(\mu_{\mathrm{G}}=//initialize\) Step 5 : if\(\Sigma n=\mathrm{N}\) then Step 6 : \(\mu_{\mathrm{G}}=\mathrm{Task}_{N}::\mathrm{TM}::\) controllers Step 7 : Update \(\mathrm{fail}_{\mathrm{ctrl}}=0,\mathrm{Unsk}=\mathrm{C}_{\mathrm{tsk}}+1\) Step 8 : End if Step 9 : Else if \(\mathrm{G}_{\mathrm{gd}}\
eq 0\ \forall\mathrm{\text{m}}\in\mathrm{N}\setminus\mathrm{failed}\) allocations \(\rightarrow\) TAE Step 10 : \(\mathrm{C}_{\mathrm{tsk}}=0;\mathrm{N}=\mathrm{n}-1\) Step 11 : \(\mu_{\mathrm{G}}=\mathrm{Task}_{N}-\mathrm{fail}_{\mathrm{tkg}}\forall\mathrm{ A}\mathrm{e}-\) initialized grouping Step 12 : End if Step 13 : End for
```  
**Algorithm 1** Task Grouping  
In the first phase, the controller nodes with similar tasks are grouped for tasking time to ensure monotonous accomplishments.