An Internet of Things gateway, data sending and reporting method, and Internet of Things system

By designing a multi-protocol-supported Internet of Things gateway, using the mapping relationship between inter-process communication and device service modules, the flexibility, disaster recovery and scalability of multi-protocol support in the prior art is solved, and higher system stability and scalability are achieved.

CN119210938BActive Publication Date: 2025-03-04ASPIRE TECH (SHENZHEN) LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411404541.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-10
Publication Date
2025-03-04
Estimated Expiration
2044-10-10

AI Technical Summary

Technical Problem

Existing IoT gateways have problems such as flexibility, disaster recovery, scalability and dynamic upgrades when supporting multi-protocols, resulting in insufficient system stability and scalability.

Method used

A gateway for IoT is designed, using gateway service program module and multiple device service program modules. Each device service program module adopts a different IoT device protocol, communicates and connects through inter-process communication technology, and configures the mapping relationship of the device service program module and its corresponding communication devices in the gateway service program module.

Benefits of technology

It realizes the flexibility and independence of multiple protocols, avoids the entire gateway crash caused by some protocol exceptions, and supports independent upgrades of a single device service program, improving the scalability and stability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119210938B_ABST
    Figure CN119210938B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of Internet of Things data collection technology, and provides an Internet of Things gateway, a data sending and reporting method, and an Internet of Things system. The Internet of Things gateway includes a gateway service program module and multiple device service program modules, each device service program module adopts a different Internet of Things device protocol, and the gateway service program module and the device service program module are connected by inter-process communication technology. The gateway service program module is configured with a mapping relationship between the device service program module and the Internet of Things device corresponding to the communication. The present invention configures multiple device service program modules with different Internet of Things device protocols, and the gateway service program module and the device service program module are connected by inter-process communication technology, so that each device service program module does not affect each other, and the entire gateway will not crash due to abnormal crash of some device service programs. At the same time, it can also realize the independent upgrade of a single device service program.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of Internet of Things data collection, and in particular to an Internet of Things gateway, a data sending and reporting method, and an Internet of Things system. Background Art

[0002] In the field of IoT data collection, the IoT gateway plays the role of protocol conversion between the IoT platform and IoT devices, so that the data of IoT devices with different communication protocols can be reported to the IoT platform through the IoT gateway, thereby realizing IoT data collection of IoT devices.

[0003] In the existing technology, IoT gateways usually have a single protocol or a limited number of protocols built in to achieve compatible docking with IoT devices with different communication protocols. However, the problems are:

[0004] 1) Flexibility issue: a gateway that supports a single protocol only supports one protocol when working;

[0005] 2) Disaster recovery issues: When a gateway that supports multiple protocols is working, if some of the protocols crash abnormally, the entire gateway will crash abnormally.

[0006] 3) Scalability issues: When adding a new protocol, it is necessary to build the entire gateway program including the interface part that connects to the IoT platform;

[0007] 4) Dynamic upgrade problem: when a new protocol interface is added to the gateway, it is necessary to stop all the original gateway protocols first, then upgrade the software, and finally restart the upgraded gateway. The upgrade process will affect the functions of other gateway protocols. Summary of the invention

[0008] Based on this, the purpose of the present invention is to provide an Internet of Things gateway, a data sending and reporting method, and an Internet of Things system to solve at least one technical problem in the background technology.

[0009] An Internet of Things gateway according to an embodiment of the present invention comprises a gateway service program module and a plurality of device service program modules, each of the device service program modules adopts a different Internet of Things device protocol;

[0010] The gateway service program module and the device service program module are connected by using inter-process communication technology;

[0011] The device service program module adopts the corresponding Internet of Things device protocol to communicate with at least one Internet of Things device, is used to receive the reported data sent by the Internet of Things device and report it to the gateway service program module, and is used to receive the sent data sent by the gateway service program module and send it to the Internet of Things device;

[0012] The gateway service program module is communicatively connected to the Internet of Things platform. The gateway service program module is configured with a mapping relationship between the device service program module and its corresponding communicating Internet of Things device, and is used to report the reported data of the device service program module to the Internet of Things platform, and to receive the sent data sent by the Internet of Things platform, and send it to the corresponding device service program module according to the mapping relationship.

