## 4 The Scheduler Architecture
### Queue Management System
#### 4.1.2 Optimal Usage and Dropping (OUD) Scheduling Technique  
In this segment, a scheduling technique called the Optimal Usage and Dropping technique (OUD) is proposed and presented. This technique incorporates a schedule and drop mechanism into the system. During scheduling, the following approach is followed. Upon arrival, the technique places the new task into the queue while maintaining the predefined order. If placing a task in the queue results in the task missing its deadline, the technique drops the data packet with the lowest throughput ratio \(\left(\frac{p_{i}}{s_{i}}\right)\) in the queue. The task that should be eventually selected is one that possesses the highest throughput ratio in as much as it will not cause the succeeding task to miss its deadline. The complexity of adding a new job to the queue is made straightforward by the OUD technique. The technique employs its dropping approach to maintain the queue by using \(I_{t_{i}}^{O}=\frac{R_{min}}{S_{min}}\), where \(S_{min}\leq S_{i}\leq S_{max}\) is the processing time required by \(A_{i}\), and \(R_{min}\leq R_{i}\leq R_{max}\) is the deadline of \(A_{i}\). Time is measured from the arrival time to the beginning of the service. The symbol \(I_{t}^{O}\) is employed to introduce the OUD parameter with the assumption that \(h(A_{i},\ t)\) and \(y(A_{i},\ t)\) are the functions that describe the predefined order of \(A_{i}\) in the queue potential at time \(t\).  
* \(h(A_{i},\ t)\) is the index of task \(A_{i}\) in \(I_{t}^{O}\). \(h(A_{i},\ t)=1\) indicates that \(A_{i}\) is at the front of the queue.
* \(y(A_{i},\ t):=\sum_{A_{k:k}(A_{k},\ t)\subset h(A_{k},\ t)}s_{i}\) is the time a task is put on hold before processing with the assumption that no new task arrives until processing starts.  
Algorithm 3 below describes how the OUD technique manages a task arrival. The new task is taken as \(A_{i}\), which is introduced to the queue \(I_{t_{i-1}}^{O}\) at time a \(t_{i}\).  
It is worth noting that the values of \(h(A_{k},t_{i})\) and \(y(A_{k},t_{i})\) change after introducing a new task \(A_{i}\) at time \(t_{i}\) as follows. If \(h(A_{k},t_{i})>h(A_{i},t_{i})\), then \(y(A_{k},t_{i})\)\(\Rightarrow\)\(y(A_{k},t_{i-1})+s_{i}\) and \(h(A_{k},t_{i})=h(A_{k},t_{i-1})+1\); otherwise, no change exists.  
```
1: Arrival of a new task \((A_{i})\)
2: If \(I_{t}^{O}=\varnothing\) and the server is not busy, then \(A_{i}\) is processed and return to 1.
3:\(A_{i}\) added to the queue using the order of shortest time of expiry. If there exist task with the same time of expiry, order is taken in descending manner of their rewards.
4: Locate the first task (\(A_{k}\)) that will miss its deadline as a result of the inserting \(A_{i}\) into the queue \((h(A_{k},\ t)\geq h(A_{i},\ t))\) \(h_{k}\)\(\Rightarrow\)\(\left\{\begin{aligned} & q_{i,s(A_{i},\ t)}\\ &\infty\end{aligned}\right.\begin{aligned} &\min_{q_{i,s(A_{i},\ t)}}\left(h \left(A_{j},\ t_{i}\right)\right)&&\exists j:q_{j}\leq y(A_{i}, \ t)\\ &\infty\end{aligned}\)
5: If \(h_{k}\):=\(\infty\) then return to 1.
6: Locate the task \(A_{r}\) that has the lowest reward per servicing time. If there exist several, select the one that has the shortest time of expiry. \(A_{r}\)\(\Rightarrow\)\(\min_{h(A_{j},t_{i})\leq h_{k}}\left(\frac{p_{i}}{s_{i}}\right)\)
7: Drop task \(A_{r}\) from queue
8: Go to 1
```  
**Algorithm 3** OUD Scheduling  
Table 1 below shows the summary of different scheduling algorithms, the type of workflow scheduling employed, and the tools and objectives of the algorithms.  
\begin{table}
\begin{tabular}{c c c c c} \hline
**Reference** & **Algorithm Employed** & **Complexity** & **Description** & **Environment** \\ \hline
[20,22,23] & Early Deadline First Scheduling Algorithm & Simple scheduling algorithm & Prioritize task scheduling by searching for the queue for the job closest to its deadline & Various Systems including smart grid environment \\ \hline \end{tabular}
\end{table}
Table 1: Scheduling Algorithms employed in Different Environments.