AlexaのSmart HomeをAWSで作る方法

>100 Views

April 09, 19

スライド概要

デバイスを管理するクラウドを構築するに必要なAWSのサービスを紹介 AlexaDay 2019で発表した資料です。

https://alexaday2018.jaws-ug.jp/

profile-image

クラウドで働くIoTおじさん

シェア

またはPlayer版

埋め込む »CMSなどでJSが使えない場合

関連スライド

各ページのテキスト
1.

AlexaのSmart Homeを AWSで作る方法 2019/4/6 Alexa Day 2019 © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

2.

https://www.amazon.co.jp/gp/browse.html?node=5364379051 © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

3.

アジェンダ • カスタムスキルとスマートホームスキルの違い • スマートホームデバイスメーカーのクラウドに必要な要素 • AWSでデバイスクラウドを作るために必要なのは? © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

4.

カスタムスキルと スマートホームスキルの違い © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

5.

カスタムスキルの概要 https://developer.amazon.com/ja/docs/custom-skills/understanding-custom-skills.html © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

6.

SmartHome Skillの概要 https://developer.amazon.com/ja/docs/smarthome/understand-the-smart-home-skill-api.html © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

7.

SmartHome Skillの概要 https://developer.amazon.com/ja/docs/smarthome/understand-the-smart-home-skill-api.html © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

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.

スキルを有効化 Amazon Alexa デバイスメーカのデバイスクラウド デバイス用 アプリ スマート デバイス © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

12.

スキルを有効化 Amazon Alexa デバイスメーカのデバイスクラウド デバイス用 アプリ スマート デバイス © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

13.

発話操作 発話 Amazon Alexa Echo デバイスメーカのデバイスクラウド デバイス用 アプリ デバイス操作 スマート デバイス © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

14.

アプリから操作 Amazon Alexa Echo 状態通知 デバイスメーカのデバイスクラウド デバイス用 アプリ デバイス操作 スマート デバイス © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

15.

デバイスクラウドに必要な要素 • アプリでデバイスを登録 • アカウント管理 • デバイス管理 • スキルを有効にする • ユーザー認証 • Alexa側とユーザー、デバイスを紐づけ(アカウントリンキング) • デバイスを操作する • デバイス制御 • 状態通知 © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

16.

AWSのどのサービスを使うと 実現できるのか © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

17.

Amazon Cognito(アカウント管理、ユーザー認証) アイデンティティの管理とクロスプラットフォームなデータ同期 特徴 ■Cognito Identity : AWSサービスへのゲートウェイ Amazon Cognito (AWS IAM / STS) Any SDK Authentication Any Service © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. • 複数のIDプロバイダや独自認証基盤との連携 したユニークなアイデンティティの作成・管 理 • クロスプラットフォーム、クロスデバイスで のデータ同期 • セキュリティのベストプラクティス実装を実 現 • アカウントリンキングで必要なOAuth2.0の 認可サーバとして利用可能 https://aws.amazon.com/jp/cognito/

18.

AWS IoT Core(デバイス管理) IoTデバイスのデータ収集、デバイスのリモート制御を実現することができる 特徴 • • • • © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. MQTTやHTTPSを使ったメッセージ配送 TLS1.2を使った相互認証後にMQTTで接続する ことにより安全にメッセージのやり取りが可能 SQLに近い文法でルールを設定でき、センサー データの値に応じたアクションを実行できる デバイスが常時接続されてなくてもアプリケー ションからのメッセージをクラウド上の仮想デ バイス(デバイスシャドウ)に格納することで デバイスが接続した時にメッセージを受け取れ ることができる https://aws.amazon.com/jp/iot-core/

19.

Amazon DynamoDB(デバイス管理) 特徴 完全マネージド型の NoSQL データベースサービス ハイスケーラブル、低レイテンシー 高可用性– 3x レプリケーション シンプル且つパワフルAPI ストレージの容量制限がない 運用管理必要なし © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. https://aws.amazon.com/jp/dynamodb/

20.

Amazon API Gateway Web APIの作成・保護・運用と公開を簡単に 特徴 Mobile Apps API Gatew ay Cache • OS、キャパシティ等インフラの管理不要 • バックエンドとしてLambda、既存Webシス テムを利用可能 • 認証/スロットリング/キャッシュ AWS Lambda functions API Gatew ay Endpoints on Amazon EC2 / Amazon Elastic Beanstalk Websites Services Amazon CloudWatch Monitoring Any other publicly accessible endpoint © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. https://aws.amazon.com/jp/api-gateway/

21.

