Vous êtes sur la page 1sur 2

2016 IEEE 5th Global Conference on Consumer Electronics

A Proxy Framework for API Interoperability


in the Internet of Things
Satoshi Asano*, Takeshi Yashiro, and Ken Sakamura
*
Ubiquitous Computing Technology Corporation, YRP Ubiquitous Networking Laboratory, The University of Tokyo
E-mail: satoshi.asano@uctec.com, takeshi.yashiro@ubin.jp, ken@sakamura-lab.org

AbstractWe propose a novel framework for the Internet of which enables device profiles to be handled efficiently.
Things (IoT) devices, which aims to realize interoperability However, none of the existing work based on syntactic
among devices without modification to the devices. Our approach is flexible enough to make device APIs interoperable.
framework works as a proxy that accepts standard API requests,
which are translated into device-specific requests using the In this paper, we propose a novel IoT framework that can
conversion rules defined as device-specific profiles. Application realize interoperability among devices without modification to
programmers are not required to be aware of the difference of the devices. Our framework is founded on a flexible device
the APIs of devices thanks to the standard API provided by the profile schema, which can describe conversion methods from
framework. We evaluated our framework and found that our standard API to device-specific API. Using these device
framework can standardize two different device APIs in practical profiles, device manager works as an API translator and
scenarios with a negligible impact on response time. provides transparent access to devices via standard API.
KeywordsIoT; device framework; API
II. PROPOSED FRAMEWORK
I. INTRODUCTION A. Design Overview
The Internet of Things (IoT) is now considered a key We have designed and implemented our proposed
technology to realize an intelligent environment by integrating framework as shown in Fig. 1. The framework consists of 4
physical and cyber objects as a whole system. The number of parts: device manager, device profile repository, authorization
IoT-enabled devices (IoT devices) have been increasing manager, and access control manager. Device manager accepts
rapidly, and they are designed to communicate with standard API calls and translates them to device-specific calls
applications or other IoT devices through the Internet. according to device profiles obtained from device profile
In order to realize interconnection among devices and repository. In addition, it provides device-search API to find
services in the IoT, interoperability of APIs is considered an devices based on functionalities; e.g., listing up all the air
important challenge [1]. Generally speaking, IoT devices from conditioners. Authorization and access control managers are
different vendors provide different APIs, which are non- responsible for realizing integrated security over IoT devices.
customizable and device-specific. Because of this, application Their APIs are based on OpenID Connect 1.0 specification,
developers need to understand the API specifications of each which allows device APIs to be integrated with ease in web
device and write specific codes to integrate these devices. For applications [6].
example, if you replace an air conditioner with another from a
different manufacturer, a smart house application needs to be B. Device Profile
upgraded as well to support the new one, even though both We designed two types of profiles to describe device APIs
provide the same functionality. Such updates in household as follows: Generic device Profile (GP) and device Specific
devices can often happen, which makes interoperability in IoT Profile (SP), both of which are based on Open API (OAI)
crucial.
So far, much work has been done to address this problem, Our proposed Framework
and it can be classified into two categories: semantic [2,3] and Vendor specific Authorization
syntactic approaches [4,5]. The first tries to describe semantics APIs hosted in Device manager
Device
profile
of device APIs as device profiles using Resource Description cloud services
repository
manager Access control
Framework derived from the semantic web. By utilizing the manager
device profiles, programs can understand the meaning of API,
how to use it, which can be used to convert an API to another.
However, it is considered impractical to process description
logics for API conversion, due to its high computational cost
and its limited readability. On the other hand, the latter Applications
Devices of devices
approach tries to describe API specifications syntactically, Fig. 1. Overview of our proposed framework.

978-1-5090-2333-2/16/$31.00 2016 IEEE


2016 IEEE 5th Global Conference on Consumer Electronics

