An internet of things edge computing P2P data collection method and system

By using the IoT edge computing P2P data collection method and leveraging the MQTTS protocol and SDK, automatic connection between any smart device and the edge gateway can be achieved, solving the problems of difficult and costly IoT device connection and reducing the hardware and network burden of the IoT platform.

CN118573687BActive Publication Date: 2025-11-18CHINA CITIC BANK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410485026.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-22
Publication Date
2025-11-18
Estimated Expiration
2044-04-22

AI Technical Summary

Technical Problem

In existing IoT edge computing data acquisition methods, IoT devices need to go through an edge gateway to the IoT cloud platform, resulting in high hardware and bandwidth costs. Furthermore, existing edge gateways have a limited scope of application and cannot support the connection of any smart device.

Method used

The IoT edge computing P2P data collection method is adopted. The edge gateway is connected to the IoT platform via the MQTTS protocol. The IoT device integrates the SDK and selects the connection mode according to whether the edge gateway has a public IP address, realizing either proxy or direct connection. After calculation, the edge gateway transmits data to the IoT platform as needed.

Benefits of technology

It reduces the hardware and network costs of the IoT platform, allowing any smart device to automatically connect to the edge gateway, providing computing power and reducing the burden on the IoT platform.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118573687B_ABST
    Figure CN118573687B_ABST
Patent Text Reader

Abstract

The application relates to an Internet of Things edge computing P2P data collection method and system, which comprises the following steps: an edge gateway is connected to an Internet of Things platform through an MQTTS protocol; an Internet of Things device integrates an Internet of Things SDK, starts the SDK and is connected to the Internet of Things platform, and the connection mode is selected according to whether the edge gateway has a public network IP; the Internet of Things device communicates with the SDK, the SDK pushes messages to the edge gateway according to the connection mode, and the edge gateway uploads the Internet of Things device connection information to the Internet of Things platform; the edge gateway and the Internet of Things platform realize message uploading and issuing through the MQTTS; a long connection disconnection duration threshold value is set, when the long connection disconnection duration exceeds the threshold value, it can be judged that the edge gateway is down, and the Internet of Things device is re-distributed. The Internet of Things device is connected to the Internet of Things platform by integrating the SDK, the massive data is transmitted to the Internet of Things platform after being calculated by the edge gateway, the hardware and network costs of the Internet of Things platform are reduced, the Internet of Things platform can be connected regardless of whether the edge gateway has a public network IP, and the computing power is provided for the Internet of Things device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of Internet of Things (IoT) software development and application technology, and in particular to an IoT edge computing P2P data acquisition method and system. Background Technology

[0002] Currently, IoT edge computing data collection involves IoT devices directly connecting to an IoT cloud platform. The data is then processed by the device gateway and uploaded to the IoT cloud platform, or it is processed directly by the IoT cloud platform. Processing massive amounts of data generated by IoT devices in the cloud requires the IoT cloud platform to provide huge hardware and bandwidth costs. Another method for IoT edge computing data collection is for IoT devices to directly connect to an edge device, where the gateway device performs data processing before uploading to the IoT cloud platform. However, existing edge gateways have limited applicability, and existing software-based edge gateways must support public network access requirements. Otherwise, even devices that support dynamic configuration of various WAN protocols cannot connect, making it difficult to make any smart device an edge gateway. Summary of the Invention

[0003] To address the shortcomings of existing technologies, this invention proposes a P2P data acquisition method and system for IoT edge computing. Any smart device, regardless of whether it has a public network, can connect to the IoT platform through this method and provide computing power to other IoT devices. IoT devices complete the interface with the IoT platform by integrating an SDK. The IoT platform acts as a coordinator to schedule and coordinate the communication between IoT devices and edge gateways. Massive amounts of data are calculated by the edge gateway and then transmitted to the IoT platform on demand.

[0004] To achieve the above objectives, the technical solution adopted by the present invention includes:

[0005] A method, characterized in that it comprises:

[0006] S1. The edge gateway connects to the IoT platform via the MQTTS protocol;

[0007] S2. The IoT device integrates the IoT SDK, starts the SDK and connects to the IoT platform. It selects a connection mode based on whether the edge gateway has a public IP address. The connection modes include:

[0008] If the edge gateway does not have a public IP address, the IoT device SDK will connect to the network components of the edge gateway in proxy mode;

[0009] If the edge gateway has a public IP address, the IoT device SDK will connect to the network components of the edge gateway in direct connection mode;

