Validate TSL model data

Updated at:

After you define a Thing Specification Language (TSL) model for a product in IoT Platform, the platform validates the data that devices report. This validation is based on the TSL model definition and the configured validation method. This topic describes the three types of data validation.

Important If a product's Data Format is set to Pass-through/Custom, IoT Platform first calls a data parsing script when a device reports TSL model data. The script transforms the reported pass-through or custom format data into Alink JSON format. IoT Platform then performs data validation.

For more information about data parsing, see Data parsing scripts.

TypeDescriptionScope
Strong validationValidates all fields in the data that a device reports. Only data that passes validation is forwarded.

Data that passes validation appears on the TSL Data tab of the Device Details page for the device in the IoT Platform console. Data that fails validation is not displayed.

For products created before October 14, 2020, strong validation is the only available method.
Weak validationValidates only the `identifier` and `dataType` fields in the data that a device reports. All data is forwarded.

Data that passes validation appears on the TSL Data tab of the Device Details page for the device in the IoT Platform console. Data that fails validation is not displayed.

You can view the data that failed validation in the checkFailedData parameter of the forwarded data. For more information, see Data formats.

For products created from October 14, 2020, to December 31, 2020 (inclusive), you can no longer change the current validation method.

When you create a product on or after January 1, 2021, you must select either weak validation or no validation. After the product is created, you cannot change the validation method.

For specific instructions, see Create a product.

No validationDoes not validate any data that a device reports. All data is forwarded.

The TSL model data is used as follows:

  • TSL model property reporting: Property data is not displayed on the TSL Data > Running Status tab of the Device DetailsIoT Platform console
  • TSL model service invocation: All services use asynchronous invocation.
  • TSL model event reporting: All events are of the information type.