More Related Content
Similar to AlexaのSmart HomeをAWSで作る方法 (20)
More from Jun Ichikawa (20)
AlexaのSmart HomeをAWSで作る方法
- 1. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
2019/4/6 Alexa Day 2019
AlexaのSmart Homeを
AWSで作る方法
- 2. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
https://www.amazon.co.jp/gp/browse.html?node=5364379051
- 3. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
アジェンダ
• カスタムスキルとスマートホームスキルの違い
• スマートホームデバイスメーカーのクラウドに必要な要素
• AWSでデバイスクラウドを作るために必要なのは?
- 4. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
カスタムスキルと
スマートホームスキルの違い
- 5. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
カスタムスキルの概要
https://developer.amazon.com/ja/docs/custom-skills/understanding-custom-skills.html
- 6. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
SmartHome Skillの概要
https://developer.amazon.com/ja/docs/smarthome/understand-the-smart-home-skill-api.html
- 7. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
SmartHome Skillの概要
https://developer.amazon.com/ja/docs/smarthome/understand-the-smart-home-skill-api.html
- 8. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
スマートホーム
デバイスメーカー
のクラウドに必要な要素
- 9. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
デバイスの登録
スマート
デバイス
デバイス用
アプリ
デバイスメーカのデバイスクラウド
- 10. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
デバイスの登録
スマート
デバイス
デバイス用
アプリ
デバイス登録
デバイスメーカのデバイスクラウド
- 11. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
スキルを有効化
スマート
デバイス
デバイス用
アプリ
Amazon Alexa
デバイスメーカのデバイスクラウド
- 12. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
スキルを有効化
スマート
デバイス
デバイス用
アプリ
Amazon Alexa
デバイスメーカのデバイスクラウド
- 13. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
発話操作
スマート
デバイス
デバイス用
アプリ
デバイス操作
Amazon Alexa
デバイスメーカのデバイスクラウド
Echo
発話
- 14. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
アプリから操作
スマート
デバイス
デバイス用
アプリ
デバイス操作
Amazon Alexa
デバイスメーカのデバイスクラウド
Echo
状態通知
- 15. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
デバイスクラウドに必要な要素
• アプリでデバイスを登録
• アカウント管理
• デバイス管理
• スキルを有効にする
• ユーザー認証
• Alexa側とユーザー、デバイスを紐づけ(アカウントリンキング)
• デバイスを操作する
• デバイス制御
• 状態通知
- 16. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWSのどのサービスを使うと
実現できるのか
- 17. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon Cognito(アカウント管理、ユーザー認証)
特徴
• 複数のIDプロバイダや独自認証基盤との連携
したユニークなアイデンティティの作成・管
理
• クロスプラットフォーム、クロスデバイスで
のデータ同期
• セキュリティのベストプラクティス実装を実
現
• アカウントリンキングで必要なOAuth2.0の
認可サーバとして利用可能
アイデンティティの管理とクロスプラットフォームなデータ同期
Amazon Cognito
(AWS IAM / STS)
■Cognito Identity : AWSサービスへのゲートウェイ
https://aws.amazon.com/jp/cognito/
- 18. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS IoT Core(デバイス管理)
IoTデバイスのデータ収集、デバイスのリモート制御を実現することができる
特徴
• MQTTやHTTPSを使ったメッセージ配送
• TLS1.2を使った相互認証後にMQTTで接続する
ことにより安全にメッセージのやり取りが可能
• SQLに近い文法でルールを設定でき、センサー
データの値に応じたアクションを実行できる
• デバイスが常時接続されてなくてもアプリケー
ションからのメッセージをクラウド上の仮想デ
バイス(デバイスシャドウ)に格納することで
デバイスが接続した時にメッセージを受け取れ
ることができる
https://aws.amazon.com/jp/iot-core/
- 19. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon DynamoDB(デバイス管理)
特徴
完全マネージド型の NoSQL データベースサービス
ハイスケーラブル、低レイテンシー
高可用性– 3x レプリケーション
シンプル且つパワフルAPI
ストレージの容量制限がない
運用管理必要なし
https://aws.amazon.com/jp/dynamodb/
- 20. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon API Gateway
特徴
• OS、キャパシティ等インフラの管理不要
• バックエンドとしてLambda、既存Webシステ
ムを利用可能
• 認証/スロットリング/キャッシュ
Web APIの作成・保護・運用と公開を簡単に
Mobile Apps
Websites
Services
API
Gateway
API Gateway
Cache
Any other publicly
accessible endpoint
AWS Lambda
functions
Endpoints on
Amazon EC2 /
Amazon Elastic
Beanstalk
Amazon
CloudWatch
Monitoring
https://aws.amazon.com/jp/api-gateway/
- 21. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Lambda
特徴 (http://aws.amazon.com/jp/lambda/)
• OS、キャパシティ等インフラの管理不要
• S3、Kinesis、SNS等でのイベント発生を元に
ユーザが用意したコードを実行
• ユーザアプリからの同期/非同期呼び出し
イベントをトリガーにコードを実行するコンピュートサービス
■イメージのリサイズやサムネイルの作成
AWS LambdaAmazon S3 Bucket イベント
元画像 サムネイル画像
1
2
3
AWS LambdaAmazon DynamoDB
Table and Stream
プッシュ通知
別テーブルを更
新
■値チェックや別テーブルへのコピー
https://aws.amazon.com/jp/lambda/
- 22. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
デバイスの登録
スマート
デバイス
デバイス用
アプリ
デバイスメーカのデバイスクラウド
Amazon Cognito
Amazon DynamoDB
Amazon API Gateway
Email
2.確認メール
AWS Lambda
AWS IoT
Core
AWS Lambda
- 23. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
デバイスの登録
スマート
デバイス
デバイス用
アプリ
デバイスメーカのデバイスクラウド
2.ペアリング
Amazon Cognito
Amazon API Gateway
AWS IoT
Core
Amazon DynamoDB
AWS Lambda
AWS Lambda
- 24. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
スキルを有効化
スマート
デバイス
デバイス用
アプリ
Amazon Alexa
デバイスメーカのデバイスクラウド
Amazon Cognito
Amazon API Gateway
AWS IoT
Core
3.Tokenの取得
Amazon DynamoDB
AWS Lambda
AWS Lambda
- 25. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
スキルを有効化
スマート
デバイス
デバイス用
アプリ
Amazon Alexa
デバイスメーカのデバイスクラウド
Amazon Cognito
Amazon API Gateway
AWS IoT
Core
2.SkillのDiscovery
Amazon DynamoDB
AWS Lambda
AWS Lambda
3.デバイス情報を
取得
- 26. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
発話操作
スマート
デバイス
デバイス用
アプリ
Amazon Alexa
デバイスメーカのデバイスクラウド
Echo
1.発話
Amazon Cognito
Amazon API Gateway
AWS IoT
Core
Amazon DynamoDB
AWS Lambda
AWS Lambda
2.Skill呼び出し
- 27. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
アプリ操作
スマート
デバイス
デバイス用
アプリ
Amazon Alexa
デバイスメーカのデバイスクラウド
Echo
Amazon Cognito
Amazon API Gateway
AWS IoT
Core
Amazon DynamoDB
AWS Lambda
AWS Lambda
3.ステータス通知
- 28. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
デバイスもAWSのサービスを
使いたい場合
- 31. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon FreeRTOS
Smart Home
AWS IoT
Greengrass
Echo
電球
ドアロック
温度計
Amazon Alexa
デバイスメーカのデバイスクラウド
Amazon Cognito
Amazon API Gateway
AWS IoT
Core
Amazon DynamoDB
AWS Lambda
AWS Lambda
スマートホームソリューション
- 32. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
まとめ
- 33. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
まとめ
• デバイスを操作するには、デバイスクラウドを構築する
必要がある
• デバイスクラウドは、「アカウント管理」、「デバイス
管理」、「デバイス制御」、「認証機能」が求められる
• AWSのマネージドサービスを利用することで、プロダク
トの価値を作り込むことに集中できる
• 一度作ってしまえば、様々なデバイスを管理でき、様々
なサービスからも利用できるようになる
- 34. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
https://developer.amazon.com/ja/alexa-skills-kit/alexa-aws-credits
- 35. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
https://aws.amazon.com/jp/about-aws/events/aws-innovate/
- 36. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Appendix
• AWS で実現する IoT 入門
• https://youtu.be/dN_DbsQoHds
• AWS re:Invent 2018: Alexa and AWS IoT, ft. VIZIO
• https://youtu.be/pVWYzDJYHck
• AWS IoT Core
• https://aws.amazon.com/jp/iot-core/
• Amazon Cognito
• https://aws.amazon.com/jp/cognito/
• Amazon DynamoDB
• https://aws.amazon.com/jp/dynamodb/
• Amazon API Gateway
• https://aws.amazon.com/jp/api-gateway/
• AWS Lambda
• https://aws.amazon.com/jp/lambda/
- 37. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Editor's Notes
- スマートホーム製品を使っている人?
スマートホームスキルを作ったことがある人?
スマートホームデバイスを作っている人?
- ユーザー登録から、認証、認可の機能をCognitoでカバーできる
- デバイスの通信、セキュリティーなどを管理できる
- ユーザーとデバイスのヒモ付、その他のメタ情報など管理
- Alexaだけではなく、スマフォアプリと言った他のデバイスからの利用を可能にする
- Skill本体、API Gateway向けのアプリとして
- 本日はとくに製造現場のユースケースで利用する、青枠の機能についてご紹介していきます。