System, method and device for adapting to MQTT communication specification of cloud platform

By introducing a system that adapts to the cloud platform MQTT communication specifications into the industrial data monitoring cloud platform, the problem of increasing development costs caused by the differences in the specifications of different cloud platforms is solved, efficient adaptation and data interaction with multiple cloud platforms is achieved, and development costs are reduced.

CN119629253AInactive Publication Date: 2025-03-14DONGTU TECH (YICHANG) CO LTD

Patent Information

Application Number
CN202411386842.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2025-03-14
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the data monitoring cloud platform in the industrial field, different cloud platforms adopt different data specifications and MQTT interaction processes, resulting in the need to develop and maintain proprietary docking software for each platform, increasing development costs.

Method used

A system that adapts to the MQTT communication specifications of the cloud platform is proposed, including the MQTT protocol basic service module, process interaction module and data interaction module. By receiving target parameters configured by users, custom process entries and trigger conditions, the data and message format of the cloud platform are defined to achieve adaptation with different cloud platforms.

Benefits of technology

The system can automatically perform data interaction actions, reducing the need to develop docking software separately for each cloud platform, greatly reducing the software development cost, and improving the system's adaptability and flexibility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119629253A_ABST
    Figure CN119629253A_ABST
Patent Text Reader

Abstract

The invention discloses a system, method and device for adapting to a cloud platform MQTT communication specification, and belongs to the technical field of communication. The system comprises an MQTT protocol basic service module which is used for receiving target parameters which are configured by a user and are related to an MQTT protocol, and establishing connection with a cloud platform according to the target parameters; the process interaction module is used for receiving process entries set by a user and trigger conditions of the process entries; under the condition that the triggering condition is met, executing the process entry; the process entries represent data interaction actions with the cloud platform; and the data interaction module is used for determining a data format and a message format used by the cloud platform, and forming interaction data based on the data format and the message format to perform data interaction with the cloud platform in the process of executing the flow entries. According to the method, the system has the capability of adapting to different cloud platforms, only configuration parameters need to be modified for the cloud platforms of MQTT protocols of different specifications, docking software does not need to be independently developed for each cloud platform, and the development cost of the software is greatly reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of communication technology, and in particular, relates to a system, method and device adapted to the MQTT communication specification of a cloud platform. Background Art

[0002] In the industrial field, the data monitoring cloud platform is a key technology for remote monitoring and management of the work site. In related technologies, it is necessary to collect the work site data through data acquisition equipment and use the MQTT (Message Queuing Telemetry Transport) protocol to transmit the work site data to the cloud platform.

[0003] In some scenarios, enterprises may use multiple cloud platforms to store and process job site data. However, different cloud platforms may use different data specifications and MQTT interaction processes, which means that when connecting to different cloud platforms, it is necessary to develop and maintain proprietary docking software for each platform, thereby increasing development costs. Summary of the invention

[0004] The present application aims to solve at least one of the technical problems existing in the prior art. To this end, the present application proposes a system, method and device for adapting to the MQTT communication specification of the cloud platform to adapt to different cloud platforms and reduce development costs.

[0005] In a first aspect, the present application provides a system adapted to the cloud platform MQTT communication specification, including:

[0006] The MQTT protocol basic service module is used to receive the target parameters related to the MQTT protocol configured by the user, and establish a connection with the cloud platform according to the target parameters;

[0007] A process interaction module, configured to receive a process entry set by a user and a trigger condition of the process entry; and execute the process entry when the trigger condition is met; the process entry represents a data interaction action with the cloud platform;

[0008] The data interaction module is used to determine the data format and message format used by the cloud platform, and in the process of executing the process entry, form interactive data based on the data format and the message format to interact with the cloud platform.

[0009] According to the system adapted to the MQTT communication specification of the cloud platform of the present application, the MQTT protocol basic service module receives the MQTT-related target parameters configured by the user, and establishes a connection with the cloud platform based on these parameters. The process interaction module allows the user to customize process entries and trigger conditions, so that the system can automatically execute data interaction actions when specific conditions are met. The data interaction module defines the data and message format of the cloud platform, and forms interactive data accordingly to complete data interaction with the cloud platform, thereby enabling the system to have the ability to adapt to different cloud platforms. For cloud platforms with MQTT protocols with different specifications, only the configuration parameters need to be modified, and there is no need to develop docking software for each cloud platform separately, which greatly reduces the software development cost.

[0010] According to one embodiment of the present application, the target parameters include connection parameters with the cloud platform, the subject of interaction with the cloud platform, and the subject of data point message interaction; wherein the data point is data collected by a data acquisition device.

[0011] In this embodiment, by providing a flexible adaptation layer, the user is allowed to configure parameters related to the MQTT protocol, such as connection parameters, interaction topics, and data point message interaction topics, so that the same system can be used to connect to different cloud platforms without the need to develop and maintain proprietary connection software for each cloud platform.

[0012] According to an embodiment of the present application, the configuration of the subject of the data point message interaction includes passive delivery and static setting;

[0013] In the case where the configuration of the topic of the data point message interaction is passive delivery, after establishing a connection with the cloud platform, receiving a characteristic message sent by the cloud platform, and determining a topic to be subscribed or sent according to the characteristic message;

