Sleep Information Gathering Protocol Using CoAP

1 downloads 0 Views 5MB Size Report
Aug 28, 2017 - IoT devices with various sensors are connected to the internet and ... Insomnia is a symptom of failing to get enough sleep because the person is not ..... When the service is started, the physical sensor resets the attached ...
entropy Article

Sleep Information Gathering Protocol Using CoAP for Sleep Care Joo Ho Choi 1 , Un Gu Kang 2 and Byung Mun Lee 2, * 1 2

*

Department of IT Convergence, Gachon University, Seongnam-si 13120, Korea; [email protected] Department of Computer Engineering, Gachon University, Seongnam-si 13120, Korea; [email protected] Correspondence: [email protected]; Tel.: +82-31-750-4756

Received: 9 June 2017; Accepted: 25 August 2017; Published: 28 August 2017

Abstract: There has been a growing interest in sleep management recently, and sleep care services using mobile or wearable devices are under development. However, devices with one sensor have limitations in analyzing various sleep states. If Internet of Things (IoT) technology, which collects information from multiple sensors and analyzes them in an integrated manner, can be used then various sleep states can be more accurately measured. Therefore, in this paper, we propose a Smart Model for Sleep Care to provide a service to measure and analyze the sleep state using various sensors. In this model, we designed and implemented a Sleep Information Gathering Protocol to transmit the information measured between physical sensors and sleep sensors. Experiments were conducted to compare the throughput and the consumed power of this new protocol with those of the protocols used in the existing service—we achieved the throughput of about two times and 20% reduction in power consumption, which has confirmed the effectiveness of the proposed protocol. We judge that this protocol is meaningful as it can be applied to a Smart Model for Sleep Care that incorporates IoT technology and allows expanded sleep care if used together with services for treating sleep disorders. Keywords: IoT; healthcare; sleep care; mobile; CoAP; application protocol; 5G network

1. Introduction The Internet of Things (IoT) is a technology that allows objects connected to a network to provide various services through communication between people and objects. In recent years, IoT technology has been applied to various fields including health care, unmanned vehicles, and smart buildings. In particular, smart care is attracting attention as an IoT-based healthcare service, and interest in personalized services using IoT platforms and wearable devices is growing [1–3]. Meanwhile, our interest in our own health is growing as our society develops into an aging society. In particular, the paradigm of health care is changing from the treatment of disease to the treatment of chronic disease, thus requiring preventive health care [4,5]. Sleep management can prevent chronic diseases such as diabetes, stroke, and coronary artery disease. Sleep is a basic resting method, which is an important means of relieving mental stress, fatigue, and restoring vitality. However, since it is difficult for us to recognize the various sleep disorders as we sleep, we can unknowingly lack sleep, leading to sleep disorders. Sleep disorders should be diagnosed and treated because they may lead to chronic illness, learning disabilities, decreased efficiency, and accidents. However, it costs a lot of time and money to visit the hospital to both diagnose and treat sleep disorders. Therefore, sleep care systems are being studied to prevent sleep disorders and to manage sleep from home. Sleep care systems are being developed in the form of a variety of sleep care devices and mobile sleep care applications [6,7]. For example, there are wearable devices that can measure sleep disorders such as snoring and tossing and turning, etc. [8]. However, the existing sleep care systems only use a single device to measure the sleep state, which makes it difficult to accurately judge

Entropy 2017, 19, 450; doi:10.3390/e19090450

www.mdpi.com/journal/entropy

Entropy 2017, 19, 450

2 of 18

the sleep disorder(s) based on the information measured. If IoT technology is used, these problems can be solved. IoT devices equipped with various sensors are distributed around the user to measure sleep environment and sleep information. That information is transmitted to the IoT device, which comprehensively analyzes the sleep state through a network, and accurately determines the sleep state based on the collected information. To accomplish this process, a suitable protocol is needed for transmitting the information measured between IoT devices. In this process, the protocol suitable for transmitting measurement information between IoT devices is required. Typical protocols are MQTT (Message Queue Telemetry Transport), CoAP (Constrained Application Protocol), and XMPP (Existing Messaging and Presence Protocol) [9,10]. IoT devices with various sensors are connected to the internet and continuously transmit the measurement data, so the cloud federation for IoT is needed to manage this. The method of using existing single servers has limitations in collecting, managing, and analyzing large amounts of generated data. Therefore, distributed processing through hypervisor virtualization by applying the cloud to IoT data collection technology can effectively apply IoT services [11,12]. In this paper, we propose a Smart Model for Sleep Care for IoT devices with various sensors to measure the sleep state and transmit the measurement information for integrated processing. This model can measure a variety of information through distributed IoT devices and utilize the servers and mobile devices used in existing internet environment. In particular, we apply cloud federation to provide real-time IoT services that require large amounts of data. In addition, we propose a CoAP-based SIGP (Sleep Information Gathering protocol) to transmit measurement information between IoT devices. If this protocol is used for sleep care, it will be possible to provide IoT services to collect measurements and analyze an individual’s sleep state. This service enables it to judge sleep information accurately based on the distributed collection and integration processing by distributed sensor devices. Based on this, we designed and implemented a protocol to verify the effectiveness of the proposed protocol. Section 1 serves as an Introduction. In Section 2, we address the contents of the sleep care service related to this paper and the protocols used in the IoT environment to measure them. In Section 3, we propose a protocol to transmit measurement information to other IoT devices equipped with various physical sensors. In Section 4, we address the results of experiments and evaluations using various sensors to verify the effectiveness of the proposed protocol. In Section 5, we address the results of the study and propose the directions for future studies. 2. Related Studies 2.1. Sleep Care Service Sleep disorders are characterized by failing to take normal sleep due to issues such as increased stress, irregular sleep, and an irregular sleep cycle. Some people suffer from insomnia and respiratory disorder during sleep. Insomnia is a symptom of failing to get enough sleep because the person is not able to sleep normally. Respiratory disorders during sleep, such as snoring and apnea, cause sleep quality to be degraded. Sleep care services are being developed using various sleep care devices or mobile applications to identify or prevent such sleep disorders. Figure 1 shows a variety of sleep care services. Figure 1a shows a sleep care device that measures sleep information through various sensors. The sound sensor attached to the user detects the sleep state of the user by detecting the sounds of snoring or tossing and turning, and measures the sleep environment through a temperature and humidity sensor [13,14]. For example, a wearable device such as a bracelet as shown in Figure 1b, provides a sleep care service. FLEX, which was developed by Fitbit, is a representative example. It provides information on activity, weight, and diet management as well as informing the user of sleep efficiency by measuring sleep time, tossing and turning, and sleep patterns. This contributes to the user’s comprehensive health management [15,16]. As shown in Figure 1c, the sleep care pillow measures sleep disorders such as

Entropy 2017, 19, 450 Entropy 2017, 19, 450

3 of 18

3 of 18

sleep disorders such as tossing and turning, incorrect sleep posture, snoring, and apnea. It measures snoring by judging the user’s breathing state through the pressure sensor and vibration sensor tossing and turning, incorrect sleep posture, snoring, and apnea. It measures snoring by judging the attached to the pillow [17]. user’s breathing state through the pressure sensor and vibration sensor attached to the pillow [17]. These devices also provide measurements in tandem with the mobile applications shown in These devices also provide measurements in tandem with the mobile applications shown in Figure 1d [18]. Some smart phones are equipped with various sensors to provide various functions, Figure 1d [18]. Some smart phones are equipped with various sensors to provide various functions, and there are applications that measure and manage the sleep state independently even if they are and measure notthere linkedare to applications the sleep carethat devices [19]. and manage the sleep state independently even if they are not linked to the sleep care devices [19].

Figure1.1. Sleep Sleep care services (a)(a) Sleep monitor device; (b) (b) Sleep carecare pillow; Figure servicesusing usingdevice deviceand andmobile, mobile, Sleep monitor device; Sleep pillow; (c)Sleep Sleepcare carewatch; watch; (d) Sleep Sleep care (c) care mobile mobileapplication. application.

