# An Actor-Based Formal Model and Runtime Environment for Resource-Bounded IoT Services +
## 2 Related Work  
Although there are some existing technologies focused on sensor-based systems [5; 6; 7; 9], there is relatively limited foundational work. This is in part because of the lack of precise understanding, specification, and analysis of such systems, and consequently, there is limited platform support for programming them. Compared to the traditional design approach [13; 14; 15], which focuses mainly on an application-specific point design which allows little compelling heritage, the proposed model enables design reuse at different levels of abstraction, including middleware libraries. It creates a stable and unified runtime environment that can be rapidly extended and customized for a range of different sensors. The programming required for offering a new IoT service can be significant if carried out from scratch. However, there is an opportunity created by the similarity in the patterns of communication required for IoT services where contextual data offered by a number of contributors become the basis for the application. We defined this pattern of communication in [11] as multi-origin communication. Multi-origin coordination mechanisms can be provided on a platform over which such a class of IoT applications could be implemented relatively easily. We also interpreted and implemented these mechanisms for the domain of crowd-sourced services [4; 16] by implementing CSSWare, a middleware which provides domain-specific mechanisms to support initiating new services. [PERSON] et al., presented a decentralized IoT edge nanoservice architecture [17] for future gadget-free computing, called nanoEdge. The proposed model enables on-demand service composition based on the hardware and software resources available at the service location. The IoT nodes contribute to nanoservices based on their hardware capacity, storage, security, and privacy services without relying on centralized entities. The nodes with more resources can participate more in service provisioning than those with fewer resources. The architecture of distributed IoT systems involves a large number of end devices connected to gateways. In many cases, both end devices and gateways operate in resource-constrained concurrent environments with limited memory and power, and require real-time capabilities in some scenarios. To accommodate such requirements, small operating systems, called IoT OSs, are specially designed to manage the device's resources efficiently. Over the last decade, several OSs for IoT applications have emerged, such as TinyOS, FreeRTOS, RIOT and Android Things. The runtime environment of IoT applications, which runs over the OS, is responsible for providing all necessary services and support for the execution of applications. There are a few related works in the literature which provide such support, such as PatRICIA [14], RapIoT [15], and Eclipse Kura [18]. PatRICIA is a framework for developing and deploying IoT applications on cloud platforms. However, this framework does not enable IoT applications to utilize the edge of the network because of the lack of code distribution mechanisms. RapIoT is a toolkit which supports rapid prototyping of IoT applications by non-expert developers. Unlike PatRICIA and RapIoT, the proposed approach supports the distributed execution of IoT applications over a large number of devices at the edge of the network. Compared to the traditional design approach [7; 9; 13; 17; 19], which focuses mainly on an application-specific point-design which allows little compelling heritage, the proposed approach offers the following salient advantages: (I) It provides a generic model for developing an efficient sensor-data processing system. Basing designs on a standard integration platform architecture with AI libraries of pre-proven components will provide a solid foundation and streamline the development and validation processes. (II) It enables the design reuse at different levels of abstraction, including middleware libraries.