Communication method, device, chip, storage medium and program product based on MQTT protocol

By reporting the supported content types to the server through the application terminal, the cloud device generates appropriate message payload content, which solves the parsing problem caused by the inconsistency of content types between publishers and subscribers in the MQTT protocol, and ensures that subscribers can correctly parse messages.

CN116134798BActive Publication Date: 2026-04-28GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
Filing Date
2020-11-17
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

In the MQTT protocol, publishers and subscribers may have different understandings of the payload content type, which may cause subscribers to be unable to correctly parse the message payload content.

Method used

The application terminal reports the content types it supports to the server, and the cloud device learns from the server and generates appropriate message payload content to ensure that subscribers can parse it correctly.

Benefits of technology

This enables subscribers to correctly parse the payload content of published messages, resolving parsing issues caused by inconsistent content types.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116134798B_ABST
    Figure CN116134798B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a communication method and device based on MQTT protocol. A cloud device can learn content types supported by an application terminal through a server, and the cloud device generates content in a payload of a published message according to the content types supported by the application terminal, thereby ensuring that the application terminal can correctly parse the content in the payload of the published message. The communication method based on the MQTT protocol comprises: an application terminal sending first information to a server, the first information being used to indicate content types supported by the application terminal.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of the Internet of Things, and more specifically, to a communication method and device based on the MQTT protocol. Background Technology

[0002] Message Queuing Telemetry Transport (MQTT) is a publish / subscribe messaging protocol designed for remote devices with limited hardware performance and poor network conditions, and is widely used in the Internet of Things (IoT) field. In some scenarios, MQTT can support multiple payload content types. In this case, the publisher and subscriber may have inconsistent understandings of the content types in the payload, leading to problems where the subscriber cannot parse the content. Summary of the Invention

[0003] This application provides a communication method and device based on the MQTT protocol. The cloud device can learn the content types supported by the application terminal through the server, and the cloud device generates the content in the payload of the published message according to the content types supported by the application terminal, thereby ensuring that the application terminal can correctly parse the content in the payload of the published message.

[0004] Firstly, a communication method based on the MQTT protocol is provided, which includes:

[0005] The application terminal sends first information to the server, which indicates the content types supported by the application terminal.

[0006] Secondly, a communication method based on the MQTT protocol is provided, which includes:

[0007] The server receives first information sent by the application terminal, which indicates the content types supported by the application terminal.

[0008] Thirdly, a communication method based on the MQTT protocol is provided, which includes:

[0009] Cloud devices obtain the content types supported by the application terminal from the server.

[0010] Fourthly, an application terminal is provided for executing the method described in the first aspect above.

[0011] Specifically, the application terminal includes a functional module for performing the method described in the first aspect above.

[0012] Fifthly, a server is provided for performing the methods described in the second aspect above.

[0013] Specifically, the server includes a functional module for performing the methods described in the second aspect above.

[0014] Sixthly, a cloud device is provided for performing the method described in the third aspect above.

[0015] Specifically, the cloud device includes functional modules for performing the methods described in the third aspect above.

[0016] In a seventh aspect, an application terminal is provided, including a processor and a memory. The memory is used to store computer programs, and the processor is used to call and run the computer programs stored in the memory to perform the methods described in the first aspect.

[0017] Eighthly, a server is provided, including a processor and a memory. The memory is used to store computer programs, and the processor is used to invoke and run the computer programs stored in the memory, performing the methods described in the second aspect above.

[0018] In a ninth aspect, a cloud device is provided, including a processor and a memory. The memory is used to store computer programs, and the processor is used to invoke and run the computer programs stored in the memory, performing the methods described in the third aspect above.

[0019] In a tenth aspect, an apparatus is provided for implementing the method in any one of the first to third aspects described above.

[0020] Specifically, the device includes a processor for retrieving and running a computer program from a memory, causing a device equipped with the device to perform the method described in any of the first to third aspects above.

[0021] Eleventhly, a computer-readable storage medium is provided for storing a computer program that causes a computer to perform the methods of any one of the first to third aspects described above.

[0022] In a twelfth aspect, a computer program product is provided, comprising computer program instructions that cause a computer to perform the methods of any one of the first to third aspects described above.

[0023] In a thirteenth aspect, a computer program is provided that, when run on a computer, causes the computer to perform the methods of any one of the first to third aspects described above.

[0024] Through the above technical solution, the application terminal can report the content types it supports to the server. The cloud device can learn about the content types supported by the application terminal through the server, and the cloud device can generate the content in the payload of the published message based on the content types supported by the application terminal, thereby ensuring that the application terminal can correctly parse the content in the payload of the published message. Attached Figure Description

[0025] Figure 1 This is a schematic flowchart illustrating a communication method based on the MQTT protocol according to an embodiment of this application.

[0026] Figure 2 This is a schematic flowchart illustrating the content types supported by an application terminal, as provided in an embodiment of this application.

[0027] Figure 3 This is a schematic flowchart illustrating another application terminal indicating the content types it supports, provided in an embodiment of this application.

[0028] Figure 4 This is a schematic flowchart illustrating another application terminal indicating the content types it supports, provided in an embodiment of this application.

[0029] Figure 5 This is a schematic block diagram of a server provided according to an embodiment of this application.

[0030] Figure 6 This is a schematic block diagram of an application terminal provided according to an embodiment of this application.

[0031] Figure 7 This is a schematic block diagram of a cloud device provided according to an embodiment of this application.

[0032] Figure 8 This is a schematic block diagram of a communication device provided according to an embodiment of this application.

[0033] Figure 9 This is a schematic block diagram of an apparatus provided according to an embodiment of this application.

[0034] Figure 10 This is a schematic block diagram of a communication system provided according to an embodiment of this application. Detailed Implementation

[0035] The technical solutions of the embodiments of this application will now be described with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art without creative effort regarding the embodiments of this application are within the scope of protection of this application.

[0036] In this embodiment of the application, the application terminal can be an MQTT client, and the application terminal completes message publishing and subscription through an MQTT server (Broker). The MQTT server is used to manage the subscription and publishing of MQTT clients.

[0037] Application terminals can be mobile phones, tablets, computers with wireless transceiver capabilities, virtual reality (VR) terminal devices, augmented reality (AR) terminal devices, wireless terminal devices in industrial control, wireless terminal devices in self-driving, wireless terminal devices in remote medical care, wireless terminal devices in smart grids, wireless terminal devices in transportation safety, wireless terminal devices in smart cities, or wireless terminal devices in smart homes, etc.