A variety of sleep care services allow users to check their sleep state or sleep environment to A variety of sleep care services allow users to check their sleep state or sleep environment to manage themselves, which contributes to proper sleep management. However, since sleep care manage themselves, which contributes to proper sleep management. However, since sleep care devices devices and mobile applications operate independently, an integrated analysis of the information and mobile applications operate independently, an integrated analysis of the information measured measured is required. If the measurements can be integrated and supplemented, it will enable more is required. If the measurements can be integrated and supplemented, it will enable more accurate accurate sleep management. This can be achieved by using IoT technology, and can efficiently sleep management. This can be achieved by using IoT technology, and can efficiently provide sleep provide sleep care services. Measurements can be exchanged by autonomous data transmission care services. Measurements exchanged datapurpose, transmission among IoT devices among IoT devices equippedcan withbevarious kindsby of autonomous sensors. For this a protocol suitable for equipped with various kinds of sensors. For this purpose, a protocol suitable for the IoT environment the IoT environment is needed to support communication between IoT devices and sensors. is needed to support communication between IoT devices and sensors. 2.2. IoT Application Protocol 2.2. IoT Application Protocol IoT technology adapts its usability based on the network environment, transmission structure, technology adapts its usability based on the network environment, transmission structure, andIoT method. A transmission structure, a suitable utilization method, and an operating environment and structure, suitable utilization method, and an are method. required A to transmission provide IoT services in aarestricted environment. Therefore, an operating applicationenvironment protocol are required to provide IoT services a restrictedand environment. Therefore, an protocols application protocol should be applied according to the IoTinenvironment service provided. Typical used for should be applied according to the IoT environment and service provided. Typical protocols used for this purpose include HTTP (HyperText Transfer Protocol), MQTT, and CoAP. this purpose (HyperText Transfer MQTT,environment and CoAP. as well as the IoT HTTP isinclude one ofHTTP the typical protocols usedProtocol), in the internet environment. Thisofapplication-layer protocol operating top ofenvironment TCP (Transmission HTTP is one the typical protocols used in the on internet as well Control as the IoT Protocol) /IP (Internet Protocol) follows the server/client model. When client transmits a request, a environment. This application-layer protocol operating on top of TCP a(Transmission Control Protocol) server communicates with the request on a 1:1 basis. In addition, HTTP provides services in the form /IP (Internet Protocol) follows the server/client model. When a client transmits a request, a server of RESTful APIs (Application Programming Interface), so it uses the provides methods such as GET, POST, communicates with the request on a 1:1 basis. In addition, HTTP services in the form of PUT, and DELETE to inform the server of the location of resources and the type of request. RESTful APIs (Application Programming Interface), so it uses the methods such as GET, POST, PUT, MQTT istoainform Publish/Subscribe messaging protocol optimized environment and DELETE the server of the location of resources andfor thean type of request.with limited bandwidth. Each Client operates on Broker, and based on a specific Topic, Client transmits MQTT is a Publish/Subscribe messaging protocol optimized for an environment with limited information about Topic to Broker as Publish simultaneously receives updates to Topic as Subscribe. bandwidth. Each Client operates on Broker, and based on a specific Topic, Client transmits information Therefore, it is easy to provide N: M service because Broker acts as a message bus that intermediates about Topic to Broker as Publish simultaneously receives updates to Topic as Subscribe. Therefore, it is easy to provide N: M service because Broker acts as a message bus that intermediates Topic’s Publisher and Subscriber. In addition, it is designed to consume less battery, and there is no restriction

Entropy 2017, 19, 450 Entropy 2017, 19, 450

4 of 18 4 of 18

Topic’s Publisher and Subscriber. In addition, it is designed to consume less battery, and there is no restriction on thesize message to the characteristics of Publish/Subscribe, which is advantageous on the message due tosize thedue characteristics of Publish/Subscribe, which is advantageous in the in the development between heterogeneous platforms. development between heterogeneous platforms. Finally, unlike operating on on UDP (User Datagram Protocol) has been Finally, unlike HTTP HTTPororMQTT, MQTT,CoAP CoAP operating UDP (User Datagram Protocol) has developed to allow devices withwith limited resources to tocommunicate network been developed to allow devices limited resources communicateininaa restricted restricted network environment[9]. [9].Although Although communication the layer UDPcannot layer not cannot not guarantee its environment thethe communication usingusing the UDP guarantee its reliability, reliability, CoAPCON supports CON (Confirmable) message and ACK (Acknowledgment) message, CoAP supports (Confirmable) message and ACK (Acknowledgment) message, enabling a enabling a 1:1 reliable transmission HTTP. also hasof a feature of using the GET, POST, and 1:1 reliable transmission like HTTP.like It also has It a feature using the GET, POST, PUT, and PUT, DELETE DELETE of methods of theAPI RESTful API provided methods the RESTful provided by HTTP. by HTTP. Figure 2a 2ashows showsa Request/Response a Request/Response Transmission Method ofHTTP an HTTP message. The HTTP Figure Transmission Method of an message. The HTTP client client requests the temperature value theserver HTTPusing server GET and method, and the server requests the temperature value from thefrom HTTP theusing GET the method, the server responds responds towith the client withthat thethe result thathas thebeen request has beenprocessed successfully processed usingcode the to the client the result request successfully using the response response code 2b of shows 200. Figure 2b showstransmission the messagemethod transmission method CoAP Client and of 200. Figure the message between CoAPbetween Client and CoAP Server. CoAP Server. The CoAP requests the temperature value from CoAP Servermessage using the The CoAP requests the temperature value from CoAP Server using the CON andCON GETmessage method. and CoAP GET method. Thereceived CoAP Server that message received responds the CON message responds byinstoring themessage, result in The Server that the CON by storing the result the ACK the ACK is a In response message. this process, it is possible to distinguish the which is amessage, responsewhich message. this process, it is In possible to distinguish the message transaction message transaction through the message ID ([0xab12]), enabling reliable information transmission. through the message ID ([0xab12]), enabling reliable information transmission.

Figure 2. 2. Message Message transfer method of HTTP and CoAP. (a) HTTP message (b) CoAP transfer method of HTTP and CoAP. (a) HTTP message transfer;transfer; (b) CoAP message message transfer. transfer.

Figure 33 shows shows the the CoAP CoAP service service model model that that is is most most widely widely used used in in the the IoT IoT service. service. Each Figure Each IoT, IoT, classified into a Server and a Client, requests and transmits the date needed to mutually provide classified into a Server and a Client, requests and transmits the date needed to mutually provide services to the IoT devices corresponding to the client request the services to users. users. In Inthe theConstrained ConstrainedNetwork, Network, the IoT devices corresponding to the client request CoAP andand receive the the services from the the IoT IoT devices corresponding to the server. For For example, the the CoAP receive services from devices corresponding to the server. example, client requests from the server the information measured by the sensor. The client requests the the client requests from the server the information measured by the sensor. The client requests the information measured measured by by the the sensor sensor from from the the server, server, receives receives the the results, results, and and operates operates the the actuator actuator information attached to to the the IoT IoT device device according according to to the the service service to to be be provided. provided. attached However, IoT application protocol should be able to provide various various services services through through storage, storage, However, IoT application protocol should be able to provide analysis, processing and conversion of data through IoT platforms rather than simply providing analysis, processing and conversion of data through IoT platforms rather than simply providing services through through aa network network interface. interface. These These services services are provided in in conjunction conjunction with with the the cloud cloud to to services are provided efficiently collect, analyze and manage large amounts of data due to the spread of IoT technology. efficiently collect, analyze and manage large amounts of data due to the spread of IoT technology. The IoT IoT cloud virtual storage and processing capabilities, andand the The cloud also alsoincludes includesvarious variousservers serverswith with virtual storage and processing capabilities, senor and actuator with virtual sensing and actuating capabilities. Through this, the IoT cloud collects the senor and actuator with virtual sensing and actuating capabilities. Through this, the IoT cloud information from all from the sensors the cloud andcloud analyzes collected in an integrative collects information all theinsensors in the andthe analyzes theinformation collected information in an way to derive the results, thereby providing various services to the user according to the result integrative way to derive the results, thereby providing various services to the user according to the obtained [20–22]. However, the sensor andand actuator with have result obtained [20–22]. However, the sensor actuator withlimited limitednetwork network environments environments have limitations in directly interacting with the IoT cloud. Therefore, if a protocol suitable for a limited limitations in directly interacting with the IoT cloud. Therefore, if a protocol suitable for a limited network environment environment and and an an existing existing Internet Internet environment environment is is utilized, utilized, an an interface interface suitable suitable for for each each network IoT device can be provided. The IoT service model using the CoAP, which is a typical model suitable IoT device can be provided. The IoT service model using the CoAP, which is a typical model suitable for the the limited limited environment, environment, also also provides provides the the inter-HTTP inter-HTTP interface interface that that is is commonly commonly used used in in the the for existing internet environment through the CoAP-HTTP proxy [23,24]. In addition, since CoAP uses existing internet environment through the CoAP-HTTP proxy [23,24]. In addition, since CoAP uses RESTful-basedAPIs APIslike like HTTP, it the hasadvantage the advantage of providing different RESTful-based HTTP, it has of providing mappingmapping between between different protocols protocols in a moreway efficient way [25,26]. in a more efficient [25,26].

Entropy 2017, 19, 450

5 of 18

Entropy 2017, 19, 450

5 of 18

Figure 3. IoT service model using CoAP. Figure 3. IoT service model using CoAP.

