Internet of Things edge gateway system and method based on MQTT, terminal and storage medium

By designing an IoT edge gateway system based on MQTT, the flexibility and scalability issues of traditional gateways in connecting diverse devices are solved, a variety of communication interfaces and efficient data processing are implemented, and the connection compatibility of IoT devices is improved. and data transmission stability.

CN118740554APending Publication Date: 2024-10-01INSPUR INTELLIGENT IOT TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411000160.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-24
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

Traditional IoT gateway designs are limited to a single or a small number of communication protocols, making it difficult to adapt to diverse and complex IoT device connections, lacking flexibility and scalability, and unable to meet efficient and reliable data transmission requirements.

Method used

Design an IoT edge gateway system based on MQTT, which includes a variety of communication interface modules, a system layer that supports the MQTT protocol, and a user-customizable application layer. It provides flexible configuration and expansion capabilities, including communication modules, packaging modules, and security calibration. Verification module, log module and automatic upgrade module ensure diversified connections and efficient data processing.

Benefits of technology

It improves the connection flexibility and compatibility between the gateway and IoT devices, ensures the efficiency and reliability of data transmission, enhances user-defined configuration capabilities, improves system security and stability, and meets the needs of different scenarios. access requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118740554A_ABST
    Figure CN118740554A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of Internet of Things communication, and particularly provides an Internet of Things edge gateway system and method based on MQTT, a terminal and a storage medium, the Internet of Things edge gateway system comprises a gateway hardware layer, a system layer and a gateway application layer, and the gateway hardware layer, the system layer and the gateway application layer are connected in sequence; the gateway hardware layer is integrated with various communication interface modules, comprises a network port module, a 4G / 5G communication module, an RS232 communication module, an RS485 communication module, a USB serial bus interface, a WIFI communication module, a ZIGBEE communication module and an LORA communication module, and is used for realizing diversified connection and data interaction with Internet of Things equipment, a gateway and an Internet of Things platform; by integrating diversified communication interface modules, the system can support the access of a plurality of Internet of Things devices, including but not limited to a plurality of communication modes such as a network port, 4G / 5G, RS232, RS485, USB, WIFI, ZIGBEE and LORA, so that the connection flexibility and compatibility between the gateway and the Internet of Things devices are greatly improved, and the access requirements of the devices in different scenes are met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of Internet of Things communication technology, and in particular relates to a hairstyle recommendation method, system, terminal and storage medium based on big data. Background Art

[0002] With the rapid development of IoT technology, the interconnection of all things has become a reality, greatly promoting the intelligent process in all fields of society. However, this trend has also brought unprecedented challenges, especially the significant increase in the diversity and complexity of connections between devices. Traditional IoT gateway designs are often limited to supporting a single or a few communication protocols (such as MODBUS, TCP, etc.), which greatly limits its flexibility and scalability in practical applications.

[0003] In the existing IoT architecture, gateways are a bridge between the physical world and the digital world, and their importance is self-evident. However, the limitations of traditional gateways are that they have a single hardware interface and rigid software logic, making it difficult to adapt to the rapidly changing IoT environment. When faced with a wide variety of IoT devices with different protocols, traditional gateways often seem to be unable to meet the needs of efficient and reliable data transmission between devices.

[0004] In addition, with the continuous expansion of IoT application scenarios, higher requirements are placed on the flexibility, configurability and scalability of gateways. Users hope to be able to flexibly configure the gateway's communication interface, data processing logic, and security authentication mechanism according to their actual needs to achieve more accurate and efficient data collection, processing and transmission. However, most gateways in the existing technology adopt a closed design, which makes it difficult for users to customize and expand them, which seriously restricts the innovation and development of IoT technology. Summary of the invention

[0005] In view of the above-mentioned deficiencies in the prior art, the present invention provides an Internet of Things edge gateway system, method, terminal and storage medium based on MQTT to solve the above-mentioned technical problems.

