简体   繁体   English

MQTT 和 OPC-UA(发布/订阅)有什么区别

[英]What is the difference between MQTT and OPC-UA (pub/sub)

So MQTT is the light weight messaging protocol based on publish/subscribe model.所以MQTT是基于发布/订阅模型的轻量级消息传递协议。

Originally OPC-UA was based on a request/response model, but I have read that it now also supports pub/sub extension.最初 OPC-UA 基于请求/响应模型,但我读到它现在也支持发布/订阅扩展。

I also understand that OPC-UA is a not really a protocol but a system architecture.我也明白 OPC-UA 并不是一个真正的协议,而是一个系统架构。 Other than this fact, from the view point of protocol features (considering pub/sub only) what is the difference between MQTT and OPC-UA?除此之外,从协议特性的角度(仅考虑发布/订阅),MQTT 和 OPC-UA 之间有什么区别?

OPC-UA Pub/Sub by itself is protocol agnostic, and MQTT is one of the transport protocols it can use (and is among those that already have the mapping specified). OPC-UA Pub/Sub 本身与协议无关,而 MQTT 是它可以使用的传输协议之一(并且是已经指定映射的协议之一)。 Other transport protocols currently defined in the OPC UA PubSub spec are AMQP, UDP, and "raw" Ethernet.目前在 OPC UA PubSub 规范中定义的其他传输协议是 AMQP、UDP 和“原始”以太网。

OPC UA PubSub extends the classic client/server communication pattern with a publish/subscribe pattern. OPC UA PubSub 使用发布/订阅模式扩展了经典的客户端/服务器通信模式。 OPC UA PubSub itself is not defined in terms of a specific protocol, instead a number of mappings to transports (and encondings) are specified. OPC UA PubSub 本身不是根据特定协议定义的,而是指定了许多到传输(和编码)的映射。

An MQTT transport with a JSON encoding of the data is one of the mappings.具有 JSON 数据编码的 MQTT 传输是映射之一。 This mapping defines a standard how to encode UA data models as JSON.此映射定义了如何将 UA 数据模型编码为 JSON 的标准。 It also defines a standard how to publish (JSON) meta data describing this data.它还定义了如何发布描述此数据的 (JSON) 元数据的标准。

This allows to publish a UA DA datatype like an AnalogItem via MQTT and get describing properties like a Range or a Unit.这允许通过 MQTT 发布 UA DA 数据类型(如模拟项)并获得描述属性(如范围或单位)。

OPC UA also describes interfaces which allows to configure the publisher. OPC UA 还描述了允许配置发布者的接口。

Details can be found here: https://reference.opcfoundation.org/v104/Core/docs/Part14/详细信息可以在这里找到: https : //reference.opcfoundation.org/v104/Core/docs/Part14/

To get an overview it is enough to read section 2, 3, 4 and the earlier parts of 5.要获得概述,阅读第 2、3、4 节和第 5 节的前面部分就足够了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM