Azure IoT/Edge Recap
Taka Wang
2018.05.03
Market Share & Enterprise Adoption
33%
13%
10%
6%
‣ AWS revenue jumped 49 percent to $5.44 billion in the first quarter.
‣ Microsoft said Azure revenue jumped 93 percent. KeyBanc analysts
estimated Azure had $1.76 billion in revenue, while Raymond
James analysts predicted the number was $2.05 billion.
Reference: CNBC & Synergy Research Group & zdnet
阿⾥雲 IoT
Reference: 追求萬物智聯,「邊緣計算」成阿⾥新賽道上的重要分⽀
2018 March
阿⾥雲 IoT - Link Edge
快速接入 函數計算 流式計算
本地暫存 設備鏈接 在線更新
容器化部署 ⾼智能 本地安全
平台功能 Reference: Link Edge
X-Ray
AWS IoT
AWS IoT Device SDK
AWS Greengrass
AWS Services
Customer Applications
Azure IoT Hub
Azure IoT Client
Azure IoT Edge
Azure Services
Azure IoT Suite
Customer Applications
AWS
Azure
Reference: Radu Vunvulea
Core functionality
Topic Azure IoT Hub Amazon AWS IoT
Communication Channels
HTTPS, AMQP, MQTT, custom ones
using protocol gateway
HTTP(s), MQTT
SDKs .NET, C99, Node.js, Java, Python C/C++, Node.js, Java, Python, iOS
Security TLS (server authentication only) TLS (mutual authentication)
Authentication
Token base (SAS) per device, X.509
device certificate, Native AD
X.509 client authentication, IAM service,
Cognito Service
Communication Command based, telemetry Command based, telemetry
Device Management
Enable a device and control device
capabilities, Command pipeline
Enable a device and control device
capabilities
Monitoring & Identity Registry Twin device Thing registry
Pricing
Per IoT Hub unit combined with number
of devices and messages per day
Per number of messages (traffic) to/
from device
Reference: DZone
AWS IoT Reference Architecture
Courtesy of AWS Doc
Azure IoT Reference Architecture
Courtesy of Azure IoT Reference Architecture
Google IoT Reference Architecture
Courtesy of Google Cloud
Cloud Dataflow
Google IoT Telemetry Reference Architecture
Courtesy of Real-Time Stream Processing for IoT
Intel® IoT Reference Architecture
Courtesy of Intel® IoT Platform Reference Architecture
There's no one size fits all solution
Core functions of IoT Cloud
Identity & Registry
API Endpoints
Virtual Device
Representation
Authentication&
Authorization
Brokered Communication
Model
Rules Engine
Stream
Processor
與 IoT Device 交換資料,作為 Message Broker
IoT Device ⾝分管理⽤
讓應⽤程式可以利⽤ IoT Device的資料
裝置狀態管理,讓應⽤程式可以使⽤⼀致性的 API 操作 IoT Device
IoT Device 權限/驗證⽤
Event Correlation and Integration
Dataflow Pipeline vs. Event Processing
Data
pipe
operation operation operation
transform aggregation
filter
Data
Time
correlation
ETL
CEP
快速接入
函數計算
流式計算
本地暫存
設備鏈接
在線更新
容器化部署
⾼智能
本地安全
Core functions of Edge device
解決網路斷斷續續問題
解決 Protocol 轉換問題
提供初步的資料流處理功能,也扮演 Rule Engine 功能
提供 Event-Driven的開發環境,特別適合 Data ingestion 情境,做出對應動作
Azure IoT/Edge
Azure IoT Suite
Ingestion Stream Analysis Presentation
Stream Analytics
IoT Hub Notification Hub
Machine Learning Power BI
Azure IoT Reference Architecture
Courtesy of Microsoft Azure
Azure IoT SDK
C99
(mbed/Arduino)
Node.js .NET Java 7+
(Android)
Python
Reference: Microsoft Azure IoT SDKs
Gateway Pattern
‣ Transparent
‣ Protocol Translation
‣ Identity Translation
Reference: Microsoft Azure Docs
Transparent
Clients think they have their own connection to the cloud even
though they are all being sent over the same connection.
Device 不知道 Edge 的存在 IoT Hub 認為 Devices 都是獨立的個體
Store and Forward
Reference: Microsoft Azure Docs
Azure IoT SDK
Protocol Translation (opaque gateway)
負責protocol/payload轉譯⼯作
IoT Hub 以為只有⼀台 Edge
無法對各別 Device 操作
Payload必須包含ID資訊
Reference: Microsoft Azure Docs
Azure IoT SDK
Identity Translation (proxy gateway)
IoT Hub 認為 Devices 都是獨立的個體
Payload必須包含ID資訊 負責protocol/payload轉譯⼯作之外
還要管理/保存device 狀態
Reference: Microsoft Azure Docs
Azure IoT SDK
Azure IoT Edge
Better Feasible solution
Service1 Service3
Service2
Virtual Local Bus/D-Bus/Dispatcher/Message Bus …
sub
pub pub sub pub sub
Service4
pub sub
No Need to change services’ endpoints
but change the routing rules (in one place)
Edge Agent
Edge Hub
Azure IoT Edge runtime
Azure IoT Edge runtime
IoT Edge Device
IoT Hub
modbus Insight Action
Reference: Microsoft Azure
IoT Device
local proxy of IoT Hub & local bus
MQTT
control modules life cycle, healthy
Insights &
module health
Modbus TCP
MQTT
AMQP
Courtesy of Andrew Hainen
Edge Agent
Edge Hub
Azure IoT Edge runtime
Azure IoT Edge runtime
IoT Edge Device
IoT Hub
modbus Insight Action
Reference: Microsoft Azure
IoT Device
local proxy of IoT Hub & local bus
MQTT
control modules life cycle, healthy
Insights &
module health
Modbus TCP
MQTT
AMQP
Courtesy of Andrew Hainen
Module
Insight
Docker Hub Azure container registry
docker image
Device in Taipei
Azure IoT Hub
Insight
Device in Taichung
Insight Twin
Insight identity
docker instance
docker instance
Insight Twin
Insight identity
Insight
/devices/taichung01/modules/insight01
/devices/taichung01/modules/insight02
Insight
docker instance
JSON JSON
/devices/taichung01
/devices/taipei01
JSON
lives in the
cloud
Run on-prem
Module
Insight
Docker Hub Azure container registry
docker image
Device in Taipei
Azure IoT Hub
Insight
Device in Taichung
Insight Twin
Insight identity
docker instance
docker instance
Insight Twin
Insight identity
Insight
/devices/taichung01/modules/insight01
/devices/taichung01/modules/insight02
Insight
docker instance
Deployment
JSON JSON
/devices/taichung01
/devices/taipei01
JSON
Sync
lives in the
cloud
Run on-prem
Module
Insight
Docker Hub Azure container registry
docker image
Device in Taipei
Azure IoT Hub
Insight
Device in Taichung
Insight Twin
Insight identity
docker instance
docker instance
Insight Twin
Insight identity
Insight
/devices/taichung01/modules/insight01
/devices/taichung01/modules/insight02
Insight
docker instance
Deployment
JSON JSON
/devices/taichung01
/devices/taipei01
JSON
Sync
Can be DLL
Can be EXE
Note
lives in the
cloud
Run on-prem
Module & Edge Hub
Edge Hub
Module
input
endpoints
output
endpoint
‣ To cloud
‣ To module
‣ From cloud
‣ From module
IoT
SDK
Reference: Azure Doc
MQTT
Broker
MQTT
Client
Message
Cache
Edge Hub
Security
Cache
Module & Edge Hub
Edge Hub
Module
input
endpoints
output
endpoint
‣ To cloud
‣ To module
‣ From cloud
‣ From module
IoT
SDK
message to cloud
original payload device id module id input name output name
stamped
Reference: Azure Doc
MQTT
Broker
MQTT
Client
Message
Cache
Edge Hub
Security
Cache
Module & Edge Hub
Edge Hub
Module
input
endpoints
output
endpoint
‣ To cloud
‣ To module
‣ From cloud
‣ From module
IoT
SDK
message to cloud
original payload device id module id input name output name
stamped
routes syntax “{route name}”: "FROM <source> WHERE <condition> INTO <sink>"
source format /messages/modules/{moduleId}/outputs/{output}
sink format $upstream
BrokeredEndpoint("/modules/{moduleId}/inputs/{input}")
route1 "sensorToFilter": "FROM /messages/modules/tempSensor/outputs/temperatureOutput INTO BrokeredEndpoint("/modules/filtermodule/inputs/input1")"
route2 "filterToIoTHub": "FROM /messages/modules/filtermodule/outputs/output1 INTO $upstream"
Reference: Azure Doc
MQTT
Broker
MQTT
Client
Message
Cache
Edge Hub
Security
Cache
import iothub_client
from iothub_client import ...
from iothub_client import ...
...
def send_confirmation_callback(message, result, user_context):
...
def receive_message_callback(message, hubManager):
...
hubManager.forward_event_to_output("output1", message, 0)
class HubManager(object):
def __init__(self, connection_string):
self.set_certificates()
self.client.set_message_callback("input1", receive_message_callback, self)
...
def set_certificates(self):
...
def forward_event_to_output(self, outputQueueName, event, send_context):
self.client.send_event_async(
outputQueueName, event, send_confirmation_callback, send_context)
def main(connection_string):
hub_manager = HubManager(connection_string)
while True:
time.sleep(1000)
...
edge hub connection string
read from environment variable
source: cookiecutter-azure-iot-edge-module
Azure IoT SDK
Module
Example
import iothub_client
from iothub_client import ...
from iothub_client import ...
...
def send_confirmation_callback(message, result, user_context):
...
def receive_message_callback(message, hubManager):
...
hubManager.forward_event_to_output("output1", message, 0)
class HubManager(object):
def __init__(self, connection_string):
self.set_certificates()
self.client.set_message_callback("input1", receive_message_callback, self)
...
def set_certificates(self):
...
def forward_event_to_output(self, outputQueueName, event, send_context):
self.client.send_event_async(
outputQueueName, event, send_confirmation_callback, send_context)
def main(connection_string):
hub_manager = HubManager(connection_string)
while True:
time.sleep(1000)
...
edge hub connection string
read from environment variable
source: cookiecutter-azure-iot-edge-module
Azure IoT SDK
Module
Example
import iothub_client
from iothub_client import ...
from iothub_client import ...
...
def send_confirmation_callback(message, result, user_context):
...
def receive_message_callback(message, hubManager):
...
hubManager.forward_event_to_output("output1", message, 0)
class HubManager(object):
def __init__(self, connection_string):
self.set_certificates()
self.client.set_message_callback("input1", receive_message_callback, self)
...
def set_certificates(self):
...
def forward_event_to_output(self, outputQueueName, event, send_context):
self.client.send_event_async(
outputQueueName, event, send_confirmation_callback, send_context)
def main(connection_string):
hub_manager = HubManager(connection_string)
while True:
time.sleep(1000)
...
edge hub connection string
read from environment variable
source: cookiecutter-azure-iot-edge-module
Azure IoT SDK
Module
Example
import iothub_client
from iothub_client import ...
from iothub_client import ...
...
def send_confirmation_callback(message, result, user_context):
...
def receive_message_callback(message, hubManager):
...
hubManager.forward_event_to_output("output1", message, 0)
class HubManager(object):
def __init__(self, connection_string):
self.set_certificates()
self.client.set_message_callback("input1", receive_message_callback, self)
...
def set_certificates(self):
...
def forward_event_to_output(self, outputQueueName, event, send_context):
self.client.send_event_async(
outputQueueName, event, send_confirmation_callback, send_context)
def main(connection_string):
hub_manager = HubManager(connection_string)
while True:
time.sleep(1000)
...
edge hub connection string
read from environment variable
source: cookiecutter-azure-iot-edge-module
Azure IoT SDK
Module
Example
Stream Analytics on Edge
IoT Edge Runtime
Stream Analytics
module
module2
module1
IoT Edge Device
IoT Device
IoT Hub
Azure
Stream Analytics Services
Data
Deployment
Configuration
Data
Command
Reference: Azure Doc
Analytical intelligence
(CEP) Complex Event Processing
Stream Analytics on Edge
IoT Edge Runtime
Stream Analytics
module
module2
module1
IoT Edge Device
IoT Device
IoT Hub
Azure
Stream Analytics Services
Data
Deployment
Configuration
Data
Command
Streaming runtime Job definition
Azure Stream Analytics: Edge Job
Reference: Azure Doc
Analytical intelligence
(CEP) Complex Event Processing
Stream Analytics on Edge
IoT Edge Runtime
Stream Analytics
module
module2
module1
IoT Edge Device
IoT Device
IoT Hub
Azure
Stream Analytics Services
Data
Deployment
Configuration
Data
Command
Temperatures=15.445
Temperatures=15.345
Temperatures=15.155
…
Temperatures=15.464
SELECT AVG(temperature) as temp
FROM input
GROUP BY TumblingWindow(second,1)
Temperatures=15.321
Input Query Outputs
Streaming runtime Job definition
Azure Stream Analytics: Edge Job
Reference: Azure Doc
Analytical intelligence
(CEP) Complex Event Processing
Stream Analytics on Edge
IoT Edge Runtime
Stream Analytics
module
module2
module1
IoT Edge Device
IoT Device
IoT Hub
Azure
Stream Analytics Services
Data
Deployment
Configuration
Data
Command
Temperatures=15.445
Temperatures=15.345
Temperatures=15.155
…
Temperatures=15.464
SELECT AVG(temperature) as temp
FROM input
GROUP BY TumblingWindow(second,1)
Temperatures=15.321
Input Query Outputs
geofence
Streaming runtime Job definition
Azure Stream Analytics: Edge Job
Reference: Azure Doc
Analytical intelligence
(CEP) Complex Event Processing
Azure Stream Analytics ≈ AWS Rule Engine
AWS IoT Core/SDK
Things
Applications
AWS IoT Core AWS
MQTT over TLS
MQTT over WebSocket/TLS
HTTP
Reference: Smart Home Building Blocks with Intel Edison & AWS
Device SDK
Certificate
Allows devices to seamlessly
drop on/off connection
Manages
device identity
Allows integration with
other AWS services (route)
Communicates with
authenticates &
authorized devices
Device
Gateway
Rules Engine
Thing
Shadow
Thing
Registry
MQTT
HTTP (REST)
Amazon
CloudWatch
Amazon
Kinesis
Amazon
ES
Amazon
DynamoDB
Amazon
S3
Amazon
Lambda
Amazon
SQS
Amazon
SNS
Amazon
Machine Learning
Actions
AWS IoT Rules Engine
SELECT DATA FROM TOPIC WHERE FILTER ACTIONS
Reference: (MBL312) NEW! AWS IoT: Programming a Physical World w/ Shadows & Rules
{
"awsIotSqlVersion": "2016-03-23",
"sql": "SELECT * FROM 'iot/test'",
"ruleDisabled": false,
"actions": [
{
"s3": {
"roleArn": "arn:aws:iam::123456789012:role/aws_iot_s3",
"bucketName": "my-bucket",
"key": "myS3Key"
}
}
]
}
Rule
Name
Description
SQL Statement
Array of Actions
Machine Learning on Edge
IoT Edge Runtime
IoT Edge device
IoT Device SDK
Azure ML Container
REST API
AI/ML Model
HTTP REST Call
‣score.py
‣model.pkl
(pickle)
Azure Machine Learning Workbench
Reference: Azure Doc
Azure function on Edge (preview)
using System.IO;
using Microsoft.Azure.Devices.Client;
using Newtonsoft.Json;
// Filter messages based on the temperature value in the body of the message and the temperature threshold value.
public static async Task Run(Message messageReceived, IAsyncCollector<Message> output, TraceWriter log)
{
const int temperatureThreshold = 25;
byte[] messageBytes = messageReceived.GetBytes();
var messageString = System.Text.Encoding.UTF8.GetString(messageBytes);
if (!string.IsNullOrEmpty(messageString))
{
// Get the body of the message and deserialize it
var messageBody = JsonConvert.DeserializeObject<MessageBody>(messageString);
if (messageBody != null && messageBody.machine.temperature > temperatureThreshold)
{
// Send the message to the output as the temperature value is greater than the threashold
var filteredMessage = new Message(messageBytes);
// Copy the properties of the original message into the new Message object
foreach (KeyValuePair<string, string> prop in messageReceived.Properties)
{
filteredMessage.Properties.Add(prop.Key, prop.Value); }
// Add a new property to the message to indicate it is an alert
filteredMessage.Properties.Add("MessageType", "Alert");
// Send the message
await output.AddAsync(filteredMessage);
log.Info("Received and transferred a message with temperature above the threshold");
}
}
}
Reference: Azure Doc
C# Sample Code only
Field protocol - Modbus Module
Reference: Azure Doc
Field protocol - OPC-UA Module
PLC1
PLC2
OPCUA
Server
IoT Edge Runtime
IoT Edge device
opc-publisher
.NET Core module
opc-proxy
C99 module IoT Hub
JSON payload
Reference: Repo1 & Repo2
Field protocol - OPC-UA Module
PLC1
PLC2
OPCUA
Server
IoT Edge Runtime
IoT Edge device
opc-publisher
.NET Core module
opc-proxy
C99 module IoT Hub
JSON payload
Reference: Repo1 & Repo2
Dead serious codebase
Container Network
eth0: 172.17.0.3 eth0: 172.17.0.4
eth0: 172.17.0.2
module module module
veth
172.17.0.1
iptables NAT
192.168.0.2
NIC
172.17.0.0/24
docker0
veth veth
Private IP Subnet: 192.168.0.0/24
Linux bridge
Linux Host
edge hub edge agent module 1
eth0: 172.17.0.3 eth0: 172.17.0.4
eth0: 172.17.0.2
module module module
vNIC
WinNAT
192.168.0.2
NIC
172.17.0.0/24
vSwitch
vNIC vNIC
Private IP Subnet: 192.168.0.0/24
Hyper-V virtual switch
Windows Host
edge hub edge agent module 1
vNIC
Device Onboard
volume manufacturing
Zero-touch provisioning
Reference: Azure Doc
Enrollment list
Azure IoT Hub
IoT Device Device Provisioning Service
X.509 Certificate
Init Setup
Azure IoT Hub
Azure IoT Hub
Endorsement Key
Zero-touch provisioning
0. Init IoT Hub & Device
Provisioning Services, link
these two services.
Reference: Azure Doc
Enrollment list
Azure IoT Hub
IoT Device Device Provisioning Service
X.509 Certificate
Init Setup
Azure IoT Hub
Azure IoT Hub
Endorsement Key
Zero-touch provisioning
1. Manufacturer encode
Identity & Registration URL
0. Init IoT Hub & Device
Provisioning Services, link
these two services.
Reference: Azure Doc
Enrollment list
Azure IoT Hub
IoT Device Device Provisioning Service
X.509 Certificate
Init Setup
Azure IoT Hub
Azure IoT Hub
Endorsement Key
Zero-touch provisioning
1. Manufacturer encode
Identity & Registration URL
2. Solution Operator add
device registration
information to enrollment list
0. Init IoT Hub & Device
Provisioning Services, link
these two services.
Reference: Azure Doc
Enrollment list
Azure IoT Hub
IoT Device Device Provisioning Service
X.509 Certificate
Init Setup
Azure IoT Hub
Azure IoT Hub
Endorsement Key
Zero-touch provisioning
Enrollment list
Azure IoT Hub
IoT Device Device Provisioning Service
X.509 Certificate
First bootup
Azure IoT Hub
Azure IoT Hub
Endorsement Key
1. Prove its identity
Reference: Azure Doc
Zero-touch provisioning
Enrollment list
Azure IoT Hub
IoT Device Device Provisioning Service
X.509 Certificate
First bootup
Azure IoT Hub
Azure IoT Hub
Endorsement Key
1. Prove its identity 2. Validate
Reference: Azure Doc
Zero-touch provisioning
Enrollment list
Azure IoT Hub
IoT Device Device Provisioning Service
X.509 Certificate
First bootup
Azure IoT Hub
Azure IoT Hub
Endorsement Key
1. Prove its identity 2. Validate
3. Register & populate the
device’s desired twin state
Reference: Azure Doc
Zero-touch provisioning
Enrollment list
Azure IoT Hub
IoT Device Device Provisioning Service
X.509 Certificate
First bootup
Azure IoT Hub
Azure IoT Hub
Endorsement Key
1. Prove its identity 2. Validate
3. Register & populate the
device’s desired twin state
4. Return device information
Reference: Azure Doc
Zero-touch provisioning
Enrollment list
Azure IoT Hub
IoT Device Device Provisioning Service
X.509 Certificate
First bootup
Azure IoT Hub
Azure IoT Hub
Endorsement Key
1. Prove its identity 2. Validate
3. Register & populate the
device’s desired twin state
4. Return device information
5. Return connection information
Reference: Azure Doc
Zero-touch provisioning
Enrollment list
Azure IoT Hub
IoT Device Device Provisioning Service
X.509 Certificate
First bootup
Azure IoT Hub
Azure IoT Hub
Endorsement Key
1. Prove its identity 2. Validate
3. Register & populate the
device’s desired twin state
4. Return device information
5. Return connection information
6. Connect to IoT Hub
Reference: Azure Doc
Zero-touch provisioning
Enrollment list
Azure IoT Hub
IoT Device Device Provisioning Service
X.509 Certificate
First bootup
Azure IoT Hub
Azure IoT Hub
Endorsement Key
1. Prove its identity 2. Validate
3. Register & populate the
device’s desired twin state
4. Return device information
5. Return connection information
6. Connect to IoT Hub
7. Get desired state from device twin
Reference: Azure Doc
Summary
X-Ray Again
快速接入 函數計算 流式計算
本地暫存 設備鏈接 在線更新
容器化部署 ⾼智能 本地安全
快速接入 函數計算 流式計算
本地暫存 設備鏈接 在線更新
容器化部署 ⾼智能 本地安全
cross-platform
docker
sandbox
preview
lambda
opc-ua sample
opc-ua*
modbus
docker push
agent upgrade
TLS & X.509 TLS & X.509
Inference* Inference
store and forward
store and forward
device SDK device SDK stream analytics
AWS Greengrass Azure IoT Edge
Microsoft’s ambitions
SaaS
PaaS
Services
Azure IoT Central
Azure IoT Suite
MTK Linux
Azure IoT Central
Reference: Azure Doc
preview
Graphic-based management (SaaS)
Azure IoT Central architecture
Reference: Azure Doc
Supplements
Device twin
Properties
Device Twin
Reported
Desired
Tags
Read, write
Read, receive
change notifications
Read
Read, write change
notifications
Read, write change
notifications
Device app Backend
Reference: Understand and use device twins in IoT Hub
Module Composition
{
"moduleContent": {
"$edgeAgent": {
"properties.desired": {
// desired properties of the Edge agent
// includes the image URIs of all modules
}
},
"$edgeHub": {
"properties.desired": {
// desired properties of the Edge hub
// includes the routing information between modules, and to IoT Hub
}
},
"{module1}": { // optional
"properties.desired": {
// desired properties of module with id {module1}
}
},
"{module2}": { // optional
...
},
...
}
}
"sensorToFilter": "FROM /messages/modules/tempSensor/outputs/temperatureOutput INTO BrokeredEndpoint("/modules/filtermodule/inputs/input1")"
Brainstorming
Why do customers buy
edge computing solutions
This question is different than the following statement: why do customers
need edge computing.
You may persuade…extend/offload cloud intelligence to edge devices to …
Further reading: KNOW YOUR CUSTOMERS' NEEDS
Why do customers buy
edge computing solutions
This question is different than the following statement: why do customers
need edge computing.
You may persuade…extend/offload cloud intelligence to edge devices to …
Further reading: KNOW YOUR CUSTOMERS' NEEDS
Who are potential customers?
Use case assumptions and pre-conditions? (What do they hold? What should
we also provide to them?)
What are customer pain points?
如何提高 cloud services 的使用率 (目的:想賣雲服務)
如何提高 cloud services 的使用率 (目的:想賣雲服務)
讓更多的裝置連上 cloud,使用 cloud 上的服務
如何提高 cloud services 的使用率 (目的:想賣雲服務)
讓更多的裝置連上 cloud,使用 cloud 上的服務
為什麼使用者不將裝置連上 cloud (前提:既然雲服務都已經準備齊全)
如何提高 cloud services 的使用率 (目的:想賣雲服務)
讓更多的裝置連上 cloud,使用 cloud 上的服務
為什麼使用者不將裝置連上 cloud (前提:既然雲服務都已經準備齊全)
還不清楚 cloud 有什麼好處,與傳統的 client/server 架構有什麼差異
如何提高 cloud services 的使用率 (目的:想賣雲服務)
讓更多的裝置連上 cloud,使用 cloud 上的服務
為什麼使用者不將裝置連上 cloud (前提:既然雲服務都已經準備齊全)
還不清楚 cloud 有什麼好處,與傳統的 client/server 架構有什麼差異
教育潛在客戶 cloud 的好處 (彈性服務)
如何提高 cloud services 的使用率 (目的:想賣雲服務)
讓更多的裝置連上 cloud,使用 cloud 上的服務
為什麼使用者不將裝置連上 cloud (前提:既然雲服務都已經準備齊全)
還不清楚 cloud 有什麼好處,與傳統的 client/server 架構有什麼差異
教育潛在客戶 cloud 的好處 (彈性服務)
清楚 cloud 的彈性,但是擔心後續費用,以及資料的安全性
如何提高 cloud services 的使用率 (目的:想賣雲服務)
讓更多的裝置連上 cloud,使用 cloud 上的服務
為什麼使用者不將裝置連上 cloud (前提:既然雲服務都已經準備齊全)
還不清楚 cloud 有什麼好處,與傳統的 client/server 架構有什麼差異
教育潛在客戶 cloud 的好處 (彈性服務)
清楚 cloud 的彈性,但是擔心後續費用,以及資料的安全性
Openstack 的潛在客戶
如何提高 cloud services 的使用率 (目的:想賣雲服務)
讓更多的裝置連上 cloud,使用 cloud 上的服務
為什麼使用者不將裝置連上 cloud (前提:既然雲服務都已經準備齊全)
還不清楚 cloud 有什麼好處,與傳統的 client/server 架構有什麼差異
教育潛在客戶 cloud 的好處 (彈性服務)
清楚 cloud 的彈性,但是擔心後續費用,以及資料的安全性
Openstack 的潛在客戶
清楚 cloud 的彈性也不排斥付費,但不知道怎麼讓裝置連接上 cloud (需求)
如何提高 cloud services 的使用率 (目的:想賣雲服務)
讓更多的裝置連上 cloud,使用 cloud 上的服務
為什麼使用者不將裝置連上 cloud (前提:既然雲服務都已經準備齊全)
還不清楚 cloud 有什麼好處,與傳統的 client/server 架構有什麼差異
教育潛在客戶 cloud 的好處 (彈性服務)
清楚 cloud 的彈性,但是擔心後續費用,以及資料的安全性
Openstack 的潛在客戶
清楚 cloud 的彈性也不排斥付費,但不知道怎麼讓裝置連接上 cloud (需求)
提供免費的 IoT Device SDK 加速客戶開發 (目的:想賣雲服務)
已經有免費的 IoT Device SDK,為什麼客戶還是不使用 cloud services
已經有免費的 IoT Device SDK,為什麼客戶還是不使用 cloud services
既有的 Device 都還沒有連網能力,無法擷取資料出來
已經有免費的 IoT Device SDK,為什麼客戶還是不使用 cloud services
既有的 Device 都還沒有連網能力,無法擷取資料出來
提供有連網能力的資料擷取裝置 (Field Gateway),提供
connect the unconnected solution
已經有免費的 IoT Device SDK,為什麼客戶還是不使用 cloud services
既有的 Device 都還沒有連網能力,無法擷取資料出來
既有的機器已有通訊模組,但使用自己的工業通訊協定,自成系統
提供有連網能力的資料擷取裝置 (Field Gateway),提供
connect the unconnected solution
已經有免費的 IoT Device SDK,為什麼客戶還是不使用 cloud services
既有的 Device 都還沒有連網能力,無法擷取資料出來
既有的機器已有通訊模組,但使用自己的工業通訊協定,自成系統
強化 IoT Device SDK 南向的溝通能力,協助有限的 protocol 轉換
提供有連網能力的資料擷取裝置 (Field Gateway),提供
connect the unconnected solution
已經有免費的 IoT Device SDK,為什麼客戶還是不使用 cloud services
既有的 Device 都還沒有連網能力,無法擷取資料出來
既有的機器已有通訊模組,但使用自己的工業通訊協定,自成系統
開發 OT 轉 IT 的 protocol 轉換 軟硬體套件
強化 IoT Device SDK 南向的溝通能力,協助有限的 protocol 轉換
提供有連網能力的資料擷取裝置 (Field Gateway),提供
connect the unconnected solution
已經有免費的 IoT Device SDK,為什麼客戶還是不使用 cloud services
既有的 Device 都還沒有連網能力,無法擷取資料出來
既有的機器已有通訊模組,但使用自己的工業通訊協定,自成系統
開發 OT 轉 IT 的 protocol 轉換 軟硬體套件
強化 IoT Device SDK 南向的溝通能力,協助有限的 protocol 轉換
不知道資料上雲後除了遠端監控,還能帶來什麼效益
提供有連網能力的資料擷取裝置 (Field Gateway),提供
connect the unconnected solution
已經有免費的 IoT Device SDK,為什麼客戶還是不使用 cloud services
既有的 Device 都還沒有連網能力,無法擷取資料出來
既有的機器已有通訊模組,但使用自己的工業通訊協定,自成系統
開發 OT 轉 IT 的 protocol 轉換 軟硬體套件
強化 IoT Device SDK 南向的溝通能力,協助有限的 protocol 轉換
不知道資料上雲後除了遠端監控,還能帶來什麼效益
教育使用者,cloud services 可以協助從資料中獲得 insight,提升
machine 的效率,進行預防性維修 (predictive maintenance) 等
提供有連網能力的資料擷取裝置 (Field Gateway),提供
connect the unconnected solution
已經有免費的 IoT Device SDK,為什麼客戶還是不使用 cloud services
既有的 Device 都還沒有連網能力,無法擷取資料出來
既有的機器已有通訊模組,但使用自己的工業通訊協定,自成系統
開發 OT 轉 IT 的 protocol 轉換 軟硬體套件
強化 IoT Device SDK 南向的溝通能力,協助有限的 protocol 轉換
不知道資料上雲後除了遠端監控,還能帶來什麼效益
教育使用者,cloud services 可以協助從資料中獲得 insight,提升
machine 的效率,進行預防性維修 (predictive maintenance) 等
提供預防性維修的 cloud service template
提供有連網能力的資料擷取裝置 (Field Gateway),提供
connect the unconnected solution
已經有免費的 IoT Device SDK,為什麼客戶還是不使用 cloud services
既有的 Device 都還沒有連網能力,無法擷取資料出來
既有的機器已有通訊模組,但使用自己的工業通訊協定,自成系統
開發 OT 轉 IT 的 protocol 轉換 軟硬體套件
強化 IoT Device SDK 南向的溝通能力,協助有限的 protocol 轉換
不知道資料上雲後除了遠端監控,還能帶來什麼效益
教育使用者,cloud services 可以協助從資料中獲得 insight,提升
machine 的效率,進行預防性維修 (predictive maintenance) 等
提供預防性維修的 cloud service template
提供有連網能力的資料擷取裝置 (Field Gateway),提供
connect the unconnected solution
提供預防性維修的 turnkey solution 軟體套件
了解預防性維護等智能服務的好處,那為何不能在本地進行?
(需求:Edge computing)
了解預防性維護等智能服務的好處,那為何不能在本地進行?
(需求:Edge computing)
本地端裝置的運算/儲存能力仍然有限,除了少量的運算/儲存工作,仍然
需要 cloud 的彈性服務(運算/儲存能力) (目的:想賣雲服務)
了解預防性維護等智能服務的好處,那為何不能在本地進行?
(需求:Edge computing)
本地端裝置的運算/儲存能力仍然有限,除了少量的運算/儲存工作,仍然
需要 cloud 的彈性服務(運算/儲存能力) (目的:想賣雲服務)
教育使用者,Edge computing 協同 cloud computing 是好方法
了解預防性維護等智能服務的好處,那為何不能在本地進行?
(需求:Edge computing)
本地端裝置的運算/儲存能力仍然有限,除了少量的運算/儲存工作,仍然
需要 cloud 的彈性服務(運算/儲存能力) (目的:想賣雲服務)
推出免費的 Edge computing SDK (目的:想賣雲服務)
教育使用者,Edge computing 協同 cloud computing 是好方法
了解預防性維護等智能服務的好處,那為何不能在本地進行?
(需求:Edge computing)
本地端裝置的運算/儲存能力仍然有限,除了少量的運算/儲存工作,仍然
需要 cloud 的彈性服務(運算/儲存能力) (目的:想賣雲服務)
為什麼雲端業者願意推出邊緣計算的(免費)服務? (Edge消滅Cloud的悖論)
推出免費的 Edge computing SDK (目的:想賣雲服務)
教育使用者,Edge computing 協同 cloud computing 是好方法
了解預防性維護等智能服務的好處,那為何不能在本地進行?
(需求:Edge computing)
本地端裝置的運算/儲存能力仍然有限,除了少量的運算/儲存工作,仍然
需要 cloud 的彈性服務(運算/儲存能力) (目的:想賣雲服務)
為什麼雲端業者願意推出邊緣計算的(免費)服務? (Edge消滅Cloud的悖論)
下放部分 Cloud 能力,綁住裝置使用者,仍要使用 cloud 進行裝置管理,
大數據處理等服務 (目的:想賣雲服務)
推出免費的 Edge computing SDK (目的:想賣雲服務)
教育使用者,Edge computing 協同 cloud computing 是好方法
了解預防性維護等智能服務的好處,那為何不能在本地進行?
(需求:Edge computing)
本地端裝置的運算/儲存能力仍然有限,除了少量的運算/儲存工作,仍然
需要 cloud 的彈性服務(運算/儲存能力) (目的:想賣雲服務)
為什麼雲端業者願意推出邊緣計算的(免費)服務? (Edge消滅Cloud的悖論)
下放部分 Cloud 能力,綁住裝置使用者,仍要使用 cloud 進行裝置管理,
大數據處理等服務 (目的:想賣雲服務)
推出免費的 Edge computing SDK (目的:想賣雲服務)
教育使用者,Edge computing 協同 cloud computing 是好方法
‣ 為什麼公有雲服務業者要做 IoT SDK?
‣ 為什麼他們要推出邊緣計算?
‣ 為什麼我們要做邊緣運算?
‣ 為什麼客戶要上雲?
‣ 為什麼客戶要邊緣運算?
How to connect microservices
Host
Service1
Service3
Service5
Service7
Service6 Service4
Service8 Service2
How to connect microservices
Host
Service1
Service3
Service5
Service7
Service6 Service4
Service8 Service2
How to connect microservices
Host
Service1
Service3
Service5
Service7
Service6 Service4
Service8 Service2
Service9
Simplified version
Service1
Service3
Service2 sub
sub
pub
pub
pub
sub
sub
pub
sub
pub sub
pub
with pub/sub pattern
Service1
Service3
Service2
sub
pub pub
pub
sub
pub
pub
sub
pub
if msg from svc2 then..
elif msg from svc3 then..
if msg from svc1 then..
elif msg from svc2 then..
if msg from svc1 then..
elif msg from svc3 then..
Simplified version
Service1
Service3
Service2 sub
sub
pub
pub
pub
sub
sub
pub
sub
pub sub
pub
with pub/sub pattern
Service1
Service3
Service2
sub
pub pub
pub
sub
pub
pub
sub
pub
if msg from svc2 then..
elif msg from svc3 then..
if msg from svc1 then..
elif msg from svc2 then..
if msg from svc1 then..
elif msg from svc3 then..
Service4
Service4
Simplified version
Service1
Service3
Service2 sub
sub
pub
pub
pub
sub
sub
pub
sub
pub sub
pub
with pub/sub pattern
Service4
Service1
Service3
Service2
sub
pub pub
pub
sub
pub
pub
sub
pub
if msg from svc2 then..
elif msg from svc3 then..
if msg from svc1 then..
elif msg from svc2 then..
if msg from svc1 then..
elif msg from svc3 then..
Service4
Service4
Simplified version
Service1
Service3
Service2 sub
sub
pub
pub
pub
sub
sub
pub
sub
pub sub
pub
with pub/sub pattern
Service1
Service3
Service2
sub
pub pub
pub
sub
pub
pub
sub
pub
if msg from svc2 then..
elif msg from svc3 then..
if msg from svc1 then..
elif msg from svc2 then..
if msg from svc1 then..
elif msg from svc3 then..
Service4
Service4
Simplified version
Service1
Service3
Service2 sub
sub
pub
pub
pub
sub
sub
pub
sub
pub sub
pub
Violate the Open-Closed Principle
with pub/sub pattern
Better Feasible solution
Service1 Service3
Service2
sub
pub pub sub pub sub
Better Feasible solution
Service1 Service3
Service2
Virtual Local Bus/D-Bus/Dispatcher/Message Bus …
sub
pub pub sub pub sub
Better Feasible solution
Service1 Service3
Service2
Virtual Local Bus/D-Bus/Dispatcher/Message Bus …
sub
pub pub sub pub sub
Service4
pub sub
No Need to change services’ endpoints
but change the routing rules (in one place)

