RT-IFTTT is an applet-based real-time IoT framework with condition-aware flexible polling intervals. RT-IFTTT analyzes current sensor values, trigger conditions and constraints of all the applets in the framework, and dynamically calculates the optimal polling intervals for each sensor.
With a simple “If This Then That” syntax, IoT frameworks such as IFTTT and Microsoft Flow allow users to easily create custom applets integrating sensors and actuators. Since users expect their applets to respond to changed sensor values within a certain latency while the sensors usually have limited battery power, reading the sensor values at the right time point is crucial for the IoT frameworks to support realtime responses of the applets while maximizing battery lives of sensors. However, existing IoT frameworks periodically read the sensor data with fixed intervals without reflecting current sensor values and trigger conditions of applets, so the intervals are either too long to meet the real-time constraints, or too short wasting batteries of sensors. This work extends the existing IFTTT syntax for users to describe real-time constraints, and proposes the first real-time IoT framework with trigger condition-aware flexible polling intervals, called RT-IFTTT. RT-IFTTT analyzes current sensor values, trigger conditions and constraints of all the applets in the framework, and dynamically calculates the optimal polling intervals for each sensor. This work collects real-world sensing data from 10 physical sensors for 10 days, and shows that the RT-IFTTT framework with the proposed schedulers executes 100 to 400 applets according to user-defined real-time constraints with up to 64.12% less sensor polling counts compared to the framework with the fixed intervals.
We implemented RT-IFTTT simulation by using Matlab. So there is no need to install other libraries or frameworks except Matlab.
- Matlab R2017a or higher: We tested the codes on Matlab R2017a, but the lower is not confirmed.
- 2 GB of free disk space: Due to the size of MNSVG model, the simulation needs the large size of a free space. The size of generated files depends on the amount of your sensor data.
- Time and patience: It takes at least 12 hours to simulate the situation of 400 applets with given training & sensor data. We are working on performance issues.
If you are eager to reproduce the result of the paper, just change
num_applets in the config.m to 100, 200, 300, 400 and type
run in the command window. But we strongly recommend you to read the
following description to run your own data and extensible configuration.
In order to reproduce the result, we provided the data which is used to
evaluate algorithms. data/sample.csv and
data/rawdata.csv are collected data from 10 physical
sensors that consist of 2 sets of temperature, humidity, UV index, ambient
light, and pressure sensors. The file data/sample.csv
has training data to build a prediction model, and the file
data/rawdata.csv has evaluation data to evaluate
algorithms.
Moreover, we provided the randomly generated applets which are used in the
evaluation of the paper: data/applet_YYY.mat (YYY = 100, 200, 300, 400).
s4_applet_generator.m can generate other
random applets; see s4_applet_generator.m
for details.
You can use the provided sensor data (data/sample.csv and
data/rawdata.csv) which is used in the paper, or you can
give your own sensor data to test. Sensor data inputs should follow this format.
(You can see data/sample.csv as an example.)
- Training data and evaluation data: In order to run the simulation with your sensor data, you have to provide training data and evaluation data. The training data is used to build the MNSVG (maximum normalized sensor value gradient) prediction model, and the evaluation data is used to evaluate the RT-IFTTT algorithm and the baseline algorithms.
- CSV file: The data should be comma-separated.
- Same Header: The first row should be a header row which represents the date & time or the name of a sensor. The column of the training data and the raw data should be in the same order.
- Date & Time: The first column should represent the date & time when the data is corrected.
- Date & Time Format:
DD-MMM-YYYY hh:mm:ss. For example:10-Apr-2017 13:20:01. See details ins1_sensor_data.mto change the format.
In order to run the simulation, you have to look carefully the configuration
file config.m. Global constants are in uppercase; you must not
change the global constants in uppercase.
num_sensors: The number of sensors to simulate.num_sensorsshould be equal to the number of your given data insample_csvandrawdata_csv. Default: 10num_applets: The number of applets to simulate. Default: 100clear_matrix: When you want to clear all the generated matrix, setclear_matrixto 1. The scriptrunwill ask you again. Default: 0rerun_from_s4: When you don't want to re-build the prediction model and the data, setrerun_from_s4to 1. Then the simulation re-generate random applets, and run the evaluation. Default: 0
sample_csv: The file path to the training data. Default: data/sample.csv.rawdata_csv: The file path to the evaluation data. Default: data/rawdata.csv.
wsize: The window size of the low-pass filter. Default: 600
delta_t: MNSVG model takes some ∆t for prediction , not all the contiguous ∆t due to the size and the performance of the model. Default: [1, 10, 20, ... , 900]
deadline: Relative deadlines for each applet are chosen from a finite set. Default: [30, 60, 300, 600]rand_maxandrand_min: The maximum and minimum values of each sensor data set. The number of elements should be equal tonum_sensors.
fix_opt_interval: The sensor polling interval for Optimistic Fixed Interval (Fix-Opt). Default: 900fix_con_interval: The sensor polling interval for Conservative Fixed Interval (Fix-Con). Default: 30
modeling_interval: The next sampling interval required to keep the sensor value prediction model valid. Default: 900e: Constant miss ratio for all the applets. Default: 0.1
After you edit the configuration, simply type run on the command window. Seat
back and watch!
- Each module from
s1tos5generates a.matfile. If a.matfile already exists, the scriptrunwill not execute the correspond module. - Some modules have a time stamp & progress indicator. That is, it will take long time to finish.
- See
run.mfor details.
DESIGN.md describes the design of the modules and simulation. See
DESIGN.md for details.
- Seonyeong Heo: heosy@postech.ac.kr
- Seungbin Song: sbsong@postech.ac.kr