aws re:invent 2016: iot blueprints: optimizing supply for smart agriculture from the farm to the...

53
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Jason Massey, John Crawford, Asif Khan November 29, 2016 IOT 402 IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table

Upload: amazon-web-services

Post on 08-Jan-2017

67 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: AWS re:Invent 2016: IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table (IOT402)

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

Jason Massey, John Crawford, Asif Khan

November 29, 2016

IOT 402

IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table

Page 2: AWS re:Invent 2016: IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table (IOT402)

What to expect from this session

Deep dive into how we scale alerts using AWS IOT

Introduction to

IOT architectures overview

Page 3: AWS re:Invent 2016: IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table (IOT402)

Our story starts with the most fundamental question in any

industry

Page 4: AWS re:Invent 2016: IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table (IOT402)

How to do more with less?

Increase production

AND

Reduce waste

Page 5: AWS re:Invent 2016: IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table (IOT402)
Page 6: AWS re:Invent 2016: IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table (IOT402)

E=mc2

Page 7: AWS re:Invent 2016: IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table (IOT402)
Page 8: AWS re:Invent 2016: IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table (IOT402)

X 30

Page 9: AWS re:Invent 2016: IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table (IOT402)

30 billion lbs

a year

Page 10: AWS re:Invent 2016: IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table (IOT402)

10^9chicken

feet

Page 11: AWS re:Invent 2016: IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table (IOT402)

4 million lbs a day

All of the strawberries

consumed each year

are produced in just

12 weeks

Page 12: AWS re:Invent 2016: IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table (IOT402)

A race against time to bring

together siloed data and create

operational context

Page 13: AWS re:Invent 2016: IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table (IOT402)

The new

"iOS"

Page 14: AWS re:Invent 2016: IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table (IOT402)

What a modern industrial OS looks like

Apps

SDKs (Data stacks) Files

Rate

schedulesWeather

Facilities

& cost

centers

Real-time

dataAlerts

Custom app

Lineage app

Page 15: AWS re:Invent 2016: IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table (IOT402)

Admin/monitoring apps

APIs

Stream processing/analytics

Workers

Code that brings in data, organizes data, or does any other dirty work

Processes, transforms, stores data from streams or batches

Exposes an interface for apps to consume data that the bottom two layers have put in our

stack database

Presents an interface for users to administer, monitor, and visualize data in this stack

Database(s)

Blueprint of a data stack

(SDK)

Page 16: AWS re:Invent 2016: IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table (IOT402)

Lambda

RDS (Postgres)

Events API

Alerts admin

app

AWS

IOTSNS

Workers

Stream processing/analytics

APIs

Admin/monitoring apps

Blueprint of a data stack

(SDK)

Database(s)

Page 17: AWS re:Invent 2016: IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table (IOT402)

What is a blast cycle??

TL;DR: Freeze something as fast as possible

Very energy-intensive process

The faster it can be frozen, the better the

quality of the product

What it looks like

Optimizing blast cyclesWhat the heck is a blast cycle?

Page 18: AWS re:Invent 2016: IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table (IOT402)

What is the strategy?

When the energy rate for the next rate interval is above

$0.50 / kWh, I want to determine whether to shut down

I want to base this decision on the product I’m freezing

I want to try to determine how much time I have left in the

process to help my decision-making process

Optimizing blast cyclesStrategy

Page 19: AWS re:Invent 2016: IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table (IOT402)

Texts/

phone

notifications

Bunch of

sensor data

AWS

IOT

Events

API

SNSAlert

streams

Rule registration

User

subscriptions

Lambda

functions

Rate

schedule

stack

Hourly

rate

emitter

Amazon

ML

Real-time

data stack

Bunch of

rate

schedules

Optimizing blast cyclesArchitecture overview

Rule

triggersDevice

data

stream

Page 20: AWS re:Invent 2016: IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table (IOT402)

Texts/

phone

notifications

Bunch of

sensor data

AWS

IOT

Events

API

SNSAlert

streams

Rule registration

User

subscriptions

Lambda

functions

Rate

schedule

stack

Hourly

rate

emitter

Amazon

ML

Real-time

data stack

Bunch of

rate

schedules

Optimizing blast cyclesAlert registration

Rule

triggersDevice

data

stream

Page 21: AWS re:Invent 2016: IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table (IOT402)

Events

API

Alert #1

Based on previous analytics of blast cycles, we’ve

determined the optimal blast cycle time should be 48 hours

for 300,000 lbs of California squid.

SELECT *,'36' as alert_id

FROM ‘things/devices/3027'