specification [7]. GP defines the syntax and semantics of the "api": { "paths": { "/power": { "put": {
standard device API for each device class (e.g., air "parameters": [
conditioners, refrigerators, etc.). It consists of device ID, its {"name": "id", "in": "query", "required": true,
name; device type (actuator, sensor, or transducer), "type": "string"},
informative text, version, and the API format. On the other {"name": "power", "in": "body", "required": true,
"schema": {"type": "boolean"}}],
hand, SP is responsible for describing each specific device
"x-type": ["Actuator"],
product, and defines the conversion rules from device-specific "x-access-type": "eval",
APIs to standard APIs defined in GP. It consists of device "x-access-method": "put",
model ID, manufacturer ID, and API conversion rules "x-location": /api/newdeveloper/lights/{id}/state",
described using our extended OAI. The list of extensions we "x-request-body": {"on":device_request["power"]}",
made to the OAI are as shown in Table I, consisting of "x-response-body":
conversion information of API path, access method, request "{"power":#{JSON.parse(device_response)[0]
body, and response body. Fig. 2 shows an example of the SP ['success'].values[0]}}"
fragment defined for Philips Hue API [8]. It describes that the Fig. 2. Example of SP fragment for Philips Hue API
standard PUT /power API accepts parameters named id
and power, and that the device manager converts these seconds respectively, with standard deviations of 0.0043 and
requests to PUT /api/newdeveloper/lights/{id}/state, which 0.0015 seconds. The mean delay caused by the framework was
the product natively provides. Request and response 0.0146 seconds. According to a study in usability engineering,
parameters are converted as well, based on the rules given in response time of 0.1 seconds is perceived as instantaneous by
x-request-body and x-response-body, both of which can be users [9]. Therefore, the response time of the framework can
written in Ruby Programming Language. be considered small enough in real usage.
Regarding security, our framework is equipped with user
III. EVALUATION AND DISSCUSSIONS authorization and authentication based on OpenID Connect
We implemented device manager and device profile 1.0. Only the legitimate users can access device APIs under
repository using Grape framework, a domain specific the control of access control manager. API conversion rules
language for creating RESTful APIs in Ruby. Based on this are evaluated in a secure sandbox, which makes it impossible
implementation, we evaluated our framework with respect to for adversaries to damage device managers by registering
the capabilities of the proposed profiles, the abilities of device tainted scripts on the framework.
control via standard API, the impact to the response time and
security issues caused by the framework. IV. CONCLUSION
As a case study, we created device profiles for Philips Hue, We proposed a novel framework for the IoT devices,
part of which were as shown in Fig. 2. As can be seen in the which aims to realize interoperability among devices without
rule, the proposed framework is capable of converting HTTP modification to the devices. The evaluation results showed
access method, request and response bodies, using general that our framework can standardize two different device APIs
programming language that is Turing-complete. We also in practical scenarios with a negligible impact on response
confirmed two different types of lighting APIs can be accessed time.
using the common API as shown in the URL below:
http://{The hostname of the framework}/api/v1/devices/{The ID of the REFERENCES
device}/api?path=power&method=put&request_params=%7b%22power% [1] A. Whitmore, A. Agarwal, and L. Xu, "The Internet of Things---A
22:true,%22id%22:1%7d survey of topics and trends," Information Systems Frontiers, vol. 17, no.
2, pp. 261-274, April 2015.
In order to assess the latency caused by the introduction of
[2] D. Pfisterer et al., "SPITFIRE: toward a semantic web of things," in
our framework, we compared the response times of Philips IEEE Commun Mag., vol. 49, no. 11, pp. 40-48, November 2011.
Hue API with and without our framework. We measured 100 [3] A. Sheth, C. Henson and S. S. Sahoo, "Semantic Sensor Web," in IEEE
times and the mean response times were 0.0199 and 0.0053 Internet Comput., vol. 12, no. 4, pp. 78-83, July-Aug. 2008.
[4] K. Aberer, M. Hauswirth, and A. Salehi, Global Sensor Networks, tech.
TABLE I. EXTENSIONS OF OPEN API SPECIFICATION IN SP.
report LSIR-2006-001, Global Sensor Networks, 2006.
[5] UPnP Forum. (2015, April). Leveraging UPnP+: the Next Generation of
Element name Summary Universal Interoperability [Online]. Available: http://upnp.org/resources/
x-api-type An API type of the device chosen from followings: whitepapers/UPnP_Plus_Whitepaper_2015.pdf
Actuator, Sensor, Configurator [6] Nat Sakimura et al. (2014, November 8). OpenID Connect Core 1.0 inco
x-location An URL of the API rporating errata set 1 [Online]. Available: http://openid.net/specs/openid-
x-access-type An access type according to following rules: connect-core-1_0.html
"redirect" when the device provides standard API, or
[7] The Linux Foundation. (2014. September 8). OpenAPI Specification
"eval" in the other case.
[Online]. Available: https://github.com/OAI/OpenAPI-Specification/blo
x-access-method HTTP access method chosen from followings: GET, b/master/versions/2.0.md
POST, PUT, PATCH, DELETE, OPTION; or script,
which returns a HTTP method. [8] Koninklijke Philips Electronics N.V. (2016). Philips hue API [Online].
x-request-body A conversion script of request body from standard Available: http://www.developers.meethue.com/philips-hue-api
API to device-specific API. [9] J. Nielsen. (2009, October 5). Powers of 10: Time Scales in User Experi
x-response-body A conversion script of response body from device- ence [Online]. Available: https://www.nngroup.com/articles/powers-of-1
specific API to standard API. 0-time-scales-in-ux/

Vous aimerez peut-être aussi