iotivity 기반헬스케어디바이스 구현사례및이슈 · 2019-08-08 · 1 bit 7bit 1bit...
TRANSCRIPT
IoTivity 기반 헬스케어 디바이스구현사례 및 이슈
ETRI | 표준연구센터 | 이원석, 이주철
2016.11.17
• Part 1. IoTivity 기반 헬스케어 디바이스 개념 소개
– IoTivity 구조/스택
– OCF 헬스케어 표준
– OCF 헬스케어 표준 – 리소스 모델
– OCF 헬스케어 표준 – 디바이스 스펙
• Part 2. 헬스케어 디바이스 구현 내용 소개
– Trivia of IoTivity
– Healthcare data model 구현 사례 소개
– 관련 이슈 - IoTivity에서의 BLE 지원
– 관련 이슈 - IoTivity에서의 아두이노 지원
• Part 3. 맺음말
목 차
Copyright ⓒ 2016 SAMSUNG ELECTRONICS. ALL RIGHTS RESERVED
Part 1. IoTivity 기반 헬스케어 디바이스개념 소개
안드로이드 앱(with IoTivity Stack)
Healthcare 디바이스(with IoTivity Stack)
체온, SPO2, 혈당, 심전도 등 정보 제공
OCF 표준 기반
OCF/IoTivity Healthcare 표준 구현 사례
(참고) 데모 동영상: https://www.youtube.com/watch?v=O8AWchL0vwg
IoTivity 개념적 구조
IoTivity 스택
<Android*, iOS*, or Microsoft* Windows* 등 > <IoTivity Service 미지원>
고사양기기를위한 Stack저사양기기를위한 Stack
OCF Healthcare 표준
목표
• Fitness/Healthcare 리소스모델개발
• Fitness/Healthcare 디바이스스펙개발
Scope and Use Cases – v1.0
• Personal Health and Fitness
• Health and fitness data collection, monitoring, and notifications
• Data from personal health and fitness devices can be gathered, monitored, and
shared with healthcare services
OCF Healthcare 표준
Scope and Use Cases – v1.0
• Personal Health and Fitness
OCF Healthcare 표준 – 리소스 모델Friendly Name Resource Type (rt)
Activity oic.r.activity
Blood glucose oic.r.blood.glucose
Blood pressure oic.r.blood.pressure
Body Fat oic.r.body.fat
Body height oic.r.body.height
Body mass index oic.r.bmi
Body metrics oic.r.body.metrics
Body position oic.r.body.position
Body site oic.r.body.site
Body temperature oic.r.body.temperature
Body water oic.r.body.water
Body weight oic.r.body.weight
Breath oic.r.breath
Continuous glucose monitor oic.r.cgm
Friendly Name Resource Type (rt)Cycling computer oic.r.cycling.computerCycling power oic.r.cycling.powerCycling speed cadence oic.r.cycling.speedcadenceDistance oic.r.distanceElectromyography oic.r.emgFat free mass oic.r.ffmForced expiratory volume 1 oic.r.fev1Galvanic skin response oic.r.gsrHeart rate oic.r.heartrateMuscle oxygen saturation oic.r.muscle.oxygen.saturationOxygen saturation oic.r.blood.oxygen.saturationPeak expiratory flow oic.r.pefRepetition oic.r.repetitionRespiration rate oic.r.respirationrateSleep oic.r.sleepSoft lean mass oic.r.slmSteps oic.r.steps
GET /oic/res?rt=oic.r.blood.glucoseExample
OCF Healthcare 표준 – 리소스 모델 RAML / JSON 스키마 정의
Property name Value type Mandatory Access mode Description
bloodsugar number yes Read OnlyThe Concentration Of Glucose In The Blood
units string yes Read OnlyUnits Used To Measure Blood Sugar Levels
site string Read Only Lot Number Of Strip
observedtime string Read Only
An Iso8601 Format Time Indicating WhenThe Data Is Observed (Ex: 2016-02-15T09:19Z)
{
"rt": "oic.r.blood.glucose",
"bloodsugar": 100,
"units": "mg/dl",
"site": "GS48148",
"observedtime": "2016-02-15T09:19Z"
}
Example
OCF Healthcare 표준 – 리소스 모델
<Source: http://oneiota.org/>
OCF 리소스 모델 개발 도구
Live Standards 개념
OCF Healthcare 표준 – 디바이스 스펙
Device Name Device Type (rt)Activity Tracker oic.d.activitytrackerBlood Pressure Monitor oic.d.bpm
Glucose Meter oic.d.glucosemeter
Heart Rate Monitor oic.d.hrmPulse Oximeter oic.d.pulseoximeter
Scale oic.d.scale
Sleep Monitor oic.d.sleepmonitorSmart Watch oic.d.smartwatch
Strength Fitness Equipment oic.d.strengthfitnessequipment
Thermometer oic.d.thermometer
Fitness/Healthcare 디바이스프로파일로 각디바이스 타입및 필수리소스 정의
oic.r.switch.binary
필수리소스
oic.r.blood.glucose
Example GET /oic/res?rt=oic.d.glucosemeter
Copyright ⓒ 2016 SAMSUNG ELECTRONICS. ALL RIGHTS RESERVED
Part 2. 헬스케어 디바이스 구현 내용 소개
• Source of information
– https://wiki.iotivity.org
• Installation of source
– 1) Clone GIT repository from IoTivity directly (https://www.iotivity.org/documentation/linux/getting-started)
– 2) Get from GitHub mirror (https://github.com/iotivity/iotivity)
– 3) Get tarball from official site (https://www.iotivity.org/downloads)
• Built IoTivity
– https://wiki.iotivity.org/build_for_your_system
• SCONS, build tool
– Get document (http://scons.org/documentation.html)
– Get online help
• scons -h
• scons TARGET_OS=linux -h
Trivia of IoTivity
• Get info from source directory
– See “./”
– How to build
• “./Readme.scons.txt”
– Brief reference of scons script (including extra functions for IoTivity)
• “./scons_script_how_to.txt”
– Entrance of scons script
• “./SConstruct”
– Arduino specific config
• “./arduino.scons”
Trivia of IoTivity
• Tools
– Conformance Test
• ITT, IoTivity Test Tool (https://wiki.iotivity.org/conformance_test_tool)
– Free, Not maintained anymore, 32bit linux only
• CTT, Conformance Test Tool, (https://workspace.openconnectivity.org/kws/test_tools/)
– Opened for members, official conformance tool of OCF
– IoTivity Simulator
• https://wiki.iotivity.org/iotivity_tool_guide
Trivia of IoTivity
• Software platform
– IoTivity server: arduino app
– IoTivity client: android app
– IoTivity 1.0.1
• Hardware platform
– IoTivity server: arduino due + BLE shield (red bear) + e-health sensor platform
– IoTivity client: android phone
Healthcare data model 구현 사례 소개
Arduino due BLE shield E-health sensor platform
• E-health kit (v2.0 latest version)
– https://www.cooking-hacks.com/ehealth-sensors-complete-kit-biometric-medical-arduino-
raspberry-pi
– Compatible HW
• Arduino, Raspberry Pi (Model B+), Raspberry Pi 2 (Model B) and Intel Galileo boards.
– Supported sensors
• Pulse and oxygen in blood sensor (SPO2)
• Electrocardiogram sensor (ECG)
• Blood pressure sensor (sphygmomanometer) V2.0
• Electromyography Sensor (EMG)
Healthcare data model 구현 사례 소개
Healthcare data model 구현 사례 소개
• IoTivity server implementation
– HW Platform 변경 (lack of memory) : arduino mega arduino due
– scons script 수정
• Add arduino library:
• Compile arduino app:
• Build parameters
– Output image
Healthcare data model 구현 사례 소개
# ./resource/SConscript
elif target_os == 'arduino':
SConscript('csdk/stack/samples/arduino/Healthcare/healthcareserver/SConscript')
# ./arduino.scons
env.importlib(‘eHealth’)
# ./out/arduino/arm/release/resource/csdk/stack/samples/arduino/Healthcare/healthcareserver
sudo scons TARGET_OS=arduino TARGET_TRANSPORT=BLE TARGET_ARCH=arm BOARD=arduino_due_x
SHIELD=RBL_NRF8001 DEVICE_NAME=ETRI_OIC_HEALTH LOGGING=true UPLOAD=true
• APIs for IoTivity application
– C++ API (1)
• For full device (i.e. Linux)
• Examples: ./resource/examples
– C API (2)
• For constrained device (i.e. arduino)
• Examples: ./resource/csdk/stack/samples
– CA (Connectivity Abstraction) (3)
• Examples: ./resource/csdk/connectivity/samples
Healthcare data model 구현 사례 소개
Application
(3)
• Arduino application
– HeartRateEntityHandlerCb(…, OCEntityHandlerRequest * entityHandlerRequest,…)
• Switch (entityHandlerRequest->method) {
– Case OC_REST_GET: /* Do something…..*/
– ….
• }
– setup()
• OCInit(.., OC_SERVER);
• OCCreateResource(…, HeartRateEntityHandlerCb, …);
• OCCreateResource(…, BodyTemperatureEntityHandlerCb, …);
• …
– loop()
• OCProcess();
Healthcare data model 구현 사례 소개
• OCF의 기본 철학
– Billions of connected devices (devices, phones, computers and sensors) should be able to
communicate with one another regardless of manufacturer, operating system, chipset or
physical transport. The Open Connectivity Foundation (OCF) is creating a specification and
sponsoring an open source project to make this possible. (OCF site:
https://openconnectivity.org )
– …this specification also means to leverage existing radio silicon (e.g., Bluetooth®
technology, Wi-Fi, or 802.15.4) and concentrates on the network layer and the associated
data link layer adaptations produced by the IETF…. (Core spec 1.1.0)
– … An IPv6 constrained node on a BLUETOOTH(R) Low Energy network should support IETF
RFC 7668 and related updates… (Core spec 1.1.0)
– 다양한 통신기술에 독립적인 통신을 지원
관련 이슈 - IoTivity에서의 BLE 지원 (1)
• In reality…
– What happened in Plugfest #6 event… (Feb. 2016)• CTT가 BLE를 지원하지 않음!
– 현재의 IoTivity 구현은 RFC7668 을 구현하지 않음
– CoAP 메시지는 바로 BLE 프레임으로 전송됨 (OIC transport profile)
• CoAP over IPv6 vs. CoAP over BLE
– CoAP over IPv6 (over adaptation layer (RFC7668)) over BLE• 표준을 따르는 방법
• 아직 널리 보급되지 않음
• 하드웨어적 제약사항 (>=BLE4.1)
– CoAP over BLE• 비 표준적인 방법
• 표준이 널리 보급되기까지 기다리지 않아도 됨
• 상품을 빠르게 출시해야 하는 제조사의 입장에서 유리
• Constrained device 에 대응 가능함
관련 이슈 - IoTivity에서의 BLE 지원 (2)
• BLE-GATT Project Group in OCF
– Charter: This project aims to develop specification and open source for only BLE-GATT
Non-IP transport profile based on OCF Framework using packet multiplexing concept to
let multiple application communicate with each other for Wearable devices.
– Goal: Expansion of OCF ecosystem to include “BLE devices w/o IPv6”
• “BLE devices w/o IPv6” means following cases :
– BLE devices which can’t support IPSP (BLE 4.0)
– BLE devices which doesn’t support IPv6 adaptation layer (BLE 4.1 or higher)
: due to code size, memory, protocol overhead, etc
관련 이슈 - IoTivity에서의 BLE 지원 (3)
관련 이슈 - IoTivity에서의 BLE 지원 (4)
출처: BLE-GATT project purpose presentation
CoAP #1 CoAP #2 CoAP #3 ……
L CoAP’ #1 L CoAP’ #2 L CoAP’ #3 ……L
BLE Packet#1
PDU #1 PDU #2 PDU #n
PDU #1 PDU #2 ……
BLE Packet#2 BLE Packet #n
L : Length
CoAP : CoAP messageCoAP’ : Encrypted CoAP message
St : Start bitE : Encryption bitS : Source
D : DestinationHdr : Header
Encryption / Decryption
Segmentation / Desegmentation
Hdr Hdr Hdr……
Hdr
DESt S L
L
1 bit 7bit 1bit 7bit 4 Bytes
St S E D L
1 : Start
0: Not start
Source port
(0000001 ~ 1111111)
1 : Encrypted
0: Not Encrypted
Destination port
(0000001 ~ 1111111)
Indicate payload length
when St = 1
L
• OCF의 기본 철학
– Billions of connected devices (devices, phones, computers and sensors) should be able to
communicate with one another regardless of manufacturer, operating system, chipset or
physical transport. The Open Connectivity Foundation (OCF) is creating a specification and
sponsoring an open source project to make this possible. (OCF site:
https://openconnectivity.org )
– 다양한 운영체제에 독립적인 통신을 지원
관련 이슈 - IoTivity에서의 아두이노 지원 (1)
• In reality…
– What happened in Plugfest #9 event… (Sep. 2016)
• IoTivity 가 아두이노를 제대로 지원하지 않음!
– Security 관련 기능의 구현이 IoTivity 아두이노 지원코드에서 빠져 있음
• Device ID 를 생성하지 못함
• 거의 모든 CTT test case failure!
– 추후 아두이노 지원 계획 없음! (featured by Intel)
관련 이슈 - IoTivity에서의 아두이노 지원 (2)
“We do not think Arduino is a target platform for anyone who is serious about making devices. It's great for hobbyists, but not much more than that.”
“If you want a constrained device, I recommend using a real, constrained OS, like Zephyr, RIoT, Contiki, nuttX, FreeRTOS, etc. (in that order of priority).”
Copyright ⓒ 2016 SAMSUNG ELECTRONICS. ALL RIGHTS RESERVED
Part 3. 맺음말
• Healthcare 구현 플랫폼의 변경
– Linux (라즈베리 파이) with BLE
• IoTivity 는 아직 진행중…
– 현재까지는 smarthome domain 이 중심
– 향후 다양한 domain 이 추가되면 OCF의 철학에 맞는 IoTivity 가 될 것으로 예상
• Chance to contribute to IoTivity open source community!
– Contribution to “IoTivity for 아두이노”
맺음말…
Copyright ⓒ 2016 SAMSUNG ELECTRONICS. ALL RIGHTS RESERVED
THANK YOU!
Any Questions?