In this paper, we will apply a service method which can utilize both the restricted network and In this paper, weenvironment. will apply a service method the restricted networksleep and the existing internet The sleep care which servicecan thatutilize uses both this method can measure the existing through internet various environment. The sleep and carecollect serviceinformation that uses this method measure information physical sensors necessary forcan judging the sleep sleep information through various physical sensors and collect information necessary for judging the sleep state from the server or mobile device corresponding to the existing internet environment. Therefore, state fromtothe or mobile device corresponding to the existing internetsimilar environment. we want useserver CoAP—an IoT application protocol that provides functions to thoseTherefore, of HTTP we want to use CoAP—an IoT application protocol that provides functions similar to those of HTTP together with HTT—which is most widely used in the existing internet environment. In addition, together with HTT—which is most widely used in the existing internet environment. In addition, since since CoAP can reliably transmit information on a 1:1 basis, it has the advantage of being able to CoAP can reliably transmit information on a 1:1 basis, it has the advantage of being able to integrate integrate information measured by various sensors in a restricted network without loss of data. information measured by various restricted network without loss ofCoAP data. Therefore, we Therefore, we will propose a smartsensors model in forasleep care service using HTTP and together with will propose a smart model for sleep care service using HTTP and CoAP together with an application an application protocol suitable for inter-IoT devices communication. protocol suitable for inter-IoT devices communication. 3. Sleep Information Gathering Protocol 3. Sleep Information Gathering Protocol 3.1. Smart Model for Sleep Care Service 3.1. Smart Model for Sleep Care Service The proposed smart model for a sleep care service is a model that collects and integrates the The proposed smart model for a sleep care service is a model that collects and integrates the information from an IoT device with distributed sensors to analyze a variety of sleep information. information from an IoT device with distributed sensors to analyze a variety of sleep information. This model works by connecting each IoT device to a network to provide services to the IoT platform. This model works by connecting each IoT device to a network to provide services to the IoT platform. It also provides two operation modes according to the IoT device connected to the network. It also provides two operation modes according to the IoT device connected to the network. In Figure 4, IoT devices for sleep care are equipped with various physical sensors (such as a In Figure 4, IoT devices for sleep care are equipped with various physical sensors (such as a sound sensor, ambient light sensor, temperature sensor, and/or motion sensor) and operate at home. sound sensor, ambient light sensor, temperature sensor, and/or motion sensor) and operate at home. A physical sensor is a hardware type sensor that measures physical data that can be measured by a A physical sensor is a hardware type sensor that measures physical data that can be measured by a sound sensor, an illuminance sensor, or a temperature sensor. The data measured by each physical sound sensor, an illuminance sensor, or a temperature sensor. The data measured by each physical sensor is used to analyze the sleep state and sleep environment. The sensor that measures the data sensor is used to analyze the sleep state and sleep environment. The sensor that measures the data used to analyze sleep state includes a sound sensor and a motion detection sensor. The sound sensor used to analyze sleep state includes a sound sensor and a motion detection sensor. The sound sensor detects the presence and magnitude of the sound generated by the user, and the motion sensor detects the presence and magnitude of the sound generated by the user, and the motion sensor measures the motion of the user during sleep. The sensor that measures the data used to analyze measures the motion of the user during sleep. The sensor that measures the data used to analyze sleep sleep environment includes temperature sensors, humidity sensors, and illuminance sensors. Each environment includes temperature sensors, humidity sensors, and illuminance sensors. Each sensor sensor measures temperature, humidity, and illuminance during sleep. A virtual sensor in the form measures temperature, humidity, and illuminance during sleep. A virtual sensor in the form of of software autonomously receives the data measured through a physical sensor and collects software autonomously receives the data measured through a physical sensor and collects additional additional information by analyzing the information. The sleep sensor used in the smart model for information by analyzing the information. The sleep sensor used in the smart model for sleep care sleep care service is an example of a virtual sensor. For a similar case, there is IEEE 1451, an service is an example of a virtual sensor. For a similar case, there is IEEE 1451, an international standard international standard for smart sensors established by NIST (National Institute of Standards and for smart sensors established by NIST (National Institute of Standards and Technology) and IEEE [27]. Technology) and IEEE [27]. Although the IEEE 1451 smart sensor interface standard which has been Although the IEEE 1451 smart sensor interface standard which has been standardized to date only standardized to date only specifies the point-to-point interface, the Sleep Sensor defined in this paper specifies the point-to-point interface, the Sleep Sensor defined in this paper receives information from receives information from various physical sensors. By utilizing and analyzing information received, various physical sensors. By utilizing and analyzing information received, it generates and utilize it generates and utilize various information such as sleep time, wakeup time, and awakening during

Entropy 2017, 19, 450

6 of 18

Entropy 2017, 19, 450

6 of 18

various information such as sleep time, wakeup time, and awakening during sleep in a complex manner. such, this model operating method for analyzing sleep by sleep in aAs complex manner. Asprovides such, thisanmodel provides an operating method for information analyzing sleep transmitting collecting information measured by various sensors. information and by transmitting and collecting information measured by various sensors.

Figure4.4. Smart Smart model modelof ofinformation informationgathering gatheringfor forsleep sleepcare. care. Figure

However, since the method of analyzing the sleep information based on sensor information However, since the method of analyzing the sleep information based on sensor information cannot manage sleep systematically over the long term, an operation mode using IoT technology is cannot manage sleep systematically over the long term, an operation mode using IoT technology required. Therefore, we propose an operation mode by applying the IoT technology to the sleep is required. Therefore, we propose an operation mode by applying the IoT technology to the sleep sensor. Each sleep sensor operating in our home is connected to the IoT platform, and receives the sensor. Each sleep sensor operating in our home is connected to the IoT platform, and receives the health information or sleep information of the user from the healthcare server or sleep care server health information or sleep information of the user from the healthcare server or sleep care server connected to the IoT platform. The health information and sleep information of users stored in the connected to the IoT platform. The health information and sleep information of users stored in the virtualization storage is received from the IoT Cloud connected to the IoT platform. In addition, the virtualization storage is received from the IoT Cloud connected to the IoT platform. In addition, the information entered by the user can be utilized in conjunction with the mobile device. By integrating information entered by the user can be utilized in conjunction with the mobile device. By integrating this information to analyze the sleep information, more accurate results can be obtained compared to this information to analyze the sleep information, more accurate results can be obtained compared to the results obtained by using the sensor only. In order to provide a service to analyze sleep the results obtained by using the sensor only. In order to provide a service to analyze sleep information information in real time, the sleep sensor with two operational methods collects measurement in real time, the sleep sensor with two operational methods collects measurement information from information from the distributed physical sensor and information from IoT devices connected to the the distributed physical sensor and information from IoT devices connected to the IoT platform. IoT platform. In this process, communication between the sleep sensor and the IoT device connected In this process, communication between the sleep sensor and the IoT device connected to the IoT to the IoT platform utilizes an HTTP-based protocol, which is mainly used in the existing network. platform utilizes an HTTP-based protocol, which is mainly used in the existing network. And in the And in the communication between the sleep sensor and the physical sensor, CoAP, one of the IoT communication between the sleep sensor and the physical sensor, CoAP, one of the IoT application application protocols, is used. CoAP is suitable for communication with distributed physical sensors protocols, is used. CoAP is suitable for communication with distributed physical sensors centered on a centered on a sleep sensor because it transmits reliable messages in 1:1 or 1:N form. In addition, it is sleep sensor because it transmits reliable messages in 1:1 or 1:N form. In addition, it is easy to connect easy to connect with the IoT platform through the sleep sensor because it has advantage of being with the IoT platform through the sleep sensor because it has advantage of being similar to HTTP. similar to HTTP. However, since the IoT platform provides multiple users with IoT services through a network of However, since the IoT platform provides multiple users with IoT services through a network connected IoT devices, there may be a large amount of traffic or a delay in transmitting a large amount of connected IoT devices, there may be a large amount of traffic or a delay in transmitting a large of data. According to a recent survey, the number of IoT devices connected to the internet by 2020 amount of data. According to a recent survey, the number of IoT devices connected to the internet by is expected to be about 20 billion to 40 billion. When using existing 4G networks, there is a limit to 2020 is expected to be about 20 billion to 40 billion. When using existing 4G networks, there is a limit traffic that can accommodate all devices. However, the use of the 5G network can provide a real-time to traffic that can accommodate all devices. However, the use of the 5G network can provide a realservice by increasing the transmission rate 100 times compared to that of the existing 4G network time service by increasing the transmission rate 100 times compared to that of the existing 4G network and by minimizing the network latency. The 5G network is capable of high-speed data transmission using a bandwidth of more than a few hundred MHz within a high bandwidth of 300 GHz, which is beyond the limit of transmitting signals only within a low bandwidth of less than 3 GHz. The model

Entropy 2017, 19, 450

7 of 18

and by minimizing the network latency. The 5G network is capable of high-speed data transmission using bandwidth of more than a few hundred MHz within a high bandwidth of 300 GHz, which is Entropy a2017, 19, 450 7 of 18 beyond the limit of transmitting signals only within a low bandwidth of less than 3 GHz. The model suggested in in this this paper paperalso alsouses usesIoT IoTtotoprovide providesleep sleepcare careservices servicesbyby transmitting data real-time suggested transmitting data in in real-time to to various homes such as Home A, Home B and Home C. Therefore, model suggested study various homes such as Home A, Home B and Home C. Therefore, the the model suggested this this study has has considered thenetwork 5G network attracting attention a new mobile communication network. considered the 5G attracting attention as a as new mobile communication network. The sleep information analyzed by the sleep sensor is transmitted to the IoT Cloud and stored in the virtualization storage in the cloud to provide information to the IoT devices connected to the same IoT Cloud. For example, a user who has completed a sleep measurement can identify the sleep information transmitted to the IoT Cloud using a mobile application, application, thereby providing a customized service to induce positive sleep. 3.2. Protocol Design Design for for the the Model 3.2. Protocol Model In we propose the activities activities of of the the physical physical sensor, sensor, sleep In Figures Figures 5–7, 5–7, we propose the sleep sensor, sensor, and and sleep sleep care care server operating in the Smart Model for Sleep Care service by each phase. Figure 5 shows the process of Discovery & Connection Phase in which the sleep sensor detects and connects the neighboring physical sensors.

