an inter-wiki page data processor for a m2m system @matsue, 1sep., eskm2013

49
An Inter-Wiki Page Data Processor for a M2M System Takashi Yamanoue, Kentaro Oda and Koichi Shimozono Kagoshima University, Kagoshima Japan IIAI ESKM 2013, 1st Sep. 2013

Upload: takashi-yamanoue

Post on 06-May-2015

717 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: An Inter-Wiki Page Data Processor for a M2M System  @Matsue, 1sep., Eskm2013

An Inter-Wiki Page Data Processor for a M2M System

Takashi Yamanoue, Kentaro Oda and Koichi Shimozono

Kagoshima University, Kagoshima JapanIIAI ESKM 2013, 1st Sep. 2013

Page 2: An Inter-Wiki Page Data Processor for a M2M System  @Matsue, 1sep., Eskm2013

• Introduction• Overview of the M2M system• The Data Processor• Usage Example• Comparisons with Related Work• Concluding Remarks

Page 3: An Inter-Wiki Page Data Processor for a M2M System  @Matsue, 1sep., Eskm2013

Introduction

• Wiki is friendly to people -> Wiki must be friendly to machines

• Takashi Yamanoue, Kentaro Oda and Koichi Shimozono: A M2M system using Arduino, Android and Wki Software, Proceedings of the 3rd IIAI Internationa Conference on e-Service and Knowledge Management(IIAI ESKM 2012), pp.123-128, Fukuoka, Japan, 20-22 Sep. 2012.

Page 4: An Inter-Wiki Page Data Processor for a M2M System  @Matsue, 1sep., Eskm2013

Introduction

Page 5: An Inter-Wiki Page Data Processor for a M2M System  @Matsue, 1sep., Eskm2013

Introduction

Page 6: An Inter-Wiki Page Data Processor for a M2M System  @Matsue, 1sep., Eskm2013

Introduction

GNDOUT

Vdd

PIRNapionAMN2111

Light SensorDEV-08464

Temperature Sensor.DEV-08777

1kΩ100kΩ

100kΩ

LED

Android TerminalUSB Cable connector

Page 7: An Inter-Wiki Page Data Processor for a M2M System  @Matsue, 1sep., Eskm2013

Introduction

• (This time)Add a Data Processor to the mobile terminal.

• The Data Processor– Reads data from the sensors or wiki pages.– Processes the data after that. – Outputs the processed data on a wiki page

or Controls actuators by the processed data. – Is Controlled by the Program which is written on a

Wiki page.

Page 8: An Inter-Wiki Page Data Processor for a M2M System  @Matsue, 1sep., Eskm2013

Introduction

Androidterminal

Mobile Terminal

Data Processor

Command

Program

Data

Data

Control

Output

Page 9: An Inter-Wiki Page Data Processor for a M2M System  @Matsue, 1sep., Eskm2013

Overview of the M2M system

Actuators

ADK

Androidterminal

Mobile Terminal

Sensors

ADK

Androidterminal

Mobile Terminal

Androidterminal

Mobile Terminal

PukiWiki

PukiWiki

Commands +Sensor data

Commands +Sensor data

Sensor Data

Commands + Program +Output of the Processor

Com

man

ds

Com

man

ds

Sen

sor

Data

Sensor data

Sensors

ADK

Androidterminal

Mobile Terminal

Sen

sor

Data

Com

man

ds,

Prog

ram

Proc

esse

d Dat

a

Commands,

Program

Commands

Com

man

ds,

Pro

gra

m

Processed

Data

Commands + Program +Output of the Processor

Page 10: An Inter-Wiki Page Data Processor for a M2M System  @Matsue, 1sep., Eskm2013

The Data Processor

Behavior of a Mobile Terminal

The Data Processor

Page 11: An Inter-Wiki Page Data Processor for a M2M System  @Matsue, 1sep., Eskm2013

The Data Processor

Start to read commands and the programfrom the Wiki page.

Page 12: An Inter-Wiki Page Data Processor for a M2M System  @Matsue, 1sep., Eskm2013

The Data ProcessorProgram ex.

An Example of the program in a Wiki page

Just like a BASICA Dimension is a Hash tableJust like Lua.

Page 13: An Inter-Wiki Page Data Processor for a M2M System  @Matsue, 1sep., Eskm2013

The Data Processor

Output of the Program

Page 14: An Inter-Wiki Page Data Processor for a M2M System  @Matsue, 1sep., Eskm2013

The Data Processor

• Equipped with functions for communicating with other objects of the mobile terminal. The data processor can read/write data from/to web pages and sensors/actuators using these functions.

