## 4 Proposed Work  
In an RT-IoT system, the fundamental motivation is to achieve the same accuracy of the jobs within defined timing constraints. An example use case of RT-IoT systems is a patient monitoring system installed in an emergency ward. If the monitoring system is not able to execute tasks on time, it could lead to severe conditions. Table 1 shows some of the IoT tasks along with their description and type in the example use case scenario.  
In this paper, we present a systematic approach to control the admission of such periodic tasks to keep the hyper-period within a certain optimal threshold so that it can guarantee successful execution within their stringent timing constraints. The optimal threshold is selected based on the IoT devices' profile and the number of resources connected to them. The detailed method of finding the optimal threshold will be described in the subsequent subsection. Moreover, the proposed approach allows tasks of any possible period value. The paper has two main parts: first is the selection of optimal threshold and second is the selection of task sets within the optimal threshold. Figure 3 shows the overall flowchart of the proposed approach. The tasks' admission control unit computes the hyper-period of input tasks. The hyper-period is then compared with the optimal threshold. The optimal threshold is selected using Optimization Function and Constraints and using the profile of the connected physical IoT Device.  
\begin{table}
\begin{tabular}{l l l l} \hline \hline
**S.No** & **Task Name** & **Description** & **Type** \\ \hline T1 & SampleInformation & The samples of physical status of the patients is taken & Periodic \\ T2 & VerifyData & Verify sampled data for emergent pattern & Periodic \\ T3 & AnalyzePulse & Analysis of Patients’ pulse & Periodic \\ T4 & AnalyzeBloodPressure & Analysis of Patients’ blood pressure & Periodic \\ T6 & AnalyzeCardio & Analysis of Patients’ cardiogram & Periodic \\ T7 & IsEmergent & Based on the previous tasks, it finds whether the & Periodic \\ T8 & ProduceAlarm & Based on Emergent Situation, alarm is produced & Event-Driven \\ \hline \hline \end{tabular}
\end{table}
Table 1: Real-time tasks related to a Patient Monitoring System in an IoT-based SmartHealth Domain.  
Figure 3: Working flow diagram of the Proposed Approach.  
If the hyper-period falls within the threshold, it is then passed to a real-time scheduler. However, if the hyper-period does not fall within the threshold range, tasks are seeded back to admission control to tune periods of tasks and this process will go on until the desired hyper-period is achieved. The overhead of the algorithm, also called noise of the application, is the number of CPU cycles wasted in finding the optimal set of periods for input tasks. The overhead is incremented after each failed attempt, and the final value of the overhead represents total attempts it made for finding the optimal hyper-period. The threshold is also dynamically adjusted based on IoT resources and IoT devices. The mechanism for the dynamic threshold adjustment is described in the subsequent section. Once the hyper-period is fixed below the optimal threshold, tasks are passed to the Scheduler where any real-time scheduling algorithm is applied. As mentioned in the Introduction section, this method is generic and targets any class of algorithms. This is why the Scheduler can implement any algorithm depending on application context and requirements. In this paper, we use algo1 as RM and algo2 as EDF and is generic for any algorithm algo \(n\). The approach used in this research is adaptive with respect to resource awareness. It is adaptive in a sense that the threshold is all the time adjusted and safe values can be assigned based on the IoT Device's profile and IoT resources connected to it. For instance, in case a new IoT resource is registered to the IoT device, the system will re-compute the minimum and maximum threshold to cope with the added resource.