[0010] S3. The IoT device communicates with the SDK. The SDK pushes messages to the edge gateway according to the connection mode. The edge gateway uploads the IoT device connection information to the IoT platform, and the IoT device goes online.

[0011] S4. Edge gateways and IoT platforms use MQTTS to send and receive messages;

[0012] S5. Set a threshold for the duration of long connection disconnection. When the duration of long connection disconnection exceeds the threshold, the edge gateway can be determined to be down and IoT devices can be reassigned.

[0013] Furthermore, step S1 also includes: the edge gateway reporting its hardware and bandwidth information, the IoT platform evaluating the performance of the edge gateway according to its hardware information, and based on the evaluation results, the IoT platform dividing the edge gateway into proxy device group information and sending the device public and private keys and device network suite information to the edge gateway.

[0014] Furthermore, step S2 also includes: obtaining information such as the IP address and port of the edge gateway to which it should connect, and establishing a connection between the IoT SDK and the edge gateway and maintaining a UDP or TCP connection tunnel.

[0015] Furthermore, if the edge gateway does not have a public IP address, the IoT device SDK will connect to the network components of the edge gateway in proxy mode, including:

[0016] The edge gateway connects to the IoT platform for exchange services;

[0017] Exchange services for IoT devices to connect to the IoT platform;

[0018] The IoT platform's switching service assists IoT devices in establishing UDP connection tunnels with the UDP proxy of the edge gateway;

[0019] If the edge gateway has a public IP address, the IoT device SDK will connect to the network components of the edge gateway in a direct connection mode, including:

[0020] IoT devices are directly connected to the edge gateway's direct network, and corresponding long connections are established as needed.

[0021] Further, step S4 includes: acquiring device messages generated by IoT devices; the IoT devices uploading the device messages to the edge gateway by maintaining a long connection with the edge gateway; the edge gateway performing protocol packet decoding to convert the device messages into standard messages; and the edge gateway pushing the standard messages to the IoT platform through an MQTTS long connection. The standard messages are messages that conform to the IoT platform's object model definition.

[0022] The IoT platform determines the edge gateway to which the IoT device is connected based on the IoT device's online information, and pushes the standard message to the edge gateway through an MQTTS long connection. The edge gateway executes the protocol script encoding function to convert the standard message into the device message. The edge gateway pushes the device message to the IoT device through the long connection maintained with the IoT device, and the IoT device performs specific actions based on the device message.

[0023] Furthermore, step S5 also includes: after the edge gateway crashes, the IoT device periodically polls the IoT platform to obtain connection information and continuously attempts to connect to the edge gateway. After the edge gateway restores service within a predetermined time or the IoT platform re-classifies the devices, the IoT device will resume normal communication with the IoT platform.

[0024] This invention also relates to an IoT edge computing P2P data acquisition system, characterized in that it comprises:

[0025] The connectivity module is used to connect the edge gateway, the IoT platform, and the IoT devices.

[0026] The judgment module is used to determine whether the edge gateway has a public IP address in order to determine the specific connection mode.

[0027] The transmission module is used to send and receive messages.

[0028] The exception module is used to handle exceptions during the connection process.

[0029] The present invention also relates to a computer-readable storage medium, characterized in that the storage medium stores a computer program, which, when executed by a processor, implements the above-described method.

[0030] The present invention also relates to an electronic device, characterized in that it includes a processor and a memory;

[0031] The memory is used to store program instructions;

[0032] The processor is used to execute the above-described method by invoking program instructions.

[0033] The present invention also relates to a computer program product, including a computer program and / or instructions, characterized in that the computer program and / or instructions, when executed by a processor, implement the steps of the above-described method.

[0034] The beneficial effects of this invention are as follows:

[0035] The IoT edge computing P2P data acquisition method and system described in this invention enables massive amounts of data to be processed by the edge gateway and transmitted to the IoT platform on demand, greatly reducing the hardware and network costs of the IoT platform. Smart devices can join the IoT platform through this method to provide computing power for IoT devices. After integrating the SDK, IoT devices can automatically and seamlessly connect to the edge gateway according to the connection mode. Attached Figure Description

[0036] Figure 1 This is a schematic diagram of the process of a P2P data acquisition method for IoT edge computing according to the present invention.

[0037] Figure 2 This is a schematic diagram of the structure of an IoT edge computing P2P data acquisition system according to the present invention. Detailed Implementation