[0013] In addition, an Internet of Things gateway according to the above embodiment of the present invention may also have the following additional technical features:

[0014] Furthermore, the gateway service program module includes:

[0015] The business processing unit is used to first store the reported data in a database, then read the data from the database and report it to the Internet of Things platform, and to first store the sent data in a database, then read the data from the database and send it to the corresponding device service program module.

[0016] Furthermore, the gateway service program module also includes:

[0017] A plurality of device service program stub units, used to establish a mapping relationship between a device service program module and its corresponding communicating IoT device, wherein each device service program module corresponds to a different device service program stub unit;

[0018] A device service program management unit, used for managing the plurality of device service program stub units;

[0019] The service processing unit is further used to send the issued data to the corresponding device service program stub unit through the device service program management unit, so as to be issued to the corresponding device service program module through the device service program stub unit.

[0020] Furthermore, the device service program stub unit is also used to periodically send heartbeats to the corresponding device service program module and receive heartbeat responses from the device service program module. When multiple heartbeats without responses are detected, the device service program module is determined to be dead and the device service program module is restarted.

[0021] Furthermore, the Internet of Things gateway also includes a device service script program module, the number of the device service script program modules corresponds to the number of the device service program modules, and each of the device service script program modules is correspondingly communicated with one of the device service program modules for starting the corresponding device service program module.

[0022] Furthermore, the Internet of Things gateway also includes a gateway service script program module, which is communicatively connected to the gateway service program module and is used to start the gateway service program module.

[0023] Furthermore, the device service program module includes:

[0024] The device service program unit adopts the device service socket technology to receive the downlink data sent by the gateway service program module, and reports the uplink data sent by the Internet of Things device to the gateway service program module.

[0025] A data sending method according to an embodiment of the present invention is applied to the above-mentioned Internet of Things gateway, and the data sending method includes:

[0026] When the gateway service program module receives the sent data sent by the Internet of Things platform, it sends the sent data to the corresponding device service program module according to the mapping relationship between the configured device service program module and the corresponding Internet of Things device to communicate;

[0027] When receiving the sent data, the device service program module sends the sent data to the corresponding communication-connected Internet of Things device through the corresponding Internet of Things device protocol.

[0028] A data reporting method according to an embodiment of the present invention is applied to the above-mentioned Internet of Things gateway, and the data reporting method includes:

[0029] The device service program module receives the reported data of the IoT device connected to it for communication, and reports the reported data to the gateway service program module;

[0030] After receiving the reported data, the gateway service program module reports the reported data to the Internet of Things platform.

[0031] An Internet of Things system according to an embodiment of the present invention includes an Internet of Things platform, a plurality of Internet of Things devices, and the Internet of Things gateway described above;

[0032] The Internet of Things platform and the plurality of Internet of Things devices are communicatively connected via the Internet of Things gateway.

[0033] Compared with the prior art: by configuring device service program modules of multiple different IoT device protocols, the flexibility problem of a single protocol can be solved. In addition, the gateway service program module and the device service program module are connected by inter-process communication technology, and a mapping relationship between each device service program module and its corresponding IoT device is configured in the gateway service program module, so that each device service program module does not affect each other, and the entire gateway will not crash due to an abnormal crash of some device service programs. At the same time, the independent upgrade of a single device service program can be realized, avoiding the problem of shutting down all protocols when upgrading a certain protocol. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 It is a technical architecture diagram of the Internet of Things gateway in the existing technology;

[0035] Figure 2 Schematic diagram of the technical architecture of the Internet of Things gateway in the first embodiment of the present invention;

[0036] Figure 3 Schematic diagram of the technical architecture of the gateway service program module in the second embodiment of the present invention;

[0037] Figure 4 A schematic diagram of the technical architecture of a device service program module in a third embodiment of the present invention;

[0038] Figure 5 Schematic diagram of the flow of the data sending method in the fourth embodiment of the present invention;

[0039] Figure 6 Schematic diagram of the flow of the data reporting method in the fifth embodiment of the present invention. DETAILED DESCRIPTION

[0040] In order to facilitate the understanding of the present invention, the present invention will be described more fully below with reference to the relevant drawings. Several embodiments of the present invention are given in the drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present invention more thorough and comprehensive.

