Artificial Intelligence and Knowledge Engineering

6 downloads 9796 Views 637KB Size Report
of shifting computational services out of conventional desktop computers into surrounding ... methods and techniques for developing such applications easier and faster, ... embedded java versions, thus the applications therefore can be simply ...
AGENT-BASED FRAMEWORK FOR EMBEDDED SYSTEMS DEVELOPMENT IN SMART ENVIRONMENTS Egidijus Kazanavicius, Vygintas Kazanavicius, Laura Ostaseviciute Kaunas University of Technology, Faculty of Informatics, Real-time computing centre, Studentu g. 50, LT-51368,Kaunas, Lithuania [email protected], [email protected], [email protected] Abstract. This paper presents a new approach for embedded real time systems design based on multiagent paradigm. The essence of our work lies on smart environment domain. Jade - a Java based middleware is selected as a platform, facilitating the development of multi-agent embedded systems framework. Generic system architecture, the framework prototype implementation and consequently smart home temperature control application are demonstrated, reasoning that the proposed method is effective in dealing with challenges raised by contemporary embedded system development issues. Keywords: Embedded systems, multi-agent paradigm, Jade, smart home.

1

Introduction

Permanent advances and innovations in various technological fields, such as wireless communication technologies, computing devices, sensor networking and artificial intelligence techniques enable the possibilities of shifting computational services out of conventional desktop computers into surrounding environments, and enhancing the human-computer interaction as well as communication between things and devices. This might consequently lead to the “Internet of things” – a paradigm, related to the future Internet, its’ infrastructure, communication and processing technologies, putting the focus on object identity, functionality and seamless integration [5,15]. To be more precise, today’s vision on the Internet of things denotes that “uniquely addressable interconnected objects will be operating in smart spaces using intelligent interfaces to communicate within social, environmental and user contexts” [16]. Major enablers for this vision to become a reality are concerned with embedded systems, communication protocols and standards, energy storage and generation, device intelligence, technological interoperability and other issues. However, most of the above mentioned subjects require advanced theoretical investigations and practical innovations. The application domain for the Internet of things is widespread, covering retail, logistics, medicine, ubiquitous intelligent devices, smart home, transportation and other areas. As it was mentioned before, embedded system domain is an important integral part of future internet vision as well as our everyday life. Nowadays, embedded systems are everywhere, from telecommunication systems to home appliances and medical applications, but in the future, they will spread even more and might be integrated into every device surrounding us. Embedded systems are mainly designed to extend system functionality, assuring higher reliability, accuracy, lower price and power consumption [7]. Traditional embedded system design methods require prior knowledge about the system – predefined system goals, components and interaction mechanisms. However, the problems emerging today are getting more and more complex, requiring the systems to work in dynamic, ever changing environments. Thus, new requirements for the systems arise: to act autonomously, make decisions, adapt to changes – behave intelligently, saying in other words. A denoted in [8], intelligent solutions for embedded systems are beneficial in several aspects: they can assure the self- properties, such as self-management, self-healing, self-configuration; provide more autonomy; ease the modeling of the system – shorten design time as well as lower design and maintenance costs. This paper presents a new approach for embedded real time systems design based on multi-agent paradigm. The focus lies on the domain of smart environments, which are highly dynamic and perfectly suite for potential applications of the internet of things. The proposed agent-based software framework and smart home temperature control application validates the feasibility of the proposed method. The paper is organized as follows: section 2 provides the statement of the problem domain, section 3 discusses agent-based approach as a potential solution for the problem, as well as the motivation for choosing the Jade platform. Section 4 proposes the design method, revealing the proposed framework architecture and the structure of service agents. The framework prototype implementation and application scenario is proposed in section 5, conclusions – in section 6.

2

Problem statement

Although the research of smart environments domain has been an ongoing process in academic community for the last decade [1,2,9,13,14], it hasn’t realized its full potential yet. There is still space for exploration of theoretical methods and technologies suitable for this domain until smart home and smart appliance applications shift from research mode to commercial mass production. Therefore, the essence of our - 194 -

