当前位置:网站首页>ThingsBoard教程(二十):使用规则链过滤遥测数据
ThingsBoard教程(二十):使用规则链过滤遥测数据
2022-06-13 09:33:00 【拿我格子衫来】
前言
上一篇文章我们对规则链中的节点类型做了大致的概述,在tb中规则节点一共有6中类型
- 滤波器
- 属性集
- 变换
- 动作
- 外部
- 规则链
本来这一篇我是想着对每一种类型下的具体规则节点进行一一的详细讲解,但这样 不免会脱离实际使用。于是乎在详细讲解每一个具体节点之前,我们先做一些规则链的实践,在实践中学习,更加具体,也更有代入感。
那么本篇文章就来讲解第一个案例,使用规则链对遥测的数据进行筛选,过滤。这其中就用到了 过滤节点中的script
节点。
下面让我们进入主题吧。
使用规则链对遥测数据进行过滤,处理
业务场景是这样的,我们有一个智能温度计,放在我们的实验室里,它会每隔一段时间上传一次实验室的温度。但最近这个温度计总是出错,上传的数据有100度,也有-80度,这样的数据会对我们的数据统计造成一个勿扰。于是乎我们需要编写一个规则链将不正常的数据过滤掉,以此来保证数据质量。需求就是:如果上传的温度 大于50度,或者小于-10度,就不保存到数据库
需求理解清楚后,开始做吧。
创建设备
使用租户管理员进入设备列表,
新增一个设备,叫做智能温度计。
创建规则链
进入规则链库的管理
边栏推荐
- Memory management -- Viewing memory space from the perspective of executing programs and processes
- [51nod P3210] binary statistics
- Sequential representation of linear tables
- [51nod p2527] or and sum [bit operation]
- [51nod p2106] an odd number of times [bit operation]
- Storage mode of drawings
- MySQL中redo日志和undo日志简述
- LeetCode 5259. Calculate the total tax payable
- [51nod p2653] interval XOR [bit operation]
- VDD, dvdd, avdd, VCC, afvdd, dovdd, iovdd
猜你喜欢
UNIX Environment advanced programming --8- process control ---8.5 function exit-8.6 function wait and waitpid
Standard template library (STL)
MySQL中redo日志和undo日志简述
二叉树简介
acwing 790. The third root of a number (dichotomy)
[51nod p3111] xiaoming'ai intercepts [Las]
Consolas-with-Yahei
简述请求过程
(dp+ memory) acwing 901 skiing
云计算企业崛起 甲骨文数据库市场主导地位动摇
随机推荐
go-zero微服务实战系列(三、API定义和表结构设计)
UNIX Environment advanced programming --3-file io---3.10 file sharing
SQL ROW_ The number() function uses
Interrupt handling mechanism
[51nod p3047] displacement operation [bit operation]
Exercise 7-7 string replacement (15 points)
(dijkstra+ shortest path + edge traversal 0 (m)) acwing 850 Dijkstra finding the shortest path II
acwing 786. Number k
1-2 24:00 (20 points) [CSP certification true question]
Musk's "meta universe" dream
7-3 virus traceability (20 points)
Overloading of typical operators
LeetCode 6095. Strong password checker II
VDD,DVDD,AVDD,VCC,AFVDD,DOVDD,IOVDD
删除软链接
Execution order of subclass and parent constructor
Pxxx local socket communication
[ssl1271] sort I [heap]
Collection of articles on virtualization and cloud computing
VDD,DVDD,AVDD,VCC,AFVDD,DOVDD,IOVDD