[0041] It should be noted that when an element is referred to as being "fixed to" another element, it may be directly on the other element or there may be a central element. When an element is considered to be "connected to" another element, it may be directly connected to the other element or there may be a central element at the same time. The terms "vertical", "horizontal", "left", "right" and similar expressions used herein are for illustrative purposes only.

[0042] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present invention belongs. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.

[0043] like Figure 1 As shown, the technical architecture of the IoT gateway in the prior art includes modules such as a northbound interface module, a southbound interface module, and a business processing unit. The northbound interface module is oriented to the IoT platform, and is a one-to-one relationship. It is implemented according to the interface protocol of the IoT platform, and there will not be too many stability problems. It is mainly used for communication and connection with the IoT platform. The southbound interface module is oriented to the IoT device, and is integrated with a single or several protocols for communicating with the IoT device. It is mainly used for communication with IoT devices with different communication protocols. The business processing unit is mainly responsible for sending data from the IoT platform to the southbound interface module, and then the southbound interface module uses the corresponding protocol to send it to the IoT device. It is also responsible for forwarding data sent from the southbound IoT device to the IoT platform.

[0044] However, the technical architecture of the IoT gateway in the prior art has the following problems:

[0045] 1) Flexibility issue: a gateway that supports a single protocol only supports one protocol when working;

[0046] 2) Disaster recovery issues: When a gateway that supports multiple protocols is working, if some of the protocols crash abnormally, the entire gateway will crash abnormally.

[0047] 3) Scalability issues: When adding a new protocol, it is necessary to build the entire gateway program including the interface part that connects to the IoT platform;

[0048] 4) Dynamic upgrade problem: when a new protocol interface is added to the gateway, it is necessary to stop all the original gateway protocols first, then upgrade the software, and finally restart the upgraded gateway. The upgrade process will affect the functions of other gateway protocols.

[0049] To this end, the embodiments of the present invention provide an Internet of Things gateway, a method for sending and reporting data, and an Internet of Things system, which aims to solve at least one of the above technical problems existing in the Internet of Things gateway in the prior art by completely redesigning the technical architecture of the Internet of Things gateway. In order to more clearly illustrate an Internet of Things gateway, a method for sending and reporting data, and an Internet of Things system in the embodiments of the present invention, specific embodiments will be given below.

[0050] Embodiment 1

[0051] See also Figure 2 , shown is an Internet of Things gateway in the first embodiment of the present invention, including a gateway service program module and a plurality of device service program modules, each device service program module adopts a different Internet of Things device protocol, that is, each device service program module is compatible with different Internet of Things devices, that is, each device service program module can be connected to communicate with an Internet of Things device that adopts a corresponding Internet of Things device protocol;

[0052] The gateway service program module and the device service program module are connected by using inter-process communication technology (IPC for short).

[0053] The device service program module adopts the corresponding Internet of Things device protocol to communicate with at least one Internet of Things device, is used to receive the reported data sent by the Internet of Things device and report it to the gateway service program module, and is used to receive the sent data sent by the gateway service program module and send it to the Internet of Things device;

[0054] The gateway service program module is communicatively connected to the Internet of Things platform. The gateway service program module is configured with a mapping relationship between the device service program module and its corresponding communicating Internet of Things device. It is used to report the reported data of the device service program module to the Internet of Things platform, and to receive the sent data sent by the Internet of Things platform, and send it to the corresponding device service program module according to the mapping relationship.

[0055] Specifically, the gateway service program module receives the data that the device service program module requires to be reported, including but not limited to the device online and offline status data, device status data, event data, alarm data, etc., first stores it and then sends it to the IoT platform, and finally deletes the successfully reported data from the storage; at the same time, it also receives the operation instructions issued by the IoT platform, and accurately routes the operation instructions to the corresponding device service program module according to the mapping relationship between the configured device service program module and the corresponding IoT device to communicate with, so as to issue the operation instructions to the corresponding IoT device through the corresponding device service program module. In addition, it also regularly checks whether the device service program module is normal, and forcibly kills and restarts the device service program in a dead state, and tries to restore the device service program to a normal state.

[0056] Among them, the device service program module is responsible for connecting to different protocol devices. According to the characteristics of the protocol, the device service program can connect to only one device, multiple devices, or indirectly connect to multiple devices through the IoT subsystem (such as Figure 2 as shown).

