0% found this document useful (0 votes)
7 views39 pages

IoT - Lecture 9

IoT - Lecture 9
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views39 pages

IoT - Lecture 9

IoT - Lecture 9
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 39

Lecture 9

Data Collection, Storage and


Computing Using a Cloud Platform

Internet of Things

Instructor: Le Duy Tan, Ph.D.


Email: [email protected]
Topic Covered
• Cloud computing paradigm for data collection, storage
and computing
• Everything as a service and cloud service models
• IoT cloud-based services using Thingspeak other platforms
Introduction
A few conventional methods for data collection and storage are as
follows:
• Saving devices’ data at a local server for the device nodes
• Communicating and saving the devices’ data in the files locally on
removable media, such as micro SD cards and computer hard disks
• Communicating and saving the data and results of computations in a
dedicated data store or coordinating node locally
• Communicating and saving data at a local node, which is a part of a
distributed DBMS
• Communicating and saving at a remote node in the distributed DBMS
• Communicating on the Internet and saving at a data store in a web or
enterprise server
• Communicating on the Internet and saving at data centre for an
enterprise
Cloud is a new generation method for data collection, storage and
computing
Cloud computing paradigm for data collection, storage, computing and services

Devices or sensors network data collection at a device local-server, local files, dedicated data store, at a coordinating node, a
local node of a distributed DBMS, Internet-connected server of data centre, server or distributed database nodes or a cloud
infrastructure
Cloud computing paradigm for data collection, storage, computing and services

The key terms and their meanings:


• Resource refers to one that can be read (used), written (created of
changed) or executed (processed)
• System resource refers to an operating system (OS), memory,
network, server, software or application.
• Environment refers to an environment for programming, program
execution or both
• Platform denotes the basic hardware, operating system and
network, and is used for software applications or services over
which programs can be run or developed.
• Edge computing is a type of computing that pushes the frontier of
computing applications, data and services away from centralised
nodes to IoT data-generating nodes, which means at logical
extremes of the network.
• Distributed computing refers to computing and usage of resources
which are distributed at multiple computing environments over the
Internet
Cloud computing paradigm for data collection, storage, computing and services

The key terms and their meanings:


• Service is a software which provides the capabilities and logically grouped and
encapsulated functionalities.
• Web Service, according to the W3C definition, is an application identified by a URI,
described and discovered using the XML based Web-Service Description Language
(WSDL).
• Service-oriented architecture consists of components which are implemented as
independent services which can be dynamically bonded and orchestrated, and which
possess loosely coupled configurations, while the communication between them uses
messages
• Web computing refers to computing using resources at computing environment of web
server(s) or web services over the Internet
• Grid computing refers to computing using the pooled interconnected grid of computing
resources and environments in place of web servers.
• Utility computing refers to computing using focus on service levels with optimum
amount of resources allotted when required and takes the help of pooled resources
and environments for hosting applications
Cloud computing paradigm for data collection, storage, computing and services

Cloud Computing Paradigm


Cloud computing means a collection of services available over the
Internet
Cloud platform offers the following:
• Infrastructure for large data storage of devices, RFIDs, industrial
plant machines, automobiles and device networks
• Computing capabilities, such as analytics, IDE (Integrated
Development Environment)
• Collaborative computing and data store sharing
Cloud platform usages are for connecting devices, data, APIs,
applications and services, persons, enterprises, businesses and
XAAS
Internet Cloud + Clients = User applications and services with
‘no boundaries and no walls’
Cloud computing paradigm for data collection, storage, computing and services

Cloud Computing Paradigm


Cloud storage and computing environment offers a virtualised
environment
Virtualisation enables provisioning for storage, network functions,
server and desktop in execution environment of multiplatforms
and servers
Applications need not be aware of the platform, just Internet
connectivity to the platform, called cloud platform, is required.
• Virtualisation of storage
• Network Function Virtualisation (NFV)
• Virtualisation of server
• Virtualised desktop
Cloud computing paradigm for data collection, storage, computing and services

Cloud Computing Features and Advantages


• On demand self-service to users for the provision of storage, computing
servers, software delivery and server time
• Resource pooling in multi-tenant model
• Broad network accessibility in virtualised environment to heterogeneous
users, clients, systems and devices
• Elasticity
• Massive scale availability
• Scalability
• Maintainability
• Homogeneity
• Virtualisation
• Interconnectivity platform with virtualised environment for enterprises and
provisioning of in-between Service Level Agreements (SLAs)
• Resilient computing
• Advanced security
• Low cost
Cloud computing paradigm for data collection, storage, computing and services

Cloud Computing Concerns


• Requirement of a constant high-speed Internet
connection
• Limitations of the services available
• Possible data loss
• Non delivery as per defined SLA specified performance
• Different APIs and protocols used at different clouds
• Security in multi-tenant environment needs high trust
and low risks
• Loss of users’ control
Cloud computing paradigm for data collection, storage, computing and services

Cloud Deployment Models


Following are the four cloud deployment models:
1. Public cloud: This model is provisioned by educational
institutions, industries, government institutions or businesses or
enterprises and is open for public use.
2. Private cloud: This model is exclusive for use by institutions,
industries, businesses or enterprises and is meant for private use in
the organisation by the employees and associated users only.
3. Community cloud: This model is exclusive for use by a
community formed by institutions, industries, businesses or
enterprises, and for use within the community organisation,
employees and associated users. The community specifies security
and compliance considerations.
4. Hybrid cloud: A set of two or more distinct clouds (public, private
or community) with distinct data stores and applications that bind
between them to deploy the proprietary or standard technology.
Cloud computing paradigm for data collection, storage, computing and services

Example
The Microsoft cloud platform consists of:
(i) Microsoft finished services and solutions; (ii) Microsoft building
block services (Dynamic CRM Online, Sharepoint Online;
Exchange Online, dot Net, SQL, ASP dot Net, Office Live and
Windows Live Services); (iii) Cloud infrastructure services
(Windows Azure for compute, storage and resource management
services); and (iv) Global foundation services (Hardware,
networking, deployment and operations services). The platform
includes development tools (Visual Studio, Windows server,
Visual C++, Visual Basic, visual C# and dot Net)
EVERYTHING AS A SERVICE AND CLOUD SERVICE
MODELS
• Cloud connects the devices, data, applications, services, persons and
business
• Cloud computing can be considered by a simple equation:
Cloud Computing = SaaS + Paas + IaaS + DaaS
• SaaS (Software as a Service) The software is made available to an
application or service on demand
• PaaS (Platform as a Service) The platform is made available to a developer of
an application on demand
• IaaS (Infrastructure as a Service). The infrastructure (data stores, servers,
data centres and network) is made available to a user or developer of
application on demand
• DaaS (Data as a Service) Data at a data centre is made available to a user or
developer of application on demand
EVERYTHING AS A SERVICE AND CLOUD SERVICE MODELS
EVERYTHING AS A SERVICE AND CLOUD SERVICE MODELS

Example
• Give examples of Saas, PaaS, IaaS, DaaS service
models for cloud computing.
EVERYTHING AS A SERVICE AND CLOUD SERVICE MODELS

Solution
• SaaS Applications of Google Docs for online office, MS Windows Live for
online office applications, MS Exchange Labs, TCS iON (Integrated IT-as-a-
Service), Salesforce.com for extensible Customer Relations Management
(CRM) system
• PaaS SuiteFlex for business process development NetSuite tools, MS Azure
for Windows applications programming and execution environment, server
platforms of EC2 and GoGrid, application platforms of Force Com, Google
App engine for scalable execution environment for web applications, and TCS
platform BPO solutions, Xively, Nimbits, AWS IoT, IBM IoT Foundation, Cisco
IoT, IOx and Fog, TCS CUP.
• IaaS infrastructure services—Amazon Virtual Servers, GoGrid virtual servers,
Elastic Computing Cloud (EC2), Cloud.com open source IaaS, TCS
Transformation Solutions, Cisco IaaS, and IBM BlueCloud shared
infrastructure service that automate fluctuating demands for the IT resources
• DaaS Data storage platforms of Tata Communications 10 X, Apple and Cisco
for the DaaS.
IoT cloud-based services using Thingspeak other platforms

A user is an application or service. The user obtains responses or feeds from


the application or service. An IoT cloud-based service provides for data
collection, data points, messages and calculation objects
The service also provisions for the generation and communication of alerts,
triggers and feeds to the user
A server can be deployed at the edges (device nodes) which communicates the
feeds to the cloud service
A data point generates a new data each time a new sensed value (data) is
recorded
A feed means a set of data points or objects or data streams or messages
which generate and communicate after the application of rules for filter,
calculation, compaction, fusion, compression, analysis or aggregation
IoT cloud-based services using Thingspeak other platforms

Example
A server provisions for generation and communication of data points, objects,
streams, alerts, triggers and feeds applying the rules for filtering and
calculations. Consider streetlights Internet Example 1.2. Assume that each
streetlight device node generates the following data: (i) streetlightID, (ii)
ambientLightCondition aLC (= dark or daylight), (iii) trafficDensity tD (=
VehiclesPassingPerSec), (iv) functionality func (= streetlight functional or
nonFunctional) which streams to the streetlights group server locally.
Assume that a streetServer provides a local control and feeds the data streams
to IoTStreetLightsServer (ILS) at a cloud. Three applications (services), central
controller, Maintenance Service and Traffic_Lights_Control_Service connect to
the cloud for feeds of messages and alerts from an ILS hosted at the cloud.
Suggest the data points, datastreams, triggers and feeds for the ILS at the
cloud.
IoT cloud-based services using Thingspeak other platforms

Solution
DataPoints or each streetlight are (i) aLC (= 1 or 0), (ii) trafficPresence (= 1 or 0), (iii) tD
(iv) funct (= 1 or 0) and (v) activate.
The streetServer controls locally the deactivation of the individual lights when aLC =
daylight and when tD = 0 even when a trigger activate (Central controller activates the
streetlight yes or no) is received from the controller. This is an energy-saving measure.
The server receives in the feeds trigger activate for each streetlightID from the controller.
The server feeds the controller datastreams for the (i) streetID, streetServerID and
streetTrafficDensity messages and (ii) streetlightID. A functionality alert feeds when the
func = 0 and that means the streetlight needs maintenance.
Central controller receives the feeds from the clouds. The controller generates the
following data points,
(i) streetlightID (ii) activate (Central Controller command activate the streetlight yes or
no) (iv) tD (v) func .
The controller generates the feeds as follows:
1. feed_ID, streetServerID, streetlightID and activate for the streetServer
2. feed_ID, streetlightID and functionality Alert for Maintenance Service.
3. feed_ID, streetServerID and streetTrafficDensity datastream for
Traffic_Lights_Control_Service.
ThingSpeaks
• ThingSpeak is a Web Service (REST API) that lets you collect and
store sensor data in the cloud and develop Internet of Things
applications.
• It works with Arduino, Raspberry Pi and MATLAB (premade
libraries and APIs exists).
• But it should work with all kind of Programming Languages, since
it uses a REST API and HTTP.

https://thingspeak.com
* ThingSpeak is free for small non-commercial projects 2
ThingSpeak

https://thingspeak.com
ThingSpeak
• ThingSpeak is an IoT analytics platform service that lets you
collect and store sensor data in the cloud and develop Internet of
Things applications.
• The ThingSpeak service also lets you perform online analysis and
act on your data. Sensor data can be sent to ThingSpeak from any
hardware that can communicate using a REST API
• ThingSpeak is a Web Service (REST API) that lets you collect and
store sensor data in the cloud and develop Internet of Things
applications.
https://thingspeak.com
* ThingSpeak is free for small non-commercial projects 4
What is ThingSpeak?

https://se.mathworks.com/videos/introduction-to-thingspeak-107749.html
ThingSpeak + LabVIEW

LabVIEW www.ThingSpeak.com
Configuration and Settings
SubVI
ThingSpeak + Web Browser
• We can use a standard Web Browser in order to put data to
ThingSpeak or to get data from ThingSpeak

Write Data Example:


https://api.thingspeak.com/update?api_key=<WriteKey>&field3
=2 Read Data Example:
https://api.thingspeak.com/channels/<ChannelId>/fields/3/last.jso
n?key=<ReadKey>
14
Set and Read Values using a Ex
am
ple
Web Browser
Set Kp Remotely Example:
Enter the following in a Web Browser (or from a Programming Language like LabVIEW,
MATLAB, etc)
We set Kp=2
https://api.thingspeak.com/update?api_key=<WriteKey>&field3=2

Read Kp Remotely Example:


https://api.thingspeak.com/channels/<ChannelId>/fields/3/last.json?key=<ReadKey>

Response in Browser: {"created_at":"2017-06-


26T07:41:54Z","entry_id":1270,"field3":"2"}
We read Kp=2
ThingSpeak + MATLAB
ThingSpeak + MATLAB
The “ThingSpeak Support Toolbox” lets you use desktop MATLAB
to analyze and visualize data stored on ThingSpeak.com

ThingSpeak Support from Desktop MATLAB:


http://se.mathworks.com/hardware-support/thingspeak.html
ThingSpeak + Arduino Data
Collection

www.ThingSpeak.com

Data Analysis
Arduino + Wi-Fi Shield
ThingSpeak + Visual Studio/C#

Visual Studio www.ThingSpeak.com


C#
Configuration and Settings
void SaveMeasurementData()
{
string apiKey; double tagValue;

string server = "https://api.thingspeak.com/"; string webMethod;


string uri;

var webclient = new WebClient();

apiKey = “xxxxxxxxxxxxxxxxxxxxx";

tagValue = Convert.ToDouble(txtMeasurementValue.Text); webMethod =

"update?api_key=" + apiKey + "&field1=" + tagValue; uri = server +

webMethod;

webclient.UploadString(uri, "POST", "");

25
IoT cloud-based services using Thingspeak other platforms

Many cloud PaaS and SaaS platforms are now available for IoT

You might also like