[0014] In the case where the configuration of the topic of the data point message interaction is a static configuration, before establishing a connection with the cloud platform, the topic that needs to be subscribed or sent is determined.

[0015] In this embodiment, in the passive configuration mode, after the system establishes a connection with the cloud platform, it dynamically determines the topics that need to be subscribed or sent by receiving the characteristic messages sent by the cloud platform, so that the system can flexibly respond to the specific requirements of the cloud platform without knowing the interaction details in advance, thereby improving the adaptability and flexibility of the system. In the static configuration mode, the system has already determined the topics that need to be subscribed or sent before establishing a connection with the cloud platform. This method is suitable for cloud platforms with relatively fixed interaction modes that do not change frequently. Through pre-configuration, the system can quickly start and interact with the cloud platform for data, reducing the configuration overhead at runtime.

[0016] According to an embodiment of the present application, the process entry includes the published message content and the subscription processing method.

[0017] In this embodiment, by breaking down the process items into published message content and subscription processing methods, the system can more accurately manage the data flow between the cloud platform. For the definition of published message content, the data sent to the cloud platform can be made to conform to the expected business logic, which helps to reduce data misunderstandings. For the definition of subscription processing methods, it is convenient for the system to automatically perform corresponding operations when receiving specific messages from the cloud platform, which improves the system's ability to adapt to the data interaction needs of different cloud platforms.

[0018] According to an embodiment of the present application, the process entry includes multiple process entries, and each process entry corresponds to a trigger condition.

[0019] In this embodiment, by setting corresponding trigger conditions for each process entry, the system can support complex logical judgments and process control, making the data processing process more flexible and diversified, and enabling the system to better meet the specific needs of different users and different scenarios, without the need to develop and maintain proprietary docking software for each cloud platform.

[0020] According to an embodiment of the present application, determining the data format and message format used by the cloud platform includes:

[0021] Receiving a data format selected by a user and a message format set by the user in a message format template corresponding to the data format;

[0022] The data format selected by the user and the message format set by the user in the message format template corresponding to the data format are determined as the data format and message format used by the cloud platform.

[0023] In this embodiment, the data interaction specifications used by the cloud platform can be customized by the user selecting a specific data format and setting the message format in the corresponding message format template. The specific details of the data interaction can be determined dynamically and can be flexibly adjusted according to the specific requirements of different cloud platforms, thereby achieving efficient docking with different cloud platforms and reducing the possibility of communication errors and additional debugging work caused by format mismatches.

[0024] According to one embodiment of the present application, the message format template corresponds to a path expression; the path expression is used to describe and access data points in the interaction data; the path expression is represented by jsonPath, Xpath or byte offset.

[0025] In this embodiment, by using path expressions, the system can accurately describe and access data points in the interactive data, so that users can flexibly configure and adjust the specific path of data interaction according to different data format and message format requirements. For cloud platforms with MQTT protocols with different specifications, only the configuration parameters need to be modified, and there is no need to develop docking software separately for each cloud platform, which greatly reduces the software development cost.

[0026] In a second aspect, the present application provides a method for adapting the cloud platform MQTT communication specification, including:

[0027] Receiving target parameters related to the MQTT protocol configured by a user, and receiving a process entry and a triggering condition of the process entry set by the user; the process entry represents a data interaction action with the cloud platform;

[0028] Determine the data format and message format used by the cloud platform

[0029] After establishing a connection with the cloud platform according to the target parameters, if the trigger condition is met, the process entry is executed; wherein, during the execution of the process entry, interactive data is formed based on the data format and the message format to perform data interaction with the cloud platform.

[0030] According to the method of adapting the MQTT communication specification of the cloud platform of the present application, the MQTT protocol basic service module receives the MQTT-related target parameters configured by the user, and establishes a connection with the cloud platform based on these parameters. The process interaction module allows the user to customize the process entries and trigger conditions, so that the system can automatically execute data interaction actions when specific conditions are met. The data interaction module defines the data and message format of the cloud platform, and forms interactive data accordingly to complete the data interaction with the cloud platform, thereby enabling the system to have the ability to adapt to different cloud platforms. For cloud platforms with MQTT protocols with different specifications, only the configuration parameters need to be modified, and there is no need to develop docking software for each cloud platform separately, which greatly reduces the software development cost.

[0031] In a third aspect, the present application provides a device adapted to the cloud platform MQTT communication specification, including:

[0032] A receiving module, configured to receive target parameters related to the MQTT protocol configured by a user, and to receive process items and trigger conditions set by a user; the process items represent data interaction actions with the cloud platform;

[0033] A determination module is used to determine the data format and message format used by the cloud platform

[0034] An execution module is used to execute the process entry if the trigger condition is met after establishing a connection with the cloud platform according to the target parameters; wherein, during the execution of the process entry, interactive data is formed based on the data format and the message format to interact with the cloud platform.

[0035] According to the device for adapting the cloud platform MQTT communication specification of the present application, the MQTT protocol basic service module receives the MQTT-related target parameters configured by the user, and establishes a connection with the cloud platform based on these parameters. The process interaction module allows the user to customize process entries and trigger conditions, so that the system can automatically execute data interaction actions when specific conditions are met. The data interaction module defines the data and message format of the cloud platform, and forms interactive data based on this to complete data interaction with the cloud platform, thereby enabling the system to have the ability to adapt to different cloud platforms. For cloud platforms with MQTT protocols with different specifications, only the configuration parameters need to be modified, and there is no need to develop docking software for each cloud platform separately, which greatly reduces the software development cost.