[0057] In addition, in some preferred embodiments, the Internet of Things gateway also includes a device service script program module, the number of which corresponds to the number of the device service program modules, and each device service script program module is communicated with a device service program module for starting the corresponding device service program module, that is, the device service script program module is responsible for starting the device service program and restarting the device service program after the device service program exits abnormally. The embodiments of the present invention support any number of device script programs, and each device script program corresponds to a device service program.

[0058] The Internet of Things gateway also includes a gateway service script program module, which is connected to the gateway service program module for starting the gateway service program module. That is, the gateway service script program module is responsible for starting the gateway service program and restarting the gateway service program after the gateway service program exits abnormally. In the embodiment of the present invention, there is only one gateway service script program.

[0059] The Internet of Things gateway in the embodiment of the present invention can solve the flexibility problem of a single protocol by configuring device service program modules of multiple different Internet of Things device protocols. In addition, the gateway service program module and the device service program module are connected by using inter-process communication technology, and a mapping relationship between each device service program module and its corresponding communicating Internet of Things device is configured in the gateway service program module, so that each device service program module does not affect each other, and the entire gateway will not crash due to abnormal crash of some device service programs. At the same time, it can also realize independent upgrade of a single device service program, avoiding the problem of shutting down all protocols when upgrading a certain protocol.

[0060] Embodiment 2

[0061] The second embodiment of the present invention also provides an Internet of Things gateway. The difference between the Internet of Things gateway in this embodiment and the Internet of Things gateway in the first embodiment is that:

[0062] See also Figure 3 The gateway service program module in this embodiment includes an MQTT communication unit, a business processing unit, a data storage unit, a device service program management unit, several device service program stub units and a UnixDomainSocket service module.

[0063] Among them, the MQTT communication unit mainly realizes the subscription of related data sent to the Internet of Things platform (Subscribe), and the related topics include but are not limited to the platform sending device instructions, the platform updating device attributes, etc., and provides the received subscription message to the business processing unit, and provides the business processing unit with the ability to publish data to the Internet of Things platform (Publish). The related data includes but is not limited to the gateway itself data, device service program data, and device data (such as sensor data, sensor status, alarm data, etc.).

[0064] The business processing unit is used to store the reported data in a database first, then read the data from the database and report it to the Internet of Things platform, and to store the issued data in a database first, then read the data from the database and issue it to the corresponding device service program module. The device service program stub unit is used to establish a mapping relationship between the device service program module and its corresponding communicating Internet of Things device, wherein each device service program module corresponds to a different device service program stub unit; the device service program management unit is used to manage a number of device service program stub units; the business processing unit is also used to send the issued data to the corresponding device service program stub unit through the device service program management unit, so as to issue it to the corresponding device service program module through the device service program stub unit.

[0065] Specifically, the business processing unit is responsible for the processing of business data, including receiving device data sent from the device service program module, and storing the data sent from the device service program module in the database through the data storage unit. Then read the data from the database through the data storage unit, and send the data to the Internet of Things platform through the MQTT communication unit. After the data is successfully sent, the sent data record is deleted from the database through the data storage unit. It is also used to receive data from the Internet of Things platform, store the data sent from the Internet of Things platform in the database through the data storage unit, and then read the data from the database through the database storage unit, find the device route through the above mapping relationship, and send the data to the corresponding device service program pile unit. The device service program management unit manages the device service program pile unit, stipulates that the data sent by the device service program module to the Internet of Things platform must include the device ID, and the device service program module extracts the device ID from the data to establish a mapping table between the device and the device service program, thereby constructing the corresponding device service program pile.

[0066] In addition, the device service program stub unit is used to map the corresponding device service program module. When the business processing unit sends data to the device service program stub unit, the device service program stub unit transparently transmits the data to the corresponding device service program module. When the device service program stub unit receives data from the device service program module, it transparently transmits it to the business processing unit. The device service program stub unit is also used to periodically send heartbeats to the corresponding device service program module and receive the heartbeat response of the device service program module. When multiple heartbeats are detected without response, it is determined that the device service program module is dead, and the device service program module is restarted. Specifically, the device service program module can be forcibly killed and restarted through the corresponding device service script program module.