Figure sleep sensors sensors and and physical physical sensors. sensors. Figure 5. 5. Activity Activity diagram diagram of of aa smart smart model model for for connecting connecting sleep

When the service is started, the physical sensor resets the attached sensors and converts them When the service is started, the physical sensor resets the attached sensors and converts them into a standby state. The sleep sensor converts the state into Discovery, generates a Discovery.req into a standby state. The sleep sensor converts the state into Discovery, generates a Discovery.req message to search for the physical sensor around the user, and broadcasts the message. The physical message to search for the physical sensor around the user, and broadcasts the message. The physical sensor that sensed this request transmits a Discovery.res response and the sleep sensor that received sensor that sensed this request transmits a Discovery.res response and the sleep sensor that received the response message from the physical sensor generates the sensor table classified by the address of the response message from the physical sensor generates the sensor table classified by the address of each physical sensor address and the type of measurement. Next, the sleep sensor converts the state each physical sensor address and the type of measurement. Next, the sleep sensor converts the state to to Connection and transmits a Connection.req message to the physical sensor based on the generated Connection and transmits a Connection.req message to the physical sensor based on the generated sensor table to request connection setup between the sensors. The physical sensor that received this sensor table to request connection setup between the sensors. The physical sensor that received this message responds with a Connection.res message, and the sleep sensor establishes a setup between the sensors that received the response message. When the connection is complete, the sleep sensor converts the state into Measurement.

Entropy 2017, 19, 450

8 of 18

message responds with a Connection.res message, and the sleep sensor establishes a setup between the sensors that received the response message. When the connection is complete, the sleep sensor converts the19,state Entropy 2017, 450 into Measurement. 8 of 18

Figure 6. Activity diagram of smart model for measuring data. Figure 6. Activity diagram of smart model for measuring data.

Figure 6 shows the Measurement & Analysis Phase in which the sleep sensor receives data from 6 shows the Measurement & Analysis Phase in which the sleep sensor receives datasensor from bothFigure the physical sensor and the sleep care server to measure and analyze sleep state. The sleep both the physical sensor and the sleep care to measure and analyze sleep state. sleep sensor in the state of Measurement transmits an server AutoOn.req or mData.req message to theThe physical sensor in the state of Measurement transmits an AutoOn.req or mData.req message to the physical sensor that that has been completely connected to request data measurement. The AutoOn.req message is a has been completely connected to request data measurement. The AutoOn.req message is a request request to automatically receive information measured from the physical sensor at regular intervals, to automatically receive information measured fromone the value physical sensor at intervals, and The the and the mData.req message is a request to receive measured byregular the physical sensor. mData.req message is a request to receive one value measured by the physical sensor. The physical physical sensor measures the state according to the request message. sensor measures the state according the request Once the AutoOn.req message to is received, themessage. physical sensor sets the time to measure the data Once the AutoOn.req message is received, the physical sensor themeasured time to measure thetodata continuously and measures the data using the attached sensor. Thesets data according the continuously and measures the data using the attached sensor. The data measured according to the time cycle is transmitted to the sleep sensor, and the result value is included in the AutoOn.res time cycleand is transmitted toto the sleep sensor, and thesleep resultsensor value that is included in the the AutoOn.res AutoOn.res message message transmitted the sleep sensor. The received message and transmitted to the sleep sensor. The sleep sensor that received the AutoOn.res obtainsIf obtains measurement data. After that, it can obtain values by receiving messagesmessage periodically. measurement data. After that, it can obtain values by receiving messages periodically. If measurement measurement data is no longer needed, it send the AutoOff.req message from the physical sensor to data nodata longer needed, it send AutoOff.req message fromthis themessage physical releases sensor tothe stop the data stop is the measurement. The the physical sensor that received preset time measurement. The physical sensor that received this message releases the preset time and responds and responds with the AutoOff.res message, and the sleep sensor completes the data measurement with the AutoOff.res message,Ifand the sleepmessage sensor completes thethe data measurement through the through the periodic request. a mData.req is received, physical sensor also measures periodic request. If a mData.req message is received, the physical sensor also measures the data. the data. The measurement data is transmitted to the sleep sensor through the mData.res message, and the sleep sensor that received the message confirms the measurement data and completes data measurement. To utilize the existing measurement and analysis information in addition to the information measured by the physical sensor, the sleep sensor sends a data inquiry request to the sleep care server. The message used for this purpose is sData.req. The sleep care server that received this message queries the stored information from the database and responds with a sData.res message.

Entropy 2017, 19, 450

9 of 18

The measurement data is transmitted to the sleep sensor through the mData.res message, and the sleep sensor that received the message confirms the measurement data and completes data measurement. To utilize the existing measurement and analysis information in addition to the information measured by the physical sensor, the sleep sensor sends a data inquiry request to the sleep care server. The message used for this purpose is sData.req. The sleep care server that received this message Entropy 2017, 19, 450 9 of 18 queries the stored information from the database and responds with a sData.res message. The sleep sensor integrates integrates the the information information received received through through AutoOn.res, AutoOn.res, mData.res, mData.res, and sData.res messages and analyzes sleep state using the Sleep Care Smart Smart Algorithm. Algorithm. The Sleep Care Smart Algorithm information in real timetime and and terminates the sleep analysis when Algorithmanalyzes analyzesthe thereceived received information in real terminates the sleep analysis the sleep measurement is complete. The information analyzed by this process is stored in the sleep when the sleep measurement is complete. The information analyzed by this process is stored in the care and used sleep in the in future. Therefore, the sleep sends sends a request to the sleepserver care server andfor used for analysis sleep analysis the future. Therefore, the sensor sleep sensor a request sleep server including the analyzed information in the aData.req message. The sleep server to thecare sleep care server including the analyzed information in the aData.req message. Thecare sleep care that received this request responds with aData.res message and completes the data storage. After that, server that received this request responds with aData.res message and completes the data storage. the sleep converts the state into After that,sensor the sleep sensor converts theRelease. state into Release. Finally, Figure 7 is the the Release Release Phase in which the sleep sensor and physical sensor are disconnected. A A sleep sleep sensor sensor in in a state of Release transmits a Release.req message to the physical sensor because it does not need to to maintain maintain the the connection connection with with the the physical physical sensor. sensor. The physical sensor that received this message generates generates a Release.res Release.res message message and and responds responds to to the the sleep sleep sensor. sensor. The sleep sensor releases the connection with the physical sensor registered in the sensor table and ends the service.

Figure 7. diagram of smart model for releasing connection between sleep sensor physical Figure 7.Activity Activity diagram of smart model for releasing connection between sleepand sensor and sensor. physical sensor.

Unlike the IoT device connected to the IoT platform in the smart model for sleep care service, Unlike the IoT device connected to the IoT platform in the smart model for sleep care service, the IoT device equipped with the physical sensor used in various environments needs the network the IoT device equipped with the physical sensor used in various environments needs the network protocol to provide a transmission service between Sleep sensors. If the CoAP—as described in protocol to provide a transmission service between Sleep sensors. If the CoAP—as described in previous studies—is used, that will allow it to utilize the IoT devices with limited resources more previous studies—is used, that will allow it to utilize the IoT devices with limited resources more efficiently and to exchange the data between the virtual sensor, mobile devices, and the IoT platform efficiently and to exchange the data between the virtual sensor, mobile devices, and the IoT platform through CoAP-HTTP Proxy. In addition, the secure communication in sleep care application is through CoAP-HTTP Proxy. In addition, the secure communication in sleep care application is applied applied by applying the security standards provided by HTTP and CoAP. HTTPS, a securityby applying the security standards provided by HTTP and CoAP. HTTPS, a security-enhanced version enhanced version of HTTP, provides the ability to encrypt the session data through SSL (Secure of HTTP, provides the ability to encrypt the session data through SSL (Secure Socket Layer) or TLS Socket Layer) or TLS (Transport Layer Security) protocols. CoAP also provides security-enhanced (Transport Layer Security) protocols. CoAP also provides security-enhanced CoAPS through DTLS CoAPS through DTLS (Datagram Transport Layer Security). In short, it is possible to provide the smart model for a sleep care service more efficiently by using a CoAP-based Smart Information Gathering Protocol. Figure 8 defines the structure of the transmission data of a Sleep Information Gathering Protocol for use in the smart model for sleep care service. The message header comprises the first to fourth fields. The first field SEQ indicates the serial number of message which is comprised of 2 bytes. The serial number is used most often in the AutoOn.req/AutoOn.res message which requests periodic

Entropy 2017, 19, 450

10 of 18

(Datagram Transport Layer Security). In short, it is possible to provide the smart model for a sleep care service more efficiently by using a CoAP-based Smart Information Gathering Protocol. Figure 8 defines the structure of the transmission data of a Sleep Information Gathering Protocol for use in the smart model for sleep care service. The message header comprises the first to fourth fields. The first field SEQ indicates the serial number of message which is comprised of 2 bytes. The serial number is used most often in the AutoOn.req/AutoOn.res message which requests periodic sensor measurements Entropy 2017, 19, 450and receives the results. Considering that the sensor measurement cycle, in general, 10 of 18 is 0.8 s to 1 s, the number of messages used per sleep cycle is about 36,000 to 45,000. A message device that of transmits packets. Since 65,535 it stores the ID value for identifying each IoTthe device, it is comprised 1-byte size can utilize messages. The second field is the ID of IoT device comprised of 1 packets. byte. TheSince thirditfield is comprised of 1for byte, indicating theIoT length of the fourth field. that transmits stores the ID value identifying each device, it is comprised The fieldthird shows theis address to utilize the indicating URI in CoAP HTTP. URI isfield. usedThe based on of 1 fourth byte. The field comprised of 1 byte, the or length of Each the fourth fourth the API. each URI has variable size, field sizeURI is determined fieldREST shows the Since address to utilize theaURI in CoAP or the HTTP. Each is used basedbyonthe thethird RESTfield API. LENGTH. decision to use thethe remaining (except by forthe thethird fourfield fields described is Since each The URI has a variable size, field size items is determined LENGTH. Theabove) decision determined depending on the message type. DTdescribed field indicates the of data depending measured by to use the remaining items (except for the fourThe fields above) is type determined onthe the sensor is configured in 1field byte.indicates Time Field the measured time of theby sleep measured. message type. The DT the indicates type of data the information sensor is configured in When 1 byte. the sleep sensor analyzes the measured sleep information in an integrative sleepanalyzes state of the Time Field indicates the time of the sleep information measured. When theway, sleepthe sensor the user may vary to the measurement time.the Therefore, the synchronization between measured sleepaccording information in an integrative way, sleep state oftime the user may vary according tothe the sensors is adjusted Time Field. Thesynchronization Time field included in the aData.req message indicates the measurement time.using Therefore, the time between the sensors is adjusted using Time time which wasaData.req analyzedmessage in the sleep sensor. the Field.atThe Timesleep fieldinformation included in the indicates the The timeVALUE at whichfield sleepindicates information measurement results, andsensor. the VLThe field configured in 1 bytethe is measurement used to indicate the variable sizefield of was analyzed in the sleep VALUE field indicates results, and the VL VALUE field. In addition, the Auto.req message for periodically receiving data sets the data configured in 1 byte is used to indicate the variable size of VALUE field. In addition, the Auto.req transmission options through the 2-byte OPT message for periodically receiving data sets thefield. data transmission options through the 2-byte OPT field.

Figure Figure8.8.Transfer Transferdata dataformat. format.

3.3. 3.3.Interface InterfaceDesign Design Table Table 11 defines defines the the method, method, URI, URI, and and internal internal protocol protocol used used by by applying applying the the REST REST API APIfor for the the respective respectivemessage messagedata data formats formats of of the the Sleep Sleep Information Information Gathering Gathering Protocol. Protocol. The Thesleep sleepsensor sensoruses uses the GET method methodwhen whenrequesting requesting data processes the result with the response In the GET data andand processes the result with the response message.message. In addition, addition, the data transmission message of the sleep sensor uses the POST method, and the result of the message transmission is confirmed through the response message. The message of the Sleep Information Gathering Protocol uses different internal protocols according to the communication partner. CoAP is used to transmit messages between physical sensors in a restricted network environment, and HTTP is used to transmit messages between existing IoT devices.

Entropy 2017, 19, 450

11 of 18

the data transmission message of the sleep sensor uses the POST method, and the result of the message transmission is confirmed through the response message. The message of the Sleep Information Gathering Protocol uses different internal protocols according to the communication partner. CoAP is used to transmit messages between physical sensors in a restricted network environment, and HTTP is used to transmit messages between existing IoT devices. Entropy 2017, 19, 450

11 of 18

Table 1. Sleep Information Gathering Protocol (SIGP) message data format for using REST API. Table 1. Sleep Information Gathering Protocol (SIGP) message data format for using REST API. Method SIGP Data Format URI Internal Protocol Method SIGP Data Format URI Internal Protocol Discovery.req/Discovery.res /sensor/discovery CoAP Discovery.req/Discovery.res /sensor/discovery CoAP Connect.req/Connect.res /sensor/connection CoAP Connect.req/Connect.res /sensor/connection CoAP mData.req/mData.res /sensor/measurement CoAP GET mData.req/mData.res /sensor/measurement CoAP GET sData.req/sData.res /server/storage HTTP sData.req/sData.res /server/storage HTTP AutoOn.req/Auto.res /sensor/automaticon CoAP AutoOn.req/Auto.res /sensor/automaticon CoAP AutoOff.req/AutoOff.res /sensor/automaticoff CoAP AutoOff.req/AutoOff.res /sensor/automaticoff CoAP POST aData.req/aData.res /sensor/analysis HTTP POST aData.req/aData.res /sensor/analysis HTTP

Figure showsthe thesequence sequencediagram diagramofof process which sleep sensor searches for Figure 99 shows thethe process by by which thethe sleep sensor searches for and and connects the neighboring physical sensors by applying the defined message data format connects with with the neighboring physical sensors by applying the defined message data format of the of theInformation Sleep Information Gathering Protocol. The Sleep Information Protocol based operates Sleep Gathering Protocol. The Sleep Information GatheringGathering Protocol operates on based on CoAP for message transmission between physical sensors. The sleep sensor broadcasts the CoAP for message transmission between physical sensors. The sleep sensor broadcasts the Discovery.req Discovery.req stores Discovery.req message message to to identify identify neighboring neighboring physical physical sensors. sensors. Discovery.req stores the the message message sequence number, the device ID of the sleep sensor, and the URI corresponding to the U-CoAP sequence number, the device ID of the sleep sensor, and the URI corresponding to the U-CoAP field. field.

Figure 9. Sequence diagram of discovery & connection phase using SIGP. Figure 9. Sequence diagram of discovery & connection phase using SIGP.

The physical sensor that received this message responds by generating a Discovery.res message. The physical sensorthe thatsame received this message responds generating a Discovery.res Discovery.res contains sequence number as the by request, its device id, and message. the URI Discovery.res contains the same sequence number as the request, its device id, URI corresponding to the Discovery.res message. It also contains the address and type ofand the the physical corresponding to the Discovery.res message. It also contains address and type ofgenerates the physical sensor in the value field, and the sleep sensor that received thethe Discovery.res message the sensor in the value field, and the sleep sensor that received the Discovery.res message generates the sensor table with the contents stored in the value. Based on the generated sensor table, the sleep sensor table witha the contents message stored intothe Based the generated sensor thesensor sleep sensor transmits Connect.req thevalue. address of theon physical sensor, and the table, physical sensor transmits a Connect.req message to the address of the physical sensor, and the physical sensor responds with Connect.res. responds with Connect.res. Figure 10 shows Measurement & Analysis Phase in which the sleep sensor requests data from Figure 10sensor shows and Measurement & Analysis Phase in which the sleep from the the physical sleep care server, then receives results. Thesensor sleeprequests sensor data transmits an physical sensor and sleep care server, then receives results. The sleep sensor transmits an AutoOn.req AutoOn.req message to the physical sensor for periodic data measurement. The AutoOn.req message has a DT field for identifying the data type for measurement and an OPT field for setting options for periodic data measurement. The physical sensor that received this message responds with an AutoOn.res message and periodically responds by including measurement data in the value. The sleep sensor uses the AutoOff.req message to indicate it does not need more data, and transmits the data type for which it wants to stop the measurements. The sleep sensor receives an AutoOff.res

Entropy 2017, 19, 450

12 of 18

message to the physical sensor for periodic data measurement. The AutoOn.req message has a DT field for identifying the data type for measurement and an OPT field for setting options for periodic data measurement. The physical sensor that received this message responds with an AutoOn.res message and periodically responds by including measurement data in the value. The sleep sensor uses the AutoOff.req message to indicate it does not need more data, and transmits the data type for which it wants to stop the measurements. The sleep sensor receives an AutoOff.res message in response to the request. It uses mData.req message when it needs only one measurement value, not Entropy 2017, 19, 450 12 of 18 periodic measurement. This message also identifies the data type for measurement through the DT field, and the physical sensor that received a request responds by storing the result in the value field of through the DT field, and the physical sensor that received a request responds by storing the result the mData.res message. in the value field of the mData.res message.

Figure 10. Sequence diagram of measurement & analysis phase using SIGP. Figure 10. Sequence diagram of measurement & analysis phase using SIGP.

When the sleep sensor requests information stored from the sleep care server, the requested data Wheninthe sensor requests information stored sleepfor care are stored thesleep DT field using the sData.req message. Thefrom resultthe values theserver, requestthe arerequested stored in datavalue are stored the DT fieldresponse using the sData.req message. The resulton values for the request are the field ofinthe sData.res message. When the sleep sensor, the other hand, requests stored in the value field of the sData.res response message. When the sleep sensor, on the other hand, data storage from the sleep care server, it uses aData.req message and transmits the message by requests data storage from sleep care server, uses The aData.req message and transmits including the data value to the be stored in the valueitfield. sleep care server that receivedthe themessage request by including data value to be which stored confirms in the value field.isThe sleep care server that received the responds withthe aData.res message, the data stored. For data transmission between request responds with aData.res message, which confirms the data is stored. For data transmission the sleep sensor and the sleep care server, HTTP is used instead of CoAP. Since the server used in the betweenIoT theenvironment sleep sensor isand sleep care server, HTTP is used instead of CoAP. Since Therefore, the server existing notthe a restricted environment, it transmits data based on HTTP. used in the existing IoT environment is not a restricted environment, it transmits based the on HTTP. it transmits the message by storing the URI value of HTTP in the U-HTTP fielddata between sleep Therefore, it transmits the message by storing the URI value of HTTP in the U-HTTP field between the sensor and sleep care server. sleepFigure sensor11 and sleepthe care server.Phase in which the sleep sensor requests a release from the physical shows Release Figure 11 shows the Release in which message the sleepto sensor releasetofrom the physical sensor. The sleep sensor transmitsPhase a Release.req each requests physical asensor be released. The sensor. The sleep sensor transmits a Release.req message to each physical sensor to released. Release.req message has a message sequence number, the device ID of the sleep sensor,beand a URI value corresponding to Release.req. The physical sensor that received this message responds to the sleep sensor by including the same message sequence number, its device ID, and the URI value corresponding to release.res. The sleep sensor that received the response message releases the sensor table registered based on the device ID and completes the disconnection between the physical sensors.

Entropy 2017, 19, 450

13 of 18

The Release.req message has a message sequence number, the device ID of the sleep sensor, and a URI value corresponding to Release.req. The physical sensor that received this message responds to the sleep sensor by including the same message sequence number, its device ID, and the URI value corresponding to release.res. The sleep sensor that received the response message releases the sensor table registered based on the device ID and completes the disconnection between the physical sensors. Entropy 2017, 19, 450 13 of 18

Figure 11. Sequence diagram of release phase using SIGP. Figure 11. Sequence diagram of release phase using SIGP.

4. Experiment Protocols 4. Experiment Protocols 4.1. and Its Its Scenarios Scenarios 4.1. Testbed Testbed and As to verify verify the the effectiveness effectiveness of the Smart Smart Model Model for Sleep Care As shown shown in in Figure Figure 12, 12, in in order order to of the for Sleep Care service, we made a testbed by applying the Sleep Information Gathering Protocol to various service, we made a testbed by applying the Sleep Information Gathering Protocol to various IoT IoT devices. The IoT IoT device deviceused usedininthe thetestbed testbedincludes includes hardware and to which physical sensors devices. The hardware (A)(A) and (E)(E) to which physical sensors are are connected for measuring information for sleep carehardware and hardware (D) which operates as asensor sleep connected for measuring information for sleep care and (D) which operates as a sleep sensor that receives the information the physical sensor CoAP. through For each piece of that receives the information from thefrom physical sensor through ForCoAP. each piece of hardware, hardware, we used a Raspberry Pi 3 supporting Wi-Fi, and utilized a mobile application (H) to check we used a Raspberry Pi 3 supporting Wi-Fi, and utilized a mobile application (H) to check the the communication results between devices. A Samsung Galaxy S5 was used as the smartphone to communication results between devices. A Samsung Galaxy S5 was used as the smartphone to operate operate mobile applications. The Raspberry used in the experiment is very powerful mobile applications. The Raspberry Pi 3 usedPiin3 the experiment is very powerful hardwarehardware to apply to apply to the sleep monitoring service. However, more information should be measured, collected, to the sleep monitoring service. However, more information should be measured, collected, and and transmitted in order for the extension of the Smart Model for Sleep Care service to provide health transmitted in order for the extension of the Smart Model for Sleep Care service to provide health care care services. Therefore, the authors have experimented using Raspberry Pi 3 considering services. Therefore, the authors have experimented using Raspberry Pi 3 considering the scalabilitythe of scalability of the service, and experimented by applying the Sleep Information Gathering Protocol. the service, and experimented by applying the Sleep Information Gathering Protocol. For Raspberry Pi hardware (A), (D), and (E), we implemented the program using JavaScript on For Raspberry Pi hardware (A), (D), and (E), we implemented the program using JavaScript on the Node.js framework based on Raspbian OS (A). We used Raspbian OS (version 4.4.49) and Node.js the Node.js framework based on Raspbian OS (A). We used Raspbian OS (version 4.4.49) and Node.js framework (version 4.4). It has a human body sensor (HC-SR501) (B) and a sound sensor (SZHframework (version 4.4). It has a human body sensor (HC-SR501) (B) and a sound sensor (SZH-EK033) EK033) (C) for measuring a sleep state. (B) detects motion during sleep and (C) detects sound during (C) for measuring a sleep state. (B) detects motion during sleep and (C) detects sound during sleep, sleep, and they transmit the result to (A). (A) analyzes tossing and turning, snoring, and apnea based and they transmit the result to (A). (A) analyzes tossing and turning, snoring, and apnea based on the on the measurement values that it received. (E) also has a connected temperature-humidity sensor measurement values that it received. (E) also has a connected temperature-humidity sensor (DHT22) (DHT22) (F) and an illuminance sensor (GL55) (G), and each sensor is used to measure information (F) and an illuminance sensor (GL55) (G), and each sensor is used to measure information about the about the sleep environment. (A) and (E) are equipped with these physical sensors, so a CoAP-based sleep environment. (A) and (E) are equipped with these physical sensors, so a CoAP-based network network module is implemented as a program for data transmission between devices. Unlike (A) and module is implemented as a program for data transmission between devices. Unlike (A) and (E), the (E), the sleep sensor (D) is not equipped with sensors, but it receives measurement values from both sleep sensor (D) is not equipped with sensors, but it receives measurement values from both devices devices and analyzes the sleep state based on this information. We also implemented CoAP-HTTP and analyzes the sleep state based on this information. We also implemented CoAP-HTTP Proxy to Proxy to enable data request through a mobile application (H). enable data request through a mobile application (H).

Entropy 2017, 19, 450

14 of 18

Entropy 2017, 19, 450

14 of 18

Figure 12. Testbed for verifying smat model for sleep care. Figure 12. Testbed for verifying smat model for sleep care.

In this experimental environment, (D) searches neighboring (A) and (E) and establishes a In thisbetween experimental environment, (D) (D) searches neighboring and establishes connection devices. At this moment, can request the data(A) from (A)(E) andand (E) for analyzinga connection between devices. At this moment, (D) can request the data from (A) and (E) for analyzing and and processing sleep information, and measures the information about sleep state and sleep processing sleep information, and measures about state and sleep environment through the sensors installed.the (H)information can request datasleep measurement fromenvironment (A) and (E) through the sensors installed. (H) can request data measurement from (A) and (E) through (D). through (D). We conducted 3 experiments. In the first experiment, we compared the response time for HTTP HTTP We conducted 3 experiments. In the first experiment, we compared the response time for Request/Response between between (H) (H) and and (D) (D) and and the the response response time between Request/Response time for for CoAP CoAP Request Request /Response /Response between (D) and (A). In the second experiment, we compared the response time to the HTTP request of (H) (D) and (A). In the second experiment, we compared the response time to the HTTP request of (H) to to (A) as in the existing sleep care service, and the response time to the HTTP request of (H) to (A) (A) (A) as in the existing sleep care service, and the response time to the HTTP request of (H) to through CoAP third experiment, wewe measured andand compared the throughput and through CoAP Proxy Proxyofof(D). (D).InInthe the third experiment, measured compared the throughput consumed power for each request by comparing when the HTTP request was transmitted from the and consumed power for each request by comparing when the HTTP request was transmitted from sleep sensor (D) (D) to (A) equipped withwith the physical sensor and and when SIGPSIGP waswas used. the sleep sensor to (A) equipped the physical sensor when used. 4.2. Result and Evaluation 4.2. Result and Evaluation In this experiment, we implemented a system by applying the Sleep Information Gathering In this experiment, we implemented a system by applying the Sleep Information Gathering Protocol to each hardware operating in the Smart Model for Sleep Care. Figure 13 shows the Protocol to each hardware operating in the Smart Model for Sleep Care. Figure 13 shows the response response time of (D) to the request for data measurement from (H), and the time that took for (D) time of (D) to the request for data measurement from (H), and the time that took for (D) to receive to receive the results after requesting (A) and (E) for the measurement of the corresponding data. the results after requesting (A) and (E) for the measurement of the corresponding data. (D) converts (D) converts it into CoAP, and requests the data from (A) and (E), respectively. In order to analyze it into CoAP, and requests the data from (A) and (E), respectively. In order to analyze sleep sleep information in (D), we conducted experiments using two approaches: Request for sleep state information in (D), we conducted experiments using two approaches: Request for sleep state measurement (Request/Response Time (D) to (A)) and Request for sleep environment measurement measurement (Request/Response Time (D) to (A)) and Request for sleep environment measurement (Request/Response Time (D) to (E)). Respective response times were directly measured through the (Request/Response Time (D) to (E)). Respective response times were directly measured through the code and confirmed. code and confirmed. The response time to the HTTP request from (H) to (D) ranges from about 20 to 40 ms. (D) that The response time to the HTTP request from (H) to (D) ranges from about 20 to 40 ms. (D) that receives the HTTP request, converts the request through CoAP-HTTP Mapping, and then transmits it receives the HTTP request, converts the request through CoAP-HTTP Mapping, and then transmits to (A) and (E). Response Time (D) to (A) indicates the response time that it took to receive the sleep it to (A) and (E). Response Time (D) to (A) indicates the response time that it took to receive the sleep state measurement values of (B) and (C), and Request/Response Time (D) to (E) receives the sleep state measurement values of (B) and (C), and Request/Response Time (D) to (E) receives the sleep environment measurement values of (F) and (G). Based on the results, it was confirmed that the two environment measurement values of (F) and (G). Based on the results, it was confirmed that the two CoAP communications had a response time of about 50–55 ms and took about twice as long as HTTP. CoAP communications had a response time of about 50–55 ms and took about twice as long as HTTP. However, the HTTP had a response time of about 0.03 s, and CoAP had a response time of about 0.05 s, However, the HTTP had a response time of about 0.03 s, and CoAP had a response time of about 0.05 s, indicating that the difference in response time does not reduce effectiveness. indicating that the difference in response time does not reduce effectiveness. In the second experiment Figure 14, we compared (H) to (A), which is a method in which the mobile directly transmits a HTTP request for sleep measurement, and (H)–(D)–(A), which is a request method applied to the proposed Smart Model, and then compared the response time of the results of