• Equipped with table manipulation functions such like– sumif, countif

of Excel

Page 15: An Inter-Wiki Page Data Processor for a M2M System  @Matsue, 1sep., Eskm2013

The Data ProcessorSome of Embedded

Functions

• Sending command to another object.May have a return value

ex(<object>, <command>) Ex. page=ex(“connector” , “getpage http://www.page.ex/”)

Page 16: An Inter-Wiki Page Data Processor for a M2M System  @Matsue, 1sep., Eskm2013

The Data ProcessorSome of Embedded

Functions• Extracting result part in the Wiki page

getResultPart(<page>)

Page 17: An Inter-Wiki Page Data Processor for a M2M System  @Matsue, 1sep., Eskm2013

The Data ProcessorSome of Embedded

Functions• Parsing CSV and translating the value into an

array

parseCsv(<csv>,<dataTable>, <rowLabel>,<columnLabel>)

Page 18: An Inter-Wiki Page Data Processor for a M2M System  @Matsue, 1sep., Eskm2013

The Data ProcessorSome of Embedded

Functions• <csv> <col-label-1>=<val-1-1>,…,<col-label-1-1n>=<val-1-

1n>.

<col-label-2>=<val-2-1>,…,<col-label-2-2n>=<val-2-

2n>.

… <col-label-m>=<val-1-m>, …, <col-label-m-

mn>=<val-m-mn>.

Page 19: An Inter-Wiki Page Data Processor for a M2M System  @Matsue, 1sep., Eskm2013

The Data ProcessorSome of Embedded

Functions• <rowLabel> is the hash table

– (“rowcol”, “row”) – (“maxIndex”, maximum row index of the table).

• <columnLabel> is the hash table– (“rowcol”,”col”), – (“maxIndex”, maximum column index of the table), – (<col-label-1>, column index of the label), …, (<col-

label-max>).

Page 20: An Inter-Wiki Page Data Processor for a M2M System  @Matsue, 1sep., Eskm2013

The Data ProcessorSome of Embedded

Functions• parseCsv(rpart, dataTable, rowLabel,

columnLabel)• <csv> … rpart device=d, Date=2013/5/5/ 17:6:18, v=0x0c0. device=a-2, Date=2013/5/5/ 17:6:18, v=155. device=a-1, Date=2013/5/5/ 17:6:18, v=53. device=a-0, Date=2013/5/5/ 17:6:45, ave=242, ..., dt=100. device=a-0, Date=2013/5/5/ 17:7:53, ave=242, …, dt=100. …

Page 21: An Inter-Wiki Page Data Processor for a M2M System  @Matsue, 1sep., Eskm2013

d Date=2013/5/5/ 17:6:18

0x0c0

a-2 Date=2013/5/5/ 17:6:18

155

a-1 Date=2013/5/5/ 17:6:18

53

a-0 Date=2013/5/5/ 17:6:45

242

a-0 Date=2013/5/5/ 17:7:53

242

(rowcal, col)

(maxIndex, …)

(device, 0)

(Date, 1) (v, 2) (ave,3)

parseCsv(rpart,dataTable,rowLabel,columnLabel)columnLabel

(rowcal, row)

(maxIndex, …)

rowLabeldataTable

Page 22: An Inter-Wiki Page Data Processor for a M2M System  @Matsue, 1sep., Eskm2013

The Data ProcessorSome of Embedded

Functions• SumIf

sumif(<dataTable>, <hash table of row or column>,

<index-1>, <operator>, <operand>, <index-2>)

OR

Page 23: An Inter-Wiki Page Data Processor for a M2M System  @Matsue, 1sep., Eskm2013

The Data ProcessorSome of Embedded

Functions

Page 24: An Inter-Wiki Page Data Processor for a M2M System  @Matsue, 1sep., Eskm2013

The Data ProcessorSome of Embedded

Functions• CountIf

countif(<dataTable>, <hash table of row or column>,

<index-1>, <operator>, <operand>, <index-2>)

OR

Page 25: An Inter-Wiki Page Data Processor for a M2M System  @Matsue, 1sep., Eskm2013

The Data ProcessorSome of Embedded

Functions

Page 26: An Inter-Wiki Page Data Processor for a M2M System  @Matsue, 1sep., Eskm2013

Usage Example

• A Remote room monitoring/controlling system • Sensor Side

– Acquires human activity, light intensity and temperature data.

– Shows them on 24 wiki pages for each hour of a day• Data Process Side

– Totals up these data into 31 wiki pages for each day of a month,

– By Averaging each sensors’ value of every hour– Controls LEDs of the mobile terminal

Page 27: An Inter-Wiki Page Data Processor for a M2M System  @Matsue, 1sep., Eskm2013

Usage Example

Sensor Side Data Process Side

Page 28: An Inter-Wiki Page Data Processor for a M2M System  @Matsue, 1sep., Eskm2013

Usage Example

A Wiki page for each hour of a day

Sensor Side

Page 29: An Inter-Wiki Page Data Processor for a M2M System  @Matsue, 1sep., Eskm2013

Usage Example

….

command:set out-a-8=0command:get in-d last command:get in-a-2 last command:get in-a-1 lastcommand:get in-a-0 statcommand:set readInterval=300000command:set sendInterval=600000command:set pageName="pir-1-<hour>" …

A Wiki page for each hour, Command part.

Page 30: An Inter-Wiki Page Data Processor for a M2M System  @Matsue, 1sep., Eskm2013

Usage Example

….

result: device=a-2,Date=2013/8/30 13:59:4, v=168. device=a-1,Date=2013/8/30/ 13:59:4, v=82. device=a-0,Date=2013/8/30/ 14:0:7,   ave=349,   sdv=6.8789 …, max=361,min=341, … device=a-0,Date=2013/8/30 14:1:13,  ave=349, sdv=6.8349 …, max=360,min=340, …

A Wiki page for each hour, Result part.

Page 31: An Inter-Wiki Page Data Processor for a M2M System  @Matsue, 1sep., Eskm2013

Usage Example

….

graph: ymax=300 graph: ymin=0graph: x="Date" graph: device="a-2“graph: y-0="v",color="yellow“graph: device="a-1“graph: y-1="v", color="cyan"…

A Wiki page for each hour, Graph part.

Page 32: An Inter-Wiki Page Data Processor for a M2M System  @Matsue, 1sep., Eskm2013

Usage Example

• (A part of)Wiki page foreach dayof a month

• Processor Side

Page 33: An Inter-Wiki Page Data Processor for a M2M System  @Matsue, 1sep., Eskm2013

Usage Example

Page 34: An Inter-Wiki Page Data Processor for a M2M System  @Matsue, 1sep., Eskm2013

Usage Example

command: program daily program: dim dataTable program: dim columnLabel program: dim rowLabel program: ex("service","clear sendBuffer") program: output="" program: url="http://www.yama-lab.org/ adk-wiki-1/index.php?pir-1-"

Page 35: An Inter-Wiki Page Data Processor for a M2M System  @Matsue, 1sep., Eskm2013

Usage Example

program: avemax0=0 program: avemax1=0 program: avemax2=0 program: avemin0=1024 program: avemin1=1024 program: avemin2=1024

Page 36: An Inter-Wiki Page Data Processor for a M2M System  @Matsue, 1sep., Eskm2013

Usage Example

program: for i=0 to 23 program: page=ex("connector" , "getpage "+url+i) program: rpart=getResultPart(page) program: ex("service","println "+rpart) program: parseCsv(rpart,dataTable,rowLabel,columnLabel)

Page 37: An Inter-Wiki Page Data Processor for a M2M System  @Matsue, 1sep., Eskm2013

Usage Example

program: y0=sumif(dataTable, rowLabel, columnLabel("device"), "=", "a-0", columnLabel("sdv")) program: c0=countif(dataTable, rowLabel, columnLabel("device"),"=","a-0") program: ave0=1.0*y0/c0 program: if ave0>avemax0 then avemax0=ave0 program: if ave0<avemin0 then avemin0=ave0

Page 38: An Inter-Wiki Page Data Processor for a M2M System  @Matsue, 1sep., Eskm2013

Usage Example

program: dataline="device=a-0, Date="+ dataTable(0,columnLabel("Date"))+ ",ave="+ave0 program: ex("service","println "+dataline) program: ex("service","putSendBuffer "+dataline)

Page 39: An Inter-Wiki Page Data Processor for a M2M System  @Matsue, 1sep., Eskm2013

Usage Example

program: if avemax0 < 7.0 then ex("service","set out-a-8=255") else ex("service","set out-d-8=0") program: if avemax1 < 100.0 then ex("service","set out-a-9=255") else ex("service","set out-d-9=0") program: if avemax2 > 160.0 then ex("service","set out-a-10=255") else ex("service","set out-d-10=0") command: end daily command: set pageName="daily-1-<day>" command: set result="" command: run daily

Control actuators

Page 40: An Inter-Wiki Page Data Processor for a M2M System  @Matsue, 1sep., Eskm2013

Usage Example

….

result: device=a-0, Date=2013/8/30/ 23:19:8,ave=8.740391630536074 device=a-1, Date=2013/8/30/ 23:19:8,ave=0.07142857142857142 device=a-2, Date=2013/8/30/ 23:19:8,ave=173.28571428571428 device=a-0, Date=2013/8/30/ 0:58:57,ave=8.862115399734035 device=a-1, Date=2013/8/30/ 0:58:57,ave=0.0 device=a-2, Date=2013/8/30/ 0:58:57,ave=177.42857142857142

A Wiki page for each day, Result part.

Page 41: An Inter-Wiki Page Data Processor for a M2M System  @Matsue, 1sep., Eskm2013

Usage Example

...device=a-1, Date=2013/8/30/ 22:59:8,ave=0.14285714285714285 device=a-2, Date=2013/8/30/ 22:59:8,ave=173.0 device=maxvalues, Data=2013/8/30/ 22:59:8, avemax0=23.272286968015568, avemax1=80.64285714285714, avemax2=177.42857142857142Maximum values of the day. avemax0: a-0, avemax1: a-1, avemax2: a2

Page 42: An Inter-Wiki Page Data Processor for a M2M System  @Matsue, 1sep., Eskm2013

My office of two days before yesterday.

Temperature

Light intensity

Human activity

Page 43: An Inter-Wiki Page Data Processor for a M2M System  @Matsue, 1sep., Eskm2013

Comparisons with Related Work

• Xively (COSM)– Xively is a real-time open data web service for the

Internet of Things. – has open APIs for uploading and manipulating data– Our M2M system has functions similar to those of

Xively.– the APIs of Xively are used for the Xively site only. – Our system can be used for any PukiWiki site, not only

a specific site.

Page 44: An Inter-Wiki Page Data Processor for a M2M System  @Matsue, 1sep., Eskm2013

Comparisons with Related Work

• Scripting Layer for Android (SL4A)– brings popular scripting languages to Android. – We uses our original language processor for the data

processor now. – However the original language is not familiar with

potential users.– We should use SL4A instead of using our original

language processor for this potential users of this M2M system.

Page 45: An Inter-Wiki Page Data Processor for a M2M System  @Matsue, 1sep., Eskm2013

Comparisons with Related Work

• Broadcast – Is an embedded web application for remote Android

device management. – uses the SL4A. – Enable Remote Monitoring/Remote Control of an

android device.– However the Broadcast does not have the function for

data exchanging between web pages.

Page 46: An Inter-Wiki Page Data Processor for a M2M System  @Matsue, 1sep., Eskm2013

Comparisons with Related Work

• Message Oriented Middleware (MOM) – is software or hardware infrastructure supporting

sending and receiving messages between distributed systems.

– allows application modules to be distributed over heterogeneous platforms and reduces the complexity of developing applications that span multiple operating systems and network protocols.

– Our data processor can be viewed as a MOM.

Page 47: An Inter-Wiki Page Data Processor for a M2M System  @Matsue, 1sep., Eskm2013

Concluding Remarks

• Successfully acquired remote room data and totaled up the data using our M2M system.

• It is easy to define the data flow between wiki pages and it is easy to analyze the data of the M2M system by just writing programs on wiki pages.

• This easiness also can be a vulnerability of the security and safety.

Page 48: An Inter-Wiki Page Data Processor for a M2M System  @Matsue, 1sep., Eskm2013

Concluding Remarks

• We are considering to enhance the security and safety of the M2M system.

• It is not so difficult to make the data processor not only for this M2M system but also for other purpose.

• We welcome the help of others who would like one to participate in improving and making his or her own sensor/actuator network.

Page 49: An Inter-Wiki Page Data Processor for a M2M System  @Matsue, 1sep., Eskm2013

Overview of the M2M system

Actuators

ADK

Androidterminal

Mobile Terminal

Sensors

ADK

Androidterminal

Mobile Terminal

Androidterminal

Mobile Terminal

PukiWiki

PukiWiki

Commands +Sensor data

Commands +Sensor data

Sensor Data

Commands + Program +Output of the Processor

Com

man

ds

Com

man

ds

Sen

sor

Data

Sensor data

Sensors

ADK

Androidterminal

Mobile Terminal

Sen

sor

Data

Com

man

ds,

Prog

ram

Proc

esse

d Dat

a

Commands,

Program

Commands

Com

man

ds,

Pro

gra

m

Processed

Data

Commands + Program +Output of the Processor