All Products
Search
Document Center

IoT Platform:Configure Timeout Interpolation

Last Updated:Nov 01, 2024

The timeout interpolation node is designed to maintain data continuity by filling gaps with predetermined values during data reporting interruptions, making it ideal for applications that require uninterrupted data sequences.

Scenarios

Consider a thermostat temperature sensor that reports data sporadically, signaling only when temperature changes occur. If no data is reported, the temperature is presumed constant. The timeout interpolation node can be utilized to ensure minute-level data monitoring for such sensors.

Prerequisites

Ensure that data calculation expressions or data filtering filters are set up. For more information, see Configure data computing and data filtering.

Background information

Procedure

  1. Access the data parsing console.

  2. In the middle canvas, click the add image icon following the current node.

  3. In the pop-up node list, single click the Timeout Interpolation node.

  4. On the canvas, single click the Timeout Interpolation node. In the configuration panel on the right, set up the timeout interpolation according to the following table:

    Configuration Item

    Parameter

    Description

    Example

    Basic Configuration

    Interpolation Time Type

    Choose from:

    • Relative Time: Interpolates at regular intervals based on the data parsing task's start time. Set the Relative Time Compensation Period with options such as 10s, 15s, 30s, 1min, 5min, 15min, 30min.

    • Absolute Time: Uses Java (Quartz) standard Crontab expressions to define absolute interpolation times. Set the Absolute Time Compensation Period. For more information, see Appendix: Crontab Expression.

    Referencing the "Scenarios" section: For minute-level monitoring, select from two interpolation time types.

    • Relative Time: Choose Relative Time Compensation Period as 1min.

    • Absolute Time: Set the Crontab expression to 0 */1 * * * ?.

    Interpolation Data Type

    Options include:

    • Previous Real Data: Uses the last reported real data for interpolation.

    • Preset Data: Employs predefined data for interpolation. The message content should be in JSON format.

    Following the "Scenarios" section: Choose Previous Real Data.

    Advanced Configuration

    Message Partition Key

    Optional, specifies the dimension for timeout interpolation, often used to distinguish messages from different devices.

    If not set, the IoT Platform system defaults to using ProductKey and DeviceName as the partition key.

    In the "Scenarios" example: Use the thermostat's identity ID, the boxId field, as the partition key.

    Latency Toleration

    Specifies the delay in seconds before interpolating messages to prevent unnecessary interpolation due to real message transmission delays.

    Adopt the default settings.

    Time-to-Live

    Defines the maximum duration in seconds to continue interpolation if a topic has not reported messages for an extended period. The minimum purge time is 1 minute, and the maximum is 7 days, with the default being 1 day. The timer resets with each received message.

    Maintain the default settings.

    Here is a detailed configuration example based on the "Scenarios" section:

  5. To finalize the configuration of the timeout interpolation node, single click Save in the upper right corner of the data parsing workspace.

    Important

    Note: The output fields of this node are identical to those of the preceding node.

What to do next

Following the configuration of the timeout interpolation node, proceed to set up additional processing nodes or configure the target node to complete the data parsing task.

Appendix: Crontab Expression

The Java (Quartz) standard Crontab expression is detailed below:

Example:
    # Last day of each month
    @Scheduled(cron = "0 0 18 * * ?")
    public void doAtLastDayOfMonth() {
        // do something here...
    }

    Explanation:
    Java(Quartz)
    *    *    *    *    *    *    *
    -    -    -    -    -    -    -
    |    |    |    |    |    |    |
    |    |    |    |    |    |    + year [optional]
    |    |    |    |    |    +----- day of week (1 - 7) SUN,MON,TUE,WED,THU,FRI,SAT
    |    |    |    |    +---------- month (1 - 12) OR JAN,FEB,MAR,APR ...
    |    |    |    +--------------- day of month (1 - 31)
    |    |    +-------------------- hour (0 - 23)
    |    +------------------------- min (0 - 59)
    +------------------------------ second (0 - 59)

Field

Required

Value Range (Integer)

Allowed Special Characters

second

Yes

0~59

  • Asterisk (*): Represents all possible values for the field.

    For instance, when applied to the hour field:

    • 0 0 * * * ? signifies that the action occurs at the start of every hour, precisely at 0 minutes and 0 seconds.

    • 0 */5 * * * ? where */5 means every 5 minutes.

  • Comma (,): Separates multiple values.

    For instance, when specifying 0,5,10 in the min field, the expression 0 0,10 * * * ? triggers at the 0th, 5th, and 10th minute of every hour.

  • Dash (-): Specifies a range of values.

    For instance, when the min field contains 1-3, the expression 0 1-3 * * * ? signifies the first through third minutes of each hour.

  • Slash (/): Specifies increments.

    For instance, when utilized in the min field:

    • 0/15 indicates a frequency of every 15 minutes, beginning at minute zero.

    • 3/20 denotes a frequency of every 20 minutes, starting at the third minute.

    • 0 */1 * * * ? signifies a frequency of every minute.

minute

Yes

0~59

hour

Yes

0~23

day of month

Yes

1~31

  • Asterisk (*): Indicates all possible values in the field.

  • Question mark (?): Used when no specific value is needed for the field.

month

Yes

1~12 or JAN~DEC

Correspondence: 1 for January (JAN), 2 for February (FEB), 3 for March (MAR), 4 for April (APR), 5 for May (MAY), 6 for June (JUN), 7 for July (JUL), 8 for August (AUG), 9 for September (SEP), 10 for October (OCT), 11 for November (NOV), 12 for December (DEC).

Asterisk (*): Represents all possible values in the field.

day of week

Yes

0~7 or SUN~SAT

Correspondence: 0 (SUN), 1 (MON), 2 (TUE), 3 (WED), 4 (THU), 5 (FRI), 6 (SAT). Note that both 0 and 7 represent Sunday (SUN).

Asterisk (*), question mark (?): Used to specify 'no specific value' or 'any value' in the field.

year

No

1970~2099

Asterisk (*): Represents all possible values in the field.