work lies on embedded systems design for smart environment, which is the basis for enhancing domestic appliances’ and other household devices’ functionality, thus assuring safety, comfort and economy services for its users [11, 12]. Looking at smart home and all its components as a part of the Internet of things from the engineering point of view, first of all we face the requirements, emerging from the openness and dynamics of this networking infrastructure. The Internet of things will be comprised of indefinite and varying number of connected subsystems, interacting and exchanging information about their context. As the context might be constantly changing, it means they will be sharing the same environment and seeking their goals in a cooperative or competitive manner, thus overall system behavior might become unpredictable. Thus, an application, being a part of such open system as Internet, is supposed to fulfill certain requirements, such as robustness, easy maintenance, easy modification and have the before mentioned self- properties. Similar requirements arise from designer’s perspective: as there will be plenty of such systems in the future, most of them might share similar characteristics or devoted to perform the same functions: sense the environment, collect, store and update data, process information, react to changes, predict user preferences, control devices, assure the communication between system components, external components and the user and many others. Thus, there comes the need of methods and techniques for developing such applications easier and faster, speeding up the realization of new systems by reusable components and extending existing systems by adding new system components without modifications to it. Linking various implementations into higher level abstractions could result in hiding the complexity of system components, allowing specialists without specific scientific knowledge develop their own applications under domain requirements. System flexibility and fault tolerance are also desirable. Finally, from the user perspective, the smart home systems are expected to provide assistance and act autonomously, but unobtrusively. To tackle most of the above mentioned requirements, we propose to develop smart environment applications as autonomous, flexible, reactive, capable of decision making software entities, called agents.

3

Multi-agent paradigm as a potential solution

As the research on agent technologies initially concentrated on providing methodologies and tools for building agent-based systems, today it is more concentrated on understanding the features that agent approach can bring to the development of conventional software [4]. 3.1

Software agents as software components As the emphasis of today’s system engineering is put on easier system development and faster time-tomarket, one of the primary characteristics provided by agent systems is a higher level of abstraction. Software components, such as JavaBeans, Corba, .NET components, that are extensions of objects, also serve as component-oriented software engineering approach. This approach offers separating the details of component implementation and its usage, making it easier to replace one component with another or add new components to the system, while these operations are dependent only on the component’s interface, not on its implementation. Moreover, by hiding realization details, designers do not have to deal with the complexity associated with the implementation, making their development tasks easier [6]. From the above perspective, agents can also be treated as software components. An agent-component conception has already been discussed in [10]. The differences and similarities between software agents and software components are explicitly elaborated in [6], reasoning that agent paradigm is appropriate not only for applications, requiring specific agent characteristics such as autonomy and adaptation ability, but can also serve as an alternative to other solid technologies, providing the developer with higher level abstractions than any other technology available today and having concrete advantages over software components in terms of reusability. 3.2

Platform selection There are many available platforms, providing the environment for agents’ existence and operation as well as supporting the development of agent based applications [17]. One of the most efficient platforms is Jade [19] - a Java based middleware designed to ease the development of multi-agent systems, providing functionalities which are independent of the specific application and which simplify the realization of distributed applications. Jade can operate both in wired and wireless environments, furthermore, it complies with FIPA (Foundation for Intelligent Physical Agents) [18] standards and enables interoperability between other platforms, based on this standard. The Jade platform is composed of one main container and several containers that can be launched on one or more hosts distributed across the network. Each container can run zero, one or multiple agents. The following agents and services must be present at the main container at all times: the AMS (Agent Management System), the DF (Directory Facilitator) and the MTS (Message Transport System) which is also referred to as the ACC (Agent Communication Channel). For more detailed information refer to [3]. Jade is beneficial to our work under several criteria: - 195 -

4