[0036] In a fourth aspect, the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for adapting to the cloud platform MQTT communication specification as described in the third aspect above is implemented.

[0037] In a fifth aspect, the present application provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for adapting the cloud platform MQTT communication specification as described in the third aspect above.

[0038] In a sixth aspect, the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the method for adapting to the cloud platform MQTT communication specification as described in the third aspect above.

[0039] In a seventh aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the method for adapting the cloud platform MQTT communication specification as described in the third aspect above.

[0040] The above one or more technical solutions in the embodiments of the present application have at least one of the following technical effects:

[0041] According to the system adapted to the MQTT communication specification of the cloud platform of the present application, the MQTT protocol basic service module receives the MQTT-related target parameters configured by the user, and establishes a connection with the cloud platform based on these parameters. The process interaction module allows the user to customize process entries and trigger conditions, so that the system can automatically execute data interaction actions when specific conditions are met. The data interaction module defines the data and message format of the cloud platform, and forms interactive data accordingly to complete data interaction with the cloud platform, thereby enabling the system to have the ability to adapt to different cloud platforms. For cloud platforms with MQTT protocols with different specifications, only the configuration parameters need to be modified, and there is no need to develop docking software for each cloud platform separately, which greatly reduces the software development cost.

[0042] Furthermore, in some embodiments, by providing a flexible adaptation layer, users are allowed to configure parameters related to the MQTT protocol, such as connection parameters, interaction topics, and data point message interaction topics, so that the same system can be used to connect to different cloud platforms without the need to develop and maintain proprietary connection software for each cloud platform.

[0043] Furthermore, in some embodiments, in the passive configuration mode, after the system establishes a connection with the cloud platform, it dynamically determines the topics that need to be subscribed or sent by receiving characteristic messages sent by the cloud platform, so that the system can flexibly respond to the specific requirements of the cloud platform without knowing the interaction details in advance, thereby improving the adaptability and flexibility of the system. In the static configuration mode, the system has already determined the topics that need to be subscribed or sent before establishing a connection with the cloud platform. This method is suitable for cloud platforms with relatively fixed interaction modes that do not change frequently. Through pre-configuration, the system can quickly start and interact with the cloud platform for data, reducing the configuration overhead at runtime.

[0044] Furthermore, in some embodiments, by breaking down process items into published message content and subscription processing methods, the system can more accurately manage the flow of data with the cloud platform. For defining the published message content, the data sent to the cloud platform can be made to conform to the expected business logic, which helps to reduce data misunderstandings. For defining the subscription processing method, it is convenient for the system to automatically perform corresponding operations when receiving specific messages from the cloud platform, which improves the system's ability to adapt to the data interaction needs of different cloud platforms.

[0045] Furthermore, in some embodiments, by setting corresponding trigger conditions for each process entry, the system can support complex logical judgments and process control, making the data processing process more flexible and diversified, and enabling the system to better meet the specific needs of different users and in different scenarios, without the need to develop and maintain proprietary docking software for each cloud platform.

[0046] Furthermore, in some embodiments, the data interaction specifications used by the cloud platform can be customized by the user selecting a specific data format and setting the message format in the corresponding message format template. The specific details of the data interaction can be determined dynamically and can be flexibly adjusted according to the specific requirements of different cloud platforms, thereby achieving efficient docking with different cloud platforms and reducing the possibility of communication errors and additional debugging work caused by format mismatches.

[0047] Furthermore, in some embodiments, by using path expressions, the system can accurately describe and access data points in the interactive data, allowing users to flexibly configure and adjust the specific path of data interaction according to different data format and message format requirements. For cloud platforms with MQTT protocols with different specifications, only the configuration parameters need to be modified, and there is no need to develop docking software separately for each cloud platform, which greatly reduces the software development cost.

[0048] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0050] Figure 1 It is a schematic diagram of the architecture of a system adapted to the cloud platform MQTT communication specification provided in an embodiment of the present application;

[0051] Figure 2 It is a schematic diagram of the interaction process between the data acquisition device and the cloud platform provided in the embodiment of the present application;

[0052] Figure 3 It is a flowchart of a method for adapting the cloud platform MQTT communication specification provided in an embodiment of the present application;

[0053] Figure 4 It is a structural diagram of a device adapted to the cloud platform MQTT communication specification provided in an embodiment of the present application;

[0054] Figure 5 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0055] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0056] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0057] The cloud platform can collect data from the work site through data acquisition devices such as sensors and controllers, including temperature, humidity, pressure, flow, status, pulse count, etc. Data acquisition equipment is usually deployed at key locations on the industrial site to ensure that the production process can be fully monitored. In order to transmit this data to the cloud platform, the MQTT protocol is usually used. The MQTT protocol is a lightweight publish / subscribe message transmission protocol that is particularly suitable for industrial environments that require low bandwidth, high reliability and real-time performance. The MQTT protocol defines the interaction process between the client and the server to ensure that data can be efficiently and securely transmitted to the cloud platform, thereby realizing real-time monitoring and data analysis of the work site.

