Web 657 8501 1 1 E-mail: tktk@ws.cs.kobe-u.ac.jp, sachio@carp.kobe-u.ac.jp, {shinsuke,masa-n}@cs.kobe-u.ac.jp 一般社団法人 電子情報通信学会 信学技報 THE INSTITUTE OF ELECTRONICS, IEICE Technical Report INFORMATION AND COMMUNICATION ENGINEERS ISEC2013-70 LOIS2013-36 (2013-11) M2M Web Web ( ) 5 Web Event, Condition, ECA Java API Web Web ECA Implementing Execution Platform for Managing -Aware Services Based on Heterogeneous and Distributed Web Services Hiroki TAKATSUKA, Sachio SAIKI, Shinsuke MATSUMOTO, and Masahide NAKAMURA Kobe University Rokko-dai-cho 1 1Nada-kuKobeHyogo657 8501 Japan E-mail: tktk@ws.cs.kobe-u.ac.jp, sachio@carp.kobe-u.ac.jp, {shinsuke,masa-n}@cs.kobe-u.ac.jp Abstract With the spread of Machine-to-Machine (M2M) and cloud services, we have become to be able to use heterogeneous and distributed data. Implementation of the service which judges the context and controls autonomous from these data is expected. We have previously proposed the framework, which can create and manage in a unified manner context-aware services using heterogeneous and distributed Web services (sensor services, information system, state of appliance services and so on). The proposed framework consists of five layers and we define the context based on the data of the existing Web services, and then define the context-aware service by the ECA rule that is a set of event, condition and action. In this paper, we implement a platform based on the framework. The platform has the functions to register, delete, get and edit elements in each layer and to run the services. We implement these using Java, and publish APIs as the Web service. Key words Web services, context, event-condition-action rule, home network system, sensor services 1. M2M Web Web-API ( ) 71 This article is a technical report without peer review, and its polished and/or extended version may be published elsewhere. Copyright 2013 by IEICE
[1] Web ( ) Web Web [2] Web Web (RuCAS, Rule based management framework for -Aware Services) [3] 5 (WebServiceLayer, AdapterLayer, Layer, Layer, ECARuleLayer) ECARuleLayer (Event), (Condition), () ECA Web RuCAS RuCAS Platform Web API RuCAS Platform RuCAS Platform 2. 2. 1 Web Web M2M(Machine to Machine) Web M2M M2M Web Web API SOAP REST HTTP XML Web M2M Web 2. 2 (HNS) (HNS) TV HNS (SOA) HNS Web HNS CS27- HNS [4] CS27-HNS Web SOAP REST Web-API 6ch http://hns/tvservice/setchannel?channel=6 URL 2. 3 28 3. Web (Ru- CAS) RuCAS 72
ECARule Event when false true ECARuleLayer Layer AdapterLayer Adapter 1 Adapter Condition Do nothing then false then true ECA Event Condition 2 WebServiceLayer ON Layer RuCAS 3. 1 ECA (Event-Condition- Rule) ECA Event Condition ECA 1 RuCAS ECA Event: Condition: : 3. 2 RuCAS 2 RuCAS RuCAS ECA 5 (WebServiceLayer, AdapterLayer, Layer, - Layer, ECARuleLayer) ECARuleLayer ECA 3. 2. 1 WebServiceLayer Web Web Web 3. 2. 2 AdapterLayer Web API API getvalue() Adapter 3. 2. 3 Layer Adapter value > = 20 value Adapter (true) (false) Atomic( ) Compound() Atomic Compound Hot && HumidLayer (!, &&, ) 3. 2. 4 Layer Web Web 3. 2. 5 ECARuleLayer Layer Layer ECA Event false true Condition true Web 3. 3 RuCAS Web Adapter Adapter Web ECA 4. RuCAS Platform RuCAS RuCAS Platform RuCAS 3 RuCAS Platform 4. 1 Adapter Adapter RuCAS AdapterLayer endpoint, method getvalue() Web Web property getvalue() Adapter adapterid: Adapter ID 73
3 RuCAS Platform endpoint: Web method: Web API getvalue(): Web 4. 2 RuCAS Layer Atomic Compound interval run() run() Web expression resolve() eval() run() present present false true Event ECA notifyeca() contextid: ID type: (A) (C) expression: interval: () ecaarray: Event ECA present: eval(): run(): 4. 2. 1 Atomic Atomic RuCAS Atomic Adapter resolve() Adapter get- Value() value Atomic adapter: resolve(): Adapter value 4. 2. 2 Compound Compound RuCAS Compound expression children resolve() children resolve() contextid Conmpund children: resolve(): contextid 4. 3 RuCAS Layer Web url actionid: ID url: Web involeurl(): Web 4. 4 ECA ECA RuCAS ECA event false true notifyeca() notifyeca() condition 74
true action invokeurl() Web ECA event ecaarray ECA ECA ecaid: ID event: Event condition: Condition action: ECA notifyeca(): ECA 4. 5 RuCASManager RuCASManager RuCAS Platform RuCASManager RuCAS Platform API AdapterTemp API URL http://hns/rucasplatform/registeradapter?adapterid= Temp&description=&unit=&endpoint=http ://hns/temperaturesensorservice&method=getvalue&pro perty=return Web RuCAS- Manager ECA 4. 6 RuCAS Platform BSON MongoDB 3 3296 RuCAS Platform : Java 1.7.0 21 DB: MongoDB 2.4.3 Web : Apache Tomcat 7.0.39 Web : Apache Axis2 1.6.2 5. CS27-HNS RuCAS Platform CoolServiceCoolService ON Web : API API [5]: API : Web RuCAS Platform API /* Adapter */ registeradapter("temp", "", "" "http://.../temperaturesensorservice" "getvalue", "return"); registeradapter("humidity", "", "%" "http://.../humiditysensorservice" "getvalue", "return"); registeradapter("powerusageofkansai", " ", "kw" "http://...setsuden" "latestpowerusage?appid=...&area=kansai", {"Usage", "Capacity"}); /* */ registercontxt("hot", "A", "", " 28 ", "value>=28", 5000, "Temp", "return"); registercontxt("humid", "A", "", " 75% ", "value>=75", 5000, "Humidity", "return"); registercontxt("muggy", "C", "", "", "Hot&&Humid", 5000, "", ""); registercontxt("powerstable", "A", "", " ", "value<=18000000", 1800000, "PowerUsageOfKansai", "Usage"); /* */ register("coolingon", "http://.../iremoconservice/sendirsignal?...", " ON "); /* ECA = */ registereca("coolservice", "Muggy", "PowerStable", "CoolingOn", " ON ", 0); API 28 75% 1800 kw ON RuCAS Platform 20 CoolService Hot 25 Humid 27% 4 2013 11 2 8 20 Event Muggy Hot Humid Humid Hot 12 25 Event Muggy Condition PowerStable CoolingOn ON RuCAS Platform API CoolService 75
Temperature in S101 on 2013-11-02 () 26 25.5 Hot value >= 25 25 24.5 24 23.5 23 22.5 22 8 9 10 11 12 13 14 15 16 17 18 19 20 () Humidity in S101 on 2013-11-02 (%) 35 34 33 32 31 30 29 28 Humid value >= 27 27 26 8 9 10 11 12 13 14 15 16 17 18 19 20 () Power Usage of Kansai on 2013-11-02 (kw) 2000 1900 1800 PowerStable value <= 18,000,000 1700 1600 1500 1400 1300 1200 8 9 10 11 12 13 14 15 16 17 18 19 20 () 4 2013 11 2 6. 4 16 19 Event true false false true α false Hot false true value> = 25value> = 25 + α OFF 5. CoolService CoolService ON OFF [6] RuCAS Platform RuCAS Platform RuCAS Platform RuCAS Platform 7. Web RuCAS Platform RuCAS Platform API RuCAS Platform RuCAS Platform API RuCAS Platform RuCAS Platform C 24500079, B 23300009 [1] vol.108 no.290pp.15 20Nov. 2008 [2] vol.108no.458pp.381 386March 2009 [3] web vol.113no.245 pp.1 6Oct. 2013 [4] M. Nakamura, A. Tanaka, H. Igaki, H. Tamada, and K. Matsumoto, Constructing home network systems and integrated services using legacy home appliances and web services, International Journal of Web Services Research, vol.5, no.1, pp.82 98, Jan. 2008. [5] Yahoo JAPAN Web API API, http:// developer.yahoo.co.jp/webapi/shinsai [6] vol.108no.462pp.007 012March 2009 76