It can be executed on every type of Java Virtual Machine, except for Java Card. It also supports embedded java versions, thus the applications therefore can be simply portable among other embedded systems.



Jade provides the mobility service.



Jade provides lightweight communication protocol which is more simple than RMI.



Jade is continuously developed, improved and maintained (in contrast to some other agent platforms), as well as open-source and easily accessible (in contrast to other commercial platforms).



Jade achieves fault tolerance through combining two features - main container replication and DF persistence.



Jade supports .NET platform.

Embedded systems design method

This section presents embedded systems design method, based on Jade agent platform. Every sensor and actuator is modeled as a generic software agent. Later, these agents are used for creating service agents, which perform application specific functions. 4.1

Proposed system architecture for embedded system design A four-layered system architecture, built on the basis of Jade platform is proposed in Figure 1. Actual hardware sensor and actuator devices are situated in the lowest hardware level. A hardware abstraction layer (HAL) is proposed in order to hide the complexity of hardware level. Device drivers, presented in this layer, are implemented according to unified device driver interface. Framework layer consists of generic agents and helper classes that are used to construct application specific services in application layer.

Figure 1. System architecture

We propose to map each hardware sensor and actuator to each sensor/actuator agent. This implies that generic sensor or actuator device agent can be created. Our framework presents generic device agents that can be specialized at runtime by attaching different hardware drivers to them via configuration. This way we eliminate the need to develop specific device agents and developers can focus on development on services instead of infrastructure. Jade platform provides Directory facilitator (DF), Agent management (AMS) and Message transport (MTS) services [3]. Our framework utilizes Jade DF service by publishing information about every single agent and its capabilities – events and actions. The agents reside on framework and application layers. The framework provides generic agent templates that are consequently used by the developer to construct application specific agents by inheritance. - 196 -

There are six generic types of agents in the system, both static and dynamic. Static agents are platform management and configuration agents, while all service agents, as well as sensor/actuator agents are dynamic – created upon request and can be deleted after accomplishing their goal. When the system is started/restarted, platform management agent is the first agent to be created. Consequently it initiates the creation of configuration agent, which has a connection to the database and helps in detecting the host configuration, according to which the service agents and appropriate sensor/actuator agents are created and deployed on the system. All system agents register to the directory facilitator. Service agents are responsible for accomplishing some specific function in the smart home, such as temperature control, security or home appliance management. 4.2

Service agent structure Service agent has its own state and behavior. Generic Service agent structure is depicted in figure 2. Service agent can report its state changes via published events. Other agents can trigger various behaviors of the service agent by sending action messages. In order to hide protocol complexity from developer, our framework proposes helper classes and behaviors that help in defining and triggering service agent actions. Basic Service Agent structure

Temperature Control Agent structure

State

State: targetTemperature

Code

Code

Publish events

Publish OnTargetTempChange event

Publish actions

Publish SetTargetTemp action

Publish service

Publish service

Search and connect to devices

Connect to temp1 and onOff1 devices

Add service logic via behaviors

Subscribe to temp1OnSample event Implement temperature control behavior

Figure2. Basic service agent structure and temperature control example When service agent declares its events and actions, it publishes itself in Jade Directory facilitator and becomes discoverable to other agents. In order for the service agent to function properly it needs to discover and establish connectivity to sensor/actuator devices. After that, service agent can add service logic which is related to internal triggers or connected devices.

5

Prototype implementation

We have developed a prototype implementation (figure 3) of the proposed framework as a proof of concept. Later we used this framework prototype to develop a simple house temperature control application in order to validate and demonstrate the framework and its usability in real world scenarios. The framework prototype consists of generic DeviceAgent class which implements the loading of the device driver and its communication functionality. Each device driver has to implement the DeviceDriverInterface which is used in framework as a bridge to hardware. ActuatorAgent and SensorAgent are implementations of generic devices. ActuatorSupport and SensorSupport classes have been developed in order to facilitate communications and device discovery. The framework provides generic ServiceAgent class which is only responsible for providing methods, facilitating the development of real world services. ServiceAction class is a behavior which can be added to services and allows the developer to easily implement action logic without dealing with communication protocol

