Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

使用 AWS 無伺服器運算服務打造您的第一個語音助理

1,436 views

Published on

無伺服器運算可讓您無需佈建或管理伺服器,即可建置及執行應用。您可透過無伺服器運算建置網頁、行動及物聯網後端、執行串流處理或大數據工作負載、運作聊天機器人,以及執行 Amazon Alexa 應用程式及其他。在本場專題演講中,您將了解如何上手使用 AWS Lambda 進行無伺服器運算,以便在不佈建或管理伺服器的前提下執行程式碼。另外也將介紹使用 Lambda 進行佈建作業的基礎知識,以及無伺服器功能對您的效益。本場專題演講還會解說如何運用 AWS Lambda 功能自訂 Alexa 的技巧知識。

Published in: Technology
  • If you’re struggling with your assignments like me, check out ⇒ www.HelpWriting.net ⇐.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • I’ve personally never heard of companies who can produce a paper for you until word got around among my college groupmates. My professor asked me to write a research paper based on a field I have no idea about. My research skills are also very poor. So, I thought I’d give it a try. I chose a writer who matched my writing style and fulfilled every requirement I proposed. I turned my paper in and I actually got a good grade. I highly recommend ⇒ www.WritePaper.info ⇐
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Check the source ⇒ HelpWriting.net ⇐ This site is really helped me out gave me relief from headaches. Good luck!
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

使用 AWS 無伺服器運算服務打造您的第一個語音助理

  1. 1. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Simon Wang Technical Account Manager, AWS Enterprise Support June 7th, 2017 How to Use AWS Serverless Computing to Develop Your First Voice Assistant
  2. 2. Agenda • Why AWS Lambda? • How Lambda works • Hello, Amazon Alexa • Demo
  3. 3. Why AWS Lambda?
  4. 4. Servers How will the application handle server hardware failure? How can I control access from my servers? When should I decide to scale out my servers? When should I decide to scale up my servers? What size servers are right for my budget? How much remaining capacity do my servers have? (AAHHHHHHHHH!!)
  5. 5. Operations and management Scaling Provisioning and utilization Availability and fault tolerance Owning servers means dealing with ...
  6. 6. Key Differences Between Compute Offerings VM Task Function Service EC2 ECS Lambda H/W OS Runtime Unit of scale Level of abstraction
  7. 7. How Lambda works
  8. 8. AWS Lambda: Run code in response to events FUNCTION SERVICES (ANYTHING) Changes in data state Requests to endpoints Changes in resource state Node Python Java C# EVENT SOURCE
  9. 9. Amazon S3 Amazon DynamoDB Amazon Kinesis AWS CloudFormation AWS CloudTrail Amazon CloudWatch Amazon Cognito Amazon SNSAmazon SES Cron events DATA STORES ENDPOINTS CONFIGURATION REPOSITORIES EVENT/MESSAGE SERVICES Example event sources that trigger AWS Lambda … and a few more with more on the way! AWS CodeCommit Amazon API Gateway Amazon Alexa AWS IoT AWS Step Functions
  10. 10. Using AWS Lambda Bring your own code • Node.js, Java, Python, C# • Bring your own libraries Simple resource model • Select power rating from 128 MB to 1.5 GB • CPU and network allocated proportionately Flexible use • Synchronous or asynchronous • Integrated with other AWS services Programming model • Use processes, threads, /tmp, sockets normally • AWS SDK built in (Python and Node.js)
  11. 11. Automatic Scaling • Each event is a Lambda request • Lambda scales to match the event rate • Don’t worry about over or under provisioning • Pay only for what you use
  12. 12. Common Use Cases Web Applications • Static websites • Complex web apps • Packages for Flask and Express Data Processing • Real time • MapReduce • Batch Chatbots • Powering Chatbot logic Backends • Apps & services • Mobile • IoT </></> Amazon Alexa • Powering voice-enabled apps • Alexa Skills Kit IT Automation • Policy engines • Extending AWS services • Infrastructure management
  13. 13. Hello, Amazon Alexa
  14. 14. What Can Alexa Do?
  15. 15. Alexa App and Skills http://alexa.amazon.com
  16. 16. Introduce to Alexa Platform
  17. 17. Demo Ask Alexa the Weather in Any City in Taiwan
  18. 18. How to Achieve It?
  19. 19. Technologies We Used • Node.js and JavaScript • AWS Lambda • Amazon Alexa service and Alexa Skills Kit (https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs)
  20. 20. How to Create an AWS Lambda Function
  21. 21. Code Snippet - weather.js Publish this function for fetching weather data Invoke external WebService Return weather info in TEXT
  22. 22. Code Snippet - lamdba.js Include Alexa Skills Kit Include weather.js module Initial an Alexa handler and register all handlers Open Skill Stop Skill About weather Recipe for pork Say a joke
  23. 23. Code Snippet - lamdba.js – Cont. Launch Skill function Weather Intent function Retrieve Slots (City Name) Get weather information by City Name Speak out (emit) weather information
  24. 24. Packing Node.js Function #For MacOS zip -r -q dist/lambda.zip ./ -x "FILE_OR_DIR_1" "FILE_OR_DIR_2" AWS-SDK can be excluded!!
  25. 25. How to Integrate Alexa Skill with Lambda
  26. 26. Amazon Developer Console (Portal)
  27. 27. Slot (City Name)
  28. 28. Demo Updating Lambda Function
  29. 29. No servers to provision or manage Scales with usage Never pay for idle Availability and fault tolerance built in Benefits of Lambda and Serverless Compute
  30. 30. AWS Lambda Pricing • Charged by • Request count ($0.2 per 1m requests) • Compute ($0.00001667 per GB*second) • Buy compute time in 100 ms increments • No minimums fees • No per-device fees Free Tier 1 million requests and 400,000 GB*second of compute every month, every customer Example • 256MB of memory • Executed 3 million times per month • It ran for 1 second each time Around $6.2 per month! https://s3.amazonaws.com/lambda-tools/pricing-calculator.html
  31. 31. Takeaways • Serverless doesn’t actually mean that we have no servers. It means that you don’t need to deal with them anymore and focus on your business logic • Many use cases can go Serverless computing • Web, data processing, interactive backends, Chatbots, Alexa, auto managing AWS resources • Bots development on AWS is easy and agile • Serverless ecosystem continues to grow • Tooling, languages, and application capabilities
  32. 32. Thank you!
  33. 33. Next steps 1. Go to console.aws.amazon.com/lambda and create your first Lambda function 2. Stay up to date with AWS Lambda on the Compute blog and check out aws.amazon.com/lambda for scenarios and customer stories. 3. See https://aws.amazon.com/serverless for reference architectures, samples, and links to more content. 4. Send us your questions, comments, and feedback on the AWS Lambda Forums.

×