[0038] As an example and not a limitation, in this embodiment, the application terminal can also be a wearable device. Wearable devices, also known as wearable smart devices, are a general term for devices that utilize wearable technology to intelligently design and develop everyday wearables, such as glasses, gloves, watches, clothing, and shoes. Wearable devices are portable devices worn directly on the body or integrated into a user's clothing or accessories. Wearable devices are not merely hardware devices; they achieve powerful functions through software support, data interaction, and cloud interaction. Broadly defined, wearable smart devices include those with comprehensive functions, large size, and the ability to achieve complete or partial functions without relying on a smartphone, such as smartwatches or smart glasses, as well as those focused on a specific application function that require interaction with other devices such as smartphones, such as various smart bracelets and smart jewelry for vital sign monitoring.

[0039] In this application embodiment, the cloud device can also be referred to as a cloud platform, which can be implemented based on cloud services. Cloud services can be combined with artificial intelligence (AI), i.e., AI cloud services, generally also known as AI as a Service (AIaaS). This is currently a mainstream service model for artificial intelligence platforms. Specifically, AIaaS platforms break down several common AI services and provide them as independent or packaged services in the cloud. This service model is similar to opening an AI-themed marketplace: all developers can access and use one or more AI services provided by the platform through application programming interfaces (APIs). Some experienced developers can also use the AI ​​framework and AI infrastructure provided by the platform to deploy and maintain their own dedicated cloud AI services.

[0040] In this article, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.

[0041] The terminology used in the embodiments section of this application is for the purpose of explaining specific embodiments of this application only, and is not intended to limit this application. The terms "first," "second," "third," and "fourth," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion.

[0042] It should be understood that the term "instruction" mentioned in the embodiments of this application can be a direct instruction, an indirect instruction, or an indication of a relationship. For example, A instructing B can mean that A directly instructs B, such as B being able to obtain information through A; it can also mean that A indirectly instructs B, such as A instructing C, so B can obtain information through C; or it can mean that there is a relationship between A and B.

[0043] In the description of the embodiments of this application, the term "correspondence" may indicate that there is a direct or indirect correspondence between two things, or that there is an association between two things, or that there is a relationship of instruction and being instructed, configuration and being configured, etc.

[0044] In this embodiment of the application, "predefined" can be achieved by pre-storing corresponding code, tables, or other means that can be used to indicate relevant information in the device (e.g., including application terminals, servers, cloud devices). This application does not limit the specific implementation method. For example, predefined can refer to what is defined in the protocol.

[0045] In this application embodiment, the "protocol" may refer to the MQTT protocol, such as MQTT version 3.1.1 and related protocols applied in future MQTT, and this application does not limit it.

[0046] To facilitate a better understanding of the embodiments of this application, the MQTT protocol related to this application will be described.

[0047] MQTT version 3.1.1 does not have the ability to negotiate the content type of the transmitted content. Therefore, if multiple payload content types are supported in an ecosystem, the publisher cannot be aware of the content types supported by the subscriber, and there may be situations where the published content cannot be parsed by the subscriber.

[0048] To address the aforementioned issues, this application proposes a communication scheme based on the MQTT protocol. The cloud device can obtain the content types supported by the application terminal through the server, and the cloud device can generate the content in the payload of the published message based on the content types supported by the application terminal, thereby ensuring that the application terminal can correctly parse the content in the payload of the published message.

[0049] The technical solution of this application is described in detail below through specific embodiments.

[0050] Figure 1 This is a schematic flowchart of a communication method 100 based on the MQTT protocol according to an embodiment of this application, as follows: Figure 1 As shown, the method 100 may include at least some of the following:

[0051] S110, the application terminal sends first information to the server, the first information being used to indicate the content types supported by the application terminal;

[0052] S120, the server receives the first information sent by the application terminal;

[0053] S130, the cloud device obtains the content types supported by the application terminal from the server.

[0054] It should be noted that "content type" generally refers to the content type present in the message payload. It is used to define the type and / or encoding method of the message payload content, and to determine in what form and encoding the message receiver will read this part of the content.

[0055] Optionally, as Example 1, the first information occupies at least one reserved bit in the fixed header of the MQTT connection message. That is, in S110, the application terminal sends an MQTT connection message to the server, and the first information carried in the MQTT connection message is used to indicate the content types supported by the application terminal.

[0056] For example, the fixed header in an MQTT connection message can be as shown in Table 1 below, which may include 4 reserved bits (bits 0-3). Example 1 primarily reuses fields 0-3 in Table 1 to describe the content types supported by the application terminal.

[0057] Table 1

[0058]

[0059] Specifically, bits 0-1 support four content type options, while bits 0-3 support up to 16 content types. For example, in bits 0-1: "10" represents JSON, and "11" represents TLV. JavaScript Object Notation (JSON) and tag-length-value (TLV) are just examples; this application may also include other content types.

[0060] JSON is a lightweight data-interchange format. It uses a text format that is completely independent of programming languages ​​to store and represent data. Its concise and clear hierarchical structure makes JSON an ideal data exchange language. It is easy for humans to read and write, as well as easy for machines to parse and generate, and effectively improves network transmission efficiency.

[0061] In TLV, the lengths of the T and L fields are often fixed (usually 1 to 4 bytes), while the length of the V field is variable. The T field indicates the message type, the L field indicates the message length, and the V field is often used to store the message content.

[0062] It should be noted that after establishing a connection with the server, the application terminal will send an MQTT connection message only once. This MQTT connection message can carry the content types supported by the application terminal, that is, the content type of the payload of the publish message subsequently sent to the application terminal and the content type of the payload of the subscription message that it can receive.

[0063] Alternatively, in Example 1, the server sends the MQTT connection message to the cloud device.

[0064] In Example 1, the server is a functional unit of the cloud device, therefore an internal interface (non-MQTT communication mechanism) exists between the server and the cloud device. In this case, the server sends the MQTT connection message to the cloud device through the internal interface. Correspondingly, the cloud device obtains the MQTT connection message through the internal interface with the server. The MQTT connection message carries first information indicating the content types supported by the application terminal. This first information occupies at least one reserved bit in the fixed header of the MQTT connection message.

[0065] Optionally, in Example 1, the application terminal receives an MQTT connection confirmation message sent by the server.

[0066] Optionally, the MQTT connection acknowledgment message carries second information, which indicates the content types supported by the application terminal.

[0067] Optionally, the second information occupies at least one reserved bit in the fixed header of the MQTT connection confirmation message, and the bit position occupied by the second information is the same as the bit position occupied by the first information.

[0068] The fixed header in the MQTT connection confirmation message can be as shown in Table 2 below, and it can include 4 reserved bits (bits 0-3). This second information reuses the bit 0-bit 3 fields in Table 2 to describe the content types supported by the application terminal.

[0069] Table 2

[0070]

[0071] For example, the first information reuses bits 0-1: "00" represents JSON, and "01" represents TLV. And the second information reuses bits 0-1: "00" represents JSON, and "01" represents TLV.