[0058] In actual applications, different cloud platforms may use different data specifications and MQTT interaction processes. Although the basic data collection and transmission principles are similar, the specific implementation details of each cloud platform may be different. This difference leads to the need to develop and maintain proprietary docking software for each cloud platform when docking different cloud platforms, and usually requires customized development based on the cloud platform's data specifications and MQTT interaction processes to ensure that the information from the data acquisition device can be correctly parsed and processed.

[0059] This application compares the MQTT docking specifications of multiple cloud platforms and summarizes the common features and differences as follows.

[0060] Common features: Most specifications define interaction processes, such as the status interaction process with the platform and the data interaction process. The status interaction process with the platform includes the connection, disconnection, heartbeat and other status management between the data acquisition device and the cloud platform to ensure that both parties can maintain a stable communication connection. The data interaction process includes the specific process of sending data from the data acquisition device to the cloud platform, or from the cloud platform to the data acquisition device, including the data publishing and subscription mechanisms.

[0061] Differentiation: 1. Data format: The data formats supported by different specifications are not exactly the same, and may include JSON, XML, ASCII, HEX, etc. These data formats reflect the different requirements of cloud platforms for data structure and encoding methods; 2. Message format: Even if two cloud platforms use the same data format, their message structures for the same data point may be different. For example, some specifications may use a hierarchical (nested) way to organize JSON data, while other specifications may use a flat (flat) structure; 3. MQTT protocol parameters: Different cloud platforms may have their own regulations on the access method of MQTT services, the required access parameters, the method of obtaining topics, and the specific content of topics. These parameters may include quality of service (QoS) level, whether authentication is required, topic naming rules, etc.

[0062] In order to solve at least one of the above technical problems, based on the above common features and differences, the present application provides a system, method and device for adapting the cloud platform MQTT communication specification. The following is a detailed description of the system, method and device for adapting the cloud platform MQTT communication specification provided by the embodiment of the present application through specific embodiments and their application scenarios in conjunction with the accompanying drawings.

[0063] like Figure 1 As shown, the system 100 adapted to the cloud platform MQTT communication specification includes: an MQTT protocol basic service module 101, a process interaction module 102 and a data interaction module 103.

[0064] The MQTT protocol basic service module 101 is used to receive target parameters related to the MQTT protocol configured by the user, and establish a connection with the cloud platform according to the target parameters;

[0065] The process interaction module 102 is used to receive the process items and trigger conditions of the process items set by the user; when the trigger conditions are met, the process items are executed; the process items represent data interaction actions with the cloud platform;

[0066] The data interaction module 103 is used to determine the data format and message format used by the cloud platform, and in the process of executing the process items, form interactive data based on the data format and message format to interact with the cloud platform.

[0067] In the embodiments of the present application, Figure 2 As shown, the data acquisition device can transmit uplink data in the format required by the cloud platform through the system 100 of the present application that is adapted to the cloud platform MQTT communication specification, and parse downlink data in accordance with the data format of the cloud platform.

[0068] The MQTT protocol is a lightweight message transmission protocol based on the publish / subscribe model, suitable for the Internet of Things and remote communication fields. The core concepts of the MQTT protocol include:

[0069] Topic: MQTT uses topics to identify the channel of a message. A topic is a string that usually contains multiple levels, similar to a file path, separated by slashes ( / ). Topics can contain wildcards, such as + (single-level wildcard) and # (multi-level wildcard), which are used to subscribe to messages that match multiple topics.

[0070] Publish: A publisher is a client that sends messages to a specific topic. The publishing operation is to send the message to the MQTT broker, which is responsible for distributing the message to the clients that have subscribed to the topic.

[0071] Subscribe: A subscriber is a client that receives messages. It receives relevant published messages by subscribing to one or more topics. The subscription operation is the process by which the client indicates to the broker that it is interested in certain topics.

[0072] The target parameters related to the MQTT protocol may include parameters such as server address, port number, client ID, user name, password, access method, topic acquisition method, etc. The user can provide these parameters through a graphical interface, a configuration file, or a programmatic method. For example, in the management interface of the system 100 adapted to the cloud platform MQTT communication specification, the user can enter the target parameters such as the address, port, and client ID of the MQTT server.

[0073] In the embodiment of the present application, after collecting these target parameters, these target parameters can be used to establish a connection with the cloud platform, for example, these target parameters can be used to initiate a connection request to the cloud platform, and the connection can be established after passing the authentication. After establishing a connection with the cloud platform, one or more topics can be subscribed according to business needs.

[0074] In an embodiment of the present application, a process entry represents a data interaction action with a cloud platform, and is the basic unit of an interaction process with a cloud platform. In a process entry, a series of operations that need to be performed after a specific trigger condition is met can be defined, including the content of the published message and the processing method of the subscription. Among them, the process entry may include an action type, such as sending a message, executing a local command, calling an external service, etc., and may also include the topic to which the action will be published or the topic to be subscribed, and may also include the specific content of the message to be published, which may be static or dynamically generated based on certain variables and conditions. The trigger condition may be a specific message field value or a message received on a specific topic. When the trigger condition is met, the process entry may be executed.

[0075] In this embodiment, by breaking down the process items into published message content and subscription processing methods, the system can more accurately manage the data flow between the cloud platform. For the definition of published message content, the data sent to the cloud platform can be made to conform to the expected business logic, which helps to reduce data misunderstandings. For the definition of subscription processing methods, it is convenient for the system to automatically perform corresponding operations when receiving specific messages from the cloud platform, which improves the system's ability to adapt to the data interaction needs of different cloud platforms.

[0076] Let's take an example to illustrate the process entry and trigger conditions. In this example, it is assumed that the cloud platform supports remote control and remote adjustment. First, you need to define a subscribed process entry to receive remote control or remote adjustment commands from the cloud platform. The cloud platform can send these commands through the MQTT topic, where the subscription topic can be device / control. The trigger condition is: the func field in the message is 1 (remote control) or 2 (remote adjustment). This trigger condition means that when receiving a message on the device / control topic, the value of the func field will be checked. If the value is 1 or 2, the corresponding process entry will be triggered.

[0077] When the trigger condition is met, the predefined processing flow (i.e., process entry) will be executed. Among them, the process entry can include remote control processing and remote adjustment processing. If the func field is checked to be 11, the remote control command will be parsed (for example, turning the device on or off); if the func field is checked to be 2, the remote adjustment command will be parsed (for example, adjusting a certain parameter of the device, such as brightness or temperature). The parsing process can be implemented through jsonpath, xpath, byte offset, etc. Taking the implementation through jsonPath as an example, jsonPath can be: $.command.on: check whether the command to turn on the device is received; $.command.off: check whether the command to turn off the device is received.

[0078] Assume that the cloud platform sends a remote control command to turn on the device. The json message is as follows:

[0079] {

[0080] "func":1,

[0081] "command":{

[0082] "on":true

[0083] }

[0084] }

[0085] After receiving this message, it will identify this as a remote control command based on the value of the func field. Then, it will parse the specific content of the command through the jsonPath expression $.command.on and execute the start operation.

[0086] Of course, in addition to the above-mentioned remote adjustment and remote control related processing flows, process entries can also be data collection, data verification, scheduled tasks, user notifications, etc.

[0087] The user can configure the process items and trigger conditions through a graphical interface, a configuration file or a programming method. For example, the user configures in the management interface of the system 100 adapted to the cloud platform MQTT communication specification.

[0088] In the embodiments of the present application, the data format refers to the structure and layout of the data during transmission and storage, and the data format may include json, xml, ascii, hex, etc. The message format refers to the specific form of data in MQTT communication, including the message header and the payload. The message header contains information such as quality of service, subject, message identifier, etc., while the payload is the actual data content transmitted. For example, an MQTT message may contain the reading of a temperature sensor, and the message format will specify how this reading is encapsulated and transmitted. During the execution of process entries, the data interaction module will form interactive data according to the predefined data format and message format, including encapsulating the data collected by the data acquisition device into an MQTT message and publishing it to the cloud platform, as well as parsing the message received from the cloud platform and performing corresponding actions.

[0089] Taking the data format as json, the uploaded interactive data message is represented by the following json:

[0090] {

[0091] "attr":{

[0092] "temp":{

[0093] "timestamp":"xxxxxxxx",

[0094] "value":"xxxx",

[0095] "quality":"xxxx"

[0096] }

[0097] }

[0098] }

[0099] Among them, attr is an object that contains all attribute data. temp is an attribute of the attr object, which is also an object that contains detailed information about the temperature data. timestamp, value, and quality are attributes of the temp object, which store the timestamp, temperature value, and data quality, respectively. The acquisition time (timestamp) can be a string indicating the specific time when the data was collected. The format can be ISO8601 format, such as 2023-12-07T08:00:00Z. The value (value) indicates the actual measured value of the temperature and can be a number, such as 25.5. The quality (quality) can indicate the accuracy of the data, whether it has been calibrated, or other quality-related information, such as good, bad, or calibrated.

[0100] The user can provide the data format and message format used by the cloud platform to be connected through a graphical interface, a configuration file or a programming method. For example, in the management interface of the system 100 adapted to the cloud platform MQTT communication specification, the user can select and determine the data format and message format used by the cloud platform.

[0101] According to the system adapted to the MQTT communication specification of the cloud platform of the present application, the MQTT protocol basic service module receives the MQTT-related target parameters configured by the user, and establishes a connection with the cloud platform based on these parameters. The process interaction module allows the user to customize process entries and trigger conditions, so that the system can automatically execute data interaction actions when specific conditions are met. The data interaction module defines the data and message format of the cloud platform, and forms interactive data accordingly to complete data interaction with the cloud platform, thereby enabling the system to have the ability to adapt to different cloud platforms. For cloud platforms with MQTT protocols with different specifications, only the configuration parameters need to be modified, and there is no need to develop docking software for each cloud platform separately, which greatly reduces the software development cost.

[0102] In some embodiments, the target parameters include connection parameters with the cloud platform, the subject of interaction with the cloud platform, and the subject of data point message interaction; wherein the data point is the data collected by the data collection device.

[0103] In this embodiment, the connection parameters with the cloud platform may be basic parameters required to establish an MQTT connection, such as a server address, a port number, a client ID, a user name, and a password.

[0104] The topic of interaction with the cloud platform is used for general communication with the cloud platform and is not specific to a data point. The topic of interaction with the cloud platform may be used for device status update, command issuance, event notification, etc. For example, the device status reporting topic: devices / {device_id} / status, the device can use this topic to report its status, such as online, offline, fault, etc.; the command issuance topic: devices / {device_id} / command, the cloud platform weakly uses this topic to issue control commands, such as turning on and off light bulbs, adjusting brightness, etc.

[0105] The topic of data point message interaction is used to transmit specific data points, defining the format and content of the data, and how to transmit it through MQTT messages. For example, the brightness data reporting topic is: sensors / brightness / {sensor_id}. The device can use this topic to report brightness data, and the message body can contain the brightness value and timestamp.

[0106] In this embodiment, the data point may be data such as temperature, humidity, switch status, pulse count, etc., or may be data such as analog quantity, state quantity, accumulated quantity, etc. that can be collected by a data acquisition device.

[0107] In this embodiment, by providing a flexible adaptation layer, the user is allowed to configure parameters related to the MQTT protocol, such as connection parameters, interaction topics, and data point message interaction topics, so that the same system can be used to connect to different cloud platforms without the need to develop and maintain proprietary connection software for each cloud platform.

[0108] In some embodiments, the configuration of the subject of data point message interaction includes passive delivery and static setting;

[0109] When the topic of data point message interaction is configured as passive delivery, after establishing a connection with the cloud platform, the characteristic message sent by the cloud platform is received, and the topic to be subscribed or sent is determined according to the characteristic message;

[0110] When the topic of data point message interaction is statically configured, before establishing a connection with the cloud platform, determine the topic that needs to be subscribed or sent.

[0111] In this embodiment, the user can determine whether the configuration of the topic of the data point message interaction is static configuration or dynamic configuration through the graphical interface. For example, in the management interface of the system 100 adapted to the cloud platform MQTT communication specification, the user can select and determine the configuration of the topic of the data point message interaction.

[0112] In the passive delivery configuration, the topic of data point message interaction is not statically defined in advance on the device side, but is dynamically delivered by the cloud platform after the device establishes a connection with the cloud platform. Specifically, after establishing a connection with the cloud platform, you can listen to the characteristic message from the cloud platform. The characteristic message includes the topic information that the device needs to subscribe to or send. According to the instructions in the received characteristic message, determine the specific topic of data point message interaction to subscribe or publish data.

[0113] In static configuration mode, users can also set the subject of data point message interaction in the management interface. For example, they can pre-define the subject that needs to be subscribed or published according to the documents or specifications of the cloud platform.

[0114] In this embodiment, in the passive configuration mode, after the system establishes a connection with the cloud platform, it dynamically determines the topics that need to be subscribed or sent by receiving the characteristic messages sent by the cloud platform, so that the system can flexibly respond to the specific requirements of the cloud platform without knowing the interaction details in advance, thereby improving the adaptability and flexibility of the system. In the static configuration mode, the system has already determined the topics that need to be subscribed or sent before establishing a connection with the cloud platform. This method is suitable for cloud platforms with relatively fixed interaction modes that do not change frequently. Through pre-configuration, the system can quickly start and interact with the cloud platform for data, reducing the configuration overhead at runtime.

[0115] In some embodiments, the process entry includes multiple process entries, and each process entry corresponds to a trigger condition.

[0116] In this embodiment, by setting corresponding trigger conditions for each process entry, the system can support complex logical judgments and process control, making the data processing process more flexible and diversified, and enabling the system to better meet the specific needs of different users and different scenarios, without the need to develop and maintain proprietary docking software for each cloud platform.

[0117] In some embodiments, determining the data format and message format used by the cloud platform includes:

[0118] Receive the data format selected by the user and the message format set by the user in the message format template corresponding to the data format;

[0119] The data format selected by the user and the message format set by the user in the message format template corresponding to the data format are determined as the data format and message format used by the cloud platform.

[0120] In this embodiment, in the management interface of the system 100 adapted to the cloud platform MQTT communication specification, the user can select a suitable data format according to the requirements of the cloud platform, and determine the data format used by the cloud platform according to the user's selection. For example, if the cloud platform requires the use of json format for data exchange, the user selects json as the data format.

[0121] In this embodiment, the system 100 adapted to the cloud platform MQTT communication specification also provides a message format template corresponding to the data format. After the user selects the data format, the message format template corresponding to the data format will be provided for the user to set the message format. Among them, the message format template may include the payload structure of the message, the service quality level of the message, the reserved message flag, etc. For example, the user selects json as the data format and defines the following message format in the message format template:

[0122] {

[0123] "temperature":22.5,

[0124] "humidity":45,

[0125] "timestamp":"2023-12-07T08:00:00Z"

[0126] }

[0127] In this embodiment, the data interaction specifications used by the cloud platform can be customized by the user selecting a specific data format and setting the message format in the corresponding message format template. The specific details of the data interaction can be determined dynamically and can be flexibly adjusted according to the specific requirements of different cloud platforms, thereby achieving efficient docking with different cloud platforms and reducing the possibility of communication errors and additional debugging work caused by format mismatches.

[0128] In some embodiments, the message format template corresponds to a path expression; the path expression is used to describe and access data points in the interaction data; the path expression is represented by jsonPath, Xpath or byte offset.

[0129] In this embodiment, the path expression is used to describe and access the data points in the interactive data. Different data formats correspond to different path expressions. For example, if the interactive data uses the json format, then each key-value pair of the data point information in the interactive data message can be represented by the path expression jsonPath. Similar to the collection time, value, quality and other attributes of the data point, the uploaded data message template needs to be described using jsonPath. For interactive data in json format:

[0130] {

[0131] "attr":{

[0132] "temp":{

[0133] "timestamp":"xxxxxxxx",

[0134] "value":"xxxx",

[0135] "quality":"xxxx"

[0136] }

[0137] }

[0138] }

[0139] The path expression jsonPath is: $.attr.temp.timestamp represents the collection time of the temperature data point in the json data; $.attr.temp.value represents the measured value of the temperature data point; $.attr.temp.quality represents the quality of the temperature data point.

[0140] Similarly, the path expression corresponding to the message format template in XML format can be expressed by Xpath, and the path expression corresponding to the message format template in ASCII format and Hex format can be expressed by byte offset. Among them, byte offset can be used to describe the exact position of a data point in the data stream. For example, in a binary protocol, the position of each data field can be determined by the byte offset from the beginning of the data.

[0141] In this embodiment, by using path expressions, the system can accurately describe and access data points in the interactive data, so that users can flexibly configure and adjust the specific path of data interaction according to different data format and message format requirements. For cloud platforms with MQTT protocols with different specifications, only the configuration parameters need to be modified, and there is no need to develop docking software separately for each cloud platform, which greatly reduces the software development cost.

[0142] The following introduces a method for adapting the cloud platform MQTT communication specification provided in an embodiment of the present application, wherein the method for adapting the cloud platform MQTT communication specification can be applied to a terminal, and can be specifically executed by hardware or software in the terminal.

[0143] The terminal includes, but is not limited to, a portable communication device such as a mobile phone or tablet computer with a touch-sensitive surface (e.g., a touch screen display and / or a touch pad). It should also be understood that in some embodiments, the terminal may not be a portable communication device, but a desktop computer with a touch-sensitive surface (e.g., a touch screen display and / or a touch pad).

[0144] In the following various embodiments, a terminal including a display and a touch-sensitive surface is described. However, it should be understood that the terminal may include one or more other physical user interface devices such as a physical keyboard, a mouse and a joystick.

[0145] The method for adapting the cloud platform MQTT communication specification provided in the embodiment of the present application can be executed by an electronic device or a functional module or functional entity in the electronic device that can implement the method for adapting the cloud platform MQTT communication specification. The electronic devices mentioned in the embodiment of the present application include but are not limited to mobile phones, tablet computers, computers, cameras and wearable devices. The method for adapting the cloud platform MQTT communication specification provided in the embodiment of the present application is described below using an electronic device as an example of the execution subject.

[0146] like Figure 3 As shown, the method for adapting the cloud platform MQTT communication specification includes: step 310, step 320 and step 330.

[0147] Step 310: receiving target parameters related to the MQTT protocol configured by the user, and receiving process items and triggering conditions of the process items set by the user; the process items represent data interaction actions with the cloud platform;

[0148] Step 320: Determine the data format and message format used by the cloud platform

[0149] Step 330: After establishing a connection with the cloud platform according to the target parameters, if the triggering conditions are met, the process entry is executed; wherein, during the execution of the process entry, interactive data is formed based on the data format and message format to interact with the cloud platform.

[0150] According to the method of adapting the MQTT communication specification of the cloud platform of the present application, the MQTT protocol basic service module receives the MQTT-related target parameters configured by the user, and establishes a connection with the cloud platform based on these parameters. The process interaction module allows the user to customize the process entries and trigger conditions, so that the system can automatically execute data interaction actions when specific conditions are met. The data interaction module defines the data and message format of the cloud platform, and forms interactive data accordingly to complete the data interaction with the cloud platform, thereby enabling the system to have the ability to adapt to different cloud platforms. For cloud platforms with MQTT protocols with different specifications, only the configuration parameters need to be modified, and there is no need to develop docking software for each cloud platform separately, which greatly reduces the software development cost.

[0151] The method for adapting the cloud platform MQTT communication specification provided in the embodiment of the present application can be executed by a device for adapting the cloud platform MQTT communication specification. In the embodiment of the present application, the device for adapting the cloud platform MQTT communication specification is taken as an example to illustrate the device for adapting the cloud platform MQTT communication specification provided in the embodiment of the present application.

[0152] The embodiment of the present application also provides a device adapted to the cloud platform MQTT communication specification.

[0153] like Figure 4 As shown, the device adapted to the cloud platform MQTT communication specification includes:

[0154] The receiving module 410 is used to receive the target parameters related to the MQTT protocol configured by the user, and receive the process items and trigger conditions of the process items set by the user; the process items represent data interaction actions with the cloud platform;

[0155] Determination module 420, used to determine the data format and message format used by the cloud platform

[0156] The execution module 430 is used to execute the process entry if the trigger condition is met after establishing a connection with the cloud platform according to the target parameters; wherein, during the execution of the process entry, interactive data is formed based on the data format and message format to interact with the cloud platform.