[0067] Among them, the UnixDomainSocket service module provides UnixDomainSocket service, listens to the UnixSock connection from the device service program module, and creates a device service program stub unit. That is, when the frame hears the data reported by a new IoT device (because the reported data contains the device ID), it will automatically create a mapping relationship between the IoT device and its corresponding device service program module, thereby automatically creating a new device service program stub unit.

[0068] Embodiment 3

[0069] The third embodiment of the present invention also provides an Internet of Things gateway. The difference between the Internet of Things gateway in this embodiment and the Internet of Things gateway in the first embodiment is that:

[0070] See also Figure 4 The device service program module in this embodiment includes a device service program unit. The device service program unit uses the device service bracket technology to receive the downlink data sent by the gateway service program module and report the uplink data sent by the IoT device to the gateway service program module. The device service bracket (SDK) is a functional component for interacting with the gateway service program. The device service program can communicate with the gateway service program based on the device service bracket component. Due to the use of the device service bracket technology, new protocols can be implemented on the basis of the device service bracket. There is no need to worry about how to send data to the IoT platform or how to receive data from the IoT platform, so there is no need to build the entire gateway program together, solving the scalability problem.

[0071] The service script program workflow of the device service script program module is an infinite loop, which loads the device service program in the loop body, waits for the device service program to exit, and immediately enters the next loop to load the device service program again after the device service program exits. This mechanism can prevent the device service program from crashing abnormally and resume operation at a very fast speed.

[0072] Specifically, the device service program unit includes: a UnixDomainSocket client communication unit, a device service bracket and other equipment units, wherein the UnixDomainSocket client communication unit is responsible for establishing a UnixSocket connection with the gateway service program module. The device service bracket provides a quick integration solution for developing device service program modules, and is mainly responsible for responding to the heartbeat sent by the gateway service program, receiving data from the Internet of Things platform sent by the gateway service program, and providing the received data from the Internet of Things platform to the device service program integration through a certain interface. Provide the business module data sending capability of the device service program. Other equipment units are business implementation modules of the device service program module, which are customized modules developed for specific protocols and specific subsystems. These modules need to use the device service bracket to upload the collected data to the Internet of Things platform, and need to obtain data update instructions, device operation instructions, etc. from the Internet of Things platform through the device service bracket.

[0073] Embodiment 4

[0074] See also Figure 5 The fourth embodiment of the present invention provides a data sending method, which is applied to the Internet of Things gateway described in any of the above embodiments. The data sending method includes:

[0075] Step S01, when the gateway service program module receives the sent data sent by the Internet of Things platform, according to the mapping relationship between the configured device service program module and the corresponding Internet of Things device to communicate, the sent data is sent to the corresponding device service program module;

[0076] Step S02, when receiving the sent data, the device service program module sends the sent data to the corresponding communication-connected IoT device through the corresponding IoT device protocol.

[0077] It should be noted that the data sending method in this embodiment is implemented based on the technical architecture of the Internet of Things gateway. For parts that are not fully described in this embodiment or other parts that are not described, please refer to the corresponding description part of the Internet of Things gateway in the above embodiment.

[0078] Embodiment 5

[0079] See also Figure 6 The fifth embodiment of the present invention provides a data reporting method, which is applied to the Internet of Things gateway described in any of the above embodiments. The data reporting method includes:

[0080] Step S11, the device service program module receives the reported data of the IoT device that is communicatively connected thereto, and reports the reported data to the gateway service program module;

[0081] Step S12: After receiving the reported data, the gateway service program module reports the reported data to the Internet of Things platform.

[0082] It should be noted that the data sending method in this embodiment is implemented based on the technical architecture of the Internet of Things gateway. For parts that are not fully described in this embodiment or other parts that are not described, please refer to the corresponding description part of the Internet of Things gateway in the above embodiment.

[0083] In combination with the data sending and reporting methods described in the fourth and fifth embodiments, in order to make data sending more reliable, in some optional embodiments, the following reliable data sending mechanism may be established:

[0084] Among them, the gateway service program module is divided into four threads for data from the device to the IoT platform and data from the IoT platform to the IoT device, namely, the uplink sending thread, the uplink data storage thread, the downlink sending thread, and the downlink data storage thread.

[0085] (1) Uplink data storage thread

