Aggregate Generation

Aggregation of time series data.

Overview

Once a Data Model is marked as ‘ACTIVATION_REQUESTED’ state, it is kept in queue to execute the activation with next available resources. Typically, this happens within few minutes.

Once a model is picked up for activation, the status of the model is marked as “ACTIVATION_IN_PROGRESS” to indicate that the activation process has been started.

During activation, data from various datasets is read for the selected time window and merged together.

After the data from various datasets have been merged, Aggregates are generated at a lowest granularity of the combination of a thing ID and a timestamp.

The entire aggregation process involves data processing as well as data manipulation steps to generate aggregates. This process can take from minutes up to several hours, depending on the following factors:

  • Number of onboarded things
  • Number of master data records
  • Number of messages within an aggregate bucket
  • Granularity of the aggregate window

Once the aggregates are generated, the data model status changes to ACTIVE. Reaching this status is a prerequisite for further data analysis with the help of SAP Analytics Cloud.

Details

Handling of Data Records Arriving Late

In IoT mass data processing scenarios, it is not unusual that sensor data arrive at a particular processing stage at a point in time that doesn't properly reflect the sequence of data measurements. Such irregularities can be caused by numerous factors, for example:

  • Internal data clustering strategies of the involved devices that cannot be influenced from outside ("black box" principle).
  • Weak data transfer capacity of wireless transmission paths.
  • Processing delays and temporary outages in the data ingestion pipeline.

Example

Let’s consider that the activation of a data model has been completed successfully for the period of 12 February 2020 00:00:00 to 16 February 2020 23.59.59.

Some data with a timestamp at 15 February 2020 23:59:59 (that is, within the time period in question) have been posted on 17 February 2020 03:00:00 (that is, three hours after the observation window has closed). In this case, these late arriving datapoints are not considered in the aggregate generation because the aggregate window of this time point has already been processed by the Content Manager.

Sample Data
# Time Window identifier Time Window Value Lag Period Identifier Lag Period Value Aggregate Time Window Warm Store Retention Activation Trigger Time (UTC) Extraction Time
1 DAY 10 null null HOURLY 90 2020-02-12T03:20:00

Start: 2020-02-12T03:00:00

End: 2020-02-12T02:59:59

2 DAY 10 DAY 1 HOURLY 90 2020-02-12T03:20:00

Start: 2020-02-01T03:00:00

End: 2020-02-11T02:59:59

3 DAY 10 null null DAILY 90 2020-02-12T03:20:00

Start: 2020-02-01T00:00:00

End: 2020-02-11T23:59:59

4 DAY 10 DAY 1 DAILY 90 2020-02-12T03:20:00

Start: 2020-31-01T00:00:00

End: 2020-02-10T23:59:59

5 DAY 10 null null WEEKLY 90 2020-02-12T03:20:00

Start: 2020-27-01T00:00:00

End: 2020-02-09T23:59:59

6 DAY 10 DAY 1 WEEKLY 90 2020-02-12T03:20:00

Start: 2020-27-01T00:00:00

End: 2020-02-09T23:59:59

7 DAY 10 DAY 4 WEEKLY 90 2020-02-12T03:20:00

Start: 2020-20-01T00:00:00

End: 2020-02-02T23:59:59

8 DAY 30 null null MONTHLY 90 2020-02-12T03:20:00

Start: 2020-01-01T00:00:00

End: 2020-01-31T23:59:59

9 DAY 30 DAY 1 MONTHLY 90 2020-02-12T03:20:00

Start: 2020-01-01T00:00:00

End: 2020-01-31T23:59:59

10 DAY 60 null null DAILY 30 2020-02-12T03:20:00

Start: 2020-01-14T00:00:00

End: 2020-02-11T23:59:59

11 DAY 60 DAY 1 DAILY 30 2020-02-12T03:20:00

Start: 2020-01-14T00:00:00

End: 2020-02-10T23:59:59

12 DAY 60 null null WEEKLY 30 2020-02-12T03:20:00

Start: 2020-01-20T00:00:00

End: 2020-02-09T23:59:59

13 DAY 60 DAY 1 WEEKLY 30 2020-02-12T03:20:00

Start: 2020-01-20T00:00:00

End: 2020-02-09T23:59:59

14 DAY 60 DAY 4 WEEKLY 30 2020-02-12T03:20:00

Start: 2020-01-20T00:00:00

End: 2020-02-02T23:59:59

15 DAY 90 null null MONTHLY 60 2020-03-01T00:00:00

Start: 2020-01-01T00:00:00

End: 2020-02-29T23:59:59

16 DAY 90 DAY 1 MONTHLY 60 2020-03-01T00:00:00

Start: 2020-01-01T00:00:00

End: 2020-01-31T23:59:59

Incremental Aggregate Workflow

  1. Once the activation is completed, aggregates for data that are posted later are processed in intervals according to the specified Aggregate Time Window. Aggregates for the selected window are then generated for all things.
  2. The incremental aggregates for a model are always computed sequentially. The first chunk of data is processed between 3:00 a.m. to 4:00 a.m., and the next chunk between 4:00 a.m. and 5:00 a.m.
  3. In case the incremental aggregate flow is delayed, the system recognizes the timeout after 6 hours for data models based on an HOURLY aggregation window and after 1 day for all data models with an aggregate window other than HOURLY.
  4. This means that any pending incremental aggregates are executed after a timeout of 6 hours for HOURLY-based data models. Similarly, for data models with an aggregate window other than HOURLY execution takes place with a delay of one day.
  5. The frequency of the incremental aggregate flow is equal to the Aggregation Window setting of the data model. It will be executed as per the schedule explained below:
    • Every UTC Hour for Hourly Aggregate Window.
    • Every day 12 a.m. UTC time for Daily Aggregate Window.
    • Every Monday 12 a.m. UTC time for Weekly Aggregate Window.
    • 1st day of every Month at 12 a.m. UTC time for Monthly Aggregate Window.