Home Appliance Management System for Monitoring Digitized Devices Using Cloud Computing Technology in Ubiquitous Sensor Network Environment

The number of service techniques available for digitized home appliances is rapidly increasing as a result of various advances in digital technology. Users can now easily control and monitor home appliances via sensor networks formed among home appliances in ubiquitous environments. However, home appliances generate such large amounts of metadata about their status every month that in order to provide home appliance monitoring services to users, an approach that is able to store, analyze, and process these large amounts of metadata is needed. We propose a system that uses UPnP to collect metadata from home appliances and cloud computing technology to store and process the metadata collected from ubiquitous sensor network environments. Our proposed system utilizes a home gateway and is designed and implemented using UPnP technology to search for and collect device features and service information. It also provides a function for transmitting the metadata from the home appliances to a cloud-based data server that uses Hadoop-based technology to store and process the metadata collected by a home appliance monitoring service.


Introduction
With the unfolding of the information age, home appliances, including various types of digital devices, became capable of communicating with one another through the Internet. Many smart devices are now being equipped with new features. For example, users can now control their smart TVs via their mobile phones and watch the media contents stored on a PC on their smart TVs. A home network enables all connectable devices to be connected in a single network inside of the home so that they can communicate with each other. In the new millennium, home networks have evolved in a consistent way. Simultaneously, the amounts of log data and metadata used for monitoring the status of home appliances have increased significantly. With the ultimate goal of realizing a way to cope with these changes, many researchers have carried out studies focusing on how to process and analyze the huge amounts of data generated by sensors deployed throughout smart homes [1][2][3][4][5]. Studies indicate that the metadata from devices deployed in home networks are generated by the sensors integrated inside the home appliances. These metadata should be collected, analyzed, and processed in a ubiquitous sensor network environment. To facilitate this, a relay device that enables outside communications with the home network is needed.
A home gateway is such a device [6][7][8][9]. Home appliances can be monitored and controlled via a network deployed inside the home. However, it is impossible for the home network to communicate with an external network outside of the home as is. Home gateways are used to overcome this limitation of home networks. Most home gateways use diverse technological elements to collect metadata and perform associated processes for devices deployed in a home network. OSGi is used to support these diverse technological elements by processing and analyzing the metadata they collect [10]. In addition, OSGi is convenient because it provides the functions necessary for the home network on 2 International Journal of Distributed Sensor Networks a single platform from its bundles and allows developers to implement the functions they require.
As the large amounts of metadata generated by home appliances deployed in home networks increase significantly, home gateways that use OSGi are encountering problems such as insufficient computing power and shortage of data storage space. Researchers are now therefore looking to utilize cloud computing technology to handle the huge amounts of data generated by the appliances. Cloud computing is a state-of-the-art technology that has been receiving a lot of attention in the computing field. In cloud computing, distributed processing of massive amounts of data can be achieved using spare resources, which results in savings, both economically and temporally. Furthermore, cloud computing brings technological advances [2,[11][12][13][14]. Cloud computing has become an effective solution for processing massive metadata generated by home appliances connected via home gateways. Combining the various elements of technology mentioned above, this paper proposes a cloud-based system for monitoring and controlling home appliances.
Our proposed cloud-based home digital devices monitoring and control system consists of two major parts, the home network and a data server. It also includes a home gateway and a simulator. The home gateway is responsible for collecting device features and the service capabilities of the individual devices deployed in the home network and sending the data collected to the data server. The simulator provides information about the home appliances. The home gateway and the device simulator exchange data with each other using the Cling library. The Cling library, which supports the Android mobile OS, is a Java library of functions that implements the UPnP service. It also has a function that enables an external network to access a home network. This function makes the Cling library a good solution for achieving communication between the home gateway and the data server. In our proposed system, the home gateway does not establish the network using OSGi, unlike the approach proposed in [7], in which OSGi is used to set up the network. While a gateway that uses OSGi provides a number of useful functions to collect and manage data from devices residing in the home network, the objective of the home gateway proposed in this paper is to play the simple role of a bridge between the home network and a data server in the cloud. As a result, using the Cling library, we designed and implemented a function that enables communication between a UPnP-capable module and an external network in order to collect data from the electronic devices deployed in the home network and send them to the external server. In our proposed system, the data server stores and maintains the metadata generated by the home appliances. In addition, the data server provides a device monitoring service to the users. Metadata is stored in the data server using the Hadoop Distributed File System (HDFS) [15], which ensures scalability and security, even if the size of the data increases significantly. HDFS is a Hadoop-based file system that supports massive data processing effectively. It stores data with a scalable and distributed structure and maintains a copy of the data to insure against any occurrence of data loss. To meet users' requirements for processing and extracting the data stored in HDFS, we designed a progress module using MapReduce in the data server. The data server presents the data to the users via HTTP after extracting the required data using MapReduce [16]. In this process, if the user wants to make a change to a device's state, the data server receives the change request from the user and extracts specific commands for the designated device. Upon extracting the commands, the data server then sends them to the home gateway so that the commands can be executed. Our proposed system facilitates the monitoring and control of a number of home appliances by cooperation of the data server and the home gateway [17].
The remainder of this paper is organized as follows. Section 2 discusses related studies, home networks, smart homes, and cloud computing. Section 3 gives a detailed explanation about the system architecture designed by utilizing the results from previous studies. Section 4 highlights the data flow that occurs during the data communication process. Section 5 presents the results obtained from our system implemented on the basis of the designed architecture. Finally, Section 6 concludes this paper.

Related Work
Many researchers have proposed approaches for controlling digital devices and using their service functions outside of the home network [1,6,18]. In [7], Kang et al. implemented a UPnP AV architectural multimedia system using a home gateway supported by the OSGi platform to provide internal and external multimedia services. In their system, they used the UPnP bundle of OSGi to provide users with an external multimedia streaming service. The multimedia services are provided by a multimedia sharing system based on the UPnP AV Architecture [19]. Although the system was implemented using OSGi, due to congested multimedia content, the system could not support a large amount of multimedia data storing and management approaches.
In [20], Cui et al. proposed a UPnP-based multimedia sharing system that utilizes cloud computing. This system provides multimedia content storing and management functions via cloud computing, which is used to transcode the multimedia content to provide a personalized multimedia streaming service. In [14], Kim et al. developed a multimedia content transcoding module using MapReduce and HDFS. Díaz-Sánchez et al. [12] also proposed media cloud, a middleware for set-top boxes that classifies, searches for, and delivers multimedia content inside home networks and across any cloud that interoperates with UPnP and DLNA. Media cloud provides an easy to manage, cost-effective solution for using cloud computing to share content among federated home networks. It also allows devices from different home networks to communicate as if they are on the same local network.
A similar trend is taking place with sensors. With the development of small sensor nodes that can be connected to a network, research on sensor networks, which function by connecting several sensor nodes to each other, is underway [21]. The research is being conducted in areas such as home security, healthcare, health management, and environmental monitoring. In home networks that use DLNA and International Journal of Distributed Sensor Networks 3 ECHONET, the information that the sensors acquire can be used extensively by various devices. In [22], Jeong et al. implemented a large-scale middleware for ubiquitous sensor networks (called Lamses) that provides a USN middleware mechanism to focus on network processing. Lamses supports various heterogeneous sensor networks and mobile RFID. Unfortunately, RFID and other sensed devices have security vulnerabilities and generate a lot of data communication traffic. Hence, many researchers, such as Gao and Xiao [23] and Chen et al. [24], are currently researching core network issues and security problems.
A system that utilizes a ubiquitous data source server (UDSS)-a sensor device for home networks-for use by sensors in the home, has also been proposed [25]. In the proposed system, by connecting a sensor to an ordinary home appliance and using the values acquired by the sensor, control of the home appliance is made possible. However, to achieve cooperative behavior like this, configuring that behavior directly on a PC connected to the sensor device is necessary. Configuration of a behavior cannot be performed from outside of the home, which is very inconvenient [25].
In [11], Xu et al. proposed a cloud-based framework for enabling smart home monitoring services. The system architecture resolves several issues including certification, media capture, Data-Cloud storage, and NAT traversal. The system offers remote control for surveillance and automatic sensor-control monitoring. In addition, it utilizes elastic storage and intelligent processing with the help of cloud computing. We implemented a prototype of this system to verify the utility of this architecture.
In [26], Wei et al. proposed a cloud architecture based on an existing cloud system to support smart homes. In their proposed architecture, clouds can provide more humanized services for digital home appliances in smart homes, and smart home nodes can form peer-to-peer networks and publish, lookup, and use services in the cloud. They designed a mechanism that connects the smart home nodes and a cloud server to form a peer-to-peer network and introduced it as a web service in the cloud, so that smart home users can not only be suppliers but also consumers of cloud services.
In line with the related works outlined above, we propose a cloud-based home appliance monitoring and control system. Utilizing the strong points of previous research results, we design and implement a home gateway to collect metadata from home appliances and transmit them to a data server and a cloud-based data server to store and manage the metadata generated by home appliances.

Proposed System Architecture
The objective of our proposed system is to store and maintain status information about home appliances (such as refrigerators, air conditioners, humidifiers, and boilers) sent by a home gateway using a cloud-based data server. The data server stores and maintains metadata generated by home appliances on HDFS and also provides monitoring services for users by transmitting metadata to their smartphones when they request data for a specific device. Metadata associated with home appliances are collected by the home gateway in XML format. After collecting the metadata, they are sent by the home gateway to the data server through a series of processes. The home gateway is capable of collecting information such as device features, service capabilities, and status information about devices deployed in the home network using UPnP. Figure 1 depicts the structure of our proposed system.
The proposed system can be divided into two parts according to the component dealing with the data: the home network part, which monitors the status of devices and collects metadata and transmits them to the data server, and the cloud-based data server, which manages information received from the home network in a coordinated fashion. The home gateway is the most important part of the home network. It can communicate with one or more home appliances in the home network via a router in both wireless and wired fashion. In a home network connected via a router, the home gateway uses the UPnP function to discover and gather information on device features, service capabilities, and the status of the connected home appliances. The home gateway plays two important roles in the home network. First, it detects and collects information on device features and service capabilities advertised by the electronic devices. Second, it communicates with the cloud-based data server and sends metadata to it. In other words, the home gateway functions as a bridge between the home network and the data server across the boundary of the network.
The data center resides in cloud storage and maintains the metadata sent by the home gateway. It is designed to analyze and store metadata about home appliances deployed in the home network. Technically, the data center is implemented using MapReduce and HDFS. The metadata stored in the data center are used to provide a monitoring and control service to the users. End users can remotely check the status of any desired devices using their own smartphones. Further, in conjunction with the data server, they can also control the services with which the devices are equipped. The individual modules comprising the system architecture are described in more detail below.

Home Gateway.
In the home network established using the UPnP function, the home gateway detects and gathers information about home appliances and their service features. As a result, UPnP is considered to be a very powerful technology. However, connecting a UPnP-based home network to an external network is a very challenging task. For this reason, we propose to make the home gateway responsible for passing the data collected from the devices residing in the home network to the external data server. This gateway function can be realized by complicated cooperation among a number of modules. The modules that have to be implemented in the home gateway are as follows: network bridge module (NBM), device metadata parsing module (DMPM), device subscription function (DSF), action transmission module (ATM), and device registering function (DRF). Figure 2 illustrates the internal structure of a home gateway.
DRF is a basic function provided by UPnP that discovers and collects device feature information advertised by the devices in a home network. To accomplish this, DRF uses the simple service discovery protocol (SSDP), a network protocol for advertising and discovering the services and device features of individual electronic devices. SSDP is textbased and establishes a network among devices residing in a home network using HTTPU. Consequently, electronic devices use SSDP to advertise their features and service information to other devices in a home network. The home gateway uses SSDP in the DRF to collect metadata from the devices. In collecting this information from the devices, SSDP adopts a multicast mechanism so that it always discovers the data via port 1900. The discovered data are stored in temporary DRF storage for use by DSF and ATM in the future. The information retrieved by DRF is basic information about electronic devices, such as deviceType, friendlyName, model description, model name, model number, UDN, and model URL. On the basis of the information about the device, DSF can request more detailed information associated with a specific device. When the request is made, DSF obtains service metadata in XML format. DSF accesses the URL of a specific device via the subscription command provided by UPnP. It can fetch the service names, which can be supplied by the device in XML, and can also get information on the current status of the device. In order to achieve these functions, DRF is implemented by GENA, which provides a status alarm function based on HTTP. Thus, DSF retrieves information from the devices through GENA and stores a device's status information in a temporary space. From the information acquired, we can check the command codes to control the service. These command codes are used by ATM.
ATM uses data given by DRS and DSF to pass command codes to electronic devices and control device services. ATM controls the service features of devices in two ways. ATM can access the devices using information provided by DRF, such as URL, UDN, and model name. Second, ATM can use the command codes sent by NBM to control the devices. ATM sends the commands through the simple object access protocol (SOAP), a protocol that facilitates the exchange of XML messages over HTTP, HTTPS, and SMTP. SOAP is the underlying protocol used to deliver basic messages in web services. There are several types of message patterns in SOAP.
It is designed with a design pattern combining header and body, which is implemented in XML. Thus, SOAP is the most suitable protocol for delivering data and commands over a HTTP-based environment. SOAP is also used as the primary command-delivery mechanism in UPnP. The home gateway facilitates the collection of device data in a home network and control of the devices. In addition, the home gateway has a function for communicating with the cloud-based data server. NBM, in the home gateway, establishes a connection with the data server and transfers information about device features and service capabilities to the data server through the connection. Information such as device metadata and service metadata is sent to the NBM residing in the data server via the NBM in the home gateway. To make a connection between the home network and the external network, NBMs are required to be implemented in both the home gateway and the data server. In this case, the communication is carried out via HTTP and information is exchanged as XML-formatted data. When a user sends commands to a specific device deployed in the home network, the command entered by the user is passed to the device through NBM. In this way, users can control specific devices remotely. In this context, NBM can be considered the most important module since it acts as a networking bridge between the home network and the external network.
In UPnP-based data communication, XML data is used as a vehicle for transferring data and HTTP is used as the protocol. The home gateway, devices, and data server communicate with each other in XML format. Therefore, metadata information associated with a specific device has to be extracted from XML-formatted data. To extract the necessary information from the XML formatted data, we implemented a DMPM inside the home network. DMPM specifically parses XML data sent via HTTP and extracts metadata information such as device type, model name, and URL. The information extracted by DMPM is either immediately used by other modules or stored in a temporary space for future use.
The home gateway acts as a bridge between the home network and the cloud-based external data server. In addition, it is in charge of the exchange of data and collection of information to and from the devices deployed in the home network. Metadata information associated with the devices is sent to the data server via home gateway. Using the metadata information, the data server in conjunction with various modules can offer a device monitoring service to users. In the next section, we give details about the cloud-based data server.

Cloud-Based Data Server.
The data server delivers metadata information to the smart devices, stores and manages device information, and provides monitoring services to users. The metadata include the device information, command codes, and service information. Metadata are deposited in HDFS and used to provide monitoring services through MapReduce. Because metadata information is passed in XML format, the data server needs a function to extract XML data. To handle metadata generated by the electronic devices, the data server uses a combination of HDFS, MapReduce, metadata extraction module (MEM), NBM, and MSM. Details about each module are given in the following sections. Figure 3 depicts the internal structure of the cloud-based data server.
In order to keep communicating with the home gateway residing in the home network, the data server is required to have a counterpart NBM to the NBM in the home gateway. The NBM allows the data server to send device control commands to the home gateway when the user makes a request for a specific device. It also allows the home gateway to send metadata information generated by the electronic device to the data server. When the user sends a command to a specific device, the command has to be delivered to the home gateway. To do this, NBM is equipped with a UPnP bridge feature that enables it to provide host functions based on the UPnP functional demands. Using NBM, the data server can communicate in both directions and receive/send XML data via HTTP without any restrictions. XML data sent by the home network are passed to its counterpart NBM in the data server. The NBM then sends the XML data to the MEM because the metadata have to be extracted in  order to get separate information such as a device's feature, service information, and state information. The extracted information is then stored. The MEM extracts detailed information about each device from the XML data sent by the home gateway. In other words, the MEM parses the XML data and extracts individual field values from it. For more accurate data extraction, the MEM is designed and implemented using the UPnP function. Once the data have been extracted by the MEM, they are stored in a distributed storage space that is named according to the device with which the data is associated. HDFS is considered the most suitable for storing the data because the data are deposited in a distributed storage space.
Hadoop-based MapReduce takes the extracted metadata and separates them according to the name of the devices, specifically, the model name. In this module, a mapping process is carried out to investigate and store the metadata delivered accompanied with the model name. When the data are stored in HDFS, three duplicates are made and stored in a distributed manner due to the technical nature of HDFS. In terms of scalability of data, HDFS is also capable of effectively storing and maintaining the data even if the data consistently increase in size. Eventually, the data stored in HDFS are used to provide electronic device monitoring and control services to end users.
The metadata stored in HDFS are transferred to an MSM when a user makes a request. The MSM establishes a oneto-one connection with the user's smart device. To extract status information about the device specified by the user, the MSM acquires the metadata associated with the device from HDFS. It then passes the data to the user in text format via HTTP. On successful delivery of the information to the user, he/she can then check the condition of the device on his/her smart device. In addition to the monitoring service, the MSM is capable of controlling the device specified by the user. The user can check the available control functions on his/her smart device. When the user clicks a command, a request is sent to the MSM located in the data server, which then passes it to MapReduce. The data server then extracts information from the command using MapReduce and sends it to the home gateway via NBM. In short, the MSM acts as an interface to provide services to the user.

Data Flow
In this section, we discuss the data communication architecture among the components, focusing on the data server and the home gateway of the home network. Figure 4 illustrates the data flow that occurs among components. All the components of the proposed system are capable of transmitting data in XML format. As shown in Figure 4, the home network comprises electronic devices, the home gateway, and a router. The router facilitates the connection between the internal network and the external network.
All home appliances generate information about themselves, such as their features, service capabilities, and current status. Device features and service capabilities are predefined by respective vendors, while status information is generated by a sensor integrated with the device. Sensors differ according to the device with which they are associated. However, a sensor is designed to meet some criteria to properly perform its basic function as specified. For example, a refrigerator is divided into a freezer compartment and a refrigerator compartment. Each compartment has a distinctive sensor to measure temperature with different criteria. The user can check the temperature for each compartment using the relevant sensor. Sometimes there may be a need to adjust the temperature in the compartment depending on the food we want to keep in the refrigerator. In addition, the refrigerator could provide a function that retrieves the expiration date of the food stored in it. These kinds of information are dealt with by the data server. The refrigerator only passes the data, such as the expiration date, to the data server. In the case of a humidifier, the sensor would need to measure the water level of the water tank and transfer that data to the data server. The sensor is used to measure the device's condition except for the basic features of the device. Information regarding the device's features is advertised within the home network via the router.
The home gateway collects the information advertised via the router, checks it, and registers it in the DRF. The home network is configured based on UPnP, so the data are exchanged among the devices in XML format. For this reason, the device features and service information are extracted using the DMPM. Specifically, DMPM extracts the device's URL and model name from the advertised data. After these data are extracted, the information is stored in a temporary space. The information is then utilized by the DSF to collect detailed information about the device. On the basis of the information registered about the device, the DSF makes a request for detailed service information to the specific device. When the device receives this request from the DSF, it sends service function metadata back to the DSF. As with the other types of information, the service function metadata are extracted by the DMPM. The information is then used when the action command is transmitted to the device in the future. Once the DSF obtains service function information about a specific device, all of the data are sent to the data server through the NBM, a communicating module that uses the HTTP protocol.
The data server obtains various pieces of information about the home appliances, such as device features, service capabilities, and status information, from the home gateway via NBM. Once the information has been received, the MEM examines it and divides it into separate metadata such as model name, model URL, deviceType, friendlyName, model description, service description, and action name. Those metadata are then deposited in HDFS using MapReduce, and are used as basic data for providing device-monitoring services to the smart device of the user. When the user sends a request to the data server, the data server sends model name and state information for the device using the MSM. In our proposed system, a user can monitor an appliance's state and control it on his/her smart device. In providing monitoring and control services for the devices, the user's smart device does not need to have data processing capabilities itself. The smart device only utilizes the services provided by the data server. This means that the function required by the smart device is very simple. Thus, if the Internet is available, the user can monitor and control the devices via the data server. If the user attempts to change an appliance's state using his/her smart device, it is necessary to send the relevant command to the data server. The data server then fetches the commands that enable the user to control the device. To do this, the data server finds out the action command for the device in the metadata stored in HDFS in conjunction with MapReduce. Once the action command is found, it is sent back to the home gateway via NBM, together with information about the device. On receiving the action command and the device's information, the home gateway sends an appropriate command to the specific device. When the device gets the command sent by the home gateway, it changes its state in accordance with the command. Once the change is complete, the related information is sent back to the home gateway. As data flows freely around the system, the system's components carry out their functions in an organic fashion by interfacing with one another. Figure 5 illustrates the data flow activities for each step.

Development Environment.
We implemented all the devices comprising our proposed system using a generalpurpose computer and smart devices. Specifications for the various components used in the development environment for the implementation are listed in Table 1. The data server was a four-node cluster because it needed to be capable of storing metadata generated by a number of home appliances and creating large amounts of log files accordingly. In order to prevent loss of log data, the data were stored in HDFS on the data server. Hadoop-based MapReduce was applied to process the data. The Cling library was used to realize communication with the home network. Because the Cling library has excellent support for UPnP and is Java-based, it is suitable for MapReduce, which runs on a Java-based platform. In addition, Cling provides a UPnP library based on Android. Our system was implemented using simulators acting as home appliances instead of actual devices. The simulator was developed with the Android-based Cling library. Finally, a smart device was implemented with a focus on enabling it to be used anywhere an internet connection is available because the smart device should be able to access the data server in order to allow the user to monitor and control the home appliances.

Implementation Results.
We implemented all components, except for the smart devices, using the Java-based Cling library. We also implemented the simulators for home appliances such as refrigerators, humidifiers, and air conditioners using a Samsung Galaxy Note 10.1 tablet. We then tested the system in conjunction with the simulators. The simulation results are shown in Figure 6. After establishing a connection between the home gateway and the data server, we sent information about the home appliances to be stored in HDFS on the data server. The stored data were then transferred to a user's smart device by the MSM of the data server. Using the data sent by the MSM, users were able to browse information about the condition of the home appliances and control them at will. Figure 7 shows screen captures for the data server, the home gateway, and the smart device.
To implement the home appliance simulator, we used an API provided by the Cling library. Table 2 lists the classes and functions provided by the API.
The main roles of the home gateway are as follows: (1) collection of information about the home appliances, such as device features, service capabilities, and conditions; (2) sending the information collected to the data server; and (3) allowing the user to control the home appliances by means of commands sent by the data server to the device. We implemented these functions using the Cling library. The APIs used to collect information about devices are listed in Table 3.
The home gateway is in charge of sending the device's status information to the data server. To do this, we implemented a Cling-based bridge in the home gateway. The bridge enables the home gateway to communicate with the data center. As mentioned above, NBM operates as a bridge. The main APIs used for implementing the bridge are listed in Table 4. Table 5 lists the APIs that are used for storing metadata in HDFS on the data server. The main APIs used by MapReduce to extract information are included in the APIs shown in Table 5.
International Journal of Distributed Sensor Networks 9 (a) (b) (c) Figure 7: Implementation results for the data server (a), the home gateway (b), and the smart device (c). Registers device features and service information SwitchableRouter Used to connect to the home network

Conclusions
Users can monitor and control home appliances from outside a home network using our proposed system. Home appliances form ubiquitous sensor networks via status sensors that they use to advertise device features and service information.
According to the home appliance information advertised, a home gateway collects metadata from the home appliances  and sends them to a cloud-based data server. The data server stores metadata on HDFS, processes them using MapReduce, and also uses them to provide a monitoring service to users. Users can also control the home appliances via the NBM provided by the data server. As a result of the provision of the home appliance monitoring and status-controlling functions, users can easily confirm the status of home appliances.
Our proposed system easily deals with the large amounts of home appliance metadata generated by processing them using cloud computing technology and effectively utilizing computing resources. In our proposed system, HDFS is used to store and manage home appliance metadata. However, an effective approach to store and manage semistructured data such as XML is needed. Therefore, as future work, we plan to design a real-time data monitoring system to effectively manage semistructured and unstructured data. In order to reduce the computational burden of smart devices, we also aim to design a zero-client interface using HTML5 to support the monitoring and control of home appliances. Furthermore, we plan to research about home cloud services to handle multimedia devices and home appliances integration system.