From Thing to Smart Thing: Towards
an Architecture for Agent-Based AmI
Systems
Carlos Eduardo Pantoja, José Viterbo and Amal El-Fallah Seghrouchni
Abstract This paper presents the Internet of Smart Things, which uses improved
things managed by Multi-Agent Systems for providing a network of devices for open
environments in Ambient Intelligence systems. The proposed architecture employs
a middleware for the Internet of Things as a base for the connectivity and communicability of devices. The Smart Things are deployed using hardware technologies
interconnected to provide autonomy and specialized agents for interfacing controllers
and to communicate with other devices. Prototypes are built as a proof-of-concept
for validating the approach.
Keywords Ubiquitous computing · Multi-agent systems · AmI
1 Introduction
Ubiquitous Computing is the capability of embedding intelligence in everyday
objects using computer systems to provide services and information continuously
to support users in daily tasks and acting transparently in the environment [1]. One
of its subareas is Ambient Intelligence (AmI), which comprises electronic and intelligent environments interconnecting different technologies for assisting in daily tasks
autonomously and proactively [2]. In dynamic environments such as AmI based
on Internet of Things (IoT), devices can enter or leave anytime, growing or even
reducing the hardware infrastructure available. In fact, there will be a fixed part of
C. E. Pantoja (B)
Centro Federal de Educação Tecnológica (CEFET/RJ), Rio de Janeiro, Brazil
e-mail: pantoja@cefet-rj.br
C. E. Pantoja · J. Viterbo
Universidade Federal Fluminense (UFF), Rio de Janeiro, Brazil
e-mail: viterbo@ic.uff.br
A. E.-F. Seghrouchni
LIP6, Sorbonne Universités -UPMC - Paris 06, Paris, France
e-mail: amal.elfallah@lip6.fr
© Springer Nature Singapore Pte Ltd. 2020
G. Jezic et al. (eds.), Agents and Multi-agent Systems: Technologies
and Applications 2019, Smart Innovation, Systems and Technologies 148,
https://doi.org/10.1007/978-981-13-8679-4_5
57
58
C. E. Pantoja et al.
the infrastructure—such as electrical facilities—and a mobile part that can grow
depending on upcoming devices.
Intelligent agents are entities that can be constructed in both hardware and software and they are able of performing actions in certain environments autonomously
and pro-actively based on some cognitive model of reasoning. A Multi-Agent
System (MAS) is composed of intelligent agents capable of communicating and
collaborating—or even competing—for using resources in an environment to achieve
conflicting or common goals [3]. The use of the agent approach in AmI systems is justified by the autonomous characteristics of agents and their use in complex systems,
both found in Ubiquitous Computing [4, 5].
Some works [6–9] apply MAS in IoT domain. However, they use only one agent
for each device, which can raise issues such as processing bottlenecks and agents
overloading depending on what is executed. In these cases, a MAS could be preferable
for controlling devices because agents can be specialized in some functions such
as dealing with hardware interfaces and communication. Thus, applying MAS in
embedded systems for devices is not a simple task and problems can arise because
of the number of perceptions in environments and real-time constraints that agents
have to consider in response to a stimulus.
For helping create autonomous embedded MAS, some approaches deal with
them [10, 11]. However, these works consider a MAS embedded in a device without the ability to communicate with other devices. Every agent present in the MAS
just communicates with agents from its own MAS and controls hardware. Therefore,
some communication mechanism must be provided for such kind of devices to enable
a horizontal communication between the devices in an IoT or AmI system. If the
embedded MAS does not have any kind of mechanism for exchanging information
with other devices, it will not be useful in a collective system where decisions have
to be made considering distributed information.
The objective of this work is to propose an architecture characterized as an Internet
of Smart Things (IoST) for the deployment of AmI Systems in open environments
based on IoT technologies comprising devices managed by MAS as Smart Things.
So, we consider an open environment as an AmI system running over an IoT network, where devices can enter or leave anytime. Every device is independent and
autonomous with enough processing power and memory for hosting an embedded
MAS (Smart Thing), which controls sensors and actuators, hardware interface, and
tiny computers. For validating the proposed architecture and the Smart Thing, two
prototypes are assembled and tests about communicability, connectivity, and autonomy are performed as a proof-of-concept [12].
When the number of devices grows exponentially, the concern with scalability
becomes latent. To address these limitations, ContextNet middleware [13] treats the
communication and connectivity of nodes in a scalable way using data protocols
based on OMG [14] standards. Furthermore, we present an extended version of
Jason [15] for programming MAS. The outlined contributions of this work are the
architecture for interconnecting devices using IoT technologies responsible for the
proposed IoST; the Smart Thing definition and design controlled by embedded MAS;
and a Jason’s customized agent architecture able to exchange messages and connect
From Thing to Smart Thing: Towards an Architecture for Agent-Based AmI Systems
59
into the IoST. In Sect. 2, the state of art is presented; Sect. 3 presents the Smart Things;
the architecture and a proof-of-concept are presented in Sect. 4, and it is concluded
in Sect. 5.
2 State of the Art
With the emergence of IoT technologies, it became possible to enhance and interconnect daily objects in an open environment for communication over the Internet to
perform pervasively actions for helping humans being. The IoT, MAS, and AmI deal
with autonomous devices capable of communication over a network to enhance an
ambient with a degree of automation or even intelligence. There are several works,
which uses agents to deal with some details of IoT such as collaboration, autonomy, and sensing in AmI systems. Mobile agents [6] provide collaboration in an IoT
and Wireless Sensor Network (WSN) using an architecture for providing integration
between heterogeneous devices, platforms, and WSN nodes. The authors affirm that
the agency model facilitates the dynamic resource configuration at runtime and the
architecture is generic considering the programming language. There is an agent for
each device and in a certain period, only one agent can be on the device. The agents
are able to move from device to device using the HTTP and from node to node in
the WSN using CoAP protocol. The use of different controllers in WSN nodes is
interesting since agents are unaware of them. The devices work as a spot where
agents can move to perform some operations, then every node and device in this IoT
network is not autonomously, depending on agent occupancy.
The Agent of Things [16] is a definition for devices managed by a single agent in
dynamic environments. The authors suggest that the approach used in most solutions
to provide communication between devices are highly programmable and depends
on a previous interaction configuration. It is proposed a conceptual framework, which
considers a direct physical interaction between devices using hardware and software
layers where every agent represents a device. But in the framework, agents are only
situated and centralized in the software layer.
A discussion [7] about using MAS in IoT raises questions about communication
and the use of protocols such as CoAP, MQTT, and AMQP, and how to implement
functionalities for access control in an agent-based IoT. It uses a server for coordinating the communication using those protocols in a WSN system containing agents
and IoT devices. Some agents are responsible for reasoning and communicating
with the IoT devices (there is one agent per device). The Agent-based Cooperating
So (ACOSO) is used as middleware in an IoT network where agents are devices [8].
It supports the development of MAS in the level of things. So, every smart object
can be abstracted to an agent using Jade as Agent-Oriented Programming Language
(AOPL). It provides a three-layered architecture: application; transport; and net and
physical. The agents manage sensors and actuators, and reason using local and distributed databases.
60
C. E. Pantoja et al.
In a decentralized approach for engineering IoT applications [9], smart objects
are data gathers and senders and the data is stored and processed in central servers
compromising their autonomy. The smart objects run even if remote technologies
are not available and there is one agent for a smart object. Some authors visioned
the idea of decentralized MAS responsible for cognitive intelligence in distributed
computing for IoT directing the area for the development of truly autonomous smart
objects independent of infrastructure technologies [17].
Commonly, these approaches consider centralized reasoning where agents are
running at a server representing devices, which is not appropriated in most cases.
The system becomes highly dependent on the server and the device autonomy is compromised since it depends on agents situated outside the device’s physical structure.
The advance of the network and microprocessors technology helped the development
of IoT and its use in the AmI domain. Thus, agents started to be effectively embedded
in devices providing the necessary autonomy to them. Yet, the approaches deal with
one-to-one relations between agents and devices, which overload agents and delays
may rise since agents have to deal with many perceptions from sensors. When comparing the performance of using one or more agents per device, it is expected that
the later approach to producing better results. Some approaches consider devices as
fixed spots where agents can move and stay for a while. However, it is not simple
to deal with the configuration of devices since users have to indicate manually their
presence.
So, we propose the Smart Thing, a fixed or mobile device with an embedded
MAS capable of sensing and acting in an IoT based AmI System. The Smart Thing
is autonomous in any environment but when connected to an IoT network it improves
its abilities with communication capabilities for context transfer.
3 From “Thing” to “Smart Thing”
A Thing in the IoT is a device that connects to any available network structure to perform actions or transfer data and they should act autonomously to attend an expected
functionality. Most of things have an architecture employing sensors and actuators
connected to hardware controllers for creating its physical body. Since, most of controllers are limited, an embedded system should be used for helping the device’s
functionalities. Serial Interfaces are used for transferring information between hardware and the embedded system. The proposed Smart Thing has a similar structure
when considering hardware technologies but it uses a MAS on top of devices. We
assert that the agent approach can bring several advantages comparing to traditional
things including internal decentralized processing, improved context generation, do
not work only as data repeaters, and its autonomous because they do not depend on
external technologies.
A traditional Thing shares some attributes (functional and non-functional) with
our Smart Things. The following functional attributes can be identified to provide
real embedded devices that are able of acting in an AmI system:
From Thing to Smart Thing: Towards an Architecture for Agent-Based AmI Systems
61
– Autonomy: every Smart Thing hosts a MAS providing autonomy and it should
perform independently of any technology that is not part of its architecture. Yet,
a Smart Thing should work properly if it has been moved to another environment or AmI system. It should still perform its functionalities even if there is no
communication with other systems and devices.
– Communicability: since the Smart Thing is an autonomous entity, it should be
able to communicate with other devices including Smart Things themselves. Then,
a communication infrastructure with different devices should be present in the AmI
system.
– Connectivity: Smart Things connect to an IoT infrastructure where middleware
for IoT plays an important role because they are constructed to deal with several
issues regarding connectivity and availability.
– Context-awareness: most devices act as data repeaters transmitting raw data from
sensors to a central computer where data processing takes place. In Smart Things,
this data processing can occur in the device, which can process and use the result
for decision making, or send improved context to a third part in the AmI system.
– Heterogeneity: Smart Things have hardware components that are responsible for
the interaction between the device and the real world. So, the Smart Thing should
provide an uncoupled architecture for interfacing hardware components where a
MAS is able of controlling these components and it must employ different kinds
of hardware controllers. The heterogeneity of controllers increases the range of
possibilities for creating Smart Things.
Besides, the following non-functional attributes are also identified in the proposed
Smart Things:
– Adaptability: The Smart Thing must be applicable in any domain. It means that
they cannot be coupled to the deployed solution. Besides, a Smart Thing of any
domain could be able of moving to another domain compliant system without any
modification in its architecture or programming.
– Computational Capacity: since Smart Things are controlled by an embedded
MAS they must use platforms with enough storing and processing capability. A
Smart Thing can employ any platform hosting an Operational System. In fact,
there is not a size limit for Smart Things.
– Interoperability: no matter what AOPL is being used for the development of
Smart Things, they must communicate properly. Besides, Smart Things are able
to communicate with other devices such as smartphones. So, mechanisms for
interoperability between systems must exist.
– Reliability: The Smart Thing must be reliable. It means that the hardware interfaces, reasoning and all components of a Smart Thing should work properly as
long as possible without crashing.
– Scalability: The IoST must be scalable, allowing the entrance of new Smart Things
without losing performance or crashing the system. So, every Smart Thing should
be prepared to enter or leave the IoST in a scalable way.
62
C. E. Pantoja et al.
4 An Architecture for the Internet of Smart Things
Despite the fact of a Smart Thing to be autonomous, it needs an infrastructure to
be part of and to put its all attributes in action. As they are extensions of Things
from IoT, the infrastructure needs to comply with the IoT bases, considering technological issues such as network facilities and middleware. Based on that, IoST is
an IoT network of interconnected Smart Things and devices that use local networks
for providing fixed structures where Smart Things should connect to be part of the
system. These structures are servers computers running a middleware for IoT to provide scalability, connectivity, communicability, context awareness and openness of
the system. Once a Smart Thing enters in the IoST, it is possible to interact with
other existing devices of the system. As stated before, Smart Things use embedded
MAS where there will be specialized agents dedicated to performing functions for
avoiding processing bottlenecks or undesirable delays. Thus, this MAS must have
mechanisms to use the IoT as a channel for exchanging information and messages in
the AmI system. An agent named Communicator will be responsible for the identification and communicability of the Smart Thing, Interface agents will be dedicated
for interfacing controllers, and Traditional agents are responsible for helping in the
internal decision-making process. The IoST architecture can be seen in Fig. 1.
This approach leads to a decentralized architecture since every embedded MAS
is considered an autonomous and independent device capable of communicating
and, eventually, negotiating with other devices. By independent, it means that Smart
Things are able to keep running and reasoning even if communication technologies
stop. In the architecture, devices can be mobile or fixed, where the former one is
composed of all movable devices. The later one is composed of all devices that are
fixed in the infrastructure of the environment and cannot be moved without changing
physical parts, such as electrical facilities.
The architecture uses the ContextNet as IoT middleware where every device
should connect to be part of the system and to communicate with other devices.
Fig. 1 The IoST architecture with things and smart things
From Thing to Smart Thing: Towards an Architecture for Agent-Based AmI Systems
63
In this approach, we assert that devices can employ embedded MAS for managing
sensors and actuators in the AmI systems and work as Smart Things. It is composed
of a cognitive layer using Jason framework with agents responsible for interfacing
hardware components, and agents responsible for communication in the network
using an instance of ContextNet. The hardware layer is composed of: the platform
for embedding the MAS, which could be any tiny computer such as Raspberry Pi;
sensors and actuators; and controllers. Therefore, it is possible to employ three types
of agents in a project:
– Standard: the basic unit of a MAS. It is able to communicate with other agents
of its MAS but not with agents from a different MAS. It is not able to control any
kind of hardware. In the IoST, it is the Traditional agent.
– Interface: it controls hardware independently of its type and the domain applied
in the solution. They have all the abilities of a standard agent but they are not able
to communicate with agents from a different MAS.
– Communicator: it can communicate with agents from a different MAS or any
device using ContextNet. It has the same abilities of a standard agent but it is not
able of controlling hardware.
We propose the use of MAS developed using Jason and ContextNet to exploit some
advantages of using a robust middleware for IoT applications, which guarantees a
great number of devices transmitting data at same time, and a well-known framework
for agents solutions. Jason already counts with Standard and Interface agents. Then,
we present a customized architecture for Communicator agents with an embedded
instance of ContextNet.
4.1 Communicability and Connectivity for Smart Things
For the programming of agents that are able to exchange messages with agents from
different MAS, a new kind of agent named Communicator was proposed. Based on
the IoST architecture, the Communicator agent must have mechanisms for sending
and receiving messages connected to the ContextNet. Thus, the reasoning cycle of
the Communicator agent was extended with the ContextNet middleware embedded
in its architecture (Fig. 2).
At the beginning of the reasoning cycle, it is capable of receiving messages from
other devices using ContextNet. All messages received generates events and updates
the agent’s Belief Base. The next modification was inserted at the end of the reasoning
cycle after the sendMsg step. At this moment, the agent can send a message to agents
from a device using ContextNet. Every agent must have an identification number
provided by ContextNet and it uses an internal action named sendOut likewise the
original send from Jason. Both of them send a message to an addressee using an
illocutionary force. The major difference between them is that sendOut sends a
message to a Communicator agent in another MAS. In this version, the available
illocutionary forces are:
64
C. E. Pantoja et al.
Fig. 2 The reasoning cycle of communicator agents
– achieve: sends a goal to be accomplished by the addressee. The content of the
message sent will be inserted in the base of intentions of this agent.
– unachieve: drops a goal in case it has not been reached yet. The content of the
message will be removed from the base of intentions of the addressee.
– tell: sends a belief that the addressee believes to be true. The content of the message
must be a literal representing a belief. It will be inserted into the belief base of the
addressee.
– untell: the sender agent informs the addressee agent that the belief is no longer
to be believed. The content of the message is removed from the belief base of the
addressee.
4.2 Proof-of-Concept
First, the IoST must be provided to allow the connection of devices. For this, a server
with an instance of ContextNet middleware was configured as well as all the network
requirements needed. ContextNet is responsible for the connectivity, communicability, reliability, and scalability of the IoST. A Smart Thing is equipped with controllers,
sensors, and actuators connected to any computational platform with an operational
system and sufficient processing power for hosting a MAS. Tiny computers are
commonly used since they are small, hold serial ports, and onboard communication
technologies. So, we employed in the Smart Things ATMEGA328 controllers connected with temperature and luminosity sensors and power plug where electricity
can be turned on or off, and a Raspberry Pi Zero for hosting the MAS (Fig. 3). In the
MAS was employed one Communicator agent per device, one Interface agent per
controller, and one Traditional agent for aiding the other ones in the communication
process.
In order to test the functional attributes of Smart Things, some devices were
prepared to attend our proof-of-concept. The autonomy of devices was tested by
verifying if sensors values were still being gathered when the server was disconnected. So, we assembled one Smart Thing responsible for gathering data from a
temperature sensor and depending on the temperature measured, it should turn on or
From Thing to Smart Thing: Towards an Architecture for Agent-Based AmI Systems
65
Fig. 3 One of the smart
thing prototypes
off the plug where an air-conditioner is connected. The Smart Thing should connect
to the ContextNet and after that, the server was disconnected. We repeated this ten
times and the Smart Thing was able to perform autonomously in all opportunities.
Once the server is available, the connectivity and communicability were possible to
be tested. Thus, we tested the behavior of Smart Things by sending messages with
data from the luminosity sensor of one Smart Thing to another one. This former one
is responsible for executing a turn on action in its light actuator based on the value
received. There were no problems in the execution of these tests.
The context-awareness was tested using the former test but changing the information that was sent. Instead of sending just the raw information from luminosity
sensor, the Smart Thing was able to gather and process this information as dark or
bright and it sent this context for the second Smart Thing to execute the turn-on
action. The heterogeneity was tested by changing the controller from ATMEGA328
to Galileo Gen 2 in the first Smart Thing. Again, it was not identified any problems
during the execution and everything went well. The objective of this proof-of-concept
is to highlight that it is possible to employ MAS in embedded systems to provide
autonomous and pro-active devices that are not dependable on central services to
keep reasoning. Besides, the IoST extends the Smart Thing reach, providing a layer
with connectivity, scalability, and communication. Although simple, these tests aim
to validate the main functionalities and the communication between the layers of the
approach. However, formalization and more complex tests using as many devices as
possible are necessary.
5 Conclusions
In this paper, it was introduced the IoST, which is an architecture for the deployment
of devices enhanced with MAS working as Smart Things. In some cases, the use of
66
C. E. Pantoja et al.
MAS in devices can bring advantages compared to traditional things that only work
as data repeaters sending data from sensors to a server for generating context about
a situation and they need stimulus from other devices to act upon the environment.
Besides, Smart Things communicate with other devices and they also allow improved
information or even a previous context generation before sending it to a server application releasing processing power of server applications, for example. Smart Things
are also autonomous because agents can make decisions and act without depending
on a third part processing.
Smart Things are constructed based on several hardware technologies that act
together to provide autonomy without depending on third parts such as IoST’s servers.
A proof-of-concept example was presented showing some of the proposed behaviors
of the IoST such as connectivity, autonomy, and communicability. As future works,
the IoST must be tested in a broad scenario involving many devices as possible.
Besides, the IoST can be used as a middle layer for the virtualization of devices
using web services where interested people can access their information publicly or
privately according to their needs. In this way, the devices connected to the IoST can
expose their resources as Sensor as a service model.
References
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
Weiser, M.: The computer for the 21st century. IEEE Pervasive Comput. 1(1), 19–25 (2002)
Weber, W., Rabaey, J., Aarts, E.: Ambient Intelligence. Springer, Berlin (2005)
Wooldridge, M.: An Introduction to MultiAgent Systems. Wiley, New Jersey (2009)
Viterbo, J., Mazuel, L., Charif, Y., Endler, M., Sabouret, N., Breitman, K., Seghrouchni, A.E.F.,
Briot, J.: Ambient intelligence: management of distributed and heterogeneous context knowledge. CRC Studies in Informatics Series, pp. 1–44. Chapman & Hall, London (2008)
Maciel, C., de Souza, P.C., Viterbo, J., Mendes, F.F., El Fallah Seghrouchni, A.: A multi-agent
architecture to support ubiquitous applications in smart environments. In: Koch, F., Meneguzzi,
F., Lakkaraju, K. (eds.) Agent Technology for Intelligent Mobile Services and Smart Societies,
pp. 106–116. Springer, Berlin (2015)
Leppanen, T., Liu, M., Harjula, E., Ramalingam, A., Ylioja, J., Narhi, P., Riekki, J., Ojala, T.:
Mobile agents for integration of internet of things and wireless sensor networks. In: Systems,
Man, and Cybernetics (SMC), pp. 14–21. IEEE (2013)
Rivera, D., Cruz-Piris, L., Lopez-Civera, G., de la Hoz, E., Marsa-Maestre, I.: Applying an
unified access control for IoT-based intelligent agent systems. In: 2015 IEEE 8th International
Conference on Service-Oriented Computing and Applications (SOCA), pp. 247–251. IEEE
(2015)
Savaglio, C., Fortino, G., Zhou, M.: Towards interoperable, cognitive and autonomic IoT systems: an agent-based approach. In: 2016 IEEE 3rd World Forum on Internet of Things (WFIoT), pp. 58–63. IEEE (2016)
Hernández, M.E.P., Reiff-Marganiec, S.: Towards a software framework for the autonomous
internet of things. In: 2016 IEEE 4th International Conference on Future Internet of Things
and Cloud (FiCloud), pp. 220–227. IEEE (2016)
Pantoja, C.E., Stabile, M.F., Lazarin, N.M., Sichman, J.S.: Argo: an extended Jason architecture
that facilitates embedded robotic agents programming. In: Baldoni, M., Müller, J.P., Nunes,
I., Zalila-Wenkstern, R. (eds.) Engineering Multi-Agent Systems: 4th International Workshop,
EMAS, pp. 136–155. Springer, Berlin (2016)
From Thing to Smart Thing: Towards an Architecture for Agent-Based AmI Systems
67
11. Brandao, F., Nunes, P., Jesus, V.S., Pantoja, C.E., Viterbo, J.: Managing natural resources in a
smart bathroom using a ubiquitous multi-agent system. In: 11th Software Agents, Environments
and Applications School (2017)
12. Wohlin, C., Runeson, P., Höst, M., Ohlsson, M.C., Regnell, B., Wesslén, A.: Experimentation
in Software Engineering. Springer Science & Business Media, Berlin (2012)
13. Endler, M., Baptista, G., Silva, L., Vasconcelos, R., Malcher, M., Pantoja, V., Pinheiro, V.,
Viterbo, J.: Contextnet: context reasoning and sharing middleware for large-scale pervasive
collaboration and social networking. In: Proceedings of the Workshop on Posters and Demos
Track, p. 2. ACM (2011)
14. Pardo-Castellote, G.: OMG data-distribution service: architectural overview. In: 2003 Proceedings of the 23rd International Conference on Distributed Computing Systems Workshops, pp.
200–206. IEEE (2003)
15. Bordini, R.H., Hübner, J.F., Wooldridge, M.: Programming Multi-Agent Systems in AgentSpeak Using Jason. Wiley, New York (2007)
16. Mzahm, A.M., Ahmad, M.S., Tang, A.: Enhancing the internet of things (IoT) via the concept
of agent of things (AoT). J. Netw. Innov. Comput. 2(2014), 101–110 (2014)
17. Singh, M.P., Chopra, A.K.: The internet of things and multiagent systems: decentralized intelligence in distributed computing. In: 2017 Distributed Computing Systems (ICDCS), pp. 1738–
1747. IEEE (2017)