[0006] In a first aspect, the present invention provides an Internet of Things edge gateway system based on MQTT, comprising a gateway hardware layer, a system layer and a gateway application layer, wherein the gateway hardware layer, the system layer and the gateway application layer are connected in sequence;

[0007] The gateway hardware layer integrates a variety of communication interface modules, including network port module, 4G / 5G communication module, RS232 communication module, RS485 communication module, USB serial bus interface, WIFI communication module, ZIGBEE communication module and LORA communication module, which are used to achieve diversified connections and data interaction with IoT devices, gateways and IoT platforms;

[0008] The system layer is deployed on the gateway hardware layer and is responsible for the overall management and scheduling of the system, including the operating system, the communication protocol stack supporting the MQTT protocol, the data processing engine, the security authentication mechanism and the power management system. It controls each communication module and processes and forwards data.

[0009] The gateway application layer is built on the system layer to provide user-customizable application service interfaces, supporting users to flexibly configure and expand the application scenarios of the edge gateway according to actual needs, including but not limited to a configuration module for setting and managing various parameters of the gateway, and a data parsing module for receiving data from IoT devices and performing format parsing and preliminary processing.

[0010] A further improvement of this technical solution is that the gateway application layer also includes:

[0011] The communication module is used to establish communication links between the gateway application layer and IoT devices, gateways and IoT platforms, and perform protocol conversion according to requirements;

[0012] The packaging module is used to package the corresponding commands according to different configurations, package the parsed data into a JSON string, and add a universal timestamp field to the JSON string;

[0013] The security verification module is used to verify and sign the data returned from the IoT device or IoT platform according to different configurations;

[0014] The log module is used to record all critical events that occur during the operation of the system, including but not limited to system startup, configuration changes, and errors;

[0015] The upgrade module is used to regularly check whether new versions or patches are released, and when a new version is detected, evaluate the differences between the current version and the new version and decide whether an upgrade operation is required;

[0016] The timing module is used to periodically check the allocation of system resources.

[0017] In a second aspect, the present invention provides a communication method of an MQTT-based IoT edge gateway system according to any one of the above items, comprising:

[0018] Read the configuration file, initiate a connection according to the communication protocol type configured for the IoT device, and obtain the corresponding connection handle;

[0019] According to different configuration information, package corresponding commands;

[0020] Send the packaged corresponding command to the IoT device through the connection handle, and read the return value of the IoT device;

[0021] Call the security verification module according to the configuration information to verify and sign the return value;

[0022] Parse the corresponding return value according to the configuration information;

[0023] Package the parsed data into a JSON string, add a universal timestamp field to the JSON string, and send the JSON string to the IoT platform.

[0024] A further improvement of this technical solution is that the configuration file includes:

[0025] IoT platform information, including MQTT address;

[0026] IoT device information, including communication protocol information, timed query tag information, command mode, command format, and data parsing information;

[0027] Communication auxiliary information, including LORA node ID and MODBUS slave address;

[0028] Timing interval information;

[0029] Update subscription information.

[0030] A further improvement of the technical solution is that the data parsing information includes data length, data format, number of decimal places, floating point mark, batch parsing mark and negative number mark.

[0031] Further improvements to this technical solution include automatically upgrading the IoT edge gateway, and the specific steps include:

[0032] Start the upgrade module monitoring function of the IoT edge gateway to subscribe to the preset MQTT upgrade topic to receive upgrade instructions from the IoT platform;

[0033] When receiving an upgrade instruction sent through the MQTT upgrade topic, receive the complete upgrade instruction data packet;

[0034] Compare the received upgrade version information with the current gateway version information to determine whether an upgrade operation needs to be performed;

[0035] If it is determined that an upgrade is required, download the compressed package of the upgrade file from the specified server according to the download link in the upgrade instruction;

[0036] Perform integrity check on the compressed package of the downloaded upgrade file to ensure that the file has not been tampered with or damaged during transmission;

[0037] After the verification is passed, decompress the compressed package to the specified directory;

[0038] Replace the current gateway program main file with the decompressed new program main file;