- 197 -

specifics. Finally, the ServiceSupport class can be used by other services and agents in order to easily subscribe to the developed service events and trigger actions.

Figure 3. Proposed framework prototype diagram 5.1

Real-world example – temperature control in smart house The smart house temperature control application developed on the basis of our framework is presented to further illustrate the proposed platform. Consider a house environment outfitted with temperature sensors and heating switches in different rooms. System integrator could use our framework with provided components to develop a temperature control application. System architecture and its deployment scenario are depicted in figure 4.

Figure 4.Temperature control application deployment architecture

The smart house system is deployed on two hosts. One of the hosts is a master host which is responsible for the platform and configuration management. Master host also runs agents responsible for interaction with the end-user (interface agents). Several non-controlling service agents such as user preference, statistical and heat counter are deployed on master host as well. The temperature control host is a small embedded device, running embedded Java Virtual Machine. This host has hardware temperature sensors and on/off switches connected. Thus device agents have to reside inside this host. Temperature Control service agent is deployed on this host for ensuring fault-tolerance and performance. Still, this service can be running on the master or any other host as well. The temperature control agent is a service agent which has established connections to temperature sensor and on/off switch. This agent periodically measures temperature and adjusts heating switch state according to the - 198 -

control algorithm. The implementation of TemperatureControlAgent in the context of our proposed framework is depicted in the figure below.

Figure 5.Temperature control agent class diagram in framework context

The temperature control agent has a target temperature set. In order to set the new target temperature, agent implements SetTargetTemp action. Each time target temperature is changed, the OnTargetTempChange is fired in order to notify all subscribed agents about new targets. The temperature control agent implements temperature sensor data sampling event which triggers temperature control behaviour. The structure of the agent and its implementation steps are shown in figure 5. 5.2

Results The smart house temperature control application, presented above, illustrates the advantages of the proposed method. The proposed framework provides functionality for platform management and configuration, service access, as well as the control of sensors and actuators and the developer only needs to focus on service logic implementation. This guarantees faster and easier application development. The temperature control implementation was very easy – it took us to write 75 lines of java code. The temperature control application with proposed framework overhead takes about 25Kbytes. 20C Threshold temp.

...

Room temperature

OnOffswitch state ...

...

Time, samples

Figure 6. Results obtained from temperature control application From the architectural viewpoint, multi-agent paradigm is rather similar to component-based approach. In multi-agent systems, the components are replaced by agents, having wider characteristics, such as autonomy, reactivity, proactivity, ontologies and others. Most agent-based platforms are dedicated to realizing enterprise solutions, satisfying soft real-time requirements and Jade is not an exception. Our aim is to take advantage of the features, offered by this platform and adapt it to designing real-time embedded components and their systems, taking into account the hardware part. The proposed sensor and actuator abstractions allow an easy the - 199 -

integration of any physical device into the embedded system. Moreover, jade platform allows monitoring of realtime events – the communication between agent components, as depicted in figure 6. Target temperature, dynamics of room temperature and on/off switches are shown in the top area of figure. Agent communication results obtained from Jade sniffer are shown at the bottom part of the picture. The temperature sensor Temp1 agent periodically sends INFORM messages to the temperature control agent Control1. These messages trigger temperature control behavior. Each time room temperature reaches threshold level, a message is sent to on/off switch OnOff1.

6

Conclusions

State-of-the-art agent platforms such as Jade provide a good background facilitating the development of smart agent-based systems. However, they are not adjusted to design real time embedded systems. Consequently we have developed a framework, facilitating embedded system design through a set of generic reusable components, hiding the implementation complexity. The developer, not necessarily an embedded system specialist, can construct a system by only adding application specific functionality. Such system development method clearly distinguishes between two roles of an engineer: low level system developer – creating drivers and smart system developer – the one, creating applications. Moreover, real-time monitoring of events allows observing the interaction of system components. The future work focuses on complementing the framework with additional components, e.g. for assuring several non-functional requirements, such as fault-tolerance, components for interacting with external systems and others.