[0157] According to the device for adapting the cloud platform MQTT communication specification of the present application, the MQTT protocol basic service module receives the MQTT-related target parameters configured by the user, and establishes a connection with the cloud platform based on these parameters. The process interaction module allows the user to customize process entries and trigger conditions, so that the system can automatically execute data interaction actions when specific conditions are met. The data interaction module defines the data and message format of the cloud platform, and forms interactive data based on this to complete data interaction with the cloud platform, thereby enabling the system to have the ability to adapt to different cloud platforms. For cloud platforms with MQTT protocols with different specifications, only the configuration parameters need to be modified, and there is no need to develop docking software for each cloud platform separately, which greatly reduces the software development cost.

[0158] The device adapted to the cloud platform MQTT communication specification in the embodiment of the present application can be an electronic device, or a component in an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or it can be other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0159] The device adapted to the cloud platform MQTT communication specification in the embodiment of the present application may be a device having an operating system. The operating system may be a Microsoft (Windows) operating system, an Android (Android) operating system, an IOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0160] In some embodiments, Figure 5As shown, an embodiment of the present application also provides an electronic device 500, including a processor 501, a memory 502, and a computer program stored in the memory 502 and executable on the processor 501. When the program is executed by the processor 501, each process of the method embodiment of the above-mentioned adaptation to the cloud platform MQTT communication specification is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0161] It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.

[0162] An embodiment of the present application also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the method embodiment of the above-mentioned adaptation to the cloud platform MQTT communication specification are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0163] The processor is the processor in the electronic device in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0164] An embodiment of the present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the above-mentioned method for adapting to the cloud platform MQTT communication specification.

[0165] The processor is the processor in the electronic device in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0166] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned method embodiment for adapting to the cloud platform MQTT communication specification, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0167] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0168] It should be noted that, in this article, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises one..." does not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be noted that the scope of the method and device in the embodiment of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0169] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0170] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

[0171] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0172] Although the embodiments of the present application have been shown and described, those skilled in the art will appreciate that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present application, and that the scope of the present application is defined by the claims and their equivalents.

Claims

1. A system adapted to the cloud platform MQTT communication specification, characterized in that: include: The MQTT protocol basic service module is used to receive the target parameters related to the MQTT protocol configured by the user, and establish a connection with the cloud platform according to the target parameters; A process interaction module, configured to receive a process entry set by a user and a trigger condition of the process entry; and execute the process entry when the trigger condition is met; the process entry represents a data interaction action with the cloud platform; The data interaction module is used to determine the data format and message format used by the cloud platform, and in the process of executing the process entry, form interactive data based on the data format and the message format to interact with the cloud platform.

2. The system according to claim 1, characterized in that The target parameters include connection parameters with the cloud platform, the subject of interaction with the cloud platform and the subject of data point message interaction; wherein the data point is the data collected by the data collection device.

3. The system according to claim 2, characterized in that The configuration of the subject of the data point message interaction includes passive sending and static setting; In the case where the configuration of the topic of the data point message interaction is passive delivery, after establishing a connection with the cloud platform, receiving a characteristic message sent by the cloud platform, and determining a topic to be subscribed or sent according to the characteristic message; In the case where the configuration of the topic of the data point message interaction is a static configuration, before establishing a connection with the cloud platform, the topic that needs to be subscribed or sent is determined.

4. The system according to claim 1, characterized in that The process entry includes the content of the published message and the processing method of the subscription.

5. The system according to claim 1, characterized in that The process entry includes multiple ones, and each process entry corresponds to a trigger condition.

6. The system according to claim 1, characterized in that Determining the data format and message format used by the cloud platform includes: Receiving a data format selected by a user and a message format set by the user in a message format template corresponding to the data format; The data format selected by the user and the message format set by the user in the message format template corresponding to the data format are determined as the data format and message format used by the cloud platform.

7. The system according to claim 6, characterized in that The message format template corresponds to a path expression; the path expression is used to describe and access data points in the interactive data.

8. A method for adapting the cloud platform MQTT communication specification, characterized in that: include: Receiving target parameters related to the MQTT protocol configured by a user, and receiving process items set by a user and triggering conditions of the process items; The process entry represents a data interaction action with the cloud platform; Determine the data format and message format used by the cloud platform; After establishing a connection with the cloud platform according to the target parameters, if the trigger condition is met, the process entry is executed; wherein, during the execution of the process entry, interactive data is formed based on the data format and the message format to perform data interaction with the cloud platform.

9. A device adapted to the cloud platform MQTT communication specification, characterized in that: include: A receiving module, configured to receive target parameters related to the MQTT protocol configured by a user, and to receive process items and trigger conditions set by a user; the process items represent data interaction actions with the cloud platform; A determination module is used to determine the data format and message format used by the cloud platform An execution module is used to execute the process entry if the trigger condition is met after establishing a connection with the cloud platform according to the target parameters; wherein, during the execution of the process entry, interactive data is formed based on the data format and the message format to interact with the cloud platform.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method according to claim 8 is implemented.

Citation Information

Patent Citations

  • Communication method and Internet of Things system

    CN113992478A

Cited By

  • Message forwarding method and device, telecontrol machine and readable storage medium

    CN121396972A