WHERE timestamp> 1473177600

Optimizing blast cyclesAlert registration

Page 22: AWS re:Invent 2016: IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table (IOT402)

Events

API

Alert #2

We want to take into consideration when the electrical rate is

more than 50 cents per kWh so we can determine if we want

to pause the cycle.

SELECT *,'36' as alert_id

FROM ‘things/rates/56’

WHERE rate>0.50

Optimizing blast cyclesAlert registration

Page 23: AWS re:Invent 2016: IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table (IOT402)

Texts /

Phone

Notifications

Bunch of

sensor data

AWS

IOT

Events

API

SNSAlert

Streams

Rule registration

User

Subscriptions

Lambda

Functions

Rate

schedule

stack

Hourly

rate

emitter

Amazon

ML

Real-time

data stack

Bunch of

rate

schedules

Optimizing blast cyclesAlert registration

Rule

TriggersDevice

data

stream

Page 24: AWS re:Invent 2016: IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table (IOT402)

Rate

schedule

stack

Real-time

data stack

Optimizing blast cyclesOvercoming interval disparity

Rate-change frequencies

Never (flat pricing)

Hourly (real-time pricing)

Less frequently (4 times per day,

predictable rates)

Sensor-reporting frequencies

Variable

Per-second to per-hour

usually

Sent to AWS IOT by tapping into queue and

pushing data over MQTT

Worker sends rates for next hour every hour

to AWS IOT over MQTT

StreamingWorker push

(hourly)

Page 25: AWS re:Invent 2016: IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table (IOT402)

Rate

schedule

stack

Optimizing blast cyclesOvercoming interval disparity (using device shadows)

Worker push

(hourly)

Rules

engine

things/rat

es/56

things/rat

es/57

Device shadows

.

.

.

things/rates/56

things/rates/57

Page 26: AWS re:Invent 2016: IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table (IOT402)

Rate

schedule

stack

Optimizing blast cyclesRate schedule message payload

Worker push (hourly)

things/rates/56

{

“rate_id”: “56”,

“rate_start”: “1474632000”,

“rate_end”: “1474635600”,

“period_id”: “42453”,

“rate”: “0.75”,

“units”: “dollars”

}

To AWS IOT

Page 27: AWS re:Invent 2016: IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table (IOT402)

Optimizing blast cyclesIoT device message payload

One topic stream per device

things/devices/3027

To AWS IOT

Real-time

data stack

{

“device_id”: “3027”,

“timestamp”: “1474657920”,

“field_name”: “BlastCellEnable”,

“value”: “1”,

“units”: “Boolean”

}

Page 28: AWS re:Invent 2016: IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table (IOT402)

Bunch of

sensor data

Events

APIRule

registration

Rate

schedule

stack

Real-time

data stack

Bunch of

rate

schedules

Optimizing blast cyclesWhat’s happening inside AWS IOT

Device

data

stream

Rules

engine

things/devices/3027

things/devices/3028

things/devices/3029

things/devices/3030

things/rates/56

things/rates/57 Rule

trigger

Lambda

0.75 > 0.50

Page 29: AWS re:Invent 2016: IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table (IOT402)

Texts/

phone

notifications

Bunch of

sensor data

AWS

IOT

Events

API

SNSAlert

streams

Rule registration

User

subscriptions

Lambda

functions

Rate

schedule

stack

Hourly

rate

emitter

Amazon

ML

Real-time

data stack

Bunch of

rate

schedules

Optimizing blast cyclesRule triggers

Rule

triggersDevice

data

stream

Page 30: AWS re:Invent 2016: IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table (IOT402)

Rate

schedule

stack

Optimizing blast cyclesHigh rate detected

things/rates/56

Lambda

0.75 > 0.50

1. Ask the Events API for more

information about the alert.

2. Gather some timing information

from the blast cycle data.

3. Gather some information about

what’s in the blast cell.

4. Send data off to Amazon ML for

analysis (to trigger or not to

trigger?)

5. Trigger (or don’t trigger) an alert.

Function for handling a high rate

Rule

trigger

Page 31: AWS re:Invent 2016: IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table (IOT402)

Events

APIRate

schedule

stack

Optimizing blast cyclesCommunicate with Events API

things/rates/56

Lambda

0.75 > 0.50

1. Ask the Events API for more

information about the alert.

Rule

trigger

Determine any dependencies for this

alert.

1. This alert also depends on a

timer for a specific blast cell.

2. Alerts API provides additional

info about the blast cell —

references to production system

about its location.

Page 32: AWS re:Invent 2016: IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table (IOT402)