Entropy 2017, 19, 450

15 of 18

In the second experiment Figure 14, we compared (H) to (A), which is a method in which the mobile directly transmits a HTTP request for sleep measurement, and (H)–(D)–(A), which is a request Entropy 2017, 2017, 19, 19, 450 450 15 of of 18 18 Entropy 15 method applied to the proposed Smart Model, and then compared the response time of the results of measurements. In In this this experiment, experiment, the the response response times times were were also also measured measured through through the the code. code. First, First, measurements. measurements. In this experiment, the response times were also measured through the code. First, when looking at the Request/Response Time (H) to (A), in which an HTTP request was transmitted, when looking looking at at the the Request/Response Request/Response Time Time (H) (H) to to (A), (A), in in which which an an HTTP HTTP request request was was transmitted, transmitted, when it has has aa response response time time of of about 20 to 40 ms, which is similar to the HTTP communication in the the first first it about 20 to 40 ms, which is similar to the HTTP communication in it has a response time of about 20 to 40 ms, which is similar to the HTTP communication in the first experiment. On the other hand, when looking at Request/Response Time (H)–(D)–(A), it has the experiment. On On the the other other hand, hand, when when looking looking at at Request/Response Request/Response Time Time (H)–(D)–(A), (H)–(D)–(A), it it has has the the experiment. response time time from from minimum 110 to to maximum 140 ms. It can can be be judged that since (D) underwent response minimum 110 110 maximum 140 140 ms. It It judged that that since since (D) (D) underwent underwent response time from minimum to maximum ms. can be judged CoAP-HTTP Mapping, request and response are executed twice respectively, which consumes time. CoAP-HTTP Mapping, Mapping, request request and and response response are are executed executed twice twice respectively, respectively, which which consumes consumes time. time. CoAP-HTTP However, since this request also has a response time difference of about 0.1 s, there is no problem in However, since since this this request request also also has has aa response response time time difference difference of of about about 0.1 0.1 s, s, there there is is no no problem problem in in However, providing an an IoT IoT service in which CoAP and HTTP are It also also allows allows for for more more efficient efficient providing service in in which which CoAP CoAP and and HTTP HTTP are are combined. combined. It It providing an IoT service combined. also allows for more efficient resource management for (A) operating in a restricted environment by transmitting a request to (A) (A) resource management management for for (A) (A) operating operating in in aa restricted restricted environment environment by by transmitting transmitting aa request request to to resource (A) via (D) rather than by transmitting a direct request to (H) to (A). via (D) (D) rather rather than than by by transmitting transmitting aa direct direct request request to to (H) (H) to to (A). (A). via

Figure 13. Comparing Comparing request/response request/response time when using HTTP and CoAP. request/responsetime timewhen whenusing usingHTTP HTTPand andCoAP. CoAP. Figure

Figure 14. Comparing Comparing request/response request/response time in in (H) to to (A) and and (H)–(D)–(A). Figure Figure 14. 14. request/responsetime time in(H) (H) to(A) (A) and(H)–(D)–(A). (H)–(D)–(A).

In the the last experiment, experiment, we compared compared the throughput throughput and consumed consumed power when when (D) requests requests In In the last last experiment, we we compared the the throughput and and consumed power power when (D) (D) requests the data from (A) by applying HTTP and SIGP. Figure 15 shows that the average throughput for 11 the for the data data from from (A) (A) by byapplying applyingHTTP HTTPand andSIGP. SIGP.Figure Figure1515shows showsthat thatthe theaverage averagethroughput throughput for min is about 110 responses when requesting data using HTTP. On the other hand, when SIGP was min is isabout 1 min about110 110responses responseswhen whenrequesting requestingdata datausing usingHTTP. HTTP.On Onthe the other other hand, hand, when when SIGP SIGP was was used, the the throughput for for 1 min was was about 242 242 responses, which which is over twice twice as efficient efficient as the the HTTP. used, used, the throughput throughput for 11 min min wasabout about 242responses, responses, whichisisover over twiceas as efficientas as theHTTP. HTTP. In addition, there was a difference in the amount of power consumed by processing data requests for In amount of of power consumed by by processing datadata requests for In addition, addition,there therewas wasaadifference differenceininthe the amount power consumed processing requests 20 min. min. We We attached attached aa battery battery of of 1000 1000 mA mA to to (A) (A) and conducted conducted tests for for 20 min min using the the same 20 for 20 min. We attached a battery of 1000 mA to (A)and and conductedtests tests for20 20 min using using the same same protocols. When HTTP was used, 800 mA was consumed, whereas when SIGP was used, 650 mA mA protocols. When HTTP was used, 800 mA was consumed, whereas when SIGP was used, 650 protocols. When HTTP was used, 800 mA was consumed, whereas when SIGP was used, 650 mA was was consumed. The results confirmed that SIGP consumes fewer resources than HTTP while was consumed. The results confirmed that SIGP consumes fewer resources than HTTP while processing the the same same amount amount of of data. data. processing

Entropy 2017, 19, 450

16 of 18

consumed. The results confirmed that SIGP consumes fewer resources than HTTP while processing 19, 450of data. 16 of 18 theEntropy same2017, amount

Figure15. 15.Comparing Comparing throughput Figure throughputwhen whenusing usingHTTP HTTPand andSIGP. SIGP.

Conclusions 5. 5. Conclusions In this paper, we proposed a Smart Model for Sleep Care for efficient sleep management by In this paper, we proposed a Smart Model for Sleep Care for efficient sleep management by applying IoT for efficient sleep management, and then proposed a Sleep Information Gathering applying IoT for efficient sleep management, and then proposed a Sleep Information Gathering Protocol that will be used in this model. The Smart Model for Sleep Care allows various devices to Protocol that will be used in this model. The Smart Model for Sleep Care allows various devices to share information through a network through the IoT to existing sleep care services, which in turn share information through a network through the IoT to existing sleep care services, which in turn enables them to analyze the sleep information more accurately. We also defined the Sleep Information enables them to analyze the sleep information more accurately. We also defined the Sleep Information Gathering Protocol using CoAP, which is a protocol suitable for IoT to receive information related to Gathering Protocol which a protocol suitable forsleep IoT to receive information related to a a user’s health andusing sleepCoAP, state from theismobile devices and the care server. user’s health andthe sleep state fromofthe mobile devices thesuch sleep server. To verify effectiveness the service modeland using a care protocol, we made a testbed to To verify the effectiveness of the service model using such a protocol, made a that testbed compare the response time to the sleep information request. As a result, it waswe confirmed the to compare response timeshow to the sleep information As atime result, it was confirmed that the definedthe protocol did not a significant differencerequest. in response compared with the existing defined protocol didindicating not show its a significant difference in response time compared with the existing sleep care services, applicability to Smart Model for Sleep Care. sleep care services,the indicating its applicability to sleep Smartdisorders, Model formore Sleepextended Care. sleep care services To analyze user’s sleep and diagnose To analyze the user’s sleep and diagnose more extended sleep care services should be provided. In particular, there is a needsleep for a disorders, method to protect the sleep information of an individual as well In as particular, a method for using the security protocol provided CoAP or HTTP. of In an should be provided. there is a need for a method to protect thebysleep information addition,asthe proposed protocol should supplemented provideby extended and the individual well as a method for using thebesecurity protocolto provided CoAP orservices, HTTP. In addition, of the proposed protocol in integrating the therapy service to treat sleep disorders rather of theeffectiveness proposed protocol should be supplemented to provide extended services, and the effectiveness than simply measuring a sleep state should be verified in future studies. the proposed protocol in integrating the therapy service to treat sleep disorders rather than simply measuring a sleep state should be verified in future studies. Acknowledgments: This work was supported by the Ministry of Education of the Republic of Korea and the National This Research of Korea Acknowledgments: workFoundation was supported by the(NRF-2016S1A5B6913737). Ministry of Education of the Republic of Korea and the National Research Foundation of Korea (NRF-2016S1A5B6913737). Author Contributions: Joo Ho Choi and Byung Mun Lee conceived and designed the experiments; Joo Ho Choi Author Contributions: Joo HoJoo Choi Byung conceived and designed Joo Ho Choi performed the experiments; Hoand Choi and Mun ByungLee Mun Lee analyzed the data;the Unexperiments; Gu Kang contributed performed the experiments; tools; Joo Ho and wrote Byungthe Mun LeeAll analyzed Kang contributed reagents/materials/analysis JooChoi Ho Choi paper. authors the havedata; readUn andGu approved the final reagents/materials/analysis tools; Joo Ho Choi wrote the paper. All authors have read and approved the manuscript. final manuscript. Conflicts of Interest: The authors declare no conflict of interest. Conflicts of Interest: The authors declare no conflict of interest.

