Loading...
 

SmartData Series


SmartData series are classified based on the operation mode of the associated SmartData either as Time-Triggered or Event-Driven. At the time of creation, the series associated with time-triggered SmartData must define a period, whereas those not defining such attribute are assumed to be event-driven. Additionally, the beginning of a series can be specified in one of three ways: by time, by event, and manually. Therefore, the beginning of a time-triggered series can be designated by an event, and an event-driven series can be started at a given time. Similarly, the end of a series can be specified by time, by event, manually, and, additionally, in terms of event counting. Events are expressed in terms of SmartData and arithmetic and logical operators and can be either internal (stored in the platform) or external.

As a "hint" to the IoT platform, the type field specifies if the time-triggered series is collected in high or low frequency. High-frequency data is expected to be transmitted to the platform using the MultiValueSmartData format (e.g. accelerometer read at 20KHz sampling rate). Such series are denoted by the 'TTH' type. However, a temperature read once a minute also defines a time-triggered series, and samples are sent to (and stored at) the platform individually. These series are identified by the 'TTL' type. Event-driven series are identified by the 'ED' type.

Other than the conventional SmartData format, and the interactions described on the IoT Platform Documentation, and the other attributes aforementioned, the following attributes are also used:

Identifier Description
count The number of samples that are expected for a Series.
c The actual (already received) number of data samples in the Series.
now represents the current timestamp of the system.

Series Status Definition

A Series can assume the following status in its life cycle:

Status Description
Waiting The Series is created, but the time interval or the event to start collecting data has not yet happened.
Open Data for the Series is being collected, the end conditions are not yet reached.
Closed Series end condition was reached (time or event), and the expected amount of data was received.
Defective Series end condition was reached (time or event), but the expected amount of data was NOT received.

1 - Time-Triggered Series

1.1) Series with specific timestamps to start and finish the data acquisition, with a well-defined data acquisition periodicity:

JSON Definition Attributes Status definitions
Copy to clipboard
"series" : Object { "version" : 1.1 "unit" : unsigned long "x" : long "y" : long "z" : long "r" : unsigned long "t0" : unsigned long long "tf" : unsigned long long "type" : char(3) "period" : unsigned long "accuracy" : unsigned long "workflow": unsigned long "mode" : "time" }
count = (tf - t0) / period Waiting : now < t0
Open: t0 <= now <= tf
Closed: now > tf && c >= count
Defective: now > tf && c < count

1.2) Series started by the occurrence of an external event, described by a SmartData (with coordinates, unit, and value). The data frequency and the number of data samples needed is known:

JSON Definition Attributes Status definitions
Copy to clipboard
"series" : Object { "version" : 1.1 "unit" : unsigned long "x" : long "y" : long "z" : long "r" : unsigned long "sd" : SmartData "count" : unsigned long "type" : char(3) "period" : unsigned long "accuracy" : unsigned long "workflow": unsigned long "mode" : "condition" }
t0 = sd.t
tf = sd.t + count * period
Waiting : !sd
Open: sd && c < count && now <= tf
Closed: now > tf && c >= count
Defective: now > tf && c < count

1.3) Series started by the occurrence of an external event, described by a SmartData (with coordinates, unit, and value). The data frequency and the amout of time to get data is knwon:

JSON Definition Attributes Status definitions
Copy to clipboard
"series" : Object { "version" : 1.1 "unit" : unsigned long "x" : long "y" : long "z" : long "r" : unsigned long "sd" : SmartData "tf" : unsigned long long "type" : char(3) "period" : unsigned long "accuracy" : unsigned long "workflow": unsigned long "mode" : "condition" }
t0 = sd.t
count = (tf - t0)/period
Waiting : !sd
Open: sd && now <= tf
Closed: now > tf && c >= count
Defective: now > tf && c < count

1.4) Series manually started. The data acquisition frequency is known, as well as the number of data samples to be acquired:

JSON Definition Attributes Status definitions
Copy to clipboard
"series" : Object { "version" : 1.1 "unit" : unsigned long "x" : long "y" : long "z" : long "r" : unsigned long "count" : unsigned long "type" : char(3) "period" : unsigned long "accuracy" : unsigned long "workflow": unsigned long "mode" : "manual" }
t0 = now
tf = now + count * period
Open: now <= tf && c < count
Closed: now > tf && c >= count
Defective: now > tf && c < count

1.5) Series manually started. The data acquisition frequency is known, as well as the time until which the data has to be collected:

JSON Definition Attributes Status definitions
Copy to clipboard
"series" : Object { "version" : 1.1 "unit" : unsigned long "x" : long "y" : long "z" : long "r" : unsigned long "tf" : unsigned long long "type" : char(3) "period" : unsigned long "accuracy" : unsigned long "workflow": unsigned long "mode" : "manual" }
t0 = now
count = (tf - t0) / period
Open: now <= tf && c < count
Closed: now >= tf && c >= count
Defective: now > tf && c < count

2) Event-Driven Series

2.1) Series created with a defined start and end timestamps (know time interval in which events shall occur).

JSON Definition Attributes Status definitions
Copy to clipboard
"series" : Object { "version" : 1.1 "unit" : unsigned long "x" : long "y" : long "z" : long "r" : unsigned long "t0" : unsigned long long "tf" : unsigned long long "type" : char(3) "accuracy": unsigned long "workflow": unsigned long "mode" : "time" }
Waiting: now < t0
Open: t0 <= now <= tf
Closed: now > tf && c > 0
Defective: now > tf && c == 0

2.2) Series started by the occurrence of an event, and the needed number of events is known.

JSON Definition Attributes Status definitions
Copy to clipboard
"series" : Object { "version" : 1.1 "unit" : unsigned long "x" : long "y" : long "z" : long "r" : unsigned long "sd" : SmartData "type" : char(3) "count" : unsigned long long "accuracy": unsigned long "workflow": unsigned long "mode" : "condition" }
t0 = sd.t
tf = timestamp(c == count)
Waiting: !sd
Open: sd && c < count
Closed: c >= count

2.3) Series started by an event, and the time to wait for the desired events is known.

JSON Definition Attributes Status definitions
Copy to clipboard
"series" : Object { "version" : 1.1 "unit" : unsigned long "x" : long "y" : long "z" : long "r" : unsigned long "sd" : SmartData "type" : char(3) "accuracy": unsigned long "tf" : unsigned long long "workflow": unsigned long "mode" : "condition" }
t0 = sd.t Waiting: !sd
Open: sd && now <= tf
Closed: now > tf && c > 0
Defective: now > tf && c == 0

2.4) Series started by an event, and it will end with another event. Both start SmartData (s_sd) and end SmartData (e_sd) will be registered.

JSON Definition Attributes Status definitions
Copy to clipboard
"series" : Object { "version" : 1.1 "unit" : unsigned long "x" : long "y" : long "z" : long "r" : unsigned long "s_sd" : SmartData "e_sd" : SmartData "type" : char(3) "accuracy": unsigned long "workflow": unsigned long "mode" : "condition" }
t0 = s_sd.t
tf = e_sd.t
Waiting: !s_sd
Open: s_sd && now <= tf
Closed: now > tf && c > 0
Defective: now > tf && c == 0

2.5) Manually started series, expecting for a specific number of events (count).

JSON Definition Attributes Status definitions
Copy to clipboard
"series" : Object { "version" : 1.1 "unit" : unsigned long "x" : long "y" : long "z" : long "r" : unsigned long "type" : char(3) "accuracy": unsigned long "count" : unsigned long long "workflow": unsigned long "mode" : "manual" }
t0 = now
tf = timestamp( c == count)
Open: c < count
Closed: c >= count

2.6) Manually started series, expecting for events for a specific amount of time.

JSON Definition Attributes Status definitions
Copy to clipboard
"series" : Object { "version" : 1.1 "unit" : unsigned long "x" : long "y" : long "z" : long "r" : unsigned long "tf" : unsigned long long "type" : char(3) "accuracy": unsigned long "workflow": unsigned long "mode" : "manual" }
t0 = now Open: c < count && now >= tf
Closed: now >= tf && c > 0
Defective: now > tf && c == 0

2.7) Manually started series, collecting data until an event, represented by a SmartData, happens.

JSON Definition Attributes Status definitions
Copy to clipboard
"series" : Object { "version" : 1.1 "unit" : unsigned long "x" : long "y" : long "z" : long "r" : unsigned long "e_sd" : SmartData "type" : char(3) "accuracy": unsigned long "workflow": unsigned long "mode" : "manual" }
t0 = now
tf = e_sd.t
Open: !e_sd
Closed: e_sd && c > 0
Defective: e_sd && c == 0