Combining smartphone sensors and Internet-of-Things (IoT) enables new kinds of application scenarios. Cowbird is a framework that combines the evaluation of both smartphone sensors and IoT in the cloud. However, Cowbird does not scale well in large deployment contexts where thousands of IoT sensors can continuously generate high volumes of data that have to be processed. To this end, we extended Cowbird to support the sensing and evaluation of large streams of sensor data in real-time. We designed a distributed architecture based on the synergy of traditional computing systems and novel stream data processing technologies. The former is required for building a scalable IoT data sensing platform, while the latter are necessary for evaluating and processing large streams of sensor data. We show that in some conditions the data streams evaluation can be performed directly in the sensing platform. This approach avoids the introduction of extra costs and overheads caused by offloading the sensors data evaluation to a stream data processing engine.
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
A Scalable and Hybrid Cloud Framework for Evaluating Streams of Sensor Data in Real-Time
1. A Scalable and Hybrid Cloud
Framework for Evaluating Streams
of Sensor Data in Real-Time
Gabriele Di Bernardo
November 14, 2017
2. Sensors
• A sensor is a device that measures a physical quantity and convert
it into a signal which can be read by an electronic instrument
• Smartphone sensors (e.g., accelerometer, GPS, gyroscope,
ambient light sensors, barometer and many others).
• By 2018, over a third of the world’s population is projected to
own a smartphone, an estimated total of almost 2.53 billion
smartphone users in the world. - statista.com
• Internet-of-Things
• 8 billion connected things will be in use worldwide in 2017
and will reach 20.4 billion by 2020 according to Gartner Inc.
• Can we process all this sensor-generated data in real-time?
!2
3. The SWAN
Framework
• SWAN (Sensing With Android Nodes) is a framework
for easily building context-aware applications for
Android smartphones
• High-level abstraction for accessing smartphone
sensors
• Multi sensor support (20+ types of sensors)
!3
4. SWAN-Song
• SWAN-Song is a domain specific language for context
expressions
• Sensor data evaluated through a history window and
a history reduction operator
• Predicates can be combinated using math, comparison
and logic operators
self@light : lux{MEAN, 2000ms}
!4
5. The Cowbird Framework
• Cowbird combines smartphone
sensors and real-time data
generated by IoT sensors
• IoT sensor data sensed in the
cloud via Java threads
• Streams of sensor data
continuously sensed and
processed
• Smartphone sensors evaluation is
performed locally
• IoT sensors evaluation is
computed in the cloud
!5
6. Research Questions
• Which architecture can be used to process large
streams of data?
• Which technologies can be used to create real-time
data streaming applications?
• How Cowbird can be extended in order to build a
platform that senses and evaluates a large number of
sensor data streams in real-time?
!6
12. Cowbird Streams
• Powered by Apache Flink
• Communication between Fog and Streams mediated by Kafka
broker
• Stream state kept by RocksDB
• Two SWAN-Song evaluation implementations
• Smart offloading
cloud@thingspeak : temperature{MEAN, 3h} > 24.0
cloud@thingspeak : temperature{ANY, 3h} > 24.0
!12
13. SWAN-Song
Streaming-Oriented Evaluation
• Original SWAN framework collects all sensor values
within the time window and the history reduction mode
is then applied
• Streaming-oriented evaluation keeps only partial
results of each stream instead of all the data values
• MEDIAN reduction mode implemented through
Remedian algorithm
• O(log n) space
• Fixed or aligned time windows
!13
14. Hybrid-Cowbirds Evaluation
• Test application evaluates data coming from different
sound sensors arranged in different geographical locations
• Testing environment @ SURFsara
• Cowbird Fog 8 nodes (16 vCPU, 16 GiB memory)
• Kafka 1 node (16 vCPU, 32 GiB memory, 50 GiB disk).
• Cowbird Streams 16 YARN containers (8 vCPU, 48 GiB
memory)
• We evaluated performance in terms of latency and
throughput
!14
20. Related Work
Many different sensor-oriented streaming
architectures available in the literature
• Implementations of the Lambda architecture
• Limited to particular scenarios/use cases (e.g.,
robotics, smart farms, etc.)
!20
21. Conclusions
• Designed and implemented a hybrid and scalable
distributed architecture for the Cowbird framework
• Distributed sensing and evaluation(s) layer
• Capable of evaluating large loads of SWAN-Song
expressions with a low latency
• SWAN-Song expressions evaluation can be performed
by both the architectural layers depending by the
scenario
!21
22. Future Work
• Investigating the feasibility of adopting the realized
architecture in a fog computing scenario
• Implementing a real-time adaptive heuristic for offloading
SWAN-Song expressions evaluation to the Streams layer
• Re-engineering Cowbird internals as Akka actors
• Binary format for communication messages
• Extending SWAN-Song semantics to support Flink
features (e.g., ML, CEP)
!22