[0038] This invention can be divided into three parts: an IoT platform, an edge gateway, and IoT devices.

[0039] The IoT platform is the core of the system, responsible for the management and distribution of information such as devices, networks, and device protocols;

[0040] Edge gateways can be any smart device, such as ordinary computers, cloud servers, smart devices, etc. The IoT platform will evaluate the performance and network status of each edge gateway, and the evaluation results will serve as the basis for deciding which devices the edge gateway will proxy.

[0041] IoT devices need to install and run the SDK provided by the IoT platform to automatically sense and connect to the edge gateway.

[0042] To better understand the content of this invention, a detailed description will be provided in conjunction with the accompanying drawings and embodiments.

[0043] The first aspect of this invention relates to a process flow as follows: Figure 1 The IoT edge computing P2P data acquisition method shown includes:

[0044] Step S1. The edge gateway connects to the IoT platform via the MQTTS protocol and reports its hardware and bandwidth information. The IoT platform evaluates the performance of the edge gateway according to its hardware information. Based on the evaluation results, the IoT platform divides the edge gateway into agent device groups and sends the device public and private keys and device network suite information to the edge gateway.

[0045] Additionally, the network suite is started according to the configuration issued by the IoT platform, including: starting network services, loading protocol packets, authentication packets, etc.

[0046] Specifically, MQTTS is an extension of the MQTT protocol. It uses TLS / SSL to encrypt and authenticate the MQTT protocol, thereby improving the security and reliability of communication. MQTTS can connect to various IoT devices across the entire IoT platform and interconnect with data sources, edge computing devices, sensors, and other smart terminal devices for real-time communication.

[0047] Step S2. The IoT device integrates the IoT SDK, starts the SDK, and connects to the IoT platform to obtain information such as the IP address and port of the edge gateway it should connect to. The IoT SDK establishes a connection with the edge gateway and maintains a UDP or TCP connection tunnel. The connection mode is selected based on whether the edge gateway has a public IP address. The connection modes include:

[0048] If the edge gateway does not have a public IP address, the IoT device SDK will connect to the network components of the edge gateway in proxy mode;

[0049] If the edge gateway has a public IP address, the IoT device SDK will connect to the network components of the edge gateway in direct connection mode.

[0050] Specifically, if the edge gateway does not have a public IP address, the IoT device SDK will connect to the network components of the edge gateway in proxy mode, including: the exchange service for the edge gateway to connect to the IoT platform; the exchange service for the IoT device to connect to the IoT platform; and the exchange service of the IoT platform to assist the IoT device in establishing a UDP connection tunnel with the UDP proxy of the edge gateway.

[0051] When an edge gateway lacks a public IP address, IoT devices cannot directly connect to it. In this case, the IoT platform's switching service assists the edge gateway in establishing a UDP tunnel with the proxied IoT device, i.e., NAT traversal. If NAT traversal fails, the edge gateway will be unable to access the platform's computing power. NAT traversal solves the problem of communication between internal and external networks. When an edge gateway lacks a public IP address and cannot be accessed from the external network, NAT traversal technology enables communication between devices. This uses a full cone NAT traversal method: the edge gateway and the IoT device each first connect to the switching service. After receiving the connections from the edge gateway and the IoT device, the switching service obtains the public IP addresses and NAT-assigned port numbers of the edge gateway and the IoT device, and then sends the addresses and port numbers to the edge gateway and the IoT device, allowing them to connect to each other's public IP addresses and ports for direct communication.

[0052] Specifically, if the edge gateway has a public IP address, the IoT device SDK will connect to the network components of the edge gateway in a direct connection mode, including: the direct connection network end from the IoT device to the edge gateway, and the establishment of corresponding long connections as needed.

[0053] Step S3. The IoT device communicates with the SDK. The SDK pushes messages to the edge gateway according to the connection mode. The edge gateway uploads the IoT device connection information to the IoT platform, and the IoT device goes online. Communication protocols between the IoT device and the SDK include MQTT, TCP, etc.

[0054] Step S4. The edge gateway and the IoT platform use MQTTS to send and receive messages.

[0055] Specifically, when the edge gateway has a public IP address and selects the direct connection mode, the IoT device directly connects to the network component of the edge gateway. The edge gateway and the IoT platform communicate via MQTTS to send messages up and down. When the edge gateway does not have a public IP address and selects the proxy mode, the IoT device connects to the network component of the edge gateway via UDP. The edge gateway and the IoT platform communicate via MQTTS to send messages up and down.