[0086] After receiving the device uplink data from the device service program, the device service program stub writes it to the FiFo type uplink message queue. The uplink data storage thread of the business processing unit reads data from the FiFo message queue and processes it into attribute records, telemetry records, event records, device online records, and device offline records according to the message content. If the converted attribute records, telemetry records, and event records exceed the maximum sending size of MQTT, they will be decomposed into records smaller than the maximum sending size of MQTT and stored in the uploadmessages data table. When there is no message, the thread will be blocked for a few seconds. At the beginning of each polling, the last activity time of the thread is recorded in the memory statistics file.

[0087] (2) Uplink sending thread

[0088] Using polling, first determine whether the MQTT communication unit has established communication with the IoT platform. If communication is not established, try to clean up the data in the failmessages table that has failed to be sent for a long time, and finally suspend the thread for a period of time before polling. If communication has been established, read the unsent records from the uploadmessage data table in chronological order, and update the lasttimestamp time stamp each time it is read. For records with qos=0, call the MQTT communication unit and then delete the record from the database. For records with qos=1, call the MQTT communication unit and wait until the message of successful publishing is returned before deleting the record from the database. If no successful publishing message is received or an exception occurs during publishing, the number of failures increases. When the number of failures reaches the configured threshold, the record data is moved to the failmessages table and the record is deleted from the uploadmessage table. At the beginning of each polling, the last activity time of the thread is recorded in the memory statistics file.

[0089] (3) Downlink data storage thread

[0090] After receiving the subscribed message, the MQTT communication unit writes it to the FiFo type downstream message queue. The downstream data storage thread of the business processing unit reads data from the FiFo message queue and processes it into attribute update records according to the message content, which are stored in the downloadmessages data table. If there is no message, the thread is blocked for a few seconds. At the beginning of each polling, the last activity time of the thread is recorded in the memory statistics file.

[0091] (4) Downlink data sending thread

[0092] Using polling, read the unsent records from the downloadmessages data table in chronological order. Update the lasttimestamp each time it is read, restore the message field of the message to JSON data, query the device service pile module according to the device field in the JSON data, and judge the status of the device service pile module. If the status is online, call the attribute update function of the device service pile unit to send it. If the function returns a successful send, delete the record from the downloadmessages table, otherwise record the number of failures and enter the next polling. When the number of failures reaches the configured threshold, move the record data to the failmessages table and delete the record in the downloadmessage table. At the beginning of each polling, record the last activity time of the thread in the memory statistics file.

[0093] It should be noted that the above embodiments and their features can be arbitrarily combined without conflict, and the new technical solutions obtained by the combination still fall within the protection scope of the present invention.

[0094] Embodiment 6

[0095] Another aspect of the present invention further provides an Internet of Things system, comprising an Internet of Things platform, a plurality of Internet of Things devices, and an Internet of Things gateway as described in any of the above embodiments;

[0096] Among them, the IoT platform and several IoT devices are connected through the IoT gateway.

[0097] In summary, the Internet of Things gateway in the embodiment of the present invention can solve the flexibility problem of a single protocol by configuring a plurality of device service program modules of different Internet of Things device protocols. In addition, the gateway service program module and the device service program module are connected by inter-process communication technology, and the mapping relationship between each device service program module and its corresponding communicating Internet of Things device is configured in the gateway service program module, so that each device service program module does not affect each other, and the entire gateway will not crash due to abnormal crash of some device service programs. At the same time, it can also realize the independent upgrade of a single device service program, avoiding the problem of shutting down all protocols when upgrading a certain protocol. In addition, by adopting the device service bracket technology, new protocols can be implemented on the basis of the device service bracket, without having to worry about how to send data to the Internet of Things platform or how to receive data from the Internet of Things platform, so there is no need to build the entire gateway program together, solving the scalability problem.

[0098] Those skilled in the art will appreciate that the logic and / or steps represented in the flowchart or otherwise described herein, for example, may be considered as an ordered list of executable instructions for implementing logical functions, and may be specifically implemented in any computer-readable storage 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 instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For purposes of this specification, a "computer-readable storage medium" may 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 conjunction with such instruction execution systems, devices or apparatuses.

[0099] More specific examples (a non-exhaustive list) of computer-readable storage media include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable storage medium may even be a 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, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.

[0100] It should be understood that the various parts of the present invention 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 a combination thereof: 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.

[0101] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", 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 invention. 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 can be combined in any one or more embodiments or examples in a suitable manner.

[0102] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the patent of the present invention. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.

Claims

1. An Internet of Things gateway, characterized in that: The IoT gateway includes a gateway service program module and multiple device service program modules, each of which uses a different IoT device protocol; The gateway service program module and the device service program module are connected by using inter-process communication technology; The device service program module adopts the corresponding Internet of Things device protocol to communicate with at least one Internet of Things device, is used to receive the reported data sent by the Internet of Things device and report it to the gateway service program module, and is used to receive the sent data sent by the gateway service program module and send it to the Internet of Things device; The gateway service program module is connected to the Internet of Things platform for communication. The gateway service program module is configured with a mapping relationship between the device service program module and the corresponding Internet of Things device for communication, and is used to report the reported data of the device service program module to the Internet of Things platform, and to receive the sent data sent by the Internet of Things platform, and send it to the corresponding device service program module according to the mapping relationship; Wherein, the gateway service program module includes: A plurality of device service program stub units, used to establish a mapping relationship between a device service program module and its corresponding communicating IoT device, wherein each device service program module corresponds to a different device service program stub unit; A device service program management unit, used for managing the plurality of device service program stub units; In addition, the device service program stub unit is also used to periodically send heartbeats to the corresponding device service program module and receive heartbeat responses from the device service program module. When multiple heartbeats without responses are detected, the device service program module is determined to be dead and the device service program module is restarted.

2. The Internet of Things gateway according to claim 1, characterized in that: The gateway service program module includes: The business processing unit is used to first store the reported data in a database, then read the data from the database and report it to the Internet of Things platform, and to first store the sent data in a database, then read the data from the database and send it to the corresponding device service program module.

3. The Internet of Things gateway according to claim 2, characterized in that: The service processing unit is further used to send the issued data to the corresponding device service program stub unit through the device service program management unit, so as to be issued to the corresponding device service program module through the device service program stub unit.

4. The Internet of Things gateway according to claim 3, characterized in that: The device service program stub unit is also used to periodically send heartbeats to the corresponding device service program module and receive heartbeat responses from the device service program module. When multiple heartbeats without responses are detected, the device service program module is determined to be dead and the device service program module is restarted.

5. The Internet of Things gateway according to claim 1 or 4, characterized in that: The Internet of Things gateway also includes a device service script program module, the number of which corresponds to the number of the device service program modules, and each of the device service script program modules is correspondingly connected to a device service program module for starting the corresponding device service program module.

6. The Internet of Things gateway according to claim 1, characterized in that: The Internet of Things gateway also includes a gateway service script program module, which is communicatively connected to the gateway service program module and is used to start the gateway service program module.

7. The Internet of Things gateway according to claim 1, characterized in that: The device service program module includes: The device service program unit adopts the device service socket technology to receive the downlink data sent by the gateway service program module, and reports the uplink data sent by the Internet of Things device to the gateway service program module.

8. A data sending method, characterized in that: Applied to the Internet of Things gateway according to any one of claims 1 to 7, the data sending method includes: When the gateway service program module receives the sent data sent by the Internet of Things platform, it sends the sent data to the corresponding device service program module according to the mapping relationship between the configured device service program module and the corresponding Internet of Things device to communicate; When receiving the sent data, the device service program module sends the sent data to the corresponding communication-connected Internet of Things device through the corresponding Internet of Things device protocol.

9. A data reporting method, characterized in that: Applied to the Internet of Things gateway according to any one of claims 1 to 7, the data reporting method comprises: The device service program module receives the reported data of the IoT device connected to it for communication, and reports the reported data to the gateway service program module; After receiving the reported data, the gateway service program module reports the reported data to the Internet of Things platform.

10. An Internet of Things system, characterized in that: Comprising an Internet of Things platform, a plurality of Internet of Things devices, and an Internet of Things gateway as described in any one of claims 1 to 7; The Internet of Things platform and the plurality of Internet of Things devices are communicatively connected via the Internet of Things gateway.

Citation Information

Patent Citations

  • End-side Internet of Things platform architecture based on multi-scene application

    CN113542365A