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

Post on 08-Jan-2017

67 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

© 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

What to expect from this session

Deep dive into how we scale alerts using AWS IOT

Introduction to

IOT architectures overview

Our story starts with the most fundamental question in any

industry

How to do more with less?

Increase production

AND

Reduce waste

E=mc2

X 30

30 billion lbs

a year

10^9chicken

feet

4 million lbs a day

All of the strawberries

consumed each year

are produced in just

12 weeks

A race against time to bring

together siloed data and create

operational context

The new

"iOS"

What a modern industrial OS looks like

Apps

SDKs (Data stacks) Files

Rate

schedulesWeather

Facilities

& cost

centers

Real-time

dataAlerts

Custom app

Lineage app

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)

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)

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?

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

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

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

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

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

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

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)

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

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

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”

}

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

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

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

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.

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

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

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:

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

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

Texts/phone

notifications

SNS

Alert

streams

Optimizing blast cyclesSNS as alert mechanism

facility_65_stream

Lambda

alert_36_streamTexts/phone

notifications

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.

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

IoT architectures look and feel

different…

Things are NOT static assets

The customer has many identities

The home is someone’s enterprise

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

The “Internet of Things” (plural)

AWS IoT

Thank you!

Remember to complete

your evaluations!

top related