[0056] The message uploading process includes: acquiring device messages generated by IoT devices; the IoT devices uploading the device messages to the edge gateway by maintaining a long connection with the edge gateway; the edge gateway performing protocol packet decoding to convert the device messages into standard messages; and the edge gateway pushing the standard messages to the IoT platform through an MQTTS long connection. The standard messages are messages that conform to the IoT platform's object model definition.

[0057] The message delivery process includes: the IoT platform determines the edge gateway to which the IoT device is connected based on the IoT device's online information, and pushes the standard message to the edge gateway through an MQTTS long connection; the edge gateway executes the protocol script encoding function to convert the standard message into the device message; the edge gateway pushes the device message to the IoT device through the long connection maintained with the IoT device; and the IoT device performs specific actions based on the device message.

[0058] Step S5. Set a threshold for the duration of long connection disconnection. When the duration of long connection disconnection exceeds the threshold, the edge gateway can be determined to be down and IoT devices can be reassigned.

[0059] After the edge gateway goes down, IoT devices periodically poll the IoT platform to obtain connection information and continuously attempt to connect to the edge gateway. Once the edge gateway resumes service within a predetermined time or the IoT platform re-classifies the devices, the IoT devices will resume normal communication with the IoT platform.

[0060] Additionally, since the edge gateway is any device running a specific client of the IoT platform, its stability is difficult to guarantee. Therefore, possible abnormal situations should be considered and handled. In addition to the above-mentioned abnormal handling methods, the IoT platform can also judge its operating status through the status of the MQTTS long connection and the status information sent by the edge gateway.

[0061] Another aspect of the present invention relates to an IoT edge computing P2P data acquisition system, the structure of which is as follows: Figure 2 As shown, it includes:

[0062] The connectivity module is used to connect the edge gateway, the IoT platform, and the IoT devices.

[0063] The judgment module is used to determine whether the edge gateway has a public IP address in order to determine the specific connection mode.

[0064] The transmission module is used to send and receive messages.

[0065] The exception module is used to handle exceptions during the connection process.

[0066] By using this system, the aforementioned computational processing methods can be executed and the corresponding technical effects can be achieved.

[0067] Embodiments of the present invention also provide a computer-readable storage medium capable of implementing all the steps of the methods in the above embodiments, wherein the computer-readable storage medium stores a computer program that, when executed by a processor, implements all the steps of the methods in the above embodiments.

[0068] Embodiments of the present invention also provide an electronic device for performing the above-described method. As an implementation device for the method, the electronic device includes at least a processor and a memory. In particular, the memory stores data and related computer programs required for performing the method, such as stored program instructions. The processor calls the data and programs in the memory to execute all the steps of the method and obtain the corresponding technical effect.

[0069] Preferably, the electronic device may include a bus architecture, which may include any number of interconnected buses and bridges. The bus will include various circuits linked together by one or more processors and memories. The bus may also link together various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. The bus interface provides an interface between the bus and the receiver and transmitter. The receiver and transmitter may be the same element, i.e., a transceiver, providing a unit for communicating with various other systems over a transmission medium. The processor is responsible for managing the bus and general processing, while the memory may be used to store data used by the processor during operation.

[0070] Additionally, the electronic device may further include components such as a communication module, an input unit, an audio processor, a display, and a power supply. The processor (or controller, operating control) used may include a microprocessor or other processor device and / or logic device, which receives input and controls the operation of various components of the electronic device; the memory may be one or more of a buffer, flash memory, hard drive, removable media, volatile memory, non-volatile memory, or other suitable devices, which can store the aforementioned data information, and may also store programs for executing the information, and the processor can execute the program stored in the memory to achieve information storage or processing, etc.; the input unit is used to provide input to the processor, for example, it can be a button or touch input device; the power supply is used to provide power to the electronic device; the display is used to display images and text, for example, it can be an LCD display. The communication module is a transmitter / receiver that transmits and receives signals via an antenna. The communication module (transmitter / receiver) is coupled to the processor to provide input signals and receive output signals, which can be the same as in conventional mobile communication terminals. Based on different communication technologies, multiple communication modules can be incorporated into the same electronic device, such as cellular network modules, Bluetooth modules, and / or wireless LAN modules. The communication module (transmitter / receiver) is also coupled to a speaker and microphone via an audio processor to provide audio output through the speaker and receive audio input from the microphone, thereby enabling typical telecommunications functions. The audio processor can include any suitable buffer, decoder, amplifier, etc. Furthermore, the audio processor is coupled to a central processing unit, enabling on-device recording via the microphone and on-device playback of stored sound via the speaker.