[0072] In Example 1, after receiving the aforementioned MQTT connection message, the server allows the cloud device to detect it through an internal interface. Once the cloud device detects the MQTT connection message, it records the application terminal's identifier and the content types supported by the application terminal in the cloud. This allows the cloud device to query the supported content types of the application terminal when it needs to send a publish message to that application terminal later.

[0073] Optionally, in Example 1, the server receives a fourth publishing message sent by a cloud device, the content type of which belongs to the content type supported by the application terminal.

[0074] In other words, when a cloud device needs to send a publish message to an application terminal, it can find the content type that the application terminal can recognize based on the information it has recorded for that application terminal, generate the corresponding publish message, and send it to the server. The server then forwards the publish message to the application terminal based on the application terminal's subscription.

[0075] Optionally, in Example 1, the server receives a third subscription message sent by the application terminal; and in response to the third subscription message, the server forwards the fourth publication message to the application terminal.

[0076] Alternatively, in Example 1, bits 0-3 in Table 1 above can each represent a content type, so in Example 1, the cloud device can be notified that the application terminal supports several content types simultaneously.

[0077] Optionally, as Example 2, the first information is carried in the topic of the first published message. That is, in S110, the application terminal sends the first published message to the server, and the first information carried in the topic of the first published message is used to indicate the content types supported by the application terminal.

[0078] Optionally, the subject of the first published message may also include at least one of the following:

[0079] The device ID of the application terminal;

[0080] Content information is used to indicate that the subject of the first published message is a subject carrying information indicating the content types supported by the application terminal.

[0081] For example, the topic of the first published message could be: content / [deviceid] / contenttypeid;

[0082] Here, "content" indicates that the topic is a topic with a content type, and the cloud device can use this keyword to determine the purpose and meaning of the first published message; "[deviceid]" represents the device identifier of the device that sent the first published message, that is, the identifier of the application terminal; "contenttypeid" represents the type identifier of the content type carried by the topic, such as 0 for TLV and 1 for JSON.

[0083] Optionally, the Quality of Service (QoS) of the first published message is 1 or 2. This ensures that cloud devices can receive the first published message.

[0084] Optionally, the payload of the first published message is empty.

[0085] Optionally, in Example 2, the server receives a first subscription message sent by a cloud device, the first subscription message being used to subscribe to messages containing content type messages in a topic; and in response to the first subscription message, the server sends the first publication message to the cloud device.

[0086] Accordingly, the cloud device sends a first subscription message to the server, wherein the first subscription message is used to subscribe to messages whose topics include content type messages; and the cloud device receives a first publishing message sent by the server, wherein the topic of the first publishing message carries first information, the first information being used to indicate the content types supported by the application terminal.

[0087] That is, the message subscribed to by the first subscription message carries a topic including a content type message or a subscription topic registration message, and the topic registration message is a message whose topic includes a content type.

[0088] For example, the cloud device subscribes to the server using the format ucc / content / #, indicating that it needs to report content type messages. "ucc" is a keyword, and "#" can directly match any content that follows it. A specific example is: Subscribe:ucc / content / #.

[0089] Optionally, in Example 2, the server receives a second subscription message sent by the application terminal, the second subscription message being used to subscribe to a target topic, the target topic including at least content confirmation information and the identifier of the application terminal; and in response to the second subscription message, the server sends a second publishing message to the application terminal, the topic of the second publishing message including at least one of the following: content confirmation information, the identifier of the application terminal, and content type identifier.

[0090] The specific form of the second subscription message is, for example, Subscribe: topic:ucc / contentack / deviceid / #.

[0091] The specific form of the second published message is, for example, Publish: topic:ucc / contentack / [deviceid] / contenttypeid.

[0092] It should be noted that "deviceid" is used to prevent other devices from being notified, while "contentack" indicates that the cloud device has received the aforementioned first release message.

[0093] Optionally, before the server sends the second publishing message to the application terminal, the server receives a third publishing message sent by the cloud device. The subject of the third publishing message includes at least one of the following: content confirmation information, the identifier of the application terminal, and the content type identifier.

[0094] The specific form of the third published message is, for example, Publish: topic:ucc / contentack / [deviceid] / contenttypeid.

[0095] Optionally, the subject of the third publication message may also include the identifier of the cloud device. In this case, the specific form of the third publication message is, for example: Publish: topic:ucc / contentack / [deviceid] / [cloudid] / contenttypeid.

[0096] In other words, after receiving the second release message, the application terminal can know that the cloud device has received the message that supports the content type.

[0097] Optionally, the payload of the second published message is empty.

[0098] Optionally, the payload of the third published message is empty.

[0099] Optionally, in Example 2, the server receives a fourth publishing message sent by a cloud device, the content type of which belongs to the content type supported by the application terminal.

[0100] In other words, when a cloud device needs to send a publish message to an application terminal, it can find the content type that the application terminal can recognize based on the information it has recorded for that application terminal, generate the corresponding publish message, and send it to the server. The server then forwards the publish message to the application terminal based on the application terminal's subscription.

[0101] Optionally, in Example 2, the server receives a third subscription message sent by the application terminal; and in response to the third subscription message, the server sends a fourth publication message to the application terminal.

[0102] Optionally, in Example 2, the cloud device and server should confirm that the deviceID in the topic should be the ID of the device that issued the first published message, that is, the deviceID in the topic of the first published message should be the identifier of the application terminal; the application terminal can also republish the topic to re-register its supported content types. After receiving the change message, the cloud device should update the application terminal's content type registry and refresh the application terminal's content type.

[0103] Optionally, in Example 2, the cloud device can generate multiple MQTT clients, each subscribing to different content type notification messages, so that publishing can be accomplished through different MQTT clients in the future.

[0104] It should be noted that in Example 2, both the application terminal and the cloud device interact with the server as MQTT clients.

[0105] Optionally, in some embodiments, when the content types supported by the application terminal change, the application terminal sends a fifth release message to the server, wherein the subject of the fifth release message carries third information, which is used to indicate the updated content types supported by the application terminal.

[0106] For the server, the server receives a fifth release message sent by the application terminal, wherein the subject of the fifth release message carries third information, which is used to indicate the content types supported by the updated application terminal; and the server sends a sixth release message to the cloud device, wherein the subject of the sixth release message carries fourth information, which is used to indicate the content types supported by the updated application terminal.

[0107] For the cloud device, it receives a sixth publication message from the server. The subject of this sixth publication message carries fourth information, which indicates the updated content types supported by the application terminal. The cloud device also updates its records of supported content types for the application terminal.

[0108] In other words, if the content types supported by the application terminal change, the application terminal can initiate a process to update the content types it supports, so that the cloud device can accurately know the content types supported by the application.

[0109] Therefore, in this embodiment, the application terminal can report the content types it supports to the server, and the cloud device can learn about the content types supported by the application terminal through the server, as well as generate the content in the payload of the published message based on the content types supported by the application terminal, thereby ensuring that the application terminal can correctly parse the content in the payload of the published message.