[0039] Update the gateway configuration file as needed, including but not limited to MQTT address, device information, and communication auxiliary information;

[0040] According to the upgrade requirements, update the target library files required by the gateway;

[0041] After all update operations are completed, restart the IoT Edge Gateway program to apply the new upgrade content and ensure that the gateway runs with the latest version.

[0042] A further improvement of the technical solution is to parse the corresponding return value according to the configuration information, which specifically includes:

[0043] Read the rules or instructions related to return value parsing from the configuration file;

[0044] Decompress or decrypt the returned value according to the decompression instruction or decryption instruction in the configuration information;

[0045] Select the corresponding parser according to the data format of the return value;

[0046] Use the selected parser to parse the preprocessed return value according to the parsing rules in the configuration file.

[0047] Further improvements of the technical solution include that the rules include data type mapping, field name mapping, conditional judgment logic, and data format; and the instructions include decompression instructions or decryption instructions.

[0048] In a third aspect, the present invention provides a terminal, comprising:

[0049] processor, memory, wherein:

[0050] The memory is used to store computer programs.

[0051] The processor is used to call and run the computer program from the memory, so that the terminal executes the above-mentioned terminal method.

[0052] In a fourth aspect, the present invention provides a computer storage medium, wherein the computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the methods described in the above aspects.

[0053] The beneficial effects of the present invention are:

[0054] Enhanced connection flexibility and compatibility: By integrating a variety of communication interface modules, this system can support the access of various IoT devices, including but not limited to multiple communication methods such as network port, 4G / 5G, RS232, RS485, USB, WIFI, ZIGBEE and LORA, which greatly improves the connection flexibility and compatibility between the gateway and IoT devices, and meets the access requirements of devices in different scenarios.

[0055] Improve data processing efficiency and reliability: The communication protocol stack and data processing engine supporting the MQTT protocol deployed in the system layer ensures efficient and reliable data transmission between IoT devices, gateways and IoT platforms. The MQTT protocol is particularly suitable for data exchange between a large number of devices in the IoT environment due to its lightweight, low bandwidth usage and high reliability, thereby improving the data processing efficiency and stability of the entire system.

[0056] Enhanced user-defined configuration and expansion capabilities: The introduction of the gateway application layer provides users with a customizable application service interface, allowing users to flexibly configure the gateway's communication interface, data processing logic, and security authentication mechanism according to their actual needs. This high degree of configurability and scalability not only meets users' needs for accurate and efficient data collection, processing, and transmission, but also promotes the innovation and application expansion of IoT technology.

[0057] Improve system security: The built-in security authentication mechanism ensures the security and privacy protection during data transmission, prevents security issues such as data leakage and illegal access, and provides a solid guarantee for the stable operation of IoT applications.

[0058] In addition, the invention has a reliable design principle, a simple structure and a very broad application prospect. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0060] Figure 1 is a schematic block diagram of a system according to an embodiment of the present invention.

[0061] Figure 2 is a schematic flow chart of a method according to an embodiment of the present invention.

[0062] Figure 3 A schematic diagram of the structure of a terminal provided by an embodiment of the present invention.

[0063] 110 is the gateway hardware layer, 111 is the network port module, 112 is the 4G / 5G communication module, 113 is the RS232 communication module, 114 is the RS485 communication module, 115 is the USB serial bus interface, 116 is the WIFI communication module, 117 is the ZIGBEE communication module, 118 is the LORA communication module, 120 is the system layer, 121 is the operating system, 122 is the communication protocol stack, 123 is the data processing engine, 124 is the security authentication mechanism, 125 is the power management system, 130 is the gateway application layer, 131 is the configuration module, 132 is the data parsing module, 133 is the communication module, 134 is the packaging module, 135 is the security verification module, 136 is the log module, 137 is the upgrade module, and 138 is the timing module. DETAILED DESCRIPTION

[0064] In order to enable those skilled in the art to better understand the technical solutions in the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0065] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention.

