Euphoria

A Scalable, Event-driven Architecture for Designing Interactions across Heterogeneous Devices in Smart Environments

Ovidiu-Andrei Schipor, University Stefan cel Mare of Suceava, Romania
Radu-Daniel Vatavu, University Stefan cel Mare of Suceava, Romania [contact]
Jean Vanderdonckt, Université catholique de Louvain, Belgium
Euphoria is a new software architecture design and implementation that enables prototyping and evaluation of flexible, asynchronous interactions between users, personal devices, and public installations, systems, and services within smart environments of all kinds, such as the diversity of devices and sensors illustrated in the photograph below.

Figure 1. In this photograph, we illustrate multiple users, a large public display, and several personal and wearable devices: smartphones, gloves, smartwatches, and armbands. Euphoria makes it easy to integrate all these devices within the same application.

Architecture

Euphoria implements a set of design requirements following the ISO/IEC 25010:2011 standards on Software Quality Requirements and Evaluation, which we applied to the specific context of smart environments. The 5-layer architecture (see Figure 2) consists of:
  1. Producers, the components for which a relevant change in state is notified to the architecture in the form of an event. Producers are instantiated by input devices (e.g., motion sensors from the environment or embedded in mobile devices and wearables) or by software services (e.g., a particular gesture command has been detected by a gesture recognition service from the web). Once an event has been produced, the event triggers the instantiation of a message (dataflows 1 and 2), which travels to the next levels of the architecture.
  2. Emitters collect event data and pack them in the form of messages, which are delivered to the higher layers of the architecture. A message consists of a header with metadata (the event type and the identification of the producer) and a message body with details about the change of state (e.g., the button that was pressed, new orientation data of the device, the type of gesture performed by the user, new position coordinates from a motion sensor).
  3. The Processing-Engine is the core component of Euphoria. Its main responsibility is to receive messages from Emitters (dataflow 3) and to dispatch them to the appropriate Consumers that have registered to receive those specific types of events. In our implementation, the Processing-Engine is run by a node.js server. The event messages collected by the Publication-Center are unpacked by the Message-Processing-Service.
  4. Receivers are any third-party software applications that request events from the smart environment to run their business logic. The Receiver establishes a WebSocket connection with the Processing-Engine using the Message-Access-Layer (dataflows 4 and 5). In addition to the filter list of the types of events and associated Producers, the Receiver can also specify other optional parameters, such as a minimum time interval between receiving two consecutive events of the same type to prevent intractable accumulations of events to handle at once.
  5. Consumers. Once received, the message triggers a specific action on Consumers, which represent the fifth layer of the architecture (dataflows 6 and 7). This tier consists in output devices and software applications that users interact with directly.

  6. Figure 2. Euphoria consists of event producers, emitters, a processing engine, receivers, and consumers.


    Demo and source code

    A demo version of Euphoria is currently running on the repl.it platform. Bellow, we provide demonstrative code (JavaScript) that simulates the In-Vehicle Smart Environment scenario discussed in the Euphoria article. In this example, the Producer is a Myo armband producing events and messages about gestures performed by the user. The messages are consumed by an application running on a smartwatch.

    The example below implements the following steps:
    1. Use https://Euphoria2.oschipor.repl.co/input and https://Euphoria2.oschipor.repl.co/output as the connection URLs for Consumers and Producers, respectively.
    2. Connect Producers and Consumers to Euphoria. Wait for the confirmation (connection successfull) message.
    3. Produce the message (e.g., the event triggered by the Myo armband), send the message to Euphoria, and wait for the message to be processed and, ultimately, received by the Consumer.
    Note that you can open in separate windows as many Producers and Consumers to test complex scenarios. Download here the web version of the Producer and Consumer to test them independently.



    Publications

    1. Ovidiu-Andrei Schipor, Radu-Daniel Vatavu, Jean Vanderdonckt. (2019). Euphoria: A Scalable, event-driven architecture for designing interactions across heterogeneous devices in smart environments. Information and Software Technology 109. Elsevier, pp. 43-59