AWS Lambda イベントをトリガーにコードを実行するコンピュートサービス ■イメージのリサイズやサムネイルの作成 元画像 1 3 特徴 (http://aws.amazon.com/jp/lambda/) サムネイル画像 2 Amazon S3 Bucket イベント AWS Lambda • OS、キャパシティ等インフラの管理不要 • S3、Kinesis、SNS等でのイベント発生を元に ユーザが用意したコードを実行 • ユーザアプリからの同期/非同期呼び出し ■値チェックや別テーブルへのコピー 別テーブルを更 新 Amazon DynamoDB Table and Stream AWS Lambda プッシュ通知 © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. https://aws.amazon.com/jp/lambda/

22.

デバイスの登録 デバイスメーカのデバイスクラウド デバイス用 アプリ 2.確認メール Amazon Cognito AWS Lambda Email Amazon API Gateway スマート デバイス AWS Lambda Amazon DynamoDB © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS IoT Core

23.

デバイスの登録 デバイスメーカのデバイスクラウド デバイス用 アプリ 2.ペアリング Amazon Cognito Amazon API Gateway スマート デバイス AWS Lambda AWS Lambda Amazon DynamoDB © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS IoT Core

24.

スキルを有効化 Amazon Alexa 3.Tokenの取得 デバイスメーカのデバイスクラウド デバイス用 アプリ Amazon Cognito Amazon API Gateway スマート デバイス AWS Lambda AWS Lambda Amazon DynamoDB © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS IoT Core

25.

スキルを有効化 Amazon Alexa 2.SkillのDiscovery デバイスメーカのデバイスクラウド デバイス用 アプリ AWS Lambda Amazon Cognito Amazon API Gateway スマート デバイス AWS Lambda 3.デバイス情報を 取得 Amazon DynamoDB © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS IoT Core

26.

発話操作 1.発話 Amazon Alexa Echo 2.Skill呼び出し デバイスメーカのデバイスクラウド デバイス用 アプリ Amazon Cognito Amazon API Gateway スマート デバイス AWS Lambda AWS Lambda Amazon DynamoDB © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS IoT Core

27.

アプリ操作 Amazon Alexa Echo 3.ステータス通知 デバイスメーカのデバイスクラウド デバイス用 アプリ Amazon Cognito Amazon API Gateway スマート デバイス AWS Lambda AWS Lambda Amazon DynamoDB © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS IoT Core

28.

デバイスもAWSのサービスを 使いたい場合 © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

29.

Amazon FreeRTOS 人気のあるFreeRTOSをベースにした、 小型で低消費電力のエッジデバイスを容易に プログラミング、デプロイ、保護、接続、保守することが可能な マイクロコントローラー向けのオペレーティングシステム FreeRTOS カーネル ベース ローカル接続用の ライブラリ AWS IoT Greengrass クラウド接続用の ライブラリ AWS IoT Core セキュリティ ライブラリ OTA Beta & コード署名

30.

AWS IoT Greengrass クラウドの機能をローカルデバイスに拡張するソフトウェアです。 これにより、デバイスは情報のソースに近いデータを収集して分析し、 ローカルイベントに自律的に反応して、ローカルネットワーク上で安全に通信できます クラウドか ら配布した Lambdaを ローカルで 実行 ローカルで のメッセー ジングと Lambdaの トリガ データと状 態の同期 (ローカル シャドウ) クラウド同 様のセキュ リティポリ シー Greengrass Core自体の アップデー ト(OTA) OPC-UAの プロトコル アダプタ ローカルリ ローカルで ソースアク ML/DLの推論 セス を実行 2018.4.4 GA Announce!!

31.

スマートホームソリューション Amazon Alexa Echo Smart Home デバイスメーカのデバイスクラウド ドアロック Amazon Cognito 電球 AWS Lambda AWS IoT Greengrass Amazon API Gateway 温度計 Amazon FreeRTOS © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS Lambda Amazon DynamoDB AWS IoT Core

32.

まとめ © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

33.

まとめ • デバイスを操作するには、デバイスクラウドを構築する 必要がある • デバイスクラウドは、「アカウント管理」、「デバイス 管理」、「デバイス制御」、「認証機能」が求められる • AWSのマネージドサービスを利用することで、プロダ クトの価値を作り込むことに集中できる • 一度作ってしまえば、様々なデバイスを管理でき、様々 なサービスからも利用できるようになる © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

34.

https://developer.amazon.com/ja/alexa-skills-kit/alexa-aws-credits © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

35.

https://aws.amazon.com/jp/about-aws/events/aws-innovate/ © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

36.

Appendix • AWS で実現する IoT 入門 • • AWS re:Invent 2018: Alexa and AWS IoT, ft. VIZIO • • https://aws.amazon.com/jp/dynamodb/ Amazon API Gateway • • https://aws.amazon.com/jp/cognito/ Amazon DynamoDB • • https://aws.amazon.com/jp/iot-core/ Amazon Cognito • • https://youtu.be/pVWYzDJYHck AWS IoT Core • • https://youtu.be/dN_DbsQoHds https://aws.amazon.com/jp/api-gateway/ AWS Lambda • https://aws.amazon.com/jp/lambda/ © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

37.

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.