[0066] The key terms appearing in the present invention are explained below.

[0067] MQTT, Message Queuing Telemetry Transport, is a "lightweight" communication protocol based on the publish / subscribe model. The protocol is built on the TCP / IP protocol and was released by IBM in 1999. MQTT has been widely used in the fields of Internet of Things (IoT), small devices, mobile applications, etc. due to its low overhead, low bandwidth usage, and easy implementation.

[0068] 4G, The 4th Generation mobile communication technology, the fourth generation of mobile communication technology; 5G, The fifth generation mobile communication technology, the fifth generation of mobile communication technology; the network dial-up speed is extremely fast, and the upload speed can also reach a relatively high level, which can meet the requirements of almost all users for wireless services.

[0069] RS232, Recommended Standard 232, is a widely used serial communication interface standard. The RS232 interface standard specifies the interface technical requirements for serial binary data exchange between data terminal equipment (DTE) and data communication equipment (DCE), including electrical characteristics, mechanical characteristics, functional characteristics, and process characteristics.

[0070] RS485, Recommended Standard 485; RS485 is not just a simple interface standard, it represents a set of important industrial communication specifications and is of key significance to industrial automation and communication system design.

[0071] USB, Universal Serial Bus, is an external bus standard used to regulate the connection and communication between computers and external devices. The USB interface supports the plug-and-play and hot-swap functions of devices. Users can connect or disconnect USB devices while the computer is working without shutting down or restarting the computer. The USB interface has the advantages of fast transmission speed, easy use, hot-swap support, flexible connection, and independent power supply. It has become one of the standard interfaces for connecting computers and other electronic devices.

[0072] WIFI, Wireless Fidelity, the Chinese meaning of WIFI is wireless fidelity; WIFI is generally understood as a wireless network technology that transmits data via radio waves, which allows devices (such as smartphones, tablets, laptops, etc.) to connect to the Internet or other network devices without the need for a physical connection (such as a network cable).

[0073] ZIGBEE, whose Chinese meaning is "purple bee", is a figurative translation used to describe certain characteristics of this wireless communication technology, such as low power consumption, low cost, short-range communication, etc. It is widely used in the fields of Internet of Things, smart home, industrial automation, etc.

[0074] LORA, the name comes from the abbreviation of "Long Range Radio", emphasizing its long-distance communication characteristics. It is a low-power LAN wireless standard developed and promoted by Semtech, which aims to solve the contradiction between power consumption and transmission distance. Under the same power consumption conditions, LoRa technology can transmit farther than other wireless methods, achieving the unity of low power consumption and long distance.

[0075] MODBUS means "Modicon Bus" in Chinese, but it is more commonly translated as "Modular Bus" or simply "Modular Bus". The name comes from its developer Modicon (now part of Schneider Electric), where "Mod" is the abbreviation of Modicon and "bus" means bus protocol. However, in the Chinese context, people are more accustomed to calling it "MODBUS protocol" or simply "MODBUS".

[0076] like Figure 1 As shown, the present invention provides an Internet of Things edge gateway system based on MQTT, including a gateway hardware layer, a system layer and a gateway application layer, and the gateway hardware layer, the system layer and the gateway application layer are connected in sequence.

[0077] Specifically, the gateway hardware layer integrates a variety of communication interface modules, including network port module, 4G / 5G communication module, RS232 communication module, RS485 communication module, USB serial bus interface, WIFI communication module, ZIGBEE communication module and LORA communication module, which are used to realize diversified connections and data interaction with IoT devices, gateways and IoT platforms; the system layer is deployed on the gateway hardware layer and is responsible for the overall management and scheduling of the system, including an operating system, a communication protocol stack that supports the MQTT protocol, a data processing engine, a security authentication mechanism and a power management system, which controls each communication module and processes and forwards data; the gateway application layer is built on the system layer and is used to provide a user-customizable application service interface to support users to flexibly configure and expand the application scenarios of the edge gateway according to actual needs, including but not limited to a configuration module for setting and managing various gateway parameters, and a data parsing module for receiving data from IoT devices and performing format parsing and preliminary processing.

[0078] In addition, the gateway application layer also includes: a communication module, which is used to establish a communication link between the gateway application layer and the IoT device, the gateway and the IoT platform, and perform protocol conversion according to requirements; a packaging module, which is used to package corresponding commands according to different configurations, and package the parsed data into a JSON string, and add a universal timestamp field to the JSON string; a security verification module, which is used to verify and sign the data returned from the IoT device or IoT platform according to different configurations; a log module, which is used to record all critical events that occur during the operation of the system, including but not limited to system startup, configuration changes and errors; an upgrade module, which is used to regularly check whether there are new versions or patches released, and when a new version is detected, evaluate the difference between the current version and the new version, and decide whether an upgrade operation needs to be performed; a timing module, which is used to regularly check the allocation of system resources.

[0079] like Figure 2 As shown, the present invention provides a communication method of an MQTT-based IoT edge gateway system according to any one of the above items, comprising:

[0080] Step 210, read the configuration file, initiate a connection according to the communication protocol type configured for the IoT device, and obtain a corresponding connection handle;

[0081] Step 220, packaging corresponding commands according to different configuration information;

[0082] Step 230, sending the packaged corresponding command to the IoT device through the connection handle, and reading the return value of the IoT device;

[0083] Step 240, calling the security verification module according to the configuration information to verify and sign the return value;

[0084] Step 250, parsing the corresponding return value according to the configuration information;

[0085] Step 260: Pack the parsed data into a JSON string, add a universal timestamp field to the JSON string, and send the JSON string to the IoT platform.

[0086] The configuration files include:

[0087] IoT platform information, including MQTT address;

[0088] IoT device information, including communication protocol information, timed query tag information, command mode, command format, and data parsing information; data parsing information includes data length, data format, number of decimal places, floating point tag, batch parsing tag, and negative number tag;

[0089] Communication auxiliary information, including LORA node ID and MODBUS slave address;

[0090] Timing interval information;

[0091] Update subscription information.

[0092] In addition, the method also includes automatically upgrading the IoT edge gateway, and the specific steps include:

[0093] Start the upgrade module monitoring function of the IoT edge gateway to subscribe to the preset MQTT upgrade topic to receive upgrade instructions from the IoT platform;

[0094] When receiving an upgrade instruction sent through the MQTT upgrade topic, receive the complete upgrade instruction data packet;

[0095] Compare the received upgrade version information with the current gateway version information to determine whether an upgrade operation needs to be performed;

[0096] If it is determined that an upgrade is required, download the compressed package of the upgrade file from the specified server according to the download link in the upgrade instruction;

[0097] Perform integrity check on the compressed package of the downloaded upgrade file to ensure that the file has not been tampered with or damaged during transmission;

[0098] After the verification is passed, decompress the compressed package to the specified directory;

[0099] Replace the current gateway program main file with the decompressed new program main file;

[0100] Update the gateway configuration file as needed, including but not limited to MQTT address, device information, and communication auxiliary information;

[0101] According to the upgrade requirements, update the target library files required by the gateway;

[0102] After all update operations are completed, restart the IoT Edge Gateway program to apply the new upgrade content and ensure that the gateway runs with the latest version.

[0103] Among them, the corresponding return value is parsed according to the configuration information, which specifically includes:

[0104] S251, reading rules or instructions related to return value parsing from a configuration file;

[0105] S252, decompressing or decrypting the return value according to the decompression instruction or decryption instruction in the configuration information;

[0106] S253, selecting a corresponding parser according to the data format of the return value;

[0107] S254. Use the selected parser to parse the preprocessed return value according to the parsing rules in the configuration file.

[0108] Among them, the rules include data type mapping, field name mapping, conditional judgment logic, and data format; the instructions include decompression instructions or decryption instructions.

[0109] Figure 3 A schematic diagram of the structure of a terminal 300 provided in an embodiment of the present invention, wherein the terminal 300 can be used to execute the communication method of the MQTT-based Internet of Things edge gateway system provided in an embodiment of the present invention.

[0110] The terminal 300 may include: a processor 310, a memory 320 and a communication module 330. These components communicate via one or more buses. Those skilled in the art will appreciate that the server structure shown in the figure does not limit the present invention, and it may be a bus structure or a star structure, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0111] The memory 320 can be used to store the execution instructions of the processor 310, and the memory 320 can be implemented by any type of volatile or non-volatile storage terminal or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. When the execution instructions in the memory 320 are executed by the processor 310, the terminal 300 can perform some or all of the steps in the following method embodiments.

[0112] The processor 310 is the control center of the storage terminal, and uses various interfaces and lines to connect various parts of the entire electronic terminal. It runs or executes software programs and / or modules stored in the memory 320, and calls data stored in the memory to perform various functions of the electronic terminal and / or process data. The processor can be composed of an integrated circuit (IC), for example, it can be composed of a single packaged IC, or it can be composed of multiple packaged ICs with the same or different functions. For example, the processor 310 can only include a central processing unit (CPU). In the embodiment of the present invention, the CPU can be a single computing core or multiple computing cores.

[0113] The communication module 330 is used to establish a communication channel so that the storage terminal can communicate with other terminals, receive user data sent by other terminals or send user data to other terminals.

[0114] The present invention also provides a computer storage medium, wherein the computer storage medium may store a program, and when the program is executed, the program may include some or all of the steps in each embodiment provided by the present invention. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM).

[0115] Those skilled in the art can clearly understand that the technology in the embodiments of the present invention can be implemented by means of software plus a necessary general hardware platform. Based on this understanding, the technical solution in the embodiments of the present invention, in essence or in other words, the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, and other media that can store program codes, including several instructions for enabling a computer terminal (which can be a personal computer, a server, or a second terminal, a network terminal, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention.

[0116] In this specification, the same or similar parts between the various embodiments can be referred to each other. In particular, for the terminal embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description in the method embodiment.

[0117] In the several embodiments provided by the present invention, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of systems or modules, which can be electrical, mechanical or other forms.

[0118] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0119] In addition, each functional module in each embodiment of the present invention may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.

[0120] Although the present invention has been described in detail with reference to the accompanying drawings and in combination with the preferred embodiments, the present invention is not limited thereto. Without departing from the spirit and essence of the present invention, a person of ordinary skill in the art may make various equivalent modifications or substitutions to the embodiments of the present invention, and these modifications or substitutions shall be within the scope of the present invention. Any person of ordinary skill in the art may easily think of changes or substitutions within the technical scope disclosed by the present invention, and these shall be within the scope of protection of the present invention.

Claims

1. An IoT edge gateway system based on MQTT, It is characterized in that It includes a gateway hardware layer, a system layer and a gateway application layer, which are connected in sequence; The gateway hardware layer integrates a variety of communication interface modules, including network port module, 4G / 5G communication module, RS232 communication module, RS485 communication module, USB serial bus interface, WIFI communication module, ZIGBEE communication module and LORA communication module, which are used to achieve diversified connections and data interaction with IoT devices, gateways and IoT platforms; The system layer is deployed on the gateway hardware layer and is responsible for the overall management and scheduling of the system, including the operating system, the communication protocol stack supporting the MQTT protocol, the data processing engine, the security authentication mechanism and the power management system. It controls each communication module and processes and forwards data. The gateway application layer is built on the system layer to provide user-customizable application service interfaces, supporting users to flexibly configure and expand the application scenarios of the edge gateway according to actual needs, including but not limited to a configuration module for setting and managing various parameters of the gateway, and a data parsing module for receiving data from IoT devices and performing format parsing and preliminary processing.