[0071] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0072] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A system that specifies functions in one or more boxes.

[0073] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including an instruction set implemented in a process. Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0074] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the functions specified in one or more boxes. Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the invention.

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

Claims

1. A P2P data acquisition method for IoT edge computing, characterized in that, include: S1. The edge gateway connects to the IoT platform via the MQTTS protocol; S2. The IoT device integrates the IoT SDK, starts the SDK and connects to the IoT platform. It selects a connection mode based on whether the edge gateway has a public IP address. The connection modes include: If the edge gateway does not have a public IP address, the IoT device SDK will connect to the network components of the edge gateway in proxy mode; If the edge gateway has a public IP address, the IoT device SDK will connect to the network components of the edge gateway in direct connection mode; S3. The IoT device communicates with the SDK. The SDK pushes messages to the edge gateway according to the connection mode. The edge gateway uploads the IoT device connection information to the IoT platform, and the IoT device goes online. S4. Edge gateways and IoT platforms use MQTTS to send and receive messages; S5. Set a threshold for the duration of long connection disconnection. When the duration of long connection disconnection exceeds the threshold, the edge gateway can be determined to be down and IoT devices can be reassigned.

2. The method as described in claim 1, characterized in that, Step S1 further includes: the edge gateway reporting its hardware and bandwidth information; the IoT platform evaluating the performance of the edge gateway according to its hardware information; and, based on the evaluation results, the IoT platform dividing the edge gateway into agent device group information and sending the device public and private keys and device network suite information to the edge gateway.

3. The method as described in claim 1, characterized in that, Step S2 further includes: obtaining information such as the IP address and port of the edge gateway to be connected, and establishing a connection between the IoT SDK and the edge gateway and maintaining a UDP or TCP connection tunnel.

4. The method as described in claim 1, characterized in that, If the edge gateway does not have a public IP address, the IoT device SDK will connect to the network components of the edge gateway in proxy mode, including: The edge gateway connects to the IoT platform for exchange services; Exchange services for IoT devices to connect to the IoT platform; The IoT platform's switching service assists IoT devices in establishing UDP connection tunnels with the UDP proxy of the edge gateway; If the edge gateway has a public IP address, the IoT device SDK will connect to the network components of the edge gateway in a direct connection mode, including: IoT devices are directly connected to the edge gateway's direct network, and corresponding long connections are established as needed.

5. The method as described in claim 1, characterized in that, Step S4 includes: acquiring device messages generated by IoT devices; the IoT devices uploading the device messages to the edge gateway by maintaining a long connection with the edge gateway; the edge gateway performing protocol packet decoding to convert the device messages into standard messages; and the edge gateway pushing the standard messages to the IoT platform through an MQTTS long connection. The standard messages are messages that conform to the IoT platform's object model definition. The IoT platform determines the edge gateway to which the IoT device is connected based on the IoT device's online information, and pushes the standard message to the edge gateway through an MQTTS long connection. The edge gateway executes the protocol script encoding function to convert the standard message into the device message. The edge gateway pushes the device message to the IoT device through the long connection maintained with the IoT device, and the IoT device performs specific actions based on the device message.

6. The method as described in claim 1, characterized in that, Step S5 further includes: after the edge gateway crashes, the IoT device periodically polls the IoT platform to obtain connection information and continuously attempts to connect to the edge gateway. After the edge gateway restores service within a predetermined time or the IoT platform re-divides the devices, the IoT device will resume normal communication with the IoT platform.

7. An IoT edge computing P2P data acquisition system, characterized in that, include: The connectivity module is used to connect the edge gateway, the IoT platform, and the IoT devices. The judgment module is used to determine whether the edge gateway has a public IP address in order to determine the specific connection mode. The transmission module is used to send and receive messages. The exception module is used to handle exceptions during the connection process.

8. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the method of any one of claims 1 to 6.

9. An electronic device, characterized in that, Including processor and memory; The memory is used to store program instructions; The processor is configured to execute the method of any one of claims 1 to 6 by invoking program instructions.

10. A computer program product comprising a computer program and / or instructions, characterized in that, When the computer program and / or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • A data exchange method for an Internet of things gateway and a service end

    CN104506567A

  • An industrial Internet of Things system based on edge computing and a data processing method thereof

    CN109862087A