The rule engine allows you to configure rules to forward eligible data reported by devices to CTSDB, and then your application server can read the data from CTSDB for processing. This takes advantage of CTSDB's high storage compression rate and aggregate display for massive amounts of data, effectively meeting the daily needs of devices for data storage, analysis, and visual display.
The figure below shows the entire process of forwarding data to CTSDB by the rule engine:
Note:You will be prompted to authorize access to CTSDB upon the first use. You need to click Authorize Now before you can proceed.
After the above configuration is completed, IoT Hub will forward eligible data reported by devices to the configured CTSDB instance. You can refer to Overview to read the data on your own application server for processing or aggregate, search for, and query the data in the CTSDB console.
${}
.Note:If you change the unit of the timestamp of the CTSDB metric to a unit other than second (such as millisecond) after the rule is created, subsequent data writes may fail.
${}
, constant, or fixed value.The advanced configuration items are suitable for scenarios where the device-reported data fields are dynamically expanding and cannot be preconfigured. For example, if there are many sensors on the devices that need to transfer data, but different devices have different specifications and configurations, and the number of sensors is variable, then you can use the following advanced configuration to store the data from all device sensors to CTSDB through the rule engine:
Note:
- Default Storage Type: the default storage type of dynamically expanding storage fields in CTSDB is tag.
- Key: this is the JSON key that needs to traverse the expanding storage. IoT Hub will traverse the JSON key value nesting under this key with
_
as the connector and finally store the data in CTSDB. The following example shows the JSON results and configuration retrieved by SQL SELECT in the rule engine (multiple subkeys can be configured) as well as the data actually stored in CTSDB:
The resending mechanism is used to send the message again in case of a failure in the message forwarding process, which makes sure that the message is received. The details are as follows:
Was this page helpful?