[0110] The communication scheme based on the MQTT protocol of this application is described in detail below through Examples 1 to 3.

[0111] In Example 1, the server (Broker) is a functional unit of the cloud device. Therefore, there is an internal interface (non-MQTT communication mechanism) between the server and the cloud device. The specific process can be as follows: Figure 2 S11-S18.

[0112] S11, the application terminal sends an MQTT connection message to the server. The structure of the fixed header of the MQTT connection message can be as shown in Table 1 above. In the fixed header of the MQTT connection message, bits 0-3 are reserved bits. The application terminal uses bits 0-1 to indicate the content types supported by the application terminal. Specifically, 00 represents JSON and 01 represents TLV.

[0113] S12, cloud devices obtain MQTT connection messages through the internal interface between the cloud device and the application terminal.

[0114] S13, the cloud device learns the content types supported by the application terminal based on the reserved bits 0-1 in the fixed header of the MQTT connection message, and records the content types supported by the application terminal and the identifier of the application terminal.

[0115] S14, the server sends an MQTT connection confirmation message to the application terminal. The structure of the fixed header of the MQTT connection confirmation message can be as shown in Table 2 above. In the fixed header of the MQTT connection confirmation message, bits 0-3 are reserved bits. The server uses bits 0-1 to indicate the content types supported by the application terminal. Specifically, 00 represents JSON and 01 represents TLV.

[0116] In other words, the server returns an MQTT connection acknowledgment message to the application device, and the same content type as in S11 is carried in the same positions (bit0-bit1) of the reserved bits (bit0-bit3) in the fixed header of the MQTT connection acknowledgment message.

[0117] S15, when a cloud device needs to send a publish message to an application terminal, it generates a publish message of the corresponding content type based on the recorded information for the application terminal.

[0118] S16, the cloud device sends a Publish message to the server, wherein the content type of the Publish message payload belongs to the content type supported by the application terminal.

[0119] S17, the application terminal sends a subscription message to the server.

[0120] S18, in response to the subscription message, the server sends the Publish message received from the cloud device to the application terminal.

[0121] In Example 2, both the application terminal (Device) and the cloud device (Cloud) act as MQTT clients interacting with the server (Broker). The specific process can be as follows: Figure 3 S21-S28.

[0122] S21, the cloud device sends subscription message 1 (Subscribe:ucc / content / #) to the server. This subscription message 1 is used to subscribe to messages whose topic includes a content type. That is, the messages subscribed to by subscription message 1 either carry a topic including a content type or a topic registration message, where the topic registration message is a message whose topic includes a content type. For example, subscription message 1 is used to subscribe to a specific topic, which can be just a message type (keyword). For example, subscribing to ucc / content / # indicates that messages requiring content type reporting are needed. # can directly match any content that follows it.

[0123] S22, the application terminal sends publish message 1 to the server. The subject of publish message 1 may be:

[0124] content / [deviceid] / contenttypeid;

[0125] Here, "content" indicates that the topic carries a content type, allowing the cloud device to determine the purpose and meaning of the first published message. "[deviceid]" represents the device identifier of the device sending the first published message, i.e., the identifier of the application terminal. "contenttypeid" represents the type identifier of the content type carried by the topic; for example, 0 indicates TLV, and 1 indicates JSON. The QoS of this first published message is 1 or 2. This ensures that the cloud device can receive the first published message.

[0126] S23, the server sends the published message 1 to the cloud device.

[0127] S24, the cloud device learns the content types supported by the application terminal based on the topic of the published message 1, and records the content types supported by the application terminal and the identifier of the application terminal.

[0128] S25, when the cloud device needs to send a publishing message to the application terminal, it generates a publishing message 2 with corresponding content type based on the recorded information for the application terminal.

[0129] S26, the cloud device sends a publishing message 2 to the server, wherein the content type of the payload of the publishing message 2 belongs to the content type supported by the application terminal.

[0130] S27, the application terminal sends subscription message 2 to the server.

[0131] S28, in response to subscription message 2, the server forwards the publish message 2 received from the cloud device to the application terminal.

[0132] Optionally, in embodiment 2, the cloud device and the server should confirm that the deviceID in the topic of publishing message 1 should be the ID of the device that issued the publishing message 1, that is, the deviceID in the topic of the publishing message 1 should be the identifier of the application terminal; the application terminal can also republish the topic to re-register its supported content types. After receiving the change message, the cloud device should update the application terminal's content type registry and refresh the application terminal's content type.

[0133] Optionally, in embodiment 2, the cloud device can generate multiple MQTT clients, each subscribing to different content type notification messages, so that publishing can be accomplished through different MQTT clients in the future.

[0134] In Example 3, both the application terminal (Device) and the cloud device (Cloud) act as MQTT clients interacting with the server (Broker). The specific process can be as follows: Figure 4 S3-1 to S3-11.

[0135] S3-1, the cloud device sends subscription message 1 (Subscribe:ucc / content / #) to the server. This subscription message 1 is used to subscribe to messages whose topic includes a content type. That is, the messages subscribed to by subscription message 1 either carry a topic including a content type or a topic registration message, where the topic registration message is a message whose topic includes a content type. For example, subscription message 1 is used to subscribe to a specific topic, which can be just a message type (keyword). For example, subscribing to ucc / content / # indicates that messages requiring content type reporting are needed. # can directly match any content that follows it.

[0136] S3-2, The application terminal sends publish message 1 to the server. The subject of publish message 1 can be:

[0137] content / [deviceid] / contenttypeid;

[0138] Here, "content" indicates that the topic carries a content type, allowing the cloud device to determine the purpose and meaning of the first published message. "[deviceid]" represents the device identifier of the device sending the first published message, i.e., the identifier of the application terminal. "contenttypeid" represents the type identifier of the content type carried by the topic; for example, 0 indicates TLV, and 1 indicates JSON. The QoS of this first published message is 1 or 2. This ensures that the cloud device can receive the first published message.

[0139] Optionally, the payload of the published message 1 can be empty.

[0140] S3-3, the server forwards the published message 1 to the cloud device.

[0141] S3-4, the application terminal sends a subscription message 2 (Subscribe: topic:ucc / contentack / deviceid / #) to the server. This subscription message 2 is used to subscribe to the target topic, which includes at least content confirmation information and the identifier of the application terminal. "deviceid" is to prevent other devices from being notified, and "contentack" indicates that the cloud device has received the above first publication message.

[0142] S3-5, the cloud device sends a publishing message 2 to the server. The subject of publishing message 2 includes at least one of the following: content confirmation information, the identifier of the application terminal, and the content type identifier. For example, publishing message 2 could specifically be Publish: topic:ucc / contentack / [deviceid] / contenttypeid.

[0143] Optionally, the subject of the post message 2 may also include the identifier of the cloud device.

[0144] Optionally, the payload of the published message 2 can be empty.

[0145] In step S3-6, the server sends the published message 2 received from the cloud device to the application terminal. Thus, the application terminal can be informed that the cloud device has received its notification of a message supporting the content type.

[0146] S3-7, the cloud device learns the content types supported by the application terminal based on the topic of the published message 1, and records the content types supported by the application terminal and the identifier of the application terminal.

[0147] S3-8 When a cloud device needs to send a publishing message to an application terminal, it generates a publishing message 3 with the corresponding content type based on the recorded information for the application terminal.

[0148] S3-9, the cloud device sends a publishing message 3 to the server, wherein the content type of the payload of the publishing message 3 belongs to the content type supported by the application terminal.

[0149] S3-10, the application terminal sends a subscription message 3 to the server.

[0150] S3-11, in response to subscription message 3, the server sends the publish message 3 received from the cloud device to the application terminal.

[0151] Optionally, in embodiment 3, the cloud device and the server should confirm that the deviceID in the topic of publishing message 1 should be the ID of the device that issued the publishing message 1, that is, the deviceID in the topic of the publishing message 1 should be the identifier of the application terminal; the application terminal can also republish the topic to re-register its supported content types. After receiving the change message, the cloud device should update the application terminal's content type registry and refresh the application terminal's content type.

[0152] Optionally, in embodiment 3, the cloud device can generate multiple MQTT clients, each subscribing to different content type notification messages, so that publishing can be accomplished through different MQTT clients in the future.

[0153] It should be understood that the above Figures 2 to 4 The examples shown are intended to help those skilled in the art better understand the embodiments of this application, and are not intended to limit the scope of the embodiments of this application. Those skilled in the art should refer to the examples provided... Figures 2 to 4 It is obvious that various equivalent modifications or changes can be made, and such modifications or changes also fall within the scope of the embodiments of this application.

[0154] The above text combined Figures 1 to 4 The method embodiments of this application are described in detail below, in conjunction with... Figures 5 to 10 The present application describes the device embodiments in detail. It should be understood that the device embodiments correspond to the method embodiments, and similar descriptions can be referred to the method embodiments.

[0155] Figure 5 A schematic block diagram of a server 200 according to an embodiment of this application is shown. Figure 5 As shown, the server 200 includes:

[0156] The communication unit 210 is used to receive first information sent by the application terminal, the first information being used to indicate the content types supported by the application terminal.

[0157] Optionally, the first information occupies at least one reserved bit in the fixed header of the MQTT connection message.

[0158] Optionally, the communication unit 210 is also used to send the MQTT connection message to the cloud device.

[0159] Optionally, the communication unit 210 is also used to send an MQTT connection confirmation message to the application terminal.

[0160] Optionally, the MQTT connection acknowledgment message carries second information, which indicates the content types supported by the application terminal.

[0161] Optionally, the second information occupies at least one reserved bit in the fixed header of the MQTT connection confirmation message, and the bit position occupied by the second information is the same as the bit position occupied by the first information.

[0162] Optionally, this first information is carried in the subject of the first published message.

[0163] Optionally, the subject of the first published message may also include at least one of the following:

[0164] The identifier of the application terminal;

[0165] Content information is used to indicate that the subject of the first published message is a subject carrying information indicating the content types supported by the application terminal.

[0166] Optionally, the payload of the first published message is empty.

[0167] Optionally, the Quality of Service (QoS) of the first published message is 1 or 2.

[0168] Optionally, the communication unit 210 is further configured to receive a first subscription message sent by a cloud device, wherein the first subscription message is used to subscribe to a message whose topic contains a content type message;

[0169] In response to the first subscription message, the communication unit 210 is also configured to send the first publication message to the cloud device.

[0170] Optionally, the communication unit 210 is further configured to receive a second subscription message sent by the application terminal, the second subscription message being used to subscribe to a target topic, the target topic including at least content confirmation information and the identifier of the application terminal;

[0171] In response to the second subscription message, the communication unit 210 is also configured to send a second publishing message to the application terminal, the subject of which includes at least one of the following: content confirmation information, the identifier of the application terminal, and content type identifier.

[0172] Optionally, the payload of the second published message is empty.

[0173] Optionally, before the server sends the second publishing message to the application terminal, the communication unit 210 is also used to receive a third publishing message sent by the cloud device. The subject of the third publishing message includes at least one of the following: content confirmation information, the identifier of the application terminal, the content type identifier, and the identifier of the cloud device.

[0174] Optionally, the payload of the third published message is empty.

[0175] Optionally, the communication unit 210 is also used to receive a fourth publishing message sent by a cloud device, wherein the content type of the payload of the fourth publishing message belongs to the content type supported by the application terminal.

[0176] Optionally, the communication unit 210 is also used to receive a third subscription message sent by the application terminal;

[0177] In response to the third subscription message, the communication unit 210 is also configured to send the fourth publication message to the application terminal.

[0178] Optionally, the communication unit 210 is further configured to receive a fifth release message sent by the application terminal, wherein the subject of the fifth release message carries third information, which is used to indicate the content types supported by the updated application terminal.

[0179] The communication unit 210 is also used to send a sixth release message to a cloud device. The subject of the sixth release message carries fourth information, which is used to indicate the content types supported by the updated application terminal.

[0180] Optionally, in some embodiments, the communication unit may be a communication interface or transceiver, or an input / output interface of a communication chip or system-on-a-chip.

[0181] It should be understood that the server 200 according to the embodiments of this application may correspond to the server in the method embodiments of this application, and the above and other operations and / or functions of each unit in the server 200 are respectively for implementing Figure 1 The corresponding server process in method 100 shown will not be elaborated here for the sake of brevity.

[0182] Figure 6 A schematic block diagram of an application terminal 300 according to an embodiment of this application is shown. Figure 6 As shown, the application terminal 300 includes:

[0183] The communication unit 310 is used to send first information to the server, the first information being used to indicate the content types supported by the application terminal.

[0184] Optionally, the first information occupies at least one reserved bit in the fixed header of the MQTT connection message.

[0185] Optionally, the communication unit 310 is also used to receive MQTT connection confirmation messages sent by the server.

[0186] Optionally, the MQTT connection acknowledgment message carries second information, which indicates the content types supported by the application terminal.

[0187] Optionally, the second information occupies at least one reserved bit in the fixed header of the MQTT connection confirmation message, and the bit position occupied by the second information is the same as the bit position occupied by the first information.

[0188] Optionally, this first information is carried in the subject of the first published message.

[0189] Optionally, the subject of the first published message may also include at least one of the following:

[0190] The identifier of the application terminal;

[0191] Content information is used to indicate that the subject of the first published message is a subject carrying information indicating the content types supported by the application terminal.

[0192] Optionally, the payload of the first published message is empty.

[0193] Optionally, the Quality of Service (QoS) of the first published message is 1 or 2.

[0194] Optionally, the communication unit 310 is further configured to send a second subscription message to the server, the second subscription message being used to subscribe to a target topic, the target topic including at least content confirmation information and the identifier of the application terminal;

[0195] The communication unit 310 is also used to receive a second publishing message sent by the server, the subject of which includes at least one of the following: content confirmation information, the identifier of the application terminal, and the content type identifier.

[0196] Optionally, the payload of the second published message is empty.

[0197] Optionally, the communication unit 310 is also used to send a third subscription message to the server;

[0198] The communication unit 310 is also used to receive a fourth publishing message sent by the server, wherein the content type of the payload of the fourth publishing message belongs to the content type supported by the application terminal.

[0199] Optionally, if the content types supported by the application terminal change, the communication unit 310 is further configured to send a fifth release message to the server, wherein the subject of the fifth release message carries third information, which is used to indicate the updated content types supported by the application terminal.

[0200] Optionally, in some embodiments, the communication unit may be a communication interface or transceiver, or an input / output interface of a communication chip or system-on-a-chip.

[0201] It should be understood that the application terminal 300 according to the embodiments of this application may correspond to the application terminal in the method embodiments of this application, and the above and other operations and / or functions of each unit in the application terminal 300 are respectively for implementing Figure 1 The corresponding process of the application terminal in method 100 shown will not be described in detail here for the sake of brevity.

[0202] Figure 7 A schematic block diagram of a cloud device 400 according to an embodiment of this application is shown. Figure 6 As shown, the cloud device 400 includes:

[0203] The communication unit 410 is used to obtain the content types supported by the application terminal from the server.

[0204] Optionally, the communication unit 410 is specifically used for:

[0205] The application terminal obtains an MQTT connection message through an internal interface with the server. The MQTT connection message carries first information, which indicates the content types supported by the application terminal.

[0206] Optionally, the first information occupies at least one reserved bit in the fixed header of the MQTT connection message.

[0207] Optionally, the communication unit 410 is specifically used for:

[0208] Send a first subscription message to the server, wherein the first subscription message is used to subscribe to messages whose topics contain content type messages;

[0209] The application terminal receives a first publication message sent by the server. The subject of the first publication message carries first information, which is used to indicate the content types supported by the application terminal.

[0210] Optionally, the subject of the first published message may also include at least one of the following:

[0211] The identifier of the application terminal;

[0212] Content information is used to indicate that the subject of the first published message is a subject carrying information indicating the content types supported by the application terminal.

[0213] Optionally, the payload of the first published message is empty.

[0214] Optionally, the Quality of Service (QoS) of the first published message is 1 or 2.

[0215] Optionally, the communication unit 410 is also configured to send a third publishing message to the server, the subject of which includes at least one of the following: content confirmation information, the identifier of the application terminal, the content type identifier, and the identifier of the cloud device.

[0216] Optionally, the payload of the third published message is empty.

[0217] Optionally, the communication unit 410 is further configured to send a fourth publishing message to the server according to the content type supported by the application terminal, wherein the content type of the payload of the fourth publishing message belongs to the content type supported by the application terminal.

[0218] Optionally, the communication unit 410 is also configured to receive a sixth publication message sent by the server, the subject of which carries fourth information, which is used to indicate the content types supported by the updated application terminal.

[0219] Optionally, in some embodiments, the communication unit may be a communication interface or transceiver, or an input / output interface of a communication chip or system-on-a-chip.

[0220] It should be understood that the cloud device 400 according to the embodiments of this application may correspond to the cloud device in the method embodiments of this application, and the above and other operations and / or functions of each unit in the cloud device 400 are respectively for implementing Figure 1 The corresponding processes for cloud devices in method 100 shown will not be elaborated here for the sake of brevity.

[0221] Figure 8 This is a schematic structural diagram of a communication device 500 provided in an embodiment of this application. Figure 8 The communication device 500 shown includes a processor 510, which can call and run computer programs from memory to implement the methods in the embodiments of this application.

[0222] Optionally, such as Figure 8 As shown, the communication device 500 may further include a memory 520. The processor 510 can retrieve and run computer programs from the memory 520 to implement the methods described in this embodiment.

[0223] The memory 520 can be a separate device independent of the processor 510, or it can be integrated into the processor 510.

[0224] Optionally, such as Figure 8 As shown, the communication device 500 may also include a transceiver 530, and the processor 510 may control the transceiver 530 to communicate with other devices. Specifically, it may send information or data to other devices or receive information or data sent by other devices.

[0225] The transceiver 530 may include a transmitter and a receiver. The transceiver 530 may further include antennas, and the number of antennas may be one or more.

[0226] Optionally, the communication device 500 may specifically be an application terminal in the embodiments of this application, and the communication device 500 may implement the corresponding processes implemented by the application terminal in the various methods of the embodiments of this application. For the sake of brevity, it will not be described in detail here.

[0227] Optionally, the communication device 500 may specifically be a server in the embodiments of this application, and the communication device 500 may implement the corresponding processes implemented by the server in the various methods of the embodiments of this application. For the sake of brevity, it will not be described in detail here.

[0228] Optionally, the communication device 500 may specifically be a cloud device in the embodiments of this application, and the communication device 500 may implement the corresponding processes implemented by the cloud device in the various methods of the embodiments of this application. For the sake of brevity, it will not be described in detail here.

[0229] Figure 9 This is a schematic structural diagram of the device according to an embodiment of this application. Figure 9 The illustrated device 600 includes a processor 610, which can call and run computer programs from memory to implement the methods in the embodiments of this application.

[0230] Optionally, such as Figure 9 As shown, the device 600 may further include a memory 620. The processor 610 can retrieve and run computer programs from the memory 620 to implement the methods described in the embodiments of this application.

[0231] The memory 620 can be a separate device independent of the processor 610, or it can be integrated into the processor 610.

[0232] Optionally, the device 600 may further include an input interface 630. The processor 610 can control the input interface 630 to communicate with other devices or chips; specifically, it can acquire information or data sent by other devices or chips.

[0233] Optionally, the device 600 may further include an output interface 640. The processor 610 can control the output interface 640 to communicate with other devices or chips; specifically, it can output information or data to other devices or chips.

[0234] Optionally, the device can be applied to the application terminal in the embodiments of this application, and the device can implement the corresponding processes implemented by the application terminal in the various methods of the embodiments of this application. For the sake of brevity, it will not be described in detail here.

[0235] Optionally, the device can be applied to the server in the embodiments of this application, and the device can implement the corresponding processes implemented by the server in the various methods of the embodiments of this application. For the sake of brevity, it will not be described in detail here.

[0236] Optionally, the device can be applied to the cloud device in the embodiments of this application, and the device can implement the corresponding processes implemented by the cloud device in the various methods of the embodiments of this application. For the sake of brevity, it will not be described in detail here.

[0237] Optionally, the device mentioned in the embodiments of this application can also be a chip. For example, it can be a system-on-a-chip, a system-on-a-chip, a chip system, or a system-on-a-chip, etc.

[0238] Figure 10 This is a schematic block diagram of a communication system 700 provided in an embodiment of this application. Figure 10 As shown, the communication system 700 includes an application terminal 710, a server 720, and a cloud device 730.

[0239] The application terminal 710 can be used to implement the corresponding functions implemented by the application terminal in the above method, the server 720 can be used to implement the corresponding functions implemented by the server in the above method, and the cloud device 730 can be used to implement the corresponding functions implemented by the cloud device in the above method. For the sake of brevity, they will not be described in detail here.

[0240] It should be understood that the processor in the embodiments of this application may be an integrated circuit chip with signal processing capabilities. In implementation, the steps of the above method embodiments can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor described above can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.

[0241] It is understood that the memory in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DR RAM). It should be noted that the memory used in the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0242] It should be understood that the above-described memory is exemplary and not a limiting description. For example, the memory in the embodiments of this application may also be static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DR RAM), etc. That is to say, the memory in the embodiments of this application is intended to include, but is not limited to, these and any other suitable types of memory.

[0243] This application also provides a computer-readable storage medium for storing computer programs.

[0244] Optionally, the computer-readable storage medium can be applied to the application terminal in the embodiments of this application, and the computer program causes the computer to execute the corresponding processes implemented by the application terminal in the various methods of the embodiments of this application. For the sake of brevity, it will not be described in detail here.

[0245] Optionally, the computer-readable storage medium can be applied to the server in the embodiments of this application, and the computer program causes the computer to execute the corresponding processes implemented by the server in the various methods of the embodiments of this application. For the sake of brevity, it will not be described in detail here.

[0246] Optionally, the computer-readable storage medium can be applied to the cloud device in the embodiments of this application, and the computer program causes the computer to execute the corresponding processes implemented by the cloud device in the various methods of the embodiments of this application. For the sake of brevity, it will not be described in detail here.

[0247] This application also provides a computer program product, including computer program instructions.

[0248] Optionally, the computer program product can be applied to the application terminal in the embodiments of this application, and the computer program instructions cause the computer to execute the corresponding processes implemented by the application terminal in the various methods of the embodiments of this application. For the sake of brevity, they will not be described in detail here.

[0249] Optionally, the computer program product can be applied to the server in the embodiments of this application, and the computer program instructions cause the computer to execute the corresponding processes implemented by the server in the various methods of the embodiments of this application. For the sake of brevity, they will not be described in detail here.

[0250] Optionally, the computer program product can be applied to the cloud device in the embodiments of this application, and the computer program instructions cause the computer to execute the corresponding processes implemented by the cloud device in the various methods of the embodiments of this application. For the sake of brevity, it will not be described in detail here.

[0251] This application also provides a computer program.

[0252] Optionally, the computer program can be applied to the application terminal in the embodiments of this application. When the computer program is run on the computer, it causes the computer to execute the corresponding processes implemented by the application terminal in the various methods of the embodiments of this application. For the sake of brevity, it will not be described in detail here.

[0253] Optionally, the computer program can be applied to the server in the embodiments of this application. When the computer program is run on the computer, it causes the computer to execute the corresponding processes implemented by the server in the various methods of the embodiments of this application. For the sake of brevity, it will not be described in detail here.

[0254] Optionally, the computer program can be applied to the cloud device in the embodiments of this application. When the computer program is run on the computer, it causes the computer to execute the corresponding processes implemented by the cloud device in the various methods of the embodiments of this application. For the sake of brevity, it will not be described in detail here.

[0255] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0256] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0257] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0258] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0259] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0260] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0261] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A communication method based on the MQTT protocol, characterized in that, include: The server receives first information sent by the application terminal, the first information being used to indicate the content types supported by the application terminal; The first information occupies at least one reserved bit in the fixed header of the MQTT connection message, or the first information is carried in the subject of the first published message.

2. The method as described in claim 1, characterized in that, The method further includes: The server sends the MQTT connection message to the cloud device.

3. The method as described in claim 1, characterized in that, The method further includes: The server sends an MQTT connection confirmation message to the application terminal.

4. The method as described in claim 3, characterized in that, The MQTT connection confirmation message carries second information, which is used to indicate the content types supported by the application terminal.

5. The method as described in claim 4, characterized in that, The second information occupies at least one reserved bit in the fixed header of the MQTT connection confirmation message, and the bit position occupied by the second information is the same as the bit position occupied by the first information.

6. The method as described in claim 1, characterized in that, The subject of the first published message also includes at least one of the following: The identifier of the application terminal; Content information is used to indicate that the subject of the first published message is a subject carrying information indicating the content types supported by the application terminal.

7. The method as described in claim 1, characterized in that, The payload of the first published message is empty.

8. The method as described in claim 1, characterized in that, The Quality of Service (QoS) of the first published message is 1 or 2.

9. The method as described in claim 1, characterized in that, The method further includes: The server receives a first subscription message sent by a cloud device, wherein the first subscription message is used to subscribe to messages whose topics include content type messages; In response to the first subscription message, the server sends the first publish message to the cloud device.

10. The method as described in claim 1, characterized in that, The method further includes: The server receives a second subscription message sent by the application terminal. The second subscription message is used to subscribe to a target topic. The target topic includes at least content confirmation information and the identifier of the application terminal. In response to the second subscription message, the server sends a second publishing message to the application terminal. The subject of the second publishing message includes at least one of the following: content confirmation information, the identifier of the application terminal, and the content type identifier.

11. The method as described in claim 10, characterized in that, The payload of the second published message is empty.

12. The method as described in claim 10, characterized in that, Before the server sends the second publishing message to the application terminal, the method further includes: The server receives a third release message sent by a cloud device. The subject of the third release message includes at least one of the following: content confirmation information, the identifier of the application terminal, the content type identifier, and the identifier of the cloud device.

13. The method as described in claim 12, characterized in that, The payload of the third published message is empty.

14. The method as described in claim 1, characterized in that, The method further includes: The server receives a fourth release message sent by the cloud device, and the content type of the payload of the fourth release message belongs to the content type supported by the application terminal.

15. The method as described in claim 14, characterized in that, The method further includes: The server receives a third subscription message sent by the application terminal; In response to the third subscription message, the server sends the fourth publish message to the application terminal.

16. The method as described in claim 1, characterized in that, The method further includes: The server receives a fifth publishing message sent by the application terminal, wherein the subject of the fifth publishing message carries third information, which is used to indicate the content types supported by the updated application terminal; The server sends a sixth release message to the cloud device. The subject of the sixth release message carries fourth information, which is used to indicate the content types supported by the updated application terminal.

17. A communication method based on the MQTT protocol, characterized in that, include: The application terminal sends first information to the server, the first information being used to indicate the content types supported by the application terminal; The first information occupies at least one reserved bit in the fixed header of the MQTT connection message, or the first information is carried in the subject of the first published message.

18. The method as described in claim 17, characterized in that, The method further includes: The application terminal receives an MQTT connection confirmation message sent by the server.

19. The method as described in claim 18, characterized in that, The MQTT connection confirmation message carries second information, which is used to indicate the content types supported by the application terminal.

20. The method as described in claim 19, characterized in that, The second information occupies at least one reserved bit in the fixed header of the MQTT connection confirmation message, and the bit position occupied by the second information is the same as the bit position occupied by the first information.

21. The method as described in claim 17, characterized in that, The subject of the first published message also includes at least one of the following: The identifier of the application terminal; Content information is used to indicate that the subject of the first published message is a subject carrying information indicating the content types supported by the application terminal.

22. The method as described in claim 17, characterized in that, The payload of the first published message is empty.

23. The method as described in claim 17, characterized in that, The Quality of Service (QoS) of the first published message is 1 or 2.

24. The method as described in claim 17, characterized in that, The method further includes: The application terminal sends a second subscription message to the server. The second subscription message is used to subscribe to a target topic. The target topic includes at least content confirmation information and the identifier of the application terminal. The application terminal receives a second publishing message sent by the server. The subject of the second publishing message includes at least one of the following: content confirmation information, the identifier of the application terminal, and content type identifier.

25. The method as described in claim 24, characterized in that, The payload of the second published message is empty.

26. The method as described in claim 17, characterized in that, The method further includes: The application terminal sends a third subscription message to the server; The application terminal receives a fourth publishing message sent by the server, and the content type of the payload of the fourth publishing message belongs to the content type supported by the application terminal.

27. The method as described in claim 17, characterized in that, The method further includes: When the content types supported by the application terminal change, the application terminal sends a fifth release message to the server, wherein the subject of the fifth release message carries third information, which is used to indicate the updated content types supported by the application terminal.

28. A communication method based on the MQTT protocol, characterized in that, include: Cloud devices obtain the content types supported by the application terminal from the server; The cloud device obtains the content types supported by the application terminal from the server, including: The cloud device obtains MQTT connection messages through an internal interface with the server, wherein the MQTT connection messages carry first information, which indicates the content types supported by the application terminal; or The cloud device receives a first publishing message sent by the server. The subject of the first publishing message carries first information, which is used to indicate the content types supported by the application terminal.

29. The method as described in claim 28, characterized in that, The first information occupies at least one reserved bit in the fixed header of the MQTT connection message.

30. The method as described in claim 28, characterized in that, Before the cloud device receives the first publication message sent by the server, the method further includes: The cloud device sends a first subscription message to the server, wherein the first subscription message is used to subscribe to messages whose topics contain content type messages.

31. The method as described in claim 28, characterized in that, The subject of the first published message also includes at least one of the following: The identifier of the application terminal; Content information is used to indicate that the subject of the first published message is a subject carrying information indicating the content types supported by the application terminal.

32. The method as described in claim 28, characterized in that, The payload of the first published message is empty.

33. The method as described in claim 28, characterized in that, The Quality of Service (QoS) of the first published message is 1 or 2.

34. The method as described in claim 28, characterized in that, The method further includes: The cloud device sends a third release message to the server. The subject of the third release message includes at least one of the following: content confirmation information, the identifier of the application terminal, the content type identifier, and the identifier of the cloud device.

35. The method as described in claim 34, characterized in that, The payload of the third published message is empty.

36. The method as described in claim 28, characterized in that, The method further includes: The cloud device sends a fourth release message to the server based on the content type supported by the application terminal, wherein the content type of the payload of the fourth release message belongs to the content type supported by the application terminal.

37. The method as described in claim 28, characterized in that, The method further includes: The cloud device receives a sixth release message sent by the server. The subject of the sixth release message carries fourth information, which is used to indicate the content types supported by the updated application terminal.

38. A server, characterized in that, include: A communication unit is configured to receive first information sent by an application terminal, wherein the first information is used to indicate the content types supported by the application terminal. The first information occupies at least one reserved bit in the fixed header of the MQTT connection message, or the first information is carried in the subject of the first published message.

39. An application terminal, characterized in that, include: A communication unit is used to send first information to the server, wherein the first information is used to indicate the content types supported by the application terminal; The first information occupies at least one reserved bit in the fixed header of the MQTT connection message, or the first information is carried in the subject of the first published message.

40. A cloud device, characterized in that, include: The communication unit is used to obtain the content types supported by the application terminal from the server. Specifically, the communication unit is used for: MQTT connection messages are obtained through an internal interface with the server, wherein the MQTT connection messages carry first information, which indicates the content types supported by the application terminal; or The application terminal receives a first publishing message sent by the server. The subject of the first publishing message carries first information, which is used to indicate the content types supported by the application terminal.

41. A server, characterized in that, include: A processor and a memory for storing a computer program, the processor for calling and running the computer program stored in the memory to perform the method as described in any one of claims 1 to 16.

42. An application terminal, characterized in that, include: A processor and a memory for storing a computer program, the processor for calling and running the computer program stored in the memory to perform the method as described in any one of claims 17 to 27.

43. A cloud device, characterized in that, include: A processor and a memory for storing a computer program, the processor for calling and running the computer program stored in the memory to perform the method as described in any one of claims 28 to 37.

44. A chip, characterized in that, include: A processor for retrieving and running a computer program from memory, causing a device on which the chip is mounted to perform the method as described in any one of claims 1 to 16.

45. A chip, characterized in that, Includes: a processor for retrieving and running a computer program from memory, causing a device on which the chip is mounted to perform the method as described in any one of claims 17 to 27.

46. ​​A chip, characterized in that, include: A processor for retrieving and running a computer program from memory, causing a device on which the chip is mounted to perform the method as described in any one of claims 28 to 37.

47. A computer-readable storage medium, characterized in that, Used to store a computer program that causes a computer to perform the method as described in any one of claims 1 to 16.

48. A computer-readable storage medium, characterized in that, Used to store a computer program that causes a computer to perform the method as described in any one of claims 17 to 27.

49. A computer-readable storage medium, characterized in that, Used to store a computer program that causes a computer to perform the method as described in any one of claims 28 to 37.

50. A computer program product, characterized in that, It includes computer program instructions that cause a computer to perform the method as described in any one of claims 1 to 16.

51. A computer program product, characterized in that, It includes computer program instructions that cause a computer to perform the method as described in any one of claims 17 to 27.

52. A computer program product, characterized in that, It includes computer program instructions that cause a computer to perform the method as described in any one of claims 28 to 37.

Citation Information

Patent Citations

  • Data transmission method, electronic device and server

    CN103825912A

  • Communication method

    CN106878446A