当前位置:网站首页>ThingsBoard教程(二十):使用规则链过滤遥测数据
ThingsBoard教程(二十):使用规则链过滤遥测数据
2022-06-13 09:33:00 【拿我格子衫来】
前言
上一篇文章我们对规则链中的节点类型做了大致的概述,在tb中规则节点一共有6中类型
- 滤波器
- 属性集
- 变换
- 动作
- 外部
- 规则链
本来这一篇我是想着对每一种类型下的具体规则节点进行一一的详细讲解,但这样 不免会脱离实际使用。于是乎在详细讲解每一个具体节点之前,我们先做一些规则链的实践,在实践中学习,更加具体,也更有代入感。
那么本篇文章就来讲解第一个案例,使用规则链对遥测的数据进行筛选,过滤。这其中就用到了 过滤节点中的script
节点。
下面让我们进入主题吧。
使用规则链对遥测数据进行过滤,处理
业务场景是这样的,我们有一个智能温度计,放在我们的实验室里,它会每隔一段时间上传一次实验室的温度。但最近这个温度计总是出错,上传的数据有100度,也有-80度,这样的数据会对我们的数据统计造成一个勿扰。于是乎我们需要编写一个规则链将不正常的数据过滤掉,以此来保证数据质量。需求就是:如果上传的温度 大于50度,或者小于-10度,就不保存到数据库
需求理解清楚后,开始做吧。
创建设备
使用租户管理员进入设备列表,
新增一个设备,叫做智能温度计。
创建规则链
进入规则链库的管理
边栏推荐
- [51nod p3058] Xiao ming'ai set [set]
- Interrupt handling mechanism
- acwing 789. Range of numbers (dichotomy + suitable for understanding dichotomy boundary)
- [51nod p2106] an odd number of times [bit operation]
- MySQL利用E-R模型的数据库概念设计
- C language: Address Book
- Consolas-with-Yahei
- (bfs) acwing 847. Hierarchy of points in the graph
- 1-4 message passing interface [CSP authentication]
- Attack and defense world PWN shell
猜你喜欢
[51nod p3111] xiaoming'ai intercepts [Las]
acwing 789. Range of numbers (dichotomy + suitable for understanding dichotomy boundary)
Trees and binary trees: the concept of binary trees
(state compression dp+good) acwing 291 Mondrian's dream
(dfs) acwing 842. Arrange numbers
Interrupt handling mechanism
acwing 786. Number k
简述请求过程
Acwing785. quick sort (sort+ quick sort + merge sort)
[51nod p3395] n-bit gray code [bit operation]
随机推荐
LeetCode 5270. Minimum path cost in grid (dynamic programming)
MySQL事务隔离级别和MVCC
LeetCode 6096. Success logarithm of spells and potions (binary search)
【 ssl2 ⁶⁶⁶⁶⁶⁶⁶⁶⁶⁶⁶⁶⁶⁶⁶⁶⁶⁶⁶83
微信小程序客服自动回复——PHP实现
Consolas-with-Yahei
LeetCode 322. Change
Tree and binary tree: operation and storage structure of tree
C language: summary of question brushing (1)
多线程 从UE4的无锁队列开始 (线程安全)
全栈开发实战|SSM框架整合开发
Standard template library (STL)
MySQL利用E-R模型的数据库概念设计
[51nod p2106] an odd number of times [bit operation]
Acwing785. quick sort (sort+ quick sort + merge sort)
UNIX Environment advanced programming --8- process control ---8.5 function exit-8.6 function wait and waitpid
I set up a blog
Jenkins access openldap user authentication
(topological sorting +bfs) acwing 848 Topological sequence of digraph
静态变量与一个类相关联,只要该类在内存中(只要您的应用程序终止,该变量就不存在)就可以使用。(堆本体,栈引用)