MQTT基本术语 - xyfancy/qcloud-iot-sdk-embedded-c GitHub Wiki
Network Connection(网络连接)
A construct provided by the underlying transport protocol that is being used by MQTT.
• It connects the Client to the Server.
• It provides the means to send an ordered, lossless, stream of bytes in both directions.
提供MQTT依赖的底层数据传输协议。
- 连接客户端与服务器
- 提供有序、无损的字节流双向传输
Application Message(应用消息)
The data carried by the MQTT protocol across the network for the application. When an Application Message is transported by MQTT it contains payload data, a Quality of Service (QoS), a collection of Properties, and a Topic Name.
为了应用,使用MQTT协议通过网络传输的数据。应用消息包含负载数据、服务质量(QoS)、属性的集合和一个主题名字。
Client(客户端)
A program or device that uses MQTT. A Client:
• opens the Network Connection to the Server
• publishes Application Messages that other Clients might be interested in.
• subscribes to request Application Messages that it is interested in receiving.
• unsubscribes to remove a request for Application Messages.
• closes the Network Connection to the Server.
使用MQTT协议的程序或者设备。客户端包含以下操作:
- 打开网络连接(连接到服务器)
- 发布应用消息
- 订阅应用消息
- 取消应用消息订阅
- 关闭网络连接
Server(服务器)
A program or device that acts as an intermediary between Clients which publish Application Messages and Clients which have made Subscriptions. A Server:
• accepts Network Connections from Clients.
• accepts Application Messages published by Clients.
• processes Subscribe and Unsubscribe requests from Clients.
• forwards Application Messages that match Client Subscriptions.
• closes the Network Connection from the Client.
充当发布应用消息的客户端以及订阅应用消息的客户端之间的桥梁。服务器包含以下操作:
- 接受客户端的网络连接
- 接收应用消息
- 处理订阅应用消息和取消订阅的客户端请求
- 将应用消息转发给订阅的客户端
- 关闭网络连接(v5.0加入)
Session(会话)
A stateful interaction between a Client and a Server. Some Sessions last only as long as the Network Connection, others can span multiple consecutive Network Connections between a Client and a Server.
服务器与客户端之间状态性的交互。有些会话只持续一次网络连接、有的可以跨域多个网络连接。
Subscription(订阅)
A Subscription comprises a Topic Filter and a maximum QoS. A Subscription is associated with a single Session. A Session can contain more than one Subscription. Each Subscription within a Session has a different Topic Filter.
一个订阅包含一个主题过滤器和一个最大服务质量值。一个订阅和一个单独的会话相关。一个会话能够包含多个订阅,其中每个订阅包含不同的主题过滤器。
Shared Subscription(共享订阅,v5.0加入)
A Shared Subscription comprises a Topic Filter and a maximum QoS. A Shared Subscription can be associated with more than one Session to allow a wider range of message exchange patterns. An Application Message that matches a Shared Subscription is only sent to the Client associated with one of these Sessions. A Session can subscribe to more than one Shared Subscription and can contain both Shared Subscriptions and Subscriptions which are not shared.
共享订阅是一种特殊的订阅,允许应用消息只发送给所有订阅该共享订阅的会话中的一个对应的客户端,即多个会话共享该消息。一个会话能够订阅多个共享订阅,能够包含共享订阅和订阅。
Wildcard Subscription(通配订阅,v5.0加入)
A Wildcard Subscription is a Subscription with a Topic Filter containing one or more wildcard characters. This allows the subscription to match more than one Topic Name.
通配订阅的主题过滤器中包含一个或者多个通配符。通过通配符,一次订阅能够匹配多个主题名字。
Topic Name(主题名)
The label attached to an Application Message which is matched against the Subscriptions known to the Server.
应用消息上的标签,与服务器的订阅信息相匹配。
The Server sends a copy of the Application Message to each Client that has a matching Subscription.(V3.1)
在v3.1.1中服务器会发送应用消息的拷贝给所有匹配的客户端,然而在v5.0中由于共享订阅的提出,该描述不成立。
Topic Filter(主题过滤器)
An expression contained in a Subscription to indicate an interest in one or more topics. A Topic Filter can include wildcard characters.
订阅中用于表示对于某些主题的兴趣的一种表达。主题过滤器中可包含通配字符。
MQTT Control Packet(MQTT控制包)
A packet of information that is sent across the Network Connection. The MQTT specification defines fifteen different types of MQTT Control Packet, for example the PUBLISH packet is used to convey Application Messages.
v5.0中MQTT标准定义了15种不同类型的MQTT控制包,v3.1.1中少了AUTH类型(在v3.1.1中显示为保留)。
Malformed Packet(畸形包,v5.0中加入)
A control packet that cannot be parsed according to this specification.
根据MQTT协议无法解析的包,应进行错误处理。
Protocol Error(协议错误,v5.0中加入)
An error that is detected after the packet has been parsed and found to contain data that is not allowed by the protocol or is inconsistent with the state of the Client or Server.
接受到的包无法被正确解析或者不符合规范。
Will Message(遗嘱消息,V5.0中加入)
An Application Message which is published by the Server after the Network Connection is closed in cases where the Network Connection is not closed normally.
服务器在网络关闭后发送的应用消息,防止网络异常关闭。
Disallowed Unicode code point(不允许的Unicode码位,V5.0中加入)
The set of Unicode Control Codes and Unicode Noncharacters which should not be included in a UTF-8 Encoded String.
UTF-8编码字符串中不应包含的Unicode控制码和Unicode非字符的集合。