Signal Calculation Service¶
Idea¶
The Signal Calculation Service processes time series data of an entity's sensor. The service aggregates, modifies, smoothes and transforms the original sensor data for further analysis or storage along with the original data.
The service enables a user to carry out the following tasks:
- Detect missing sensor values
- Replace missing sensor values with interpolated ones
- Compute a new physical parameter from available sensor readings
- Aggregate sensor values over a sliding window
Access¶
For accessing this service you need to have the respective roles listed in Analytics Services roles and scopes.
Basics¶
Modes¶
The Signal Calculation Service can be used in two modes:
Interactive Mode¶
This mode is intended to be used for small data sets. All the required configuration and data is provided in the request. The API calls are carried out synchronously and results will be available immediately in the response.
Direct Interactive Mode¶
This mode is intended to be used when the user does not want to pass IoT Time Series data in the request body. In Direct Interactive mode, the Signal Calculation Service can communicate with IoT Time Series to fetch the IoT Time Series data. The user should provide the asset details and time range to the Signal Calculation Service API's instead of passing the IoT Time Series data in the request body. The API calls are carried out synchronously and results will be available immediately in the response.
Configuration Options¶
In addition to one or multiple time series (original sensor data in IoT model format) as input, the service uses a specific configuration for the signal calculation. The configuration information consists of the following parts:
- Operation
A common operation for processing the time series - Parameter
Parameters of the operation - Operands
A set of operands, each defining the entity, the property set and the property of the time series data to operate on - Result
Defines the output format as an IoT model time series: Entity, property set and property of the resulting time series
The service executes the operation on the original sensor data and responds with the calculated time series (so-called soft sensors).
Operations¶
The Signal Calculation Service executes the following operations:
- One-argument mathematics
- ABSOLUTE: Absolute value of a numeric value
- LG: Logarithm in base 10 value of a numeric value
- LN: Logarithm in base e value of a numeric value
- EXP: Exponential value of a numeric value
- COS: Cosine value of a numeric value
- ARC_COS: Arc cosine value of a numeric value
- COSH: Cosine hyperbolic value of a numeric value
- SIN: Sine value of a numeric value
- ARC_SIN: Arc sine value of a numeric value
- SINH: Sine hyperbolic value of a numeric value
- TAN: Tangent value of a numeric value
- ARC_TAN: Arc tangent value of a numeric value
- TANH: Tangent hyperbolic value of a numeric value
- SQRT: Square root value of a numeric value
- NOT: Negation value of a numeric value
- IsNull: Checks if null
- SIGN_NEGATION: Changes the sign of a numeric value
- Two-arguments mathematics
- ADD: Adds two numeric values
- SUBTRACT: Subtracts two numeric values
- MULTIPLY: Multiplies two numeric values
- DIVIDE: Divides two numeric values
- POW: Raises the first Operand to the power of the second
- LESS_THAN: Compares two numeric values
- GREATER_THAN: Compares two numeric values
- GREATER_THAN_OR_EQUALS: Compares two numeric values
- LESS_THAN_OR_EQUALS: Compares two numeric values
- EQUALS: Checks if two values are equal
- NOT_EQUALS: Checks if two values are not equal
- AND: Applies boolean logic on two values
- OR: Applies boolean logic on two values
- Multiple arguments mathematics
- MIN: Compares multiple numeric values and generates minimum
- MAX: Compares multiple numeric values and generates maximum
- MEAN: Generates mean of multiple numeric values
- MEDIAN: Generates median of multiple numeric values
- SUM: Generates sum of multiple numeric values
- FILTER
Removes all entries of a time series where the selected boolean property is set totrue
. - MERGE
Merges two or more time series. The output time series contains existing timestamps plus new "interpolated" timestamps, depending on the selected mode:- LAST_NON_NULL_VALUE
If a non-synchronized timestamp is found, for each time series the last non-null value is taken for the new timestamp. - LINEAR_INTERPOLATION
If a non-synchronized timestamp is found, for each time series the interpolated value between the latest two consecutive values is taken for the new timestamp. - RESAMPLE
Obtain interpolated values from existing time series data at specific and equidistant, user defined timestamps
- LAST_NON_NULL_VALUE
- Constants
Uses constants for applying other operations - Convert
Converts a features type into another type- INTEGER_TO_DATETIME
Convert integer to date time - INTEGER_TO_BOOLEAN
Convert integer to boolean - INTEGER_TO_STRING
Convert integer to string - INTEGER_TO_DOUBLE
Convert integer to double - DOUBLE_TO_INTEGER
Convert double to integer - DOUBLE_TO_STRING
Convert double to string - DOUBLE_TO_BOOLEAN
Convert double to boolean - STRING_TO_INTEGER
Convert string to integer - STRING_TO_DOUBLE
Convert string to double - STRING_TO_BOOLEAN
Convert string to boolean - DATETIME_TO_INTEGER
Convert date time to integer - DATETIME_TO_DOUBLE
Convert date time to double - BOOLEAN_TO_INTEGER
Convert boolean to integer - BOOLEAN_TO_DOUBLE
Convert boolean to double - BOOLEAN_TO_STRING
Convert boolean to string
- INTEGER_TO_DATETIME
- One-argument String
- CAPITALIZE: Makes the first letter of a string uppercase
- LOWER_CASE: Makes all letters of a string lowercase
- UPPER_CASE: Makes all letters of a string uppercase
- MD5_CHECKSUM: Generates the MD5 hash of a string
- REMOVE_DIACRITIC: Deletes the diacritic characters from a string
- REMOVE_DUPLICATES: Deletes the duplicated characters from a string
- REVERSE: Reverses the order of characters from a string
- TO_EMPTY: Converts the string to empty string
- LENGTH: Returns the number of characters of a string.
- Two-arguments String
- CAPITALIZE_BY: Converts the second operand to uppercase on the first operand
- REMOVE_CHARS: Removes the second parameter from the first one
- CONCAT: Concatenates two strings
- COMPARE: Compares two strings
- REGEX_MATCHER: Checks if a string (first argument) respects a given regex (second parameters) and return a Boolean value.
- COUNT: Returns the number of appearances of the second parameter into the first operand
- INDEX_OF: Returns the index of the second argument into the first one
- LAST_INDEX_OF_CHAR: Returns the last index of the second argument into the first one
- SUBSTRING: Returns a substring of first argument starting from the given index (second argument)
- Three-arguments String
- REPLACE: Searches on a string (first operand) a given string (second operand) and replaces it with a given string (third operand).
- REGEX_REPLACE: Searches on a string (first operand) a given regex (second operand) and replaces it with a given string (third operand).
- SUBSTRING_INTERVAL: Returns a sub-string of a string (first operand) starting from the given start index (second operand) and end index (third operand).
- One-argument DateTime
- IS_WEEKEND: Check if a DateTime is during a weekend.
- IS_WORK_DAY: Check if a DateTime is on a work day.
- GET_YEARS: Returns the number of years from a given DateTime.
- GET_MONTHS: Returns the number of months from a given DateTime.
- GET_DAYS: Returns the number of days from a given DateTime.
- GET_HOURS: Returns the number of hours from a given DateTime.
- GET_MINUTES: Returns the number of minutes from a given DateTime.
- GET_SECONDS: Returns the number of seconds from a given DateTime.
- GET_MILLISECONDS: Returns the number of milliseconds from a given DateTime.
- Two-arguments DateTime
- ADD_DATE_TIME: The operation adds two DateTime values
- ADD_YEARS: Returns a new DateTime that adds the specified number of years to the value of the instance.
- ADD_MONTHS: Returns a new DateTime that adds the specified number of months to the value of the instance.
- ADD_DAYS: Returns a new DateTime that adds the specified number of days to the value of the instance.
- ADD_HOURS: Returns a new DateTime that adds the specified number of hours to the value of the instance.
- ADD_MINUTES: Returns a new DateTime that adds the specified number of minutes to the value of the instance.
- ADD_SECONDS: Returns a new DateTime that adds the specified number of seconds to the value of the instance.
- ADD_MILLISECONDS: Returns a new DateTime that adds the specified number of milliseconds to the value of the instance.
- SUBSTRACT_DATE_TIME: The operation subtracts two DateTime values and return milliseconds interval.
- SUBSTRACT_YEARS: Returns a new DateTime that subtracts the specified number of years to the value of this instance.
- SUBSTRACT_MONTHS: Returns a new DateTime that subtracts the specified number of months to the value of this instance.
- SUBSTRACT_DAYS: Returns a new DateTime that subtracts the specified number of days to the value of this instance.
- SUBSTRACT_HOURS: Returns a new DateTime that subtracts the specified number of hours to the value of this instance.
- SUBSTRACT_MINUTES: Returns a new DateTime that subtracts the specified number of minutes to the value of this instance.
- SUBSTRACT_SECONDS: Returns a new DateTime that subtracts the specified number of seconds to the value of this instance.
- SUBSTRACT_MILLISECONDS: Returns a new DateTime that subtracts the specified number of milliseconds to the value of this instance.
- LESS_THAN_DATE_TIME: The operations compares two DateTime values.
- GREATER_THAN_DATE_TIME: The operations compares two DateTime values.
- GREATER_THAN_OR_EQUALS_DATE_TIME: The operations compares two DateTime values.
- EQUALS_DATE_TIME: The operation checks if two DateTime values are or not equal
- NOT_EQUALS_DATE_TIME: The operation checks if two DateTime values are or not equal
- Observation Windows and Aggregators
- Time window: Collects a consecutive sequence of entries from on a time interval and applies a list of aggregate functions
- Length window: Collects a consecutive sequence having a fix number of entries and applies a list of aggregate functions
- DELAY
- EVENT: Shifts to the right the events from the input with the specified number
- TIME: Delays the time of the entries with the specified milliseconds received in the request
- GENERATOR
- CONTINUOUS: Generates every given period of time a simple entry containing only the timestamp
- TEMPORAL: Generates copies of the input entries based on the period parameter and number of events received as input
All operation inputs and outputs use one of the data types integer64
, double
or boolean
. If one of the operands is Null, the result is Null.
Features¶
The Signal Calculation Service exposes its API for realizing the following tasks:
- Apply a mathematical operation to specified properties of time series
- Filter time series by specified boolean properties
- Merge multiple time series
- Ability to communicate with IoT time series to obtain time series data for given asset details and time range and perform mathematical operations on this data.
Limitations¶
- In Interactive mode, the service can process a maximum of 20000 time series records.
- In Direct Interactive mode, the service can process a maximum of 20000 time series records containing a maximum of 3 variables obtained from IoT Time Series service.
Example Scenario¶
The manager of a brewery wants to calculate the average temperature of a component of the production line.
Collect time series data of the relevant temperature sensor of the production line using the IoT Time Series Service. Feed the Signal Calculation Service API with the time series of the desired time period and generate a median. Evaluate the resulting response.
Related Links¶
Except where otherwise noted, content on this site is licensed under the Development License Agreement.