Rate

schedule

stack

Optimizing blast cyclesGet blast cell info from device shadow

things/rates/56Lambda

0.75 > 0.50

2. Gather some timing information from

the blast cycle data.

Rule

trigger

Grab info from blast cell’s device

shadow (3027).

1. Is this blast cell still on? (If not,

we don’t need to do anything.)

2. How long has it been on?

things/devi

ces/3027

On for 38.5 hours

Page 33: AWS re:Invent 2016: IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table (IOT402)

Rate

schedule

stack

Optimizing blast cyclesRetrieve production information

things/rates/56

0.75 > 0.50

Talk with the Production API in the

OpsMetric (warehouse management

system) data stack.

Using the information retrieved

through the Events API, query the

WMS system to see what’s in the

blast cell.

3. Gather some information about what’s in

the blast cell.

Rule

trigger

Production

API

Lambda

1,500 cases of California squid

in spaced racks

Page 34: AWS re:Invent 2016: IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table (IOT402)

Rate

schedule

stack

Optimizing blast cyclesSend information to Lambda

things/rates/56

0.75 > 0.50

4. Send data off to Amazon ML for analysis

(to trigger or not to trigger an alert?)

Rule

trigger

Amazon

ML

Lambda

• Rate = $0.75 / kWh

• On for 38.5 hours

• 1,500 cases of California

Squid in spaced racks

Information to send:

Page 35: AWS re:Invent 2016: IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table (IOT402)

Rate

schedule

stack

Optimizing blast cyclesTrigger an alert

Lambda

5. Trigger (or not) an alert.

Depending on what Amazon ML told

us to do, we either:

1. Trigger an alert to shut down

the blast cell.

2. Ignore it.

Trigger!

things/rates/56

0.75 > 0.50

Rule

Trigger

Page 36: AWS re:Invent 2016: IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table (IOT402)

Texts/

phone

notifications

Bunch of

sensor data

AWS

IOT

Events

API

SNSAlert

streams

Rule registration

User

subscriptions

Lambda

functions

Rate

schedule

stack

Hourly

rate

emitter

Amazon

ML

Real-time

data stack

Bunch of

rate

schedules

Optimizing blast cyclesSNS as alert mechanism

Rule

triggersDevice

data

stream

Page 37: AWS re:Invent 2016: IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table (IOT402)

Texts/phone

notifications

SNS

Alert

streams

Optimizing blast cyclesSNS as alert mechanism

facility_65_stream

Lambda

alert_36_streamTexts/phone

notifications

Page 38: AWS re:Invent 2016: IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table (IOT402)

Optimizing blast cyclesResult

Shut down blast cell during this time for

5 hours

1. Save signification amount of

money and energy.

2. Still preserve quality of food.

Page 39: AWS re:Invent 2016: IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table (IOT402)

Using Amazon Machine Learning for advance prediction of energy consumption

of a plant or a facility

Using Amazon Machine Learning for equipment health monitoring for risk

management

Integrating transportation data with AWS IoT

Optimizing blast cyclesNext steps

Page 40: AWS re:Invent 2016: IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table (IOT402)

IoT architectures look and feel

different…

Page 41: AWS re:Invent 2016: IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table (IOT402)

Things are NOT static assets

Page 42: AWS re:Invent 2016: IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table (IOT402)
Page 43: AWS re:Invent 2016: IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table (IOT402)
Page 44: AWS re:Invent 2016: IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table (IOT402)

The customer has many identities

Page 45: AWS re:Invent 2016: IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table (IOT402)
Page 46: AWS re:Invent 2016: IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table (IOT402)
Page 47: AWS re:Invent 2016: IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table (IOT402)

The home is someone’s enterprise

Page 48: AWS re:Invent 2016: IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table (IOT402)
Page 49: AWS re:Invent 2016: IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table (IOT402)

IoT architectures look and feel different…

IoT architectures:

• Intermittent network

• Devices are geo-dispersed

• Stateless transactions

• No IP

Web architectures:

• Reliable network

• Servers aren’t mobile

• Stateful transactions

• IP address

Page 50: AWS re:Invent 2016: IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table (IOT402)

The “Internet of Things” (plural)

Page 51: AWS re:Invent 2016: IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table (IOT402)

AWS IoT

Page 52: AWS re:Invent 2016: IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table (IOT402)

Thank you!

Page 53: AWS re:Invent 2016: IoT Blueprints: Optimizing Supply for Smart Agriculture from the Farm to the Table (IOT402)

Remember to complete

your evaluations!