## 3 RT-IoT System Model  
The primary driver towards RT-IoT is the controlling and monitoring of real-time embedded devices via the Internet. It enables real-time systems to be employed in a more broader domain; however, it also poses additional risks of various challenges due to the remote controlling and dependence on networks. The principal features for a typical RT-IoT are the intersection of the features of traditional real-time systems and IoT systems. In addition to that, several features are highlighted to be more distinguished for RT-IoT systems [22]:  
1. **A system of input tasks of periodic and event-driven nature:** RT-IoT systems are comprised of tasks that are of periodic or event-driven nature. Periodic tasks are those tasks that repeat themselves after a specific interval called the period. For example, in a smart industry, a sensor task, which monitors the conveyor belt is a periodic task. Event-driven tasks are executed only on the occurrence of specific events. For instance, in a smart parking situation, a task that monitors the arrival of cars can only be triggered once a vehicle arrives. 2. **Real-time task scheduling model:** Most RT-IoT applications use the Liu and Layland model for the design of tasks and thus scheduling algorithms that are based on the theory can be applied here with some minor adjustments. 3. **Worst-case analysis:** In RT-IoT systems, worst-case bounds must be known to all control nodes, and each control node must consider it before any scheduling takes place. 4. **Recursion:** Many software programs allow recursion to minimise lines of codes, but it is a slow operation, and, thus, in RT-IoT systems, it is either not allowed, or if allowed then it should be within some static pre-defined bounds. 5. **Communication flow with mixed priorities:** In RT-IoT systems, tasks are of mixed priorities. Therefore, the operating nodes must know the priority of the task and the capability of a communication medium. For example, control commands in a safety-systems like avionics are highly critical tasks. Similarly, some tasks are of a lower priority, and some level of tolerance in delays and packet drops are not going to affect the system outcome. 6. **Hard and Soft real-time timing constraint:** Many RT-IoT systems also exhibit hard and soft real-time behaviour as in traditional real-time systems. 7. **Constraint Power and Memory:** In RT-IoT systems, the devices often have limited capabilities regarding power and memory, and thus special care should be given to designing tasks and selecting scheduling algorithms. Figure 1 illustrates the black box representation of the proposed system model. The primary purpose is to take IoT task sets and resource profiles and tune them in such a way to produce optimal jobs that consume fewer clock cycles and hence less power. Inputs to the proposed system are resource profiles and task sets. The output is the optimal task sets which can be passed to the IoT scheduler. The scheduler schedules tasks on IoT edge-nodes. The design of RT-IoT systems should be modelled in such a way that it must consume constrained resources wisely. Power and energy are among the constrained resources that play a vital role in the design of tasks and scheduling strategies. The average power \(P\) consumed by a microprocessor is given by Equation (1):  
\[P=V_{cc}xI, \tag{1}\]  
where \(V_{cc}\) is the supply voltage and \(I\) is the average current. Similarly, the power is directly proportional to the energy consumption of an input task. Therefore, the average energy \(E\) is given by Equation (2):  
\[E=PxT, \tag{2}\]  
where P is the average power and T is the execution time of the input task. The execution time \(T\) is a function of clock cycles consumed by input program and is given by Equation (3):  
\[T=N_{cc}xC_{p}, \tag{3}\]  
where \(N_{cc}\) is the number of clock cycles and \(C_{p}\) is the period of clock cycles.