References [1]

Abowd G. A., Bobick I., Essa E., and Mynatt W. The aware home: Developing technologies for successful aging. Proceedings of AAAI Workshop and Automation as a Care Giver. July 2002.

[2]

Augusto J. C., McCullagh P. J.: Ambient Intelligence: Concepts and Applications. Journal of Computer Science and Information Systems 4(1):1-27. 2007.

[3]

Bellifemine F., Caire G., Greenwood D. Developing multi-agent systems with JADE. Wiley Series in Agent Technology. ISBN 978-0-470-05747-6. February 2007.

[4]

Bergenti, F., Cleizes, M.-P., Zambonelli, F. Methodologies and Software Engineering for Agent Systems. The Agent-Oriented Software Engineering Handbook, Kluwer. 2004. Buckley J. From RFID to the Internet of Things. Conference on Pervasive networked systems, final report. ftp://ftp.cordis.europa.eu/pub/ist/docs/ka4/au_conf670306_buckley_en.pdf Deugo, D., Oppacher, F., Ashfield, B., and Weiss, M. Communication as a Means to Differentiate Objects, Components and Agents. Technology of Object-Oriented Languages & Systems, IEEE, 376-386. 1999. Edwards, S.; Lavagno, L.; Lee, E.A.; Sangiovanni-Vincentelli, A. Design of embedded systems: formal models, validation, and synthesis, Proceedings of the IEEE, Vol,85, Issue 3, Page(s):366 – 390. March 1997. Elmenreich W. Intelligent methods for embedded systems. Proeedings of 1st Workshop on Intelligent Solutions in Embedded Systems (WISES03), Vienna. June 2003. Helal A., Mann W., Elzabadani H., King J., Kaddourah Y., and Jansen E.. Gator tech smart house: A programmable pervasive space. IEEE Computer magazine, pages 64–74. March 2005.

[5] [6] [7] [8] [9]

[17] [18]

Krutisch R., Meier P., Wirsing M. The AgentComponent Approach, Combining Agents and Components. In Proceedings of MATES-03, Springer series of Lecture Notes on Artificial Intelligence. 2003 Ostaseviciute L., Kazanavicius E. The design of agent-based smart fridge system. In Proceedings of International Conference on Information Technologies 2008, Kaunas, Lithuania. 2008 04. Ostaseviciute L., Kazanavicius E. Agent-component design of smart appliances. In Periodical Journal „Solid State Phenomena Vols. 147-149. 2009 01 Rodríguez M. and Favela J. A Framework for Supporting Autonomous Agents in Ubiquitous Computing Environments. Proceedings of System Support for Ubiquitous Computing Workshop at the Fifth Annual Conference on Ubiquitous Computing (UbiComp 2003), Seattle, Washington. 2003. Sadeh N., Chan T., Van L., Kwon O. and Takizawa K. Creating an Open Agent Environment for Context-aware M-Commerce. In Agentcities: Challenges in Open Agent Environments, LNAI, Springer Verlag (Ed. by Burg, Dale, Finin, Nakashima, Padgham, Sierra, and Willmott), pp. 152-158. 2003 Early Challenges regarding the “Internet of Things”. http://www.iotvisitthefuture.eu/fileadmin/documents/earlychallengesIOT.pdf Internet of things in 2020. A roadmap to the future. http://www.smart-systems-integration.org/public/internet-ofthings Publicly available agent platform implementations. http://www.fipa.org/resources/livesystems.html#ADK Foundation for Intelligent Physical Agents. http://www.fipa.org/

[19]

Java Agent Development Framework. http://jade.tilab.com

[10] [11] [12] [13]

[14]

[15] [16]

- 200 -