Embedded devices are gaining popularity day by day due to the expanded use of Internet of Things applications. However, these embedded devices have limited capabilities concerning power and memory. Thus, the applications need to be tailored in such a way to perform the specified tasks within the constrained resources with the same accuracy. In Real-Time task scheduling, one of the challenging factors is the intelligent modelling of input tasks in such a way that it produces not only logically correct output within the deadline but also consumes minimum CPU power. Algorithms like Rate Monotonic and Earliest Deadline First compute hyper-period of input tasks for periodic repetition of the same set of tasks on CPU. However, at times when the tasks are not adequately modelled, they lead to an enormously high value of hyper-period which result in more CPU cycles and power consumption. Many state-of-the-art solutions are presented in this regard, but the main problem is that they limit tasks from having all possible period values; however, with the vision of Industry 4.0, where most of the tasks will be doing some critical manufacturing activities, it is highly discouraged to prevent them of a certain period. In this paper, we present a resource-aware approach to minimise the hyper-period of input tasks based on device profiles and allows tasks of every possible period value to admit. The proposed work is compared with similar existing techniques, and results indicate significant improvements regarding power consumptions. Abstract: Embedded devices are gaining popularity day by day due to the expanded use of Internet of Things applications. However, these embedded devices have limited capabilities concerning power and memory. Thus, the applications need to be tailored in such a way to perform the specified tasks within the constrained resources with the same accuracy. In Real-Time task scheduling, one of the challenging factors is the intelligent modelling of input tasks in such a way that it produces not only logically correct output within the deadline but also consumes minimum CPU power. Algorithms like Rate Monotonic and Earliest Deadline First compute hyper-period of input tasks for periodic repetition of the same set of tasks on CPU. However, at times when the tasks are not adequately modelled, they lead to an enormously high value of hyper-period which result in more CPU cycles and power consumption. Many state-of-the-art solutions are presented in this regard, but the main problem is that they limit tasks from having all possible period values; however, with the vision of Industry 4.0, where most of the tasks will be doing some critical manufacturing activities, it is highly discouraged to prevent them of a certain period. In this paper, we present a resource-aware approach to minimise the hyper-period of input tasks based on device profiles and allows tasks of every possible period value to admit. The proposed work is compared with similar existing techniques, and results indicate significant improvements regarding power consumptions. Processes 2018, 6, 90 2 of 29 A more recent advancement in the field of IoT is the vision of Industry 4.0. In Germany, this becomes a buzzword since its inception. In this paradigm, the concept of smart factories is introduced by automating the real-time manufacturing process and mass customisation of the products [13] . The convergence of Industry 4.0 and IoT applications gives rise to another field of research known as a Cyber-Physical System (CPS). Real-time IoT and CPS extend the traditional concept of IoT by further interjecting timeliness in every perspective. In reality, real-time IoT and CPS suggest the coupling and coordination between computational and physical entities in real time. These applications are generally closed-loop control applications such as Industry 4.0 and thus demand end-to-end latency thresholds, which can be served by analysing every aspect of the wireless networks, constraint tasks scheduling, real-time cloud service, real-time data analytics, and so on. Consequently, it has become crucial how we can design real-time IoT and CPS that can satisfy the end-to-end real-time performance. Real-time processes are referred to as those whose accuracy of the program not only depends on the logically correct outcome of computations but also depends on the time consumed for the correct outcome [14, 15] . Real-time systems exist in almost in every field, such as command and control systems and process control systems that can be in any domain depending on scenarios. Some other examples of real-time systems are flight control systems, defence systems and space shuttle avionics systems. The main drawback of real-time systems can be their dependence on the coming events' knowledge that increases the cost and makes them inflexible to uncertain situations. In the coming ages, a true real-time system should be a hard real-time system, which meets the design goal of Industry 4.0 and Cyber-Physical Systems [16] . When activities have timing constraints, scheduling them in a such a way to meet their timing constraints is one major problem that comes to mind. Two primary categories of algorithms, namely static priority and dynamic priority, are suggested in the literature for traditional real-time systems. In the more recent past, progress has been made on the analysis of these real-time algorithms under the context of IoT, where the tasks need to be run on physical embedded devices. Research in the scheduling area for embedded systems can be leveraged in the context of IoT applications, but most of the algorithms that run well on general purpose systems do not scale well on these embedded devices because of their limited capabilities in terms of power and energy management. This issue becomes even more challenging for the periodic real-time tasks. Periodic real-time tasks are those tasks that repeat themselves after a certain time interval known as the period. The period plays a pivotal role in the overall system's performance and is regarded as an optimisation variable in many studies. Algorithms like Rate Monotonic (RM) [17] , Earliest Deadline First (EDF) [18] and Deadlock Monotonic (DM) are among the most commonly used scheduling algorithms that also suffer from this period problem. These algorithms use a hyper-period to compute how much CPU clock cycles a given task set consumes and hence the power and energy consumption of these algorithms is dependent solely on the hyper-period of the real-time input tasks. In some scenarios, where periods of input tasks are not adequately modelled. For example, when all periods are prime numbers, they lead to enormously high hyper-periods despite the fact that the algorithm correctly schedules the tasks theoretically, but devices don't have sufficient resources to deal with such a high hyper-period. Some of the conventional approaches to limit the value of a hyper-period are bounded hyper-period and harmonization. In a bounded hyper-period approach [19], a static threshold is fixed, and the hyper-period is limited below this static threshold. In a harmonization approach [20, 21] , though no such threshold is defined, the period values are in harmonic series and thus one value of a period will be the harmonic factor of another. The RM algorithm gives 100% utilization for a harmonic period. Both of these approaches minimise the value of hyper-period to a great extent but have their shortcomings. The static threshold does not scale well for dynamic scenarios like IoT where the resources are not fixed, and new IoT resources can register on the fly. The harmonization approach does not allow tasks to have a period value which could contribute to the high value of the hyper-period. Consequently, it dramatically decreases the tasks' acceptance ratio and, additionally, it is not a scalable approach that is considered a highly important attribute in the context of IoT applications.
Ahmad et al. REF provided a brief comparison of the difference between conventional real-time and contemporary real-time systems.
An Adaptive Approach Based on Resource-Awareness Towards Power-Efficient Real-Time Periodic Task Modeling on Embedded IoT Devices
Processes
Processes
Computer Science