This topic describes how to filter data that a device reports to the cloud. In this example, a LightSensor device is used.
Prerequisites
- An edge instance is created. For more information, see Build environments for Link IoT Edge Pro Edition or Build environments for Link IoT Edge Standard Edition.
- A LightSensor product is created, a LightSensor device is created for the product, and the LightSensor device is assigned to the edge instance. For more information, see Sample drivers.
Background information
Sensors constantly report collected data. For example, a thermometer reports temperature values and a light sensor reports illuminance values. No significant difference exists in data that a device reports. Therefore, you need only to focus on the data that exceeds the limits. Link IoT Edge provides Function Compute-based edge applications to filter data that is reported to the cloud. This helps reduce costs of using Alibaba Cloud resources.
To view device data, click View Data. You can see that values regularly change from 100 to 600 with a difference ±100. Data is reported every two seconds. Reporting data with a high frequency for a long period may incur unnecessary costs. You can use Function Compute-based edge applications to filter data that the device reports to the cloud.
1. Create a data filtering function
2. Assign the function to the edge instance
3. Configure message routing
For more information about how to add a message route and set parameters, see Configure message routing.