References References Datta, S.K.; Bonnet, C.; Gyrard, A.; Ferreira da Costa, R.P.; Boudaoud, K. Applying Internet of Things for Datta, S.K.; Bonnet, C.; Gyrard, A.; Ferreira da Costa, R.P.; Boudaoud, K. Applying Internet of Things personalized healthcare in smart homes. In Proceedings of the Wireless and Optical Communication forConference, personalized healthcare smart homes. In Proceedings of the Wireless and Optical Communication Taipei, Taiwan,in23–24 October 2015. Conference, Taipei, Taiwan, 23–24 October 2015. 2. Pantelopoulos, A.; Bourbakis, N.G. A Survey on Wearable Sensor-Based Systems for Health Monitoring 2. Pantelopoulos, A.; Bourbakis, N.G. A Survey Wearable and Prognosis. IEEE Trans. Syst. Man Cybern.on 2009, 40, 1–12Sensor-Based Systems for Health Monitoring and Prognosis. IEEE Trans. Syst. Man Cybern. 2009, 40, 1–12. [CrossRef]Sleep Disorder using CoAP. Int. J. Mob. 3. Choi, J.H.; Kang, U.K.; Lee, B.M. IoT Service Model for Measuring Device Eng. 2017, 1, 9–14.

1.

1.

Entropy 2017, 19, 450

3. 4.

5. 6.

7.

8. 9.

10. 11.

12.

13. 14.

15. 16. 17.

18.

19.

20.

21. 22. 23.

17 of 18

Choi, J.H.; Kang, U.K.; Lee, B.M. IoT Service Model for Measuring Sleep Disorder using CoAP. Int. J. Mob. Device Eng. 2017, 1, 9–14. [CrossRef] Dhawan, A.P.; Heetderks, W.J.; Pavel, M.; Acharya, S.; Akay, M.; Mairal, A.; Wheeler, B.; Dacso, C.C.; Sunder, T.; Lovell, N.; et al. Current and Future Challenges in Point-of-Care Technologies: A Paradigm-Shift in Affordable Global Healthcare With Personalized and Preventive Medicine. IEEE J. Transl. Eng. Health Med. 2015, 3, 2800110. [CrossRef] [PubMed] Perez, A.J.; Leff, D.R.; Ip, H.M.D.; Yang, G.Z. From Wearable Sensors to Smart Implants—Toward Pervasive and Personalized Healthcare. IEEE Trans. Biomed. Eng. 2015, 62, 2750–2762. [CrossRef] [PubMed] Chang, D.W.; Liu, Y.D.; Young, C.P.; Chen, J.J.; Chen, Y.H.; Chen, C.Y.; Hsu, Y.C.; Shaw, F.Z.; Liang, S.F. Design and Implementation of a Modular-ized Polysomnography System. IEEE Trans. Instrum. Meas. 2012, 61, 1933–1944. [CrossRef] Chen, Z.; Lin, M.; Chen, F.; Lane, N.D.; Cardone, G.; Wang, R.; Li, T.; Chen, Y.; Choudhury, T.; Campbell, A.T. Unobtrusive Sleep Monitoring using Smartphones. In Proceedings of the 2013 7th International Conference on Pervasive Computing Technologies for Healthcare, Venice, Italy, 5–8 May 2013. Shin, H.; Cho, J. Unconstrained snoring detection using a smartphone during ordinary sleep. BioMed. Eng. OnLine 2014, 13, 116. [CrossRef] [PubMed] Fuqaha, A.A.; Guizani, M.; Mohammadi, M.; Aledhari, M.; Ayyash, M. Internet of Things: A Survey on Enabling Technologies, Protocols and Applications. IEEE Commun. Surv. Tutor. 2015, 17, 2347–2376. [CrossRef] Shelby, Z.; Hartke, K.; Bormann, C. The Constrained Application Protocol (CoAP); Internet Engineering Task Force: California, CA, USA, 2014. Celesti, A.; Fazio, M.; Giacobbe, M.; Puliafito, A.; Villari, M. Characterizing Cloud Federation in IoT. In Proceedings of the 2016 30th International Conference on Advanced Information Networking and Applications Workshops (WAINA), Crans-Montana, Switzerland, 23–25 March 2016. Agarwal, R.; Fernandez, D.G.; Elsaleh, T.; Gyrard, A.; Lanza, A.; Sanchez, L.; Georagntas, N.; Issarny, V. Unified IoT ontology to enable interoperability and federation of testbeds. In Proceedings of the 2016 IEEE 3rd World Forum on Internet of Things (WF-IoT), Reston, VA, USA, 12–13 December 2016. Sense. Available online: http://www.hello.is/ (accessed on 30 April 2017). Lin, F.; Zhuang, Y.; Song, C.; Wang, A.; Li, Y.; Gu, C.; Li, C.; Xu, W. SleepSense: A Noncontact and Cost-Effective Sleep Monitoring System. IEEE Trans. Biomed. Circuits Syst. 2016, 11, 189–202. [CrossRef] [PubMed] Fitbit. Available online: http://www.fitbit.com/ (accessed on 30 April 2017). Jowbone. Available online: http://www.jawbone.com/ (accessed on 30 April 2017). Zhang, J.; Zhang, Q.; Wang, Y.; Qiu, C. A real-time auto-adjustable smart pillow system for sleep apnea detection and treatment. In Proceedings of the 2013 ACM/IEEE International Conference on Information Processing in Sensor Networks (IPSN), Philadelphia, PA, USA, 8–11 April 2013. Behar, J.; Roebuck, A.; Shahid, M.; Daly, J.; Hallack, A.; Palmius, N.; Stradling, J.; Clifford, G.D. SleepAp: An Automated Obstructive Sleep Apnoea Screening Application for Smartphones. IEEE J. Biomed. Health Inf. 2014, 19, 325–331. [CrossRef] [PubMed] Cao, L.; Zheng, G.; Shen, Y. Research on design of military ammunition container monitoring system based on IoT. In Proceedings of the Prognostics and System Health Management Conference, Chengdu, China, 19–21 October 2016. Celesti, A.; Mulfari, D.; Fazio, M.; Villari, M.; Puliafito, A. Exploring Container Virtualization in IoT Clouds. In Proceedings of the 2016 IEEE International Conference on Smart Computing (SMARTCOMP), St. Louis, MO, USA, 18–20 May 2016. Morabito, R. Virtualization on Internet of Things Edge Devices with Container Technologies: A Performance Evaluation. IEEE Access 2017, 5, 8835–8850. [CrossRef] Krejcar, O.; Jirka, J.; Janckulik, D. Use of Mobile Phones as Intelligent Sensors for Sound Input Analysis and Sleep State Detection. Sensors 2011, 11, 6037–6055. [CrossRef] [PubMed] Sulaeman, A.B.; Ekadiyanto, F.A.; Sari, R.F. Performance evaluation of HTTP-CoAP proxy for wireless sensor and actuator networks. In Proceedings of the 2016 IEEE Asia Pacific Conference on Wireless and Mobile (AP-WiMob), Bandung, Indonesia, 13–15 September 2016.

Entropy 2017, 19, 450

24. 25.

26.

27.

18 of 18

Ludovici, A.; Calveras, A. A Proxy Design to Leverage the Interconnection of CoAP Wireless Sensor Networks with Web Applications. Sensors 2015, 15, 1217–1244. [CrossRef] [PubMed] Sommer, N.L.; Touseau, L.; Mahéo, Y.; Auzias, M.; Raimbault, F. A Disrup-tion-Tolerant RESTful Support for the Web of Things. In Proceedings of the 2016 IEEE 4th International Conference on Future Internet of Things and Cloud (FiCloud), Vienna, Austria, 22–24 August 2016. Teklemariam, G.K.; Hoebeke, J.; Abeele, F.V.D.; Moerman, I.; Demeester, P. Simple RESTful sensor application development model using CoAP. In Proceedings of the 2014 IEEE 39th Conference on Local Computer Networks Workshops (LCN Workshops), Edmonton, AB, Canada, 8–11 September 2014. Lee, K. IEEE 1451: A standard in support of smart transducer networking. In Proceedings of the Instrumentation and Measurement Technology Conference, Baltimore, MD, USA, 1–4 May 2000. © 2017 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

Suggest Documents