Azure IoT & ML Recap - 20180503

  • 1.
  • 2.
    Market Share &Enterprise Adoption 33% 13% 10% 6% ‣ AWS revenue jumped 49 percent to $5.44 billion in the first quarter. ‣ Microsoft said Azure revenue jumped 93 percent. KeyBanc analysts estimated Azure had $1.76 billion in revenue, while Raymond James analysts predicted the number was $2.05 billion. Reference: CNBC & Synergy Research Group & zdnet
  • 3.
  • 4.
    阿⾥雲 IoT -Link Edge 快速接入 函數計算 流式計算 本地暫存 設備鏈接 在線更新 容器化部署 ⾼智能 本地安全 平台功能 Reference: Link Edge
  • 5.
    X-Ray AWS IoT AWS IoTDevice SDK AWS Greengrass AWS Services Customer Applications Azure IoT Hub Azure IoT Client Azure IoT Edge Azure Services Azure IoT Suite Customer Applications AWS Azure Reference: Radu Vunvulea
  • 6.
    Core functionality Topic AzureIoT Hub Amazon AWS IoT Communication Channels HTTPS, AMQP, MQTT, custom ones using protocol gateway HTTP(s), MQTT SDKs .NET, C99, Node.js, Java, Python C/C++, Node.js, Java, Python, iOS Security TLS (server authentication only) TLS (mutual authentication) Authentication Token base (SAS) per device, X.509 device certificate, Native AD X.509 client authentication, IAM service, Cognito Service Communication Command based, telemetry Command based, telemetry Device Management Enable a device and control device capabilities, Command pipeline Enable a device and control device capabilities Monitoring & Identity Registry Twin device Thing registry Pricing Per IoT Hub unit combined with number of devices and messages per day Per number of messages (traffic) to/ from device Reference: DZone
  • 7.
    AWS IoT ReferenceArchitecture Courtesy of AWS Doc
  • 8.
    Azure IoT ReferenceArchitecture Courtesy of Azure IoT Reference Architecture
  • 9.
    Google IoT ReferenceArchitecture Courtesy of Google Cloud Cloud Dataflow
  • 10.
    Google IoT TelemetryReference Architecture Courtesy of Real-Time Stream Processing for IoT
  • 11.
    Intel® IoT ReferenceArchitecture Courtesy of Intel® IoT Platform Reference Architecture
  • 12.
    There's no onesize fits all solution
  • 13.
    Core functions ofIoT Cloud Identity & Registry API Endpoints Virtual Device Representation Authentication& Authorization Brokered Communication Model Rules Engine Stream Processor 與 IoT Device 交換資料,作為 Message Broker IoT Device ⾝分管理⽤ 讓應⽤程式可以利⽤ IoT Device的資料 裝置狀態管理,讓應⽤程式可以使⽤⼀致性的 API 操作 IoT Device IoT Device 權限/驗證⽤ Event Correlation and Integration
  • 14.
    Dataflow Pipeline vs.Event Processing Data pipe operation operation operation transform aggregation filter Data Time correlation ETL CEP
  • 15.
    快速接入 函數計算 流式計算 本地暫存 設備鏈接 在線更新 容器化部署 ⾼智能 本地安全 Core functions ofEdge device 解決網路斷斷續續問題 解決 Protocol 轉換問題 提供初步的資料流處理功能,也扮演 Rule Engine 功能 提供 Event-Driven的開發環境,特別適合 Data ingestion 情境,做出對應動作
  • 16.
  • 17.
    Azure IoT Suite IngestionStream Analysis Presentation Stream Analytics IoT Hub Notification Hub Machine Learning Power BI
  • 18.
    Azure IoT ReferenceArchitecture Courtesy of Microsoft Azure
  • 19.
    Azure IoT SDK C99 (mbed/Arduino) Node.js.NET Java 7+ (Android) Python Reference: Microsoft Azure IoT SDKs
  • 20.
    Gateway Pattern ‣ Transparent ‣Protocol Translation ‣ Identity Translation Reference: Microsoft Azure Docs
  • 21.
    Transparent Clients think theyhave their own connection to the cloud even though they are all being sent over the same connection. Device 不知道 Edge 的存在 IoT Hub 認為 Devices 都是獨立的個體 Store and Forward Reference: Microsoft Azure Docs Azure IoT SDK
  • 22.
    Protocol Translation (opaquegateway) 負責protocol/payload轉譯⼯作 IoT Hub 以為只有⼀台 Edge 無法對各別 Device 操作 Payload必須包含ID資訊 Reference: Microsoft Azure Docs Azure IoT SDK
  • 23.
    Identity Translation (proxygateway) IoT Hub 認為 Devices 都是獨立的個體 Payload必須包含ID資訊 負責protocol/payload轉譯⼯作之外 還要管理/保存device 狀態 Reference: Microsoft Azure Docs Azure IoT SDK
  • 24.
  • 25.
    Better Feasible solution Service1Service3 Service2 Virtual Local Bus/D-Bus/Dispatcher/Message Bus … sub pub pub sub pub sub Service4 pub sub No Need to change services’ endpoints but change the routing rules (in one place)
  • 26.
    Edge Agent Edge Hub AzureIoT Edge runtime Azure IoT Edge runtime IoT Edge Device IoT Hub modbus Insight Action Reference: Microsoft Azure IoT Device local proxy of IoT Hub & local bus MQTT control modules life cycle, healthy Insights & module health Modbus TCP MQTT AMQP Courtesy of Andrew Hainen
  • 27.
    Edge Agent Edge Hub AzureIoT Edge runtime Azure IoT Edge runtime IoT Edge Device IoT Hub modbus Insight Action Reference: Microsoft Azure IoT Device local proxy of IoT Hub & local bus MQTT control modules life cycle, healthy Insights & module health Modbus TCP MQTT AMQP Courtesy of Andrew Hainen
  • 28.
    Module Insight Docker Hub Azurecontainer registry docker image Device in Taipei Azure IoT Hub Insight Device in Taichung Insight Twin Insight identity docker instance docker instance Insight Twin Insight identity Insight /devices/taichung01/modules/insight01 /devices/taichung01/modules/insight02 Insight docker instance JSON JSON /devices/taichung01 /devices/taipei01 JSON lives in the cloud Run on-prem
  • 29.
    Module Insight Docker Hub Azurecontainer registry docker image Device in Taipei Azure IoT Hub Insight Device in Taichung Insight Twin Insight identity docker instance docker instance Insight Twin Insight identity Insight /devices/taichung01/modules/insight01 /devices/taichung01/modules/insight02 Insight docker instance Deployment JSON JSON /devices/taichung01 /devices/taipei01 JSON Sync lives in the cloud Run on-prem
  • 30.
    Module Insight Docker Hub Azurecontainer registry docker image Device in Taipei Azure IoT Hub Insight Device in Taichung Insight Twin Insight identity docker instance docker instance Insight Twin Insight identity Insight /devices/taichung01/modules/insight01 /devices/taichung01/modules/insight02 Insight docker instance Deployment JSON JSON /devices/taichung01 /devices/taipei01 JSON Sync Can be DLL Can be EXE Note lives in the cloud Run on-prem
  • 31.
    Module & EdgeHub Edge Hub Module input endpoints output endpoint ‣ To cloud ‣ To module ‣ From cloud ‣ From module IoT SDK Reference: Azure Doc MQTT Broker MQTT Client Message Cache Edge Hub Security Cache
  • 32.
    Module & EdgeHub Edge Hub Module input endpoints output endpoint ‣ To cloud ‣ To module ‣ From cloud ‣ From module IoT SDK message to cloud original payload device id module id input name output name stamped Reference: Azure Doc MQTT Broker MQTT Client Message Cache Edge Hub Security Cache
  • 33.
    Module & EdgeHub Edge Hub Module input endpoints output endpoint ‣ To cloud ‣ To module ‣ From cloud ‣ From module IoT SDK message to cloud original payload device id module id input name output name stamped routes syntax “{route name}”: "FROM <source> WHERE <condition> INTO <sink>" source format /messages/modules/{moduleId}/outputs/{output} sink format $upstream BrokeredEndpoint("/modules/{moduleId}/inputs/{input}") route1 "sensorToFilter": "FROM /messages/modules/tempSensor/outputs/temperatureOutput INTO BrokeredEndpoint("/modules/filtermodule/inputs/input1")" route2 "filterToIoTHub": "FROM /messages/modules/filtermodule/outputs/output1 INTO $upstream" Reference: Azure Doc MQTT Broker MQTT Client Message Cache Edge Hub Security Cache
  • 34.
    import iothub_client from iothub_clientimport ... from iothub_client import ... ... def send_confirmation_callback(message, result, user_context): ... def receive_message_callback(message, hubManager): ... hubManager.forward_event_to_output("output1", message, 0) class HubManager(object): def __init__(self, connection_string): self.set_certificates() self.client.set_message_callback("input1", receive_message_callback, self) ... def set_certificates(self): ... def forward_event_to_output(self, outputQueueName, event, send_context): self.client.send_event_async( outputQueueName, event, send_confirmation_callback, send_context) def main(connection_string): hub_manager = HubManager(connection_string) while True: time.sleep(1000) ... edge hub connection string read from environment variable source: cookiecutter-azure-iot-edge-module Azure IoT SDK Module Example
  • 35.
    import iothub_client from iothub_clientimport ... from iothub_client import ... ... def send_confirmation_callback(message, result, user_context): ... def receive_message_callback(message, hubManager): ... hubManager.forward_event_to_output("output1", message, 0) class HubManager(object): def __init__(self, connection_string): self.set_certificates() self.client.set_message_callback("input1", receive_message_callback, self) ... def set_certificates(self): ... def forward_event_to_output(self, outputQueueName, event, send_context): self.client.send_event_async( outputQueueName, event, send_confirmation_callback, send_context) def main(connection_string): hub_manager = HubManager(connection_string) while True: time.sleep(1000) ... edge hub connection string read from environment variable source: cookiecutter-azure-iot-edge-module Azure IoT SDK Module Example
  • 36.
    import iothub_client from iothub_clientimport ... from iothub_client import ... ... def send_confirmation_callback(message, result, user_context): ... def receive_message_callback(message, hubManager): ... hubManager.forward_event_to_output("output1", message, 0) class HubManager(object): def __init__(self, connection_string): self.set_certificates() self.client.set_message_callback("input1", receive_message_callback, self) ... def set_certificates(self): ... def forward_event_to_output(self, outputQueueName, event, send_context): self.client.send_event_async( outputQueueName, event, send_confirmation_callback, send_context) def main(connection_string): hub_manager = HubManager(connection_string) while True: time.sleep(1000) ... edge hub connection string read from environment variable source: cookiecutter-azure-iot-edge-module Azure IoT SDK Module Example
  • 37.
    import iothub_client from iothub_clientimport ... from iothub_client import ... ... def send_confirmation_callback(message, result, user_context): ... def receive_message_callback(message, hubManager): ... hubManager.forward_event_to_output("output1", message, 0) class HubManager(object): def __init__(self, connection_string): self.set_certificates() self.client.set_message_callback("input1", receive_message_callback, self) ... def set_certificates(self): ... def forward_event_to_output(self, outputQueueName, event, send_context): self.client.send_event_async( outputQueueName, event, send_confirmation_callback, send_context) def main(connection_string): hub_manager = HubManager(connection_string) while True: time.sleep(1000) ... edge hub connection string read from environment variable source: cookiecutter-azure-iot-edge-module Azure IoT SDK Module Example
  • 38.
    Stream Analytics onEdge IoT Edge Runtime Stream Analytics module module2 module1 IoT Edge Device IoT Device IoT Hub Azure Stream Analytics Services Data Deployment Configuration Data Command Reference: Azure Doc Analytical intelligence (CEP) Complex Event Processing
  • 39.
    Stream Analytics onEdge IoT Edge Runtime Stream Analytics module module2 module1 IoT Edge Device IoT Device IoT Hub Azure Stream Analytics Services Data Deployment Configuration Data Command Streaming runtime Job definition Azure Stream Analytics: Edge Job Reference: Azure Doc Analytical intelligence (CEP) Complex Event Processing
  • 40.
    Stream Analytics onEdge IoT Edge Runtime Stream Analytics module module2 module1 IoT Edge Device IoT Device IoT Hub Azure Stream Analytics Services Data Deployment Configuration Data Command Temperatures=15.445 Temperatures=15.345 Temperatures=15.155 … Temperatures=15.464 SELECT AVG(temperature) as temp FROM input GROUP BY TumblingWindow(second,1) Temperatures=15.321 Input Query Outputs Streaming runtime Job definition Azure Stream Analytics: Edge Job Reference: Azure Doc Analytical intelligence (CEP) Complex Event Processing
  • 41.
    Stream Analytics onEdge IoT Edge Runtime Stream Analytics module module2 module1 IoT Edge Device IoT Device IoT Hub Azure Stream Analytics Services Data Deployment Configuration Data Command Temperatures=15.445 Temperatures=15.345 Temperatures=15.155 … Temperatures=15.464 SELECT AVG(temperature) as temp FROM input GROUP BY TumblingWindow(second,1) Temperatures=15.321 Input Query Outputs geofence Streaming runtime Job definition Azure Stream Analytics: Edge Job Reference: Azure Doc Analytical intelligence (CEP) Complex Event Processing
  • 42.
    Azure Stream Analytics≈ AWS Rule Engine AWS IoT Core/SDK Things Applications AWS IoT Core AWS MQTT over TLS MQTT over WebSocket/TLS HTTP Reference: Smart Home Building Blocks with Intel Edison & AWS Device SDK Certificate Allows devices to seamlessly drop on/off connection Manages device identity Allows integration with other AWS services (route) Communicates with authenticates & authorized devices Device Gateway Rules Engine Thing Shadow Thing Registry MQTT HTTP (REST) Amazon CloudWatch Amazon Kinesis Amazon ES Amazon DynamoDB Amazon S3 Amazon Lambda Amazon SQS Amazon SNS Amazon Machine Learning Actions AWS IoT Rules Engine SELECT DATA FROM TOPIC WHERE FILTER ACTIONS Reference: (MBL312) NEW! AWS IoT: Programming a Physical World w/ Shadows & Rules { "awsIotSqlVersion": "2016-03-23", "sql": "SELECT * FROM 'iot/test'", "ruleDisabled": false, "actions": [ { "s3": { "roleArn": "arn:aws:iam::123456789012:role/aws_iot_s3", "bucketName": "my-bucket", "key": "myS3Key" } } ] } Rule Name Description SQL Statement Array of Actions
  • 43.
    Machine Learning onEdge IoT Edge Runtime IoT Edge device IoT Device SDK Azure ML Container REST API AI/ML Model HTTP REST Call ‣score.py ‣model.pkl (pickle) Azure Machine Learning Workbench Reference: Azure Doc
  • 44.
    Azure function onEdge (preview) using System.IO; using Microsoft.Azure.Devices.Client; using Newtonsoft.Json; // Filter messages based on the temperature value in the body of the message and the temperature threshold value. public static async Task Run(Message messageReceived, IAsyncCollector<Message> output, TraceWriter log) { const int temperatureThreshold = 25; byte[] messageBytes = messageReceived.GetBytes(); var messageString = System.Text.Encoding.UTF8.GetString(messageBytes); if (!string.IsNullOrEmpty(messageString)) { // Get the body of the message and deserialize it var messageBody = JsonConvert.DeserializeObject<MessageBody>(messageString); if (messageBody != null && messageBody.machine.temperature > temperatureThreshold) { // Send the message to the output as the temperature value is greater than the threashold var filteredMessage = new Message(messageBytes); // Copy the properties of the original message into the new Message object foreach (KeyValuePair<string, string> prop in messageReceived.Properties) { filteredMessage.Properties.Add(prop.Key, prop.Value); } // Add a new property to the message to indicate it is an alert filteredMessage.Properties.Add("MessageType", "Alert"); // Send the message await output.AddAsync(filteredMessage); log.Info("Received and transferred a message with temperature above the threshold"); } } } Reference: Azure Doc C# Sample Code only
  • 45.
    Field protocol -Modbus Module Reference: Azure Doc
  • 46.
    Field protocol -OPC-UA Module PLC1 PLC2 OPCUA Server IoT Edge Runtime IoT Edge device opc-publisher .NET Core module opc-proxy C99 module IoT Hub JSON payload Reference: Repo1 & Repo2
  • 47.
    Field protocol -OPC-UA Module PLC1 PLC2 OPCUA Server IoT Edge Runtime IoT Edge device opc-publisher .NET Core module opc-proxy C99 module IoT Hub JSON payload Reference: Repo1 & Repo2 Dead serious codebase
  • 48.
    Container Network eth0: 172.17.0.3eth0: 172.17.0.4 eth0: 172.17.0.2 module module module veth 172.17.0.1 iptables NAT 192.168.0.2 NIC 172.17.0.0/24 docker0 veth veth Private IP Subnet: 192.168.0.0/24 Linux bridge Linux Host edge hub edge agent module 1 eth0: 172.17.0.3 eth0: 172.17.0.4 eth0: 172.17.0.2 module module module vNIC WinNAT 192.168.0.2 NIC 172.17.0.0/24 vSwitch vNIC vNIC Private IP Subnet: 192.168.0.0/24 Hyper-V virtual switch Windows Host edge hub edge agent module 1 vNIC
  • 49.
  • 50.
    Zero-touch provisioning Reference: AzureDoc Enrollment list Azure IoT Hub IoT Device Device Provisioning Service X.509 Certificate Init Setup Azure IoT Hub Azure IoT Hub Endorsement Key
  • 51.
    Zero-touch provisioning 0. InitIoT Hub & Device Provisioning Services, link these two services. Reference: Azure Doc Enrollment list Azure IoT Hub IoT Device Device Provisioning Service X.509 Certificate Init Setup Azure IoT Hub Azure IoT Hub Endorsement Key
  • 52.
    Zero-touch provisioning 1. Manufacturerencode Identity & Registration URL 0. Init IoT Hub & Device Provisioning Services, link these two services. Reference: Azure Doc Enrollment list Azure IoT Hub IoT Device Device Provisioning Service X.509 Certificate Init Setup Azure IoT Hub Azure IoT Hub Endorsement Key
  • 53.
    Zero-touch provisioning 1. Manufacturerencode Identity & Registration URL 2. Solution Operator add device registration information to enrollment list 0. Init IoT Hub & Device Provisioning Services, link these two services. Reference: Azure Doc Enrollment list Azure IoT Hub IoT Device Device Provisioning Service X.509 Certificate Init Setup Azure IoT Hub Azure IoT Hub Endorsement Key
  • 54.
    Zero-touch provisioning Enrollment list AzureIoT Hub IoT Device Device Provisioning Service X.509 Certificate First bootup Azure IoT Hub Azure IoT Hub Endorsement Key 1. Prove its identity Reference: Azure Doc
  • 55.
    Zero-touch provisioning Enrollment list AzureIoT Hub IoT Device Device Provisioning Service X.509 Certificate First bootup Azure IoT Hub Azure IoT Hub Endorsement Key 1. Prove its identity 2. Validate Reference: Azure Doc
  • 56.
    Zero-touch provisioning Enrollment list AzureIoT Hub IoT Device Device Provisioning Service X.509 Certificate First bootup Azure IoT Hub Azure IoT Hub Endorsement Key 1. Prove its identity 2. Validate 3. Register & populate the device’s desired twin state Reference: Azure Doc
  • 57.
    Zero-touch provisioning Enrollment list AzureIoT Hub IoT Device Device Provisioning Service X.509 Certificate First bootup Azure IoT Hub Azure IoT Hub Endorsement Key 1. Prove its identity 2. Validate 3. Register & populate the device’s desired twin state 4. Return device information Reference: Azure Doc
  • 58.
    Zero-touch provisioning Enrollment list AzureIoT Hub IoT Device Device Provisioning Service X.509 Certificate First bootup Azure IoT Hub Azure IoT Hub Endorsement Key 1. Prove its identity 2. Validate 3. Register & populate the device’s desired twin state 4. Return device information 5. Return connection information Reference: Azure Doc
  • 59.
    Zero-touch provisioning Enrollment list AzureIoT Hub IoT Device Device Provisioning Service X.509 Certificate First bootup Azure IoT Hub Azure IoT Hub Endorsement Key 1. Prove its identity 2. Validate 3. Register & populate the device’s desired twin state 4. Return device information 5. Return connection information 6. Connect to IoT Hub Reference: Azure Doc
  • 60.
    Zero-touch provisioning Enrollment list AzureIoT Hub IoT Device Device Provisioning Service X.509 Certificate First bootup Azure IoT Hub Azure IoT Hub Endorsement Key 1. Prove its identity 2. Validate 3. Register & populate the device’s desired twin state 4. Return device information 5. Return connection information 6. Connect to IoT Hub 7. Get desired state from device twin Reference: Azure Doc
  • 61.
  • 62.
    X-Ray Again 快速接入 函數計算流式計算 本地暫存 設備鏈接 在線更新 容器化部署 ⾼智能 本地安全 快速接入 函數計算 流式計算 本地暫存 設備鏈接 在線更新 容器化部署 ⾼智能 本地安全 cross-platform docker sandbox preview lambda opc-ua sample opc-ua* modbus docker push agent upgrade TLS & X.509 TLS & X.509 Inference* Inference store and forward store and forward device SDK device SDK stream analytics AWS Greengrass Azure IoT Edge
  • 63.
  • 64.
    Azure IoT Central Reference:Azure Doc preview Graphic-based management (SaaS)
  • 65.
    Azure IoT Centralarchitecture Reference: Azure Doc
  • 66.
  • 67.
    Device twin Properties Device Twin Reported Desired Tags Read,write Read, receive change notifications Read Read, write change notifications Read, write change notifications Device app Backend Reference: Understand and use device twins in IoT Hub
  • 68.
    Module Composition { "moduleContent": { "$edgeAgent":{ "properties.desired": { // desired properties of the Edge agent // includes the image URIs of all modules } }, "$edgeHub": { "properties.desired": { // desired properties of the Edge hub // includes the routing information between modules, and to IoT Hub } }, "{module1}": { // optional "properties.desired": { // desired properties of module with id {module1} } }, "{module2}": { // optional ... }, ... } } "sensorToFilter": "FROM /messages/modules/tempSensor/outputs/temperatureOutput INTO BrokeredEndpoint("/modules/filtermodule/inputs/input1")"
  • 69.
  • 70.
    Why do customersbuy edge computing solutions This question is different than the following statement: why do customers need edge computing. You may persuade…extend/offload cloud intelligence to edge devices to … Further reading: KNOW YOUR CUSTOMERS' NEEDS
  • 71.
    Why do customersbuy edge computing solutions This question is different than the following statement: why do customers need edge computing. You may persuade…extend/offload cloud intelligence to edge devices to … Further reading: KNOW YOUR CUSTOMERS' NEEDS Who are potential customers? Use case assumptions and pre-conditions? (What do they hold? What should we also provide to them?) What are customer pain points?
  • 72.
    如何提高 cloud services的使用率 (目的:想賣雲服務)
  • 73.
    如何提高 cloud services的使用率 (目的:想賣雲服務) 讓更多的裝置連上 cloud,使用 cloud 上的服務
  • 74.
    如何提高 cloud services的使用率 (目的:想賣雲服務) 讓更多的裝置連上 cloud,使用 cloud 上的服務 為什麼使用者不將裝置連上 cloud (前提:既然雲服務都已經準備齊全)
  • 75.
    如何提高 cloud services的使用率 (目的:想賣雲服務) 讓更多的裝置連上 cloud,使用 cloud 上的服務 為什麼使用者不將裝置連上 cloud (前提:既然雲服務都已經準備齊全) 還不清楚 cloud 有什麼好處,與傳統的 client/server 架構有什麼差異
  • 76.
    如何提高 cloud services的使用率 (目的:想賣雲服務) 讓更多的裝置連上 cloud,使用 cloud 上的服務 為什麼使用者不將裝置連上 cloud (前提:既然雲服務都已經準備齊全) 還不清楚 cloud 有什麼好處,與傳統的 client/server 架構有什麼差異 教育潛在客戶 cloud 的好處 (彈性服務)
  • 77.
    如何提高 cloud services的使用率 (目的:想賣雲服務) 讓更多的裝置連上 cloud,使用 cloud 上的服務 為什麼使用者不將裝置連上 cloud (前提:既然雲服務都已經準備齊全) 還不清楚 cloud 有什麼好處,與傳統的 client/server 架構有什麼差異 教育潛在客戶 cloud 的好處 (彈性服務) 清楚 cloud 的彈性,但是擔心後續費用,以及資料的安全性
  • 78.
    如何提高 cloud services的使用率 (目的:想賣雲服務) 讓更多的裝置連上 cloud,使用 cloud 上的服務 為什麼使用者不將裝置連上 cloud (前提:既然雲服務都已經準備齊全) 還不清楚 cloud 有什麼好處,與傳統的 client/server 架構有什麼差異 教育潛在客戶 cloud 的好處 (彈性服務) 清楚 cloud 的彈性,但是擔心後續費用,以及資料的安全性 Openstack 的潛在客戶
  • 79.
    如何提高 cloud services的使用率 (目的:想賣雲服務) 讓更多的裝置連上 cloud,使用 cloud 上的服務 為什麼使用者不將裝置連上 cloud (前提:既然雲服務都已經準備齊全) 還不清楚 cloud 有什麼好處,與傳統的 client/server 架構有什麼差異 教育潛在客戶 cloud 的好處 (彈性服務) 清楚 cloud 的彈性,但是擔心後續費用,以及資料的安全性 Openstack 的潛在客戶 清楚 cloud 的彈性也不排斥付費,但不知道怎麼讓裝置連接上 cloud (需求)
  • 80.
    如何提高 cloud services的使用率 (目的:想賣雲服務) 讓更多的裝置連上 cloud,使用 cloud 上的服務 為什麼使用者不將裝置連上 cloud (前提:既然雲服務都已經準備齊全) 還不清楚 cloud 有什麼好處,與傳統的 client/server 架構有什麼差異 教育潛在客戶 cloud 的好處 (彈性服務) 清楚 cloud 的彈性,但是擔心後續費用,以及資料的安全性 Openstack 的潛在客戶 清楚 cloud 的彈性也不排斥付費,但不知道怎麼讓裝置連接上 cloud (需求) 提供免費的 IoT Device SDK 加速客戶開發 (目的:想賣雲服務)
  • 81.
    已經有免費的 IoT DeviceSDK,為什麼客戶還是不使用 cloud services
  • 82.
    已經有免費的 IoT DeviceSDK,為什麼客戶還是不使用 cloud services 既有的 Device 都還沒有連網能力,無法擷取資料出來
  • 83.
    已經有免費的 IoT DeviceSDK,為什麼客戶還是不使用 cloud services 既有的 Device 都還沒有連網能力,無法擷取資料出來 提供有連網能力的資料擷取裝置 (Field Gateway),提供 connect the unconnected solution
  • 84.
    已經有免費的 IoT DeviceSDK,為什麼客戶還是不使用 cloud services 既有的 Device 都還沒有連網能力,無法擷取資料出來 既有的機器已有通訊模組,但使用自己的工業通訊協定,自成系統 提供有連網能力的資料擷取裝置 (Field Gateway),提供 connect the unconnected solution
  • 85.
    已經有免費的 IoT DeviceSDK,為什麼客戶還是不使用 cloud services 既有的 Device 都還沒有連網能力,無法擷取資料出來 既有的機器已有通訊模組,但使用自己的工業通訊協定,自成系統 強化 IoT Device SDK 南向的溝通能力,協助有限的 protocol 轉換 提供有連網能力的資料擷取裝置 (Field Gateway),提供 connect the unconnected solution
  • 86.
    已經有免費的 IoT DeviceSDK,為什麼客戶還是不使用 cloud services 既有的 Device 都還沒有連網能力,無法擷取資料出來 既有的機器已有通訊模組,但使用自己的工業通訊協定,自成系統 開發 OT 轉 IT 的 protocol 轉換 軟硬體套件 強化 IoT Device SDK 南向的溝通能力,協助有限的 protocol 轉換 提供有連網能力的資料擷取裝置 (Field Gateway),提供 connect the unconnected solution
  • 87.
    已經有免費的 IoT DeviceSDK,為什麼客戶還是不使用 cloud services 既有的 Device 都還沒有連網能力,無法擷取資料出來 既有的機器已有通訊模組,但使用自己的工業通訊協定,自成系統 開發 OT 轉 IT 的 protocol 轉換 軟硬體套件 強化 IoT Device SDK 南向的溝通能力,協助有限的 protocol 轉換 不知道資料上雲後除了遠端監控,還能帶來什麼效益 提供有連網能力的資料擷取裝置 (Field Gateway),提供 connect the unconnected solution
  • 88.
    已經有免費的 IoT DeviceSDK,為什麼客戶還是不使用 cloud services 既有的 Device 都還沒有連網能力,無法擷取資料出來 既有的機器已有通訊模組,但使用自己的工業通訊協定,自成系統 開發 OT 轉 IT 的 protocol 轉換 軟硬體套件 強化 IoT Device SDK 南向的溝通能力,協助有限的 protocol 轉換 不知道資料上雲後除了遠端監控,還能帶來什麼效益 教育使用者,cloud services 可以協助從資料中獲得 insight,提升 machine 的效率,進行預防性維修 (predictive maintenance) 等 提供有連網能力的資料擷取裝置 (Field Gateway),提供 connect the unconnected solution
  • 89.
    已經有免費的 IoT DeviceSDK,為什麼客戶還是不使用 cloud services 既有的 Device 都還沒有連網能力,無法擷取資料出來 既有的機器已有通訊模組,但使用自己的工業通訊協定,自成系統 開發 OT 轉 IT 的 protocol 轉換 軟硬體套件 強化 IoT Device SDK 南向的溝通能力,協助有限的 protocol 轉換 不知道資料上雲後除了遠端監控,還能帶來什麼效益 教育使用者,cloud services 可以協助從資料中獲得 insight,提升 machine 的效率,進行預防性維修 (predictive maintenance) 等 提供預防性維修的 cloud service template 提供有連網能力的資料擷取裝置 (Field Gateway),提供 connect the unconnected solution
  • 90.
    已經有免費的 IoT DeviceSDK,為什麼客戶還是不使用 cloud services 既有的 Device 都還沒有連網能力,無法擷取資料出來 既有的機器已有通訊模組,但使用自己的工業通訊協定,自成系統 開發 OT 轉 IT 的 protocol 轉換 軟硬體套件 強化 IoT Device SDK 南向的溝通能力,協助有限的 protocol 轉換 不知道資料上雲後除了遠端監控,還能帶來什麼效益 教育使用者,cloud services 可以協助從資料中獲得 insight,提升 machine 的效率,進行預防性維修 (predictive maintenance) 等 提供預防性維修的 cloud service template 提供有連網能力的資料擷取裝置 (Field Gateway),提供 connect the unconnected solution 提供預防性維修的 turnkey solution 軟體套件
  • 91.
  • 92.
  • 93.
  • 94.
    了解預防性維護等智能服務的好處,那為何不能在本地進行? (需求:Edge computing) 本地端裝置的運算/儲存能力仍然有限,除了少量的運算/儲存工作,仍然 需要 cloud的彈性服務(運算/儲存能力) (目的:想賣雲服務) 推出免費的 Edge computing SDK (目的:想賣雲服務) 教育使用者,Edge computing 協同 cloud computing 是好方法
  • 95.
    了解預防性維護等智能服務的好處,那為何不能在本地進行? (需求:Edge computing) 本地端裝置的運算/儲存能力仍然有限,除了少量的運算/儲存工作,仍然 需要 cloud的彈性服務(運算/儲存能力) (目的:想賣雲服務) 為什麼雲端業者願意推出邊緣計算的(免費)服務? (Edge消滅Cloud的悖論) 推出免費的 Edge computing SDK (目的:想賣雲服務) 教育使用者,Edge computing 協同 cloud computing 是好方法
  • 96.
    了解預防性維護等智能服務的好處,那為何不能在本地進行? (需求:Edge computing) 本地端裝置的運算/儲存能力仍然有限,除了少量的運算/儲存工作,仍然 需要 cloud的彈性服務(運算/儲存能力) (目的:想賣雲服務) 為什麼雲端業者願意推出邊緣計算的(免費)服務? (Edge消滅Cloud的悖論) 下放部分 Cloud 能力,綁住裝置使用者,仍要使用 cloud 進行裝置管理, 大數據處理等服務 (目的:想賣雲服務) 推出免費的 Edge computing SDK (目的:想賣雲服務) 教育使用者,Edge computing 協同 cloud computing 是好方法
  • 97.
    了解預防性維護等智能服務的好處,那為何不能在本地進行? (需求:Edge computing) 本地端裝置的運算/儲存能力仍然有限,除了少量的運算/儲存工作,仍然 需要 cloud的彈性服務(運算/儲存能力) (目的:想賣雲服務) 為什麼雲端業者願意推出邊緣計算的(免費)服務? (Edge消滅Cloud的悖論) 下放部分 Cloud 能力,綁住裝置使用者,仍要使用 cloud 進行裝置管理, 大數據處理等服務 (目的:想賣雲服務) 推出免費的 Edge computing SDK (目的:想賣雲服務) 教育使用者,Edge computing 協同 cloud computing 是好方法 ‣ 為什麼公有雲服務業者要做 IoT SDK? ‣ 為什麼他們要推出邊緣計算? ‣ 為什麼我們要做邊緣運算? ‣ 為什麼客戶要上雲? ‣ 為什麼客戶要邊緣運算?
  • 98.
    How to connectmicroservices Host Service1 Service3 Service5 Service7 Service6 Service4 Service8 Service2
  • 99.
    How to connectmicroservices Host Service1 Service3 Service5 Service7 Service6 Service4 Service8 Service2
  • 100.
    How to connectmicroservices Host Service1 Service3 Service5 Service7 Service6 Service4 Service8 Service2 Service9
  • 101.
  • 102.
    Service1 Service3 Service2 sub pub pub pub sub pub pub sub pub if msgfrom svc2 then.. elif msg from svc3 then.. if msg from svc1 then.. elif msg from svc2 then.. if msg from svc1 then.. elif msg from svc3 then.. Simplified version Service1 Service3 Service2 sub sub pub pub pub sub sub pub sub pub sub pub with pub/sub pattern
  • 103.
    Service1 Service3 Service2 sub pub pub pub sub pub pub sub pub if msgfrom svc2 then.. elif msg from svc3 then.. if msg from svc1 then.. elif msg from svc2 then.. if msg from svc1 then.. elif msg from svc3 then.. Service4 Service4 Simplified version Service1 Service3 Service2 sub sub pub pub pub sub sub pub sub pub sub pub with pub/sub pattern Service4
  • 104.
    Service1 Service3 Service2 sub pub pub pub sub pub pub sub pub if msgfrom svc2 then.. elif msg from svc3 then.. if msg from svc1 then.. elif msg from svc2 then.. if msg from svc1 then.. elif msg from svc3 then.. Service4 Service4 Simplified version Service1 Service3 Service2 sub sub pub pub pub sub sub pub sub pub sub pub with pub/sub pattern
  • 105.
    Service1 Service3 Service2 sub pub pub pub sub pub pub sub pub if msgfrom svc2 then.. elif msg from svc3 then.. if msg from svc1 then.. elif msg from svc2 then.. if msg from svc1 then.. elif msg from svc3 then.. Service4 Service4 Simplified version Service1 Service3 Service2 sub sub pub pub pub sub sub pub sub pub sub pub Violate the Open-Closed Principle with pub/sub pattern
  • 106.
    Better Feasible solution Service1Service3 Service2 sub pub pub sub pub sub
  • 107.
    Better Feasible solution Service1Service3 Service2 Virtual Local Bus/D-Bus/Dispatcher/Message Bus … sub pub pub sub pub sub
  • 108.
    Better Feasible solution Service1Service3 Service2 Virtual Local Bus/D-Bus/Dispatcher/Message Bus … sub pub pub sub pub sub Service4 pub sub No Need to change services’ endpoints but change the routing rules (in one place)