Business message publishing method and device and Internet of Things gateway
By subscribing and decoding the message subject sent by the first terminal device in the IoT gateway, obtaining and converting it into a standard message, and performing action triggering based on the standard message, data transmission security, reliability and interoperability in the IoT gateway are solved. The problem is to achieve efficient and flexible data processing and transmission.
Patent Information
- Application Number
- CN202311707619.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-12
- Publication Date
- 2025-02-11
AI Technical Summary
How to ensure the security and reliability of data transmission in the Internet of Things gateway, avoid compatibility and interoperability issues, and improve the scalability and compatibility of the gateway.
By subscribing to the message subject sent by the first terminal device, obtain service messages sent based on the MQTT protocol, perform decoding and format conversion, obtain standard messages, and perform action triggering based on standard messages, publish standard messages to the Internet of Things in the form of message subscription Equipment or satellite equipment.
It realizes the gateway's support for multiple data formats, improves the interoperability and flexibility of devices, uses a scalable, high-performance event-driven, non-blocking method, which can handle a large number of concurrent connections, and is suitable for large Scale equipment access and can be easily scaled horizontally.
Smart Images

Figure CN119420805A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of data processing and communication transmission, and in particular to the technical field of Internet of Things. Background Art
[0002] The IoT gateway is a key component in the IoT architecture. It usually acts as a bridge between devices and cloud platforms. It is used to connect IoT edge devices and cloud platforms to achieve functions such as device management, data collection, data processing and forwarding, and communication protocol conversion. How to ensure the security and reliability of IoT gateway data transmission, avoid compatibility and interoperability issues, and improve the scalability and compatibility of the gateway has become one of the important research directions. Summary of the invention
[0003] The present application aims to solve one of the technical problems in the related art at least to a certain extent. To this end, one purpose of the present application is to propose a method for publishing a business message.
[0004] The second objective of the present application is to provide a device for publishing business messages.
[0005] The third objective of the present application is to provide an electronic device.
[0006] A fourth object of the present application is to provide a non-transitory computer-readable storage medium.
[0007] A fifth object of the present application is to provide a computer program product.
[0008] To achieve the above-mentioned purpose, the first embodiment of the present application proposes a method for publishing a business message, including:
[0009] Subscribe to the message topic sent by the first terminal device to obtain the business message sent by the first terminal device based on the message queue telemetry transmission MQTT protocol;
[0010] For each business message under the message subject, the business message is decoded and converted into a first format to obtain a standard message in a preset standard data format;
[0011] An action is triggered based on a standard message, and the standard message is published to a second terminal device in the form of a message subscription. The second terminal device is an Internet of Things device or a satellite device.
[0012] In an embodiment of the present application, the business message is decoded and converted into a first format to obtain a standard message in a preset standard data format. The gateway supports a variety of different data formats, can help connect different devices and systems, improve the interoperability and flexibility of the device, trigger actions based on standard messages, publish standard messages to IoT devices or satellite devices in the form of message subscriptions, and enable the device to send and receive satellite short message messages. It uses a scalable, high-performance event-driven, non-blocking approach, can handle a large number of concurrent connections, is suitable for large-scale device access, and can be easily expanded horizontally.
[0013] To achieve the above-mentioned purpose, the second embodiment of the present application proposes an Internet of Things gateway, including a connected access module and a data transceiver module, wherein:
[0014] The access module is used to establish a communication transmission connection between the Internet of Things gateway and the first terminal device, and obtain a business message sent by the first terminal device based on the message queue telemetry transmission MQTT protocol;
[0015] The data transceiver module is used to process and parse the received business messages and forward the business messages to the second terminal device, which is a satellite device or an Internet of Things device.
[0016] To achieve the above-mentioned purpose, the third aspect of the present application proposes a device for publishing a business message, including:
[0017] An acquisition module is used to subscribe to a message topic sent by the first terminal device to obtain a business message sent by the first terminal device based on the message queue telemetry transmission MQTT protocol;
[0018] A conversion module, used for decoding and converting the business message into a first format for each business message under the message subject, and obtaining a standard message in a preset standard data format;
[0019] The sending module is used to trigger an action based on a standard message, and publish the standard message to a second terminal device in the form of a message subscription. The second terminal device is an Internet of Things device or a satellite device.
[0020] To achieve the above-mentioned purpose, a fourth aspect of the present application provides an electronic device, including:
[0021] at least one processor; and
[0022] a memory communicatively connected to at least one processor; wherein,
[0023] The memory stores instructions that can be executed by at least one processor, and the instructions are executed by at least one processor so that the at least one processor can execute the method for publishing business messages provided in the embodiment of the first aspect of the present application.
[0024] To achieve the above-mentioned purpose, the fifth aspect embodiment of the present application proposes a computer-readable storage medium on which computer instructions are stored, wherein the computer instructions are used to enable a computer to execute the method for publishing business messages provided in the first aspect embodiment of the present application.
[0025] To achieve the above-mentioned purpose, the sixth aspect embodiment of the present application proposes a computer program product, including a computer program, which, when executed by a processor, implements the method for publishing business messages provided in the first aspect embodiment of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 It is a flowchart of a method for publishing a business message according to an embodiment of the present application;
[0027] Figure 2 It is a flowchart of a method for publishing a business message according to an embodiment of the present application;
[0028] Figure 3 It is a schematic diagram of triggering an action through a standard message according to an embodiment of the present application;
[0029] Figure 4 is a structural diagram of an Internet of Things gateway according to an embodiment of the present disclosure;
[0030] Figure 5 It is a structural block diagram of a device for publishing a service message according to an embodiment of the present application;
[0031] Figure 6 It is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0032] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.
[0033] The following describes the method, device and Internet of Things gateway for publishing business messages in an embodiment of the present application in conjunction with the accompanying drawings.
[0034] Figure 1 is a flow chart of a method for publishing a service message according to an embodiment of the present application, such as Figure 1 As shown, the method comprises the following steps:
[0035] S101, subscribing to a message topic sent by a first terminal device to obtain a business message sent by the first terminal device based on a message queue telemetry transmission MQTT protocol.
[0036] The execution entity in the embodiment of the present application may be an Internet of Things gateway.
[0037] Message Queuing Telemetry Transport (MQTT) is a lightweight publish / subscribe messaging protocol suitable for IoT and remote device communications.
[0038] Optionally, in an embodiment of the present application, the first terminal device is an Internet of Things device. The first terminal device publishes a business message to the Internet of Things gateway through the MQTT protocol, including information such as the message subject and the message content. The Internet of Things subscribes to the message subject sent by the first terminal device, and obtains the business message sent by the first terminal device based on the message queue telemetry transmission MQTT protocol according to the message subject.
[0039] That is to say, in the embodiment of the present application, the IoT gateway and the terminal device communicate in the form of message (Topic) subscription and publication.
[0040] In some embodiments, the business messages of each message topic sent by the first terminal device based on the MQTT protocol are directly received; in some embodiments, the short message sent by the first terminal device based on the MQTT protocol is received in the form of a message queue, the short message is identified, and the business message under each message topic is determined.
[0041] S102, for each business message under the message subject, decode the business message and convert it into a first format to obtain a standard message in a preset standard data format.
[0042] In the embodiment of the present application, the standard data format is a predefined standard device message format.
[0043] The IoT gateway decodes and converts the business message into the first format, parses the business message into a standard data format that can be recognized by the backend service, and obtains a standard message (DeviceMessage) in a preset standard data format, which is used to represent various data, status information or control commands generated by the device. The standard message format may include parts such as the message header, message body and message tail, and specifies the meaning and value range of each field in the message.
[0044] The IoT device decodes and converts the business message into the first format, and obtains the standard message according to the agreed standard message format.
[0045] S103: triggering an action based on the standard message, and publishing the standard message to the second terminal device in the form of message subscription.
[0046] Among them, the second terminal device is an Internet of Things device or a satellite device.
[0047] The DeviceMessage action trigger set is determined based on the standard message, the data stream is processed based on the DeviceMessage action trigger set, and the standard message is published to the second terminal device in the form of message subscription, which can make it easier for the terminal device and the IoT gateway to exchange data and interoperate with each other. In other words, the message is forwarded to all one or more second terminal devices that subscribe to the message topic, and the second terminal device then chooses whether to receive the message based on its own subscription status.
[0048] In some implementations, before publishing the standard message to the second terminal device in the form of a message subscription, the standard message is converted into a second format, wherein the second format conversion is an inverse conversion of the first format conversion.
[0049] In an embodiment of the present application, the business message is decoded and converted into a first format to obtain a standard message in a preset standard data format. The gateway supports a variety of different data formats, can help connect different devices and systems, improve the interoperability and flexibility of the device, trigger actions based on standard messages, publish standard messages to IoT devices or satellite devices in the form of message subscriptions, and enable the device to send and receive satellite short message messages. It uses an extensible, high-performance event-driven, non-blocking asynchronous programming framework (Vert.x framework), which can handle a large number of concurrent connections, is suitable for large-scale device access, and can be easily expanded horizontally.
[0050] Figure 2 is a flow chart of a method for publishing a service message according to an embodiment of the present application, such as Figure 2 As shown, the method comprises the following steps:
[0051] S201, performing connection authentication on the first terminal device.
[0052] There are many ways to authenticate the connection between the first terminal device and the IoT gateway, and the specific method selected depends on the system requirements and security considerations.
[0053] For example, in some implementations, when the first terminal device is connected to the IoT gateway, it provides a pre-assigned device identification and password for verification, and the IoT gateway performs identity authentication based on the provided credentials and performs connection authentication for the first terminal device.
[0054] In some implementations, both the first terminal device and the IoT gateway hold corresponding digital certificates. During the connection process, both parties can verify the validity of each other's certificates to achieve connection authentication.
[0055] In some implementations, the first terminal device carries specific token information when connecting, and the IoT gateway performs verification based on the token to authenticate the connection of the first terminal device.
[0056] In some implementations, the Secure Sockets Layer / Transport Layer Security (TLS / SSL) protocol is used to encrypt the connection between the device and the network management, to authenticate the connection of the first terminal device, and to ensure the privacy and integrity of the connection.
[0057] Optionally, the above methods can be used alone or in combination to achieve more stringent connection authentication. In the embodiment of the present application, there is no restriction on the method of connection authentication.
[0058] S202: If the authentication is successful, a communication transmission connection is established between the first terminal device and the Internet of Things gateway.
[0059] When the authentication is successful, a communication transmission connection is established between the first terminal device and the Internet of Things gateway, thereby ensuring the security of the connection.
[0060] S203, subscribing to the message topic sent by the first terminal device to obtain the business message sent by the first terminal device based on the message queue telemetry transmission MQTT protocol.
[0061] For the introduction of step S203, please refer to the relevant content in the above embodiment, which will not be repeated here.
[0062] It should be noted that the service message carries the first identifier of the first terminal device.
[0063] S204, decoding the business message under each message topic to obtain the decoded business message.
[0064] In the embodiment of the present application, the message is decoded into a readable data format, and a corresponding target decoder is selected according to the message type of the business message.
[0065] For example, there is a mapping relationship between the message type and the candidate decoders, and the target decoder corresponding to the message type of the service message is obtained based on the mapping relationship to facilitate subsequent decoding of the service message context.
[0066] S205, obtaining one or more target fields in a preset standard data format, identifying the decoded business message according to each target field, and extracting the target message corresponding to each target field.
[0067] In some embodiments, if the first terminal device is an IoT device, the target field may include one or more of the following: the first terminal device's identification, reception type, message identification, message content, service type, the second terminal device's identification and timestamp, device identification, platform type, information type, data type, tenant identification, etc.
[0068] In some embodiments, if the first terminal device is a satellite device, the target field may include one or more of the following: message header identifier, tenant identifier, message type, device identifier, message address, second terminal device identifier, message content, device name, timestamp, etc.
[0069] S206, encapsulate the target message to obtain a standard message.
[0070] For example, a data template in a preset standard data format can be obtained, where the template includes one or more target fields. The decoded business message is identified according to each target field, and the target message corresponding to each target field is extracted. The data template is filled according to the target message, and then encapsulated to obtain a standard message.
[0071] By encapsulating and combining target messages to obtain standard messages, the integrity, security and consistency of data can be ensured.
[0072] S207: query whether the first terminal device has satellite forwarding authority based on the first identifier, and determine the identifier of the second terminal device that subscribes to the message topic.
[0073] The device operation authority is obtained based on the first identifier, and forwarding authority authentication is performed to determine whether the first terminal device has satellite forwarding authority.
[0074] S208, if the first terminal device does not have satellite forwarding authority, and the second terminal device is an IoT device, routing is performed based on the message subject and the second terminal device identifier, and the standard message is forwarded to the second terminal device through the action trigger of the standard message.
[0075] S209, if the first terminal device has satellite forwarding authority and the second terminal device is a satellite device, the standard message is forwarded to the satellite short message server through the action trigger of the standard message, and the satellite short message server routes based on the message subject and the second terminal device identifier, and forwards the standard message to the second terminal device.
[0076] In some implementations, before publishing the standard message to the second terminal device in the form of a message subscription, the standard message is converted into a second format, wherein the second format conversion is an inverse conversion of the first format conversion.
[0077] S210, storing the published standard message in a database and recording a message publishing log to support data analysis and use.
[0078] In an embodiment of the present application, a message publishing log is recorded, and data sent by the gateway, such as standard messages, is stored in a database. Optionally, it can also be stored in an open source distributed search and analysis engine (ElasticSearch, ES) to support subsequent data analysis and use.
[0079] In the embodiment of the present application, the first terminal device is connected and authenticated. If the authentication is successful, a communication transmission connection is established between the first terminal device and the IoT gateway, which can realize encrypted data transmission and authentication to ensure the security and integrity of the data. The gateway can quickly access various MQTT devices and seamlessly connect them to the backend service. It adopts a publish / subscribe mode, which can realize two-way communication between different IoT devices and applications. By dividing permissions, it supports multi-device management, realizes resource isolation and security between different devices, avoids compatibility and interoperability issues, and improves the scalability and compatibility of the gateway.
[0080] Figure 3 FIG. 1 is a schematic diagram of triggering an action through a standard message according to an embodiment of the present application. Figure 3 As shown, in some embodiments, data forwarding and processing are performed based on DeviceMessage (standard message), and the business message includes information such as device, function call, and time report. The business message is decoded and converted to the first format, and the standard message in the standard data format is obtained. The DeviceMessage action trigger set is obtained, and different event processing nodes Node are triggered according to different device attributes and device functions of the standard information, and different device actions DeviceAction are executed. For example, the action triggers a logger (Logger) for recording and tracking specific actions or events, such as an action triggering application programming interface action API Action, and the standard message is forwarded to the satellite short message server by calling the API interface, such as the action triggering message downlink attribute, and the message is passed to the next operation in the data pipeline. For example, when the standard message execution node of the device output is reached, the standard message is published to the second terminal device through the gateway connection.
[0081] Based on the same concept, the embodiment of the present application also provides an IoT gateway with integrated satellite short messages. It provides a set of rules based on the rule engine, which can route messages to different targets, such as forwarding sensor data to specific applications, devices or databases. In addition, it also integrates the satellite short message function, and authorized devices can send data in a specified format through this gateway to implement the satellite short message communication function, and provides a web console so that users can easily manage and monitor devices and message flows.
[0082] Figure 4 is a structural diagram of an Internet of Things gateway according to an embodiment of the present disclosure, such as Figure 4 As shown, the Internet of Things gateway includes a connected access module and a data transceiver module. Optionally, the Internet of Things gateway is an Internet of Things MQTT device gateway integrating satellite short messages.
[0083] The access module is used to establish a communication transmission connection between the Internet of Things gateway and the first terminal device, and obtain the business message sent by the first terminal device based on the message queue telemetry transmission MQTT protocol.
[0084] The data transceiver module is used to process and parse the received business messages and forward the business messages to the second terminal device, which is a satellite device or an Internet of Things device.
[0085] In some embodiments, the access module includes a device access module and a communication management module, wherein:
[0086] The device access module has a fixed port for connecting to the first terminal device. That is, the first terminal device is connected to the satellite MQTT gateway through the fixed port exposed by the access module, and communicates with the gateway in the form of message (Topic) subscription and publication.
[0087] The communication management module is used to authenticate the connection of the first terminal device, establish communication transmission with the first terminal device after successful authentication, and obtain business messages. In other words, the communication management module manages and maintains the connection between the IoT gateway and other devices, and handles related transactions in the connection, such as connection authentication. After the IoT gateway subscribes to and receives the business message sent by the first terminal device, it will be handed over to the data forwarding module for processing.
[0088] The data processing module is responsible for processing and parsing the received data, including operations such as data conversion, data storage, and data filtering, and also supports customized data processing logic. In some embodiments, the data transceiver module includes a data processing module, a satellite short message forwarding module, and a data push module, wherein:
[0089] The data processing module is used to decode and convert the service message into a first format, obtain a standard message in a preset standard data format, and send the standard message to the satellite short message forwarding module or the data push module.
[0090] The satellite short message forwarding module is used to send the standard message to the satellite short message server, and the satellite short message server forwards the standard message to the satellite device.
[0091] The data push module is used to send standard messages to IoT devices.
[0092] In some implementations, the IoT gateway further includes a data storage module for storing standard messages and recording message publishing logs.
[0093] That is to say, the gateway supports forwarding data to the satellite short message platform and IoT devices through authorized configuration and calling of external satellite platforms, while recording information push logs and storing the data sent by the devices in ES for subsequent data analysis and use. When forwarding messages, routing is performed based on Topic and device identification, supporting message filtering and conversion functions, and conditional judgment and conversion can be performed based on the content of the message to ensure the correctness and reliability of the message.
[0094] The embodiments of the present application provide extended interfaces for data pre-processing and post-processing, which can easily implement customized data processing logic, such as data decryption, data format conversion, etc., and support customized data processing.
[0095] Optionally, the satellite device in the embodiment of the present application may be a Beidou satellite device, and the corresponding satellite short message is a Beidou satellite short message. In other implementations, the satellite may also be other satellites, such as a high-orbit satellite or a low-orbit satellite, etc. The embodiment of the present application is not limited to this.
[0096] Figure 5 is a structural diagram of a device for publishing a service message according to an embodiment of the present disclosure, such as Figure 5 As shown, the service message publishing device 500 includes:
[0097] An acquisition module 510 is used to subscribe to a message topic sent by the first terminal device to obtain a service message sent by the first terminal device based on the message queue telemetry transmission MQTT protocol;
[0098] The processing module 520 is used to decode and convert the business message into a first format for each business message under the message subject, and obtain a standard message in a preset standard data format;
[0099] The sending module 530 is used to trigger an action based on a standard message, and publish the standard message to a second terminal device in the form of a message subscription. The second terminal device is an Internet of Things device or a satellite device.
[0100] In some implementations, the service message carries the first identifier of the first terminal device, and the sending module 530 is further configured to:
[0101] Based on the first identifier, query whether the first terminal device has satellite forwarding authority, and determine the identifier of the second terminal device subscribed to the message topic;
[0102] If the first terminal device does not have satellite forwarding authority, and the second terminal device is an IoT device, routing is performed based on the message subject and the second terminal device identifier, and the standard message is forwarded to the second terminal device through the action trigger of the standard message;
[0103] If the first terminal device has satellite forwarding authority and the second terminal device is a satellite device, the standard message is forwarded to the satellite short message server through the action trigger of the standard message. The satellite short message server routes based on the message subject and the second terminal device identifier, and forwards the standard message to the second terminal device.
[0104] In some implementations, the acquisition module 510 is executed by the Internet of Things gateway and is further used to:
[0105] Performing connection authentication on the first terminal device;
[0106] If the authentication is successful, a communication transmission connection is established between the first terminal device and the Internet of Things gateway.
[0107] In some implementations, the processing module 520 is further configured to:
[0108] Determine a target decoder according to a message type of the service message;
[0109] The target decoder is called to decode the service message and convert the service message into the first format to obtain a standard message in a standard data format.
[0110] In some implementations, the sending module 530 is further configured to:
[0111] Performing a second format conversion on the standard message;
[0112] The second format conversion is an inverse conversion of the first format conversion.
[0113] In some implementations, the service message publishing device 500 further includes a record analysis module 540, which is used to:
[0114] The published standard messages are stored in the database and the message publishing log is recorded to support data analysis and use.
[0115] In an embodiment of the present application, the business message is decoded and converted into a first format to obtain a standard message in a preset standard data format. The gateway supports a variety of different data formats, can help connect different devices and systems, improve the interoperability and flexibility of the device, trigger actions based on standard messages, publish standard messages to IoT devices or satellite devices in the form of message subscriptions, and enable the device to send and receive satellite short message messages. It uses a scalable, high-performance event-driven, non-blocking approach, can handle a large number of concurrent connections, is suitable for large-scale device access, and can be easily expanded horizontally.
[0116] Based on the same application concept, an embodiment of the present application also provides an electronic device.
[0117] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 6 As shown, the electronic device 600 includes a memory 601, a processor 602, and a computer program product stored in the memory 601 and executable on the processor 602. When the processor executes the computer program, the aforementioned method for publishing business messages is implemented.
[0118] In order to implement the above embodiments, the present application also proposes a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the method for publishing business messages provided in the above embodiments.
[0119] In order to implement the above embodiments, the present application also proposes a computer program product, including a computer program, which, when executed by a processor, implements the method for publishing the service message provided by the above embodiments.
[0120] The collection, storage, use, processing, transmission, provision and disclosure of user personal information involved in this application are in compliance with relevant laws and regulations and do not violate public order and good morals.
[0121] It should be noted that personal information from users should be collected for legitimate and reasonable purposes and should not be shared or sold outside of these legitimate uses. In addition, such collection / sharing should be carried out after receiving the user's informed consent, including but not limited to notifying the user to read the user agreement / user notice and sign the agreement / authorization including authorization of relevant user information before the user uses the function. In addition, any necessary steps should be taken to protect and safeguard access to such personal information data and ensure that others who have access to personal information data comply with its privacy policy and procedures.
[0122] The present application is expected to provide an implementation scheme for users to selectively block the use or access of personal information data. That is, the present disclosure is expected to provide hardware and / or software to prevent or block access to such personal information data. Once the personal information data is no longer needed, the risk can be minimized by limiting data collection and deleting the data. In addition, when applicable, such personal information is de-identified to protect the privacy of the user.
[0123] In the description of the aforementioned embodiments, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. 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 representations of the above terms do 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. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0124] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0125] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.
[0126] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute the instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.
[0127] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0128] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0129] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0130] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present application.
Claims
1. A method for publishing a business message, characterized in that: include: Subscribe to the message topic sent by the first terminal device to obtain the service message sent by the first terminal device based on the message queue telemetry transmission MQTT protocol; For the service message under each message topic, the service message is decoded and converted into a first format to obtain a standard message in a preset standard data format; An action is triggered based on the standard message, and the standard message is published to a second terminal device in the form of a message subscription, where the second terminal device is an Internet of Things device or a satellite device.
2. The method according to claim 1, characterized in that: The decoding and first format conversion of the service message to obtain a standard message in a preset standard data format includes: Decoding the service message to obtain the decoded service message; Acquire one or more target fields in a preset standard data format, identify the decoded service message according to each target field, and extract the target message corresponding to each target field; The target message is encapsulated to obtain the standard message.
3. The method according to claim 2, characterized in that The decoding of the service message to obtain the decoded service message includes: Determining a target decoder according to a message type of the service message; The target decoder is called to decode the service message, and the decoded service message is obtained.
4. The method according to claim 1, characterized in that: The service message carries the first identifier of the first terminal device, and the action is triggered based on the standard message, and the standard message is published to the second terminal device in the form of message subscription, including: Based on the first identifier, query whether the first terminal device has satellite forwarding authority, and determine the identifier of the second terminal device subscribed to the message topic; If the first terminal device does not have satellite forwarding authority, and the second terminal device is an IoT device, routing is performed based on the message subject and the second terminal device identifier, and the standard message is forwarded to the second terminal device through the action trigger of the standard message; If the first terminal device has satellite forwarding authority and the second terminal device is a satellite device, the standard message is forwarded to a satellite short message server through the action trigger of the standard message, and the satellite short message server performs routing based on the message subject and the second terminal device identifier, and forwards the standard message to the second terminal device.
5. The method according to claim 1, characterized in that Executed by the Internet of Things gateway, before receiving the service message sent by the first terminal device based on the MQTT protocol, it also includes: Performing connection authentication on the first terminal device; If the authentication is successful, a communication transmission connection is established between the first terminal device and the Internet of Things gateway.
6. The method according to any one of claims 1 to 5, characterized in that: Before publishing the standard message to the second terminal device in the form of message subscription, the method further includes: Performing a second format conversion on the standard message; The second format conversion is an inverse conversion of the first format conversion.
7. The method according to any one of claims 1 to 5, characterized in that: After publishing the standard message to the second terminal device in the form of message subscription, the method further includes: The published standard messages are stored in a database, and message publishing logs are recorded to support data analysis and use.
8. The method according to claim 1, characterized in that The subscribing to the message topic sent by the first terminal device to obtain the service message sent by the first terminal device based on the message queue telemetry transmission MQTT protocol includes: Receiving a short message sent by the first terminal device in a message queue manner, where the short message is sent by the first terminal device based on the MQTT protocol; The short message is identified to determine the service message under each message topic.
9. An Internet of Things gateway, characterized in that: It includes connected access modules and data transceiver modules, where: The access module is used to establish a communication transmission connection between the Internet of Things gateway and the first terminal device, and obtain a service message sent by the first terminal device based on the message queue telemetry transmission MQTT protocol; The data transceiver module is used to process and parse the received business message and forward the business message to a second terminal device, which is a satellite device or an Internet of Things device.
10. The gateway according to claim 9, characterized in that: The access module includes a device access module and a communication management module, wherein: The device access module has a fixed port for connecting to the first terminal device; The communication management module is used to perform connection authentication on the first terminal device, establish communication transmission with the first terminal device after successful authentication, and obtain the service message.
11. The gateway according to claim 9, characterized in that: The data transceiver module includes a data processing module, a satellite short message forwarding module and a data push module, wherein: The data processing module is used to decode and convert the service message into a first format, obtain a standard message in a preset standard data format, and send the standard message to the satellite short message forwarding module or the data push module; The satellite short message forwarding module is used to send the standard message to the satellite short message server, and the satellite short message server forwards the standard message to the satellite device; The data push module is used to send the standard message to the Internet of Things device.
12. The method according to claim 11, characterized in that The Internet of Things gateway also includes a data storage module, which is used to store the standard message and record a message publishing log.
13. A device for publishing business messages, characterized in that: include: An acquisition module, used to subscribe to a message topic sent by the first terminal device to obtain a service message sent by the first terminal device based on the message queue telemetry transmission MQTT protocol; A conversion module, used to decode and convert the service message into a first format to obtain a standard message in a preset standard data format; The sending module is used to trigger an action based on the standard message, and publish the standard message to a second terminal device in the form of a message subscription, where the second terminal device is an Internet of Things device or a satellite device.
14. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 8.
15. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the steps of the method according to any one of claims 1-8.
16. A computer program product, comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 8.