- Analytics for the Internet of Things(IoT)
- Andrew Minteer
- 348字
- 2021-07-02 18:59:33
Topics
Topics are hierarchical and are similar to a filing system. For example, vehicleID/engine/oil/temperature and vehicleID/engine/oil/pressure. An IoT device linked to a vehicle might publish a message that holds the value of 122.2 to the address called vehicleID/engine/oil/temperature (where vehicleID would be the unique identifier of that specific vehicle) on the broker. A subscriber to this topic would then get a message that includes the value 122.2 when it establishes a connection to the broker. If a constant connection to the broker is held, the subscriber will receive the message in near real time.
The concept of topic matching is supported for subscribers. This allows wildcard characters, + or #, to be used when subscribing to topics. This is not allowed for publishers.
A + is a wildcard character for a single level. It works like a search pattern where all non + levels must match. A # is a wildcard character for multiple levels and must be used at the end of the string. It will return the entire hierarchy specified. Similar to copying a folder in your filesystem, it will subscribe to all subdirectories and files included for the level specified.
The wildcard allows simpler subscription management to topics. You could subscribe to vehicleID/engine/+/temperature to get all the temperature values in the engine topic. You could also subscribe to +/engine/oil/temperature to get engine oil temperature values for all devices publishing to that broker. You could subscribe to vehicleID/engine/# to get all values in that hierarchy no matter how deep the levels go.
It is important that the topic tree is designed with flexibility in mind. It should be extensible so that new branches can be added without requiring a redesign of the tree. From an analytical point of view, this means that adding more information from the devices is relatively inexpensive if designed well. If designed poorly, it requires a redesign of the topic tree, which makes it more expensive and therefore unlikely to happen. In the constantly adapting world of analytics where you learn new things and exploit them, you want flexibility at all levels.
- Java多線程編程實(shí)戰(zhàn)指南:設(shè)計(jì)模式篇(第2版)
- 數(shù)字媒體應(yīng)用教程
- 解構(gòu)產(chǎn)品經(jīng)理:互聯(lián)網(wǎng)產(chǎn)品策劃入門寶典
- Hands-On Machine Learning with scikit:learn and Scientific Python Toolkits
- Leap Motion Development Essentials
- 人臉識(shí)別原理及算法:動(dòng)態(tài)人臉識(shí)別系統(tǒng)研究
- WordPress Plugin Development Cookbook(Second Edition)
- Python機(jī)器學(xué)習(xí)編程與實(shí)戰(zhàn)
- Mastering KnockoutJS
- Rust Essentials(Second Edition)
- D3.js By Example
- Python全棧數(shù)據(jù)工程師養(yǎng)成攻略(視頻講解版)
- 軟件測(cè)試教程
- RubyMotion iOS Develoment Essentials
- Java EE 7 with GlassFish 4 Application Server