2. The MQTT-based IoT edge gateway system according to claim 1, It is characterized in that The gateway application layer also includes: The communication module is used to establish communication links between the gateway application layer and IoT devices, gateways and IoT platforms, and perform protocol conversion according to requirements; The packaging module is used to package the corresponding commands according to different configurations, package the parsed data into a JSON string, and add a universal timestamp field to the JSON string; The security verification module is used to verify and sign the data returned from the IoT device or IoT platform according to different configurations; The log module is used to record all critical events that occur during the operation of the system, including but not limited to system startup, configuration changes, and errors; The upgrade module is used to regularly check whether new versions or patches are released, and when a new version is detected, evaluate the differences between the current version and the new version and decide whether an upgrade operation is required; The timing module is used to periodically check the allocation of system resources.

3. A communication method of an MQTT-based IoT edge gateway system according to any one of claims 1-2, It is characterized in that include: Read the configuration file, initiate a connection according to the communication protocol type configured for the IoT device, and obtain the corresponding connection handle; According to different configuration information, package corresponding commands; Send the packaged corresponding command to the IoT device through the connection handle, and read the return value of the IoT device; Call the security verification module according to the configuration information to verify and sign the return value; Parse the corresponding return value according to the configuration information; Package the parsed data into a JSON string, add a universal timestamp field to the JSON string, and send the JSON string to the IoT platform.

4. The MQTT-based IoT edge gateway communication method according to claim 3, It is characterized in that The configuration file includes: IoT platform information, including MQTT address; IoT device information, including communication protocol information, timed query tag information, command mode, command format, and data parsing information; Communication auxiliary information, including LORA node ID and MODBUS slave address; Timing interval information; Update subscription information.

5. The MQTT-based IoT edge gateway communication method according to claim 4, It is characterized in that The data parsing information includes data length, data format, decimal places, floating point flag, batch parsing flag and negative number flag.

6. The MQTT-based IoT edge gateway communication method according to claim 3, It is characterized in that It also includes automatic upgrade of the IoT edge gateway, and the specific steps include: Start the upgrade module monitoring function of the IoT edge gateway to subscribe to the preset MQTT upgrade topic to receive upgrade instructions from the IoT platform; When receiving an upgrade instruction sent through the MQTT upgrade topic, receive the complete upgrade instruction data packet; Compare the received upgrade version information with the current gateway version information to determine whether an upgrade operation needs to be performed; If an upgrade is required, download the compressed package of the upgrade file from the specified server according to the download link in the upgrade instruction; Perform integrity check on the compressed package of the downloaded upgrade file to ensure that the file has not been tampered with or damaged during transmission; After the verification is passed, decompress the compressed package to the specified directory; Replace the current gateway program main file with the decompressed new program main file; Update the gateway configuration file as needed, including but not limited to MQTT address, device information, and communication auxiliary information; Update the target library files required by the gateway according to the upgrade requirements; After all update operations are completed, restart the IoT Edge Gateway program to apply the new upgrade content and ensure that the gateway runs with the latest version.

7. The MQTT-based IoT edge gateway communication method according to claim 3, It is characterized in that Parse the corresponding return value according to the configuration information, which specifically includes: Read the rules or instructions related to return value parsing from the configuration file; Decompress or decrypt the returned value according to the decompression instruction or decryption instruction in the configuration information; Select the corresponding parser according to the data format of the return value; Use the selected parser to parse the preprocessed return value according to the parsing rules in the configuration file.

8. The MQTT-based IoT edge gateway communication method according to claim 7, It is characterized in that The rules include data type mapping, field name mapping, conditional judgment logic, and data format; the instructions include decompression instructions or decryption instructions.

9. A terminal, It is characterized in that include: processor; A memory for storing execution instructions of the processor; The processor is configured to execute the method according to any one of claims 3 to 8.

10. A computer-readable storage medium storing a computer program, It is characterized in that When the program is executed by a processor, the method according to any one of claims 3 to 8 is implemented.

Citation Information

Cited By

  • Cloud-side collaborative intelligent gateway

    CN121000555A

  • Cloud-edge collaborative intelligent gateway

    CN121000555B