CN115102807B - Method, device, server, client and storage medium for gateway data transmission of Internet of things - Google Patents

Method, device, server, client and storage medium for gateway data transmission of Internet of things Download PDF

Info

Publication number
CN115102807B
CN115102807B CN202210586100.1A CN202210586100A CN115102807B CN 115102807 B CN115102807 B CN 115102807B CN 202210586100 A CN202210586100 A CN 202210586100A CN 115102807 B CN115102807 B CN 115102807B
Authority
CN
China
Prior art keywords
message
sensing node
data
node data
retransmission timer
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210586100.1A
Other languages
Chinese (zh)
Other versions
CN115102807A (en
Inventor
宁磊
洪启俊
梅逢城
陈勇
曹建民
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Technology University
Original Assignee
Shenzhen Technology University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Technology University filed Critical Shenzhen Technology University
Priority to CN202210586100.1A priority Critical patent/CN115102807B/en
Publication of CN115102807A publication Critical patent/CN115102807A/en
Priority to PCT/CN2022/124712 priority patent/WO2023226277A1/en
Application granted granted Critical
Publication of CN115102807B publication Critical patent/CN115102807B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/66Arrangements for connecting between networks having differing types of switching systems, e.g. gateways
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W28/00Network traffic management; Network resource management
    • H04W28/02Traffic management, e.g. flow control or congestion control
    • H04W28/0278Traffic management, e.g. flow control or congestion control using buffer status reports
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W84/00Network topologies
    • H04W84/18Self-organising networks, e.g. ad-hoc networks or sensor networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W88/00Devices specially adapted for wireless communication networks, e.g. terminals, base stations or access point devices
    • H04W88/16Gateway arrangements
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Abstract

The embodiment of the invention provides a method, a device, a server, a client and a storage medium for data transmission of an Internet of things gateway, wherein the method comprises the following steps: collecting sensing node data, storing the sensing node data in a buffer area, and initializing a retransmission timer and a message identifier, wherein the retransmission timer and the message identifier are corresponding to the sensing node; if the sensing node data meets the sending condition, storing the sensing node data in a message queue; reading the sensing node data from the message queue and transmitting the sensing node data; receiving the message confirmation bitmap and searching for the message identifier in the message confirmation bitmap; if the message acknowledgement bitmap contains a message identifier, the retransmission timer and the message identifier are reset and the sensing node data in the buffer is emptied. Based on the method, the reliability of data transmission and the stability of gateway service can be improved.

Description

Method, device, server, client and storage medium for gateway data transmission of Internet of things
Technical Field
The invention relates to the technical field of data transmission of the Internet of things, in particular to a method, a device, a server, a client and a storage medium for data transmission of a gateway of the Internet of things.
Background
The Internet of things gateway is a bridge for connecting Internet of things equipment and an Internet of things cloud platform and realizes bidirectional communication with the Internet of things cloud platform. However, with the generation of the emerging internet of things scene, higher requirements are put on the transmission capability and technology of the internet of things gateway. The NB-IoT gateway is another choice of the wireless communication technology of the internet of things due to the characteristics of low cost, large connection, low power consumption and wide coverage.
Currently, embedded software of NB-IoT gateways typically employs a bare metal single loop implementation scheme, i.e., loop once to perform data acquisition, data processing, and data reporting, but the reliability of the scheme is susceptible to network environment, for example, data loss may be caused by network delay during data transmission, which is not acceptable for sensing nodes that require timing to accurately report data. In addition, during a gateway service outage, the failure of the sensor to perform acquisition or the failure of the gateway to receive and process data from the sensing node can also result in data loss, which can reduce the integrity of the data transmission process. In addition, the scheme cannot ensure the accessibility or real-time of data transmission at an application layer, and a fault may occur on a link from the receiving of the sensing node data to the transmission to the cloud platform at the gateway, so that the data is permanently lost, and a short-term or long-term transmission fault is caused.
Disclosure of Invention
The following is a summary of the subject matter described in detail herein. This summary is not intended to limit the scope of the claims.
The embodiment of the invention provides a method, a device, a server, a client and a storage medium for data transmission of an Internet of things gateway, which can improve the reliability of data transmission and the persistence and stability of gateway services.
In a first aspect, an embodiment of the present invention provides a method for data transmission of an internet of things gateway, including:
collecting sensing node data, storing the sensing node data in a buffer zone, initializing a retransmission timer and a message identifier, wherein the retransmission timer and the message identifier are corresponding to the sensing node, the retransmission timer is used for triggering retransmission of the sensing node data through timing, and the message identifier is used for identifying the sensing node data stored in the buffer zone;
if the sensing node data meets the sending condition, storing the sensing node data in a message queue;
reading the sensing node data from the message queue and sending the sensing node data;
receiving a message confirmation bitmap and searching the message identifier in the message confirmation bitmap;
and if the message confirmation bitmap comprises the message identifier, resetting the retransmission timer and the message identifier, and emptying the sensing node data in the buffer zone.
In a second aspect, an embodiment of the present invention provides an apparatus for data transmission of an internet of things gateway, including:
the first processing module is used for collecting sensing node data, storing the sensing node data in a buffer zone, initializing a retransmission timer and a message identifier, wherein the retransmission timer and the message identifier are both corresponding to the sensing node, the retransmission timer is used for triggering retransmission of the sensing node data through timing, and the message identifier is used for identifying the sensing node data stored in the buffer zone;
the second processing module is used for storing the sensing node data in a message queue if the sensing node data meets the sending condition;
the third processing module is used for reading the sensing node data from the message queue and sending the sensing node data;
a fourth processing module, configured to receive a message acknowledgement bitmap, and search the message identifier in the message acknowledgement bitmap;
and a fifth processing module, configured to reset the retransmission timer and the message identifier and empty the sensing node data in the buffer if the message acknowledgement bitmap includes the message identifier.
In a third aspect, an embodiment of the present invention provides an electronic device, including a memory and a processor, where the memory stores a computer program, and the processor implements the method for data transmission of the gateway of the internet of things in the first aspect when executing the computer program.
In a fourth aspect, an embodiment of the present invention provides a computer readable storage medium, where a program is stored, where the program is executed by a processor to implement a method for data transmission of an internet of things gateway according to the first aspect.
The embodiment of the invention at least comprises the following beneficial effects: by introducing an embedded real-time operating system and adopting a mode of sharing a buffer memory and a message queue, the method realizes decoupling of data acquisition and data reporting based on a multi-task scheduling mechanism besides the traditional acquisition-processing-reporting model, and can improve the reliability of data transmission; the data decoupling is realized by utilizing the buffer area and the queue, a retransmission mechanism is introduced, the cloud platform informs the gateway of data transmission in a message bitmap mode, and the message which is not confirmed is retransmitted, so that the reliability of data transmission can be further improved; by introducing health checking and hierarchical restoration mechanisms, the persistence and stability of NB-IoT gateway services may also be improved.
Drawings
FIG. 1 is a flow chart of a method according to an embodiment of the invention;
fig. 2 is a schematic diagram of NB-IoT gateway data transmission procedure in a method according to an embodiment of the present invention;
FIG. 3 is a schematic flow chart of a data acquisition task in the method according to the embodiment of the invention;
FIG. 4 is a flow chart of a buffer scanning task in the method according to the embodiment of the invention;
FIG. 5 is a schematic flow chart of a data reporting task in the method according to the embodiment of the present invention;
FIG. 6 is a schematic flow chart of a health check task in a method according to an embodiment of the invention;
fig. 7 is a schematic flow chart of a cloud platform message acknowledgement in the method according to the embodiment of the present invention;
FIG. 8 is a flow chart of data transmission and confirmation in the method according to the embodiment of the invention;
FIG. 9 is a schematic diagram of an apparatus according to an embodiment of the present invention;
fig. 10 is a schematic diagram of an electronic device according to an embodiment of the invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
It should be understood that if an orientation description such as upper, lower, front, rear, left, right, etc. is referred to in the specification and claims and the above-described drawings, the orientation or positional relationship indicated is based on the orientation or positional relationship shown in the drawings, only for convenience of describing the present invention and simplifying the description, and does not indicate or imply that the apparatus or elements referred to must have a specific orientation, be configured and operated in a specific orientation, and thus should not be construed as limiting the present invention.
At least one meaning is one or more, a plurality of meaning is two or more, and greater than, less than, exceeding, etc. are understood to not include the present number, and greater than, less than, within, etc. are understood to include the present number. The description first and second are only for the purpose of distinguishing technical features and should not be construed as indicating or implying relative importance or implying the number of technical features indicated or the precedence of technical features indicated.
Term interpretation:
NB-IoT: the full scale Narrow Band Internet of Things is a cellular-based narrowband Internet of things technology, is also an optimal connection technology of a low-power-consumption wide area Internet of things (LPWA), bears the basic connection tasks of intelligent worlds such as intelligent families, intelligent trips, intelligent cities and the like, is widely applied to various aspects such as intelligent meters, intelligent parking, intelligent street lamps, intelligent agriculture, white appliances and the like, and is one of basic connection technologies in the 5G era.
NB-IoT gateway: an intelligent gateway based on NB-IoT technology. The internet of things is usually not a simple IP network, and often involves integration of multiple networks, and finally uses the IP network as a core to connect multiple heterogeneous networks for communication and data exchange. Many industrial devices support RS-485 serial network connection, data reporting and receiving control are performed by using a MODBUS protocol, an Internet of things server in an IP network communicates with the industrial devices through an intelligent gateway, the intelligent gateway realizes the butt joint of the MODBUS and the MQTT protocol, and the devices connected by the RS-485 bus can be added into an Internet of things operating system or an Internet of things platform, so that the devices can report information to the IoT server, and if the IoT server needs to control the devices, control data can be written into the devices through the MODBUS protocol.
NB-IoT module: the wireless communication module refers to an NB-IoT gateway, which is a modularized component integrating a chip, a memory, a power amplifier device, an antenna interface, a functional interface and the like on a circuit board, and realizes functions of radio wave receiving and transmitting, channel noise filtering, mutual conversion between analog signals and digital signals and the like. The terminal of the Internet of things is connected to the network through the wireless communication module, so that the data wireless transmission requirement is met, and the wireless communication module is key equipment for realizing intelligent networking of everything.
Cloud platform: also referred to as cloud computing platforms, refer to services based on hardware resources and software resources that provide computing, networking, and storage capabilities.
Referring to fig. 1, fig. 1 is a flow chart of a method according to an embodiment of the present invention, including, but not limited to, the following steps:
step S100: the method comprises the steps of collecting sensing node data, storing the sensing node data in a buffer zone, initializing a retransmission timer and a message identifier, wherein the retransmission timer and the message identifier are both corresponding to the sensing node, the retransmission timer is used for triggering retransmission of the sensing node data through timing, and the message identifier is used for identifying the sensing node data stored in the buffer zone.
Step S200: and if the sensing node data meets the sending condition, storing the sensing node data in a message queue.
Step S300: and reading the sensing node data from the message queue and sending the sensing node data.
Step S400: a message acknowledgement bitmap is received and a message identifier is looked up in the message acknowledgement bitmap.
Step S500: if the message acknowledgement bitmap contains a message identifier, the retransmission timer and the message identifier are reset and the sensing node data in the buffer is emptied.
The NB-IoT gateway collects data which is needed to be uploaded to the cloud platform from the internet of things equipment through the mounting sensor node, namely sensor node data. The internet of things equipment refers to terminal equipment in an application scene of the internet of things, such as street lamps, water meters, shared bicycles, logistics containers, air monitors and the like, and has the characteristics of low power consumption, wide area range, small transmission data volume, low updating frequency and the like. The sensing node data written into the buffer area is bound with a retransmission timer and a message ID (message identifier), when the retransmission timer meets the preset condition, the corresponding data is retransmitted, and the message ID is distributed to the data for sequencing the data according to the sequence stored into the buffer area. The message confirmation bitmap is a message confirmation response packet sent by the cloud platform, and the NB-IoT gateway performs message confirmation by receiving the fed back message confirmation bitmap and checking whether the message ID of the sent data is recorded in the message confirmation bitmap, i.e., determining whether the reported data is reachable and whether the data retransmission needs to be performed.
Specifically, as shown in fig. 2, the technical solution of the embodiment of the present invention may divide the data transmission task that is responsible for the NB-IoT gateway into three parts: besides the data acquisition task, the buffer area scanning task and the data reporting task, a health examination task is also provided, and the task is an independent task and does not participate in the transmission of the data stream. According to the embodiment of the invention, by introducing an embedded real-time operating system and adopting a mode of sharing the memory of the buffer area and the message queue, the decoupling of data acquisition and data reporting is realized based on a multi-task scheduling mechanism besides the traditional acquisition-processing-reporting model, so that the reliability of data transmission can be improved.
In some embodiments, step S100 may include, but is not limited to, the following steps:
and step S101, collecting sensing node data based on a first time interval.
And step S102, writing the data of the sensing nodes into the buffer data block.
Step S103, initializing a retransmission timer of the buffer data block to be zero.
Step S104, increasing the value of the message identifier of the buffer data block.
As an example, as shown in fig. 3, a flow chart of a data collection task in the method according to the embodiment of the present invention is shown, where a first time interval is a collection frequency of data of a sensing node, that is, a delay time period when the task ends, where the delay time period is set to wake up the data collection task after delaying for ten seconds; after acquisition, the sensing node data is written into a buffer area data block, and a retransmission timer and a message identifier which are bound with the buffer area data block are written together with the data content; initializing a retransmission timer of the buffer data block, and setting a flag bit of the retransmission timer to be zero, which means that the data block is to be sent; at the beginning of the data acquisition task started by the NB-IoT gateway, the initialization message identifier is zero, and the message IDs of the buffer data blocks are gradually increased along with the increase of the buffer data blocks, which represents the sequence of storing the sensor node data into the buffer.
In some embodiments, step S200 may include, but is not limited to, the following steps:
step S201: and scanning the buffer area based on the second time interval, and searching the sensor node data meeting the transmission condition.
Step S202: and if the retransmission timer is zero or the retransmission timer reaches the retransmission time limit, confirming that the data of the sensing node meets the transmission condition.
Step S203: and writing the data of the sensing node meeting the sending condition into a message queue.
As an example, as shown in fig. 4, a flow chart of a buffer scanning task in the method of the embodiment of the present invention is shown, where the buffer scanning task is a periodic scanning task, and a second time interval is a time interval between two scanning tasks, and a suitable period duration may be set according to requirements of an application scenario of the internet of things and performance of equipment; in the scanning period, searching the sensing node data meeting the sending condition by traversing the buffer area; judging whether a retransmission timer corresponding to the current buffer data block meets the conditions, wherein one of the conditions is zero for the flag bit of the retransmission timer, and the other condition is that the flag bit of the retransmission timer reaches the retransmission time limit, so that any one of the conditions is that the current buffer data block is in a state to be sent; if the current buffer data block meets the sending condition, inserting the current buffer data block into a message queue, and if the current buffer data block does not meet the sending condition, continuing to traverse the buffer until the traversing is finished; in addition, if the flag bit of the retransmission timer of the current buffer data block is greater than zero, the flag bit is incremented by one, and it should be noted that, whether or not the transmission condition is satisfied, each operation of intermittently scanning the buffer increases the retransmission timer value.
In some embodiments, step S300 may include, but is not limited to, the following steps:
step S301: and scanning the message queue based on a third time interval, and if the message queue is not empty, reading the data of the sensing node.
Step S302: and analyzing, packaging and transmitting the data of the sensing nodes.
Specifically, short periodic checking and reading the message of the message queue, and a third time interval is the time interval between two times of scanning of the message queue; after detecting that the message queue is not empty, reading data block information in the message queue, carrying out data analysis on the read data block information, analyzing a message ID and data content, formatting and packaging the message ID, the data content, the device ID and other information according to json format, and finally controlling the NB-IoT module to execute reporting of data through an AT instruction, namely sending the data packet to a cloud platform.
In some embodiments, step S400 may include, but is not limited to, the following steps:
step S401: a message acknowledgement bitmap is received.
Step S402: from the message identifier, a bitmap index of the message identifier is calculated.
Step S403: judging whether a bitmap index exists in the message confirmation bitmap, if so, confirming that the message confirmation bitmap contains a message identifier.
Specifically, an NB-IoT module is controlled to receive a message confirmation bitmap from a cloud platform through an AT instruction; and judging whether the to-be-confirmed message ID of the data block of the transmitted buffer area is in a message confirmation bitmap or not by calculating a bitmap index of the message identifier, and if the to-be-confirmed message ID is in the message confirmation bitmap, indicating that the data block is confirmed to be sent to the cloud platform. Specifically, the method for calculating the bitmap index of the message identifier comprises the following steps: and performing modulo operation on the message ID in the buffer, converting the modulo message ID into binary, right-shifting the binary message ID by 3 bits to obtain an array index, and finding out corresponding 8-bit data in the message confirmation bitmap by using the array index. The message ID is left 8 and anded with the 8-bit data just fetched. If the result of the message ID is not 0, the message ID exists in the message confirmation bitmap, and the data corresponding to the message ID is confirmed to be sent. If the message ID is 0, the message ID does not exist in the message confirmation bitmap, and the data corresponding to the message ID is not sent to the cloud platform.
In some embodiments, step S500 may include, but is not limited to, the following steps:
step S501: if the message acknowledgement bitmap contains a message identifier, both the retransmission timer and the message identifier are set to minus one.
Step S502: and emptying the sensing node data in the buffer area.
Specifically, if the to-be-acknowledged message ID of the transmitted buffer data block is in the message acknowledgement bitmap, resetting the flag bit and the message ID of the retransmission timer of the buffer data block, and in this embodiment, setting them to minus one respectively; and emptying the buffer area data block, namely releasing the buffer area, and emptying the sensing node data in the buffer area.
As an example, as shown in fig. 5, a flow chart of a data reporting task in the method of the embodiment of the present invention is shown, where first, whether a message queue is not empty is detected, if yes, a message queue is consumed, that is, a data block in the message queue is read, then a message ID and a device ID of a data header portion are processed, and after the data of a sensing node is repackaged, the data packet is sent to a cloud platform; then, receiving response data, if the response data is received, executing the next step, and if the response data is not received, returning to continue traversing the message queue; storing a message confirmation bitmap sent by the cloud platform; traversing the message ID to be confirmed of the data block sent by the buffer zone, judging whether the message ID exists in a message confirmation bitmap or not by calculating the bitmap subscript of the current message ID to be confirmed, if so, continuing to execute the next step, and if not, returning to continue traversing the message queue; resetting the flag bit and the message ID of a retransmission counter of the current buffer data block to be negative one, and emptying the data content; and then, returning to continue traversing the message queue until the message queue is empty, and waking up to continue executing the data reporting task after waiting for zero for two seconds.
It should be noted that, in the embodiment of the present invention, the retransmission timer has both the functions of timing and flag, the variable of the retransmission timer is used to represent a sending state of the data of the buffer block, and the timer is self-incremented (equivalent to timing) only when the variable is greater than or equal to one, specifically there are the following cases:
1) If the data block is empty, the default retransmission timer is negative one (indicated as empty);
2) When there is data inserted into the data block, the retransmission timer is zero (indicating that the data block is to be transmitted);
3) Thereafter identified by the buffer scan task and placed in the message queue and this retransmission timer is incremented by one (indicating that it has been sent once);
4) After that, the retransmission timer is incremented each time a scan is performed, but is not put in the transmit queue (i.e., the data is not transmitted);
5) Adding one retransmission timer until the time count of the retransmission timer reaches a threshold (usually more than 2 times of the confirmation period of the cloud platform), and putting the data block of the buffer into the message queue again, which is equivalent to executing retransmission;
6) If an acknowledgment message for the data block is obtained in the data reporting task, the retransmission timer is set to minus one (indicating that the data block is empty).
According to the technical scheme, the buffer area and the queue are utilized to realize data decoupling, a retransmission mechanism is introduced, the cloud platform informs the gateway of data transmission in a message bitmap mode, and the message which is not confirmed is retransmitted, so that the reliability of data transmission can be further improved.
The method of the embodiment of the invention further comprises the following steps:
step S600: and when the serial port is in normal communication, detecting the network attachment state, and when the serial port is in abnormal communication, executing soft reset operation.
Step S700: when the network attachment is abnormal, the initialization network access operation is executed.
Specifically, as shown in fig. 6, a flow chart of a health check task in the method according to the embodiment of the present invention is shown, in which whether the MCU program of the micro control unit works normally is checked, and if the MCU reset operation cannot be executed normally, the MCU reset operation is executed. Collecting information of the NB-IoT module, analyzing and judging the health condition of the NB-IoT module, and executing the following operations according to the situation of the NB-IoT module: when the whole NB-IoT module does not respond or serial communication is abnormal, performing the soft reset operation of the NB-IoT module; the NB-IoT module responds normally to the instruction, but re-performs the network access operation when data cannot be sent or network attachment is abnormal. By introducing health checking and hierarchical restoration mechanisms, the persistence and stability of NB-IoT gateway services may be improved.
Fig. 7 is a schematic flow chart of message confirmation of a cloud platform in the method of the embodiment of the present invention, wherein the cloud platform sends a message confirmation bitmap to an NB-IoT gateway in a bitmap accumulation confirmation manner, a timing schedule of the cloud platform wakes up a message confirmation task at intervals, the task reads message IDs of N pieces of data received recently from a data acquisition log table with a device ID and a device IP port as a packet, models the message IDs of the N pieces of data by 2N and stores the N pieces of data in a bitmap of 2N size, and after the processing is completed, sends a corresponding message confirmation bitmap to the gateway according to the device IP.
As an example, the range of message IDs is infinite, but when the logic acknowledges messages, the module 128 is taken and the acknowledgement IDs that the bitmap can carry need to be 0-127. When the message ID reaches 127 and is 128 after self-increment, the bitmap overflows, and the module 128 needs to be taken to obtain 0, and if the data with the message ID of 0 still remains to be confirmed in the buffer zone of the gateway, collision and conflict can occur between the data and the message ID of 128. So that not only the range of the confirmation ID is limited to 0-127, but also the number of message IDs to be pulled is less than half of 128, for example, set to 64, when pulling the received message ID from the database and confirming it is performed. In this way, false acknowledgements caused by collisions can be avoided to a certain extent, so that only 2N bitmaps store N pieces of data (or less), and infinite message IDs can be mapped one by one into bitmaps of limited size under such conditions by modulo operation. It should be noted that, in the above example, the value of N may be adaptively adjusted according to specific network conditions and gateway hardware configuration.
As an example, as shown in fig. 8, a flow chart of data transmission and acknowledgement in the method according to the embodiment of the present invention is shown, where,
the first step: the data acquisition task writes the acquired sensing node data into a buffer area, sets a message ID of a data block of the buffer area, and sets a retransmission timer to be zero;
and a second step of: the buffer scanning task traverses the buffer, and when the retransmission timer of the buffer data block is zero (to be sent) or reaches the retransmission time limit, the data block information is put into the message queue. When the retransmission timer of the buffer data block is greater than zero, adding one to the retransmission timer;
and a third step of: the data reporting task checks and reads the message queue data and sends the read data block. And immediately checking data reception after transmission, if a message confirmation bitmap from a cloud platform is received, scanning a message ID to be confirmed sent by a buffer area, calculating a bitmap index where the message ID is located, and resetting a retransmission timer of the data block information in the buffer area to be negative one, resetting the message ID to be negative one and clearing data content through bit operation and operation to confirm whether confirmation information of the message ID exists in the message confirmation bitmap.
Referring to fig. 9, an embodiment of the present invention provides a system schematic diagram of gateway data transmission of internet of things, including but not limited to:
the first processing module 901 is configured to collect sensing node data, store the sensing node data in a buffer area, initialize a retransmission timer and a message identifier, where the retransmission timer and the message identifier both correspond to the sensing node, the retransmission timer is configured to trigger retransmission of the sensing node data by timing, and the message identifier is configured to identify the sensing node data stored in the buffer area;
a second processing module 902, configured to store the sensing node data in the message queue if the sensing node data meets a sending condition;
the third processing module 903 is configured to read the sensing node data from the message queue and send the sensing node data;
a fourth processing module 904 configured to receive the message acknowledgement bitmap and search for a message identifier in the message acknowledgement bitmap;
a fifth processing module 905 is configured to reset the retransmission timer and the message identifier and empty the sensing node data in the buffer if the message confirmation bitmap contains the message identifier.
Referring to fig. 10, an embodiment of the invention provides an electronic device comprising a memory 1001 and a processor 1002; a memory 1001 for storing a computer program; the processor 1002 is configured to implement the method for data transmission of the gateway of the internet of things according to the embodiment of the present invention when executing the program stored in the memory 1001.
The embodiment of the invention also provides a computer readable storage medium, wherein the computer readable storage medium stores instructions which, when run on a computer, cause the computer to execute the method for data transmission of the gateway of the Internet of things provided by the embodiment of the invention.
The Memory may include random access Memory (Random Access Memory, RAM) or Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU for short), a network processor (Network Processor, NP for short), etc.; but also digital signal processors (Digital Signal Processing, DSP for short), application specific integrated circuits (Application Specific Integrated Circuit, ASIC for short), field-programmable gate arrays (Field-Programmable Gate Array, FPGA for short) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present invention, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by a wired, such as a coaxial cable, fiber optic, digital Subscriber Line (DSL), or wireless, such as infrared, wireless, microwave, or the like. The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium, such as a floppy Disk, hard Disk, magnetic tape, optical medium, such as a DVD, or a semiconductor medium, such as a Solid State Disk (SSD), etc.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for apparatus, server, client, computer readable storage medium embodiments, the description is relatively simple as it is substantially similar to method embodiments, as relevant points are found in the partial description of method embodiments.
The foregoing description is only of the preferred embodiments of the present invention and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims (9)

1. The method for data transmission of the gateway of the Internet of things is characterized by comprising the following steps:
collecting sensing node data, storing the sensing node data in a buffer zone, initializing a retransmission timer and a message identifier, wherein the retransmission timer and the message identifier are both corresponding to the sensing node, the retransmission timer is used for triggering retransmission of the sensing node data through timing, the message identifier is used for identifying the sensing node data stored in the buffer zone, the retransmission timer takes the functions of timing and marking into account, and the variable of the retransmission timer is used for representing a sending state of the data of the buffer zone;
if the sensing node data meets the sending condition, storing the sensing node data in a message queue; comprising the following steps:
scanning the buffer area based on a second time interval, and searching the sensing node data meeting the transmission condition;
if the retransmission timer is zero or the retransmission timer reaches a retransmission time limit, confirming that the sensing node data meets a sending condition;
writing the data of the sensing node meeting the sending condition into the message queue;
reading the sensing node data from the message queue and sending the sensing node data;
receiving a message confirmation bitmap and searching the message identifier in the message confirmation bitmap;
resetting the retransmission timer and the message identifier and emptying the sensing node data in the buffer area if the message confirmation bitmap contains the message identifier;
checking whether the MCU program of the micro control unit works normally, if yes, executing MCU reset operation, collecting information of the NB-IoT module, analyzing and judging health condition of the NB-IoT module, and executing the following operations according to the condition of the NB-IoT module: when the whole NB-IoT module does not respond or serial communication is abnormal, performing the soft reset operation of the NB-IoT module; the NB-IoT module responds normally to the instruction, but re-performs the network access operation when data cannot be sent or network attachment is abnormal.
2. The method of claim 1, wherein the collecting the sensor node data, storing the sensor node data in a buffer, initializing a retransmission timer and a message identifier, comprises:
collecting sensing node data based on a first time interval;
writing the sensing node data into the buffer data block;
initializing the retransmission timer of the buffer data block to zero;
the value of the message identifier of the buffer data block is increased.
3. The method of claim 1, wherein the reading the sensing node data from the message queue and transmitting the sensing node data comprises:
scanning the message queue based on a third time interval, and if the message queue is not empty, reading the sensing node data;
and analyzing, packaging and transmitting the sensing node data.
4. The method of claim 1, wherein the receiving the message acknowledgement bitmap and looking up the message identifier in the message acknowledgement bitmap comprises:
receiving the message acknowledgement bitmap;
calculating a bitmap index of the message identifier according to the message identifier;
and judging whether the bitmap subscript exists in the message confirmation bitmap, if so, confirming that the message confirmation bitmap contains the message identifier.
5. The method of claim 1, wherein resetting the retransmission timer and the message identifier and clearing the sensing node data in the buffer if the message acknowledgement bitmap contains the message identifier comprises:
if the message confirmation bitmap contains the message identifier, setting the retransmission timer and the message identifier to minus one;
and emptying the sensing node data in the buffer zone.
6. The method for data transmission of an internet of things gateway of claim 1, further comprising:
detecting a network attachment state when the serial port communicates normally, and executing soft reset operation when the serial port communicates abnormally;
and when the network attachment is abnormal, executing initialization network access operation.
7. The device for data transmission of the gateway of the Internet of things is characterized by comprising:
the first processing module is used for collecting sensing node data, storing the sensing node data in a buffer zone, initializing a retransmission timer and a message identifier, wherein the retransmission timer and the message identifier are corresponding to the sensing node, the retransmission timer is used for triggering retransmission of the sensing node data through timing, the message identifier is used for identifying the sensing node data stored in the buffer zone, the retransmission timer has the functions of timing and marking, and a variable of the retransmission timer is used for representing a sending state of the data of the buffer zone;
the second processing module is used for storing the sensing node data in a message queue if the sensing node data meets the sending condition; comprising the following steps: scanning the buffer area based on a second time interval, and searching the sensing node data meeting the transmission condition; if the retransmission timer is zero or the retransmission timer reaches a retransmission time limit, confirming that the sensing node data meets a sending condition; writing the data of the sensing node meeting the sending condition into the message queue;
the third processing module is used for reading the sensing node data from the message queue and sending the sensing node data;
a fourth processing module, configured to receive a message acknowledgement bitmap, and search the message identifier in the message acknowledgement bitmap;
a fifth processing module, configured to reset the retransmission timer and the message identifier and empty the sensing node data in the buffer if the message acknowledgement bitmap includes the message identifier; checking whether the MCU program of the micro control unit works normally, if yes, executing MCU reset operation, collecting information of the NB-IoT module, analyzing and judging health condition of the NB-IoT module, and executing the following operations according to the condition of the NB-IoT module: when the whole NB-IoT module does not respond or serial communication is abnormal, performing the soft reset operation of the NB-IoT module; the NB-IoT module responds normally to the instruction, but re-performs the network access operation when data cannot be sent or network attachment is abnormal.
8. An electronic device comprising a processor, a memory, and one or more programs stored in the memory and configured to be executed by the processor, the program comprising a method for performing the internet of things gateway data transmission of any of claims 1-6.
9. A computer readable storage medium, characterized in that a program instruction executable by a processor is stored, said program instruction being for performing the method of internet of things gateway data transmission according to any of claims 1-6.
CN202210586100.1A 2022-05-27 2022-05-27 Method, device, server, client and storage medium for gateway data transmission of Internet of things Active CN115102807B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202210586100.1A CN115102807B (en) 2022-05-27 2022-05-27 Method, device, server, client and storage medium for gateway data transmission of Internet of things
PCT/CN2022/124712 WO2023226277A1 (en) 2022-05-27 2022-10-11 Internet of things gateway data transmission method and device, server, client and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210586100.1A CN115102807B (en) 2022-05-27 2022-05-27 Method, device, server, client and storage medium for gateway data transmission of Internet of things

Publications (2)

Publication Number Publication Date
CN115102807A CN115102807A (en) 2022-09-23
CN115102807B true CN115102807B (en) 2023-11-28

Family

ID=83288203

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210586100.1A Active CN115102807B (en) 2022-05-27 2022-05-27 Method, device, server, client and storage medium for gateway data transmission of Internet of things

Country Status (2)

Country Link
CN (1) CN115102807B (en)
WO (1) WO2023226277A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115102807B (en) * 2022-05-27 2023-11-28 深圳技术大学 Method, device, server, client and storage medium for gateway data transmission of Internet of things
CN117479049B (en) * 2023-12-27 2024-03-15 成都秦川物联网科技股份有限公司 Data transmission control method for intelligent fuel gas, internet of things system and medium

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002281047A (en) * 2001-01-10 2002-09-27 Ntt Docomo Inc Packet communication controller and its method, data communication repeater system and its method, and network system
CN1562672A (en) * 2004-03-15 2005-01-12 王家法 Method for implementing instruction execution from anti-theft burglar by through mobile phone
CN1969476A (en) * 2004-06-10 2007-05-23 美商内数位科技公司 Method and apparatus for dynamically adjusting data transmission parameters and controlling H-ARQ processes
CN101272230A (en) * 2007-03-15 2008-09-24 国际商业机器公司 Reliable network packet dispatcher with interleaving multi-port circular retry queue
CN104780028A (en) * 2015-04-02 2015-07-15 京信通信技术(广州)有限公司 Method and equipment for retransmitting TCP (transmission control protocol) data messages
CN106059950A (en) * 2016-05-25 2016-10-26 四川大学 Adaptive network congestion control method based on SCPS-TP
CN106712908A (en) * 2015-11-13 2017-05-24 富士通株式会社 Data transmission method, device and system
CN111050309A (en) * 2018-10-12 2020-04-21 奇酷互联网络科技(深圳)有限公司 Mobile terminal, network registration method thereof and storage medium
CN111064674A (en) * 2019-11-05 2020-04-24 珠海格力电器股份有限公司 Data transmission method, device and system
EP3866365A1 (en) * 2020-02-14 2021-08-18 Robert Bosch GmbH Radio device, method to operate a radio device
CN113541885A (en) * 2021-07-27 2021-10-22 广东电网有限责任公司 Transmission performance protection method and system
CN113597806A (en) * 2019-08-08 2021-11-02 Oppo广东移动通信有限公司 Data transmission method and terminal equipment
CN113676605A (en) * 2020-05-15 2021-11-19 腾讯科技(深圳)有限公司 Data transmission method, device, equipment and computer readable storage medium

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7532639B2 (en) * 2003-09-10 2009-05-12 Broadcom Corporation System and method for message queue management in a power-save network
US9065839B2 (en) * 2007-10-02 2015-06-23 International Business Machines Corporation Minimally buffered data transfers between nodes in a data communications network
CN103259776A (en) * 2012-11-19 2013-08-21 北京新岸线移动多媒体技术有限公司 Method and device used for transmitting and receiving application layer information acknowledgements
US10097379B2 (en) * 2015-12-23 2018-10-09 Intel Corporation Managing communication congestion for internet of things devices
KR102071955B1 (en) * 2018-06-07 2020-03-02 주식회사 티맥스소프트 Method for processing multicast in distributed cache environment, and distributed cache server using the same
CN111949648B (en) * 2019-05-14 2024-03-01 北京沃东天骏信息技术有限公司 Memory data caching system and data indexing method
CN112491842B (en) * 2020-11-17 2022-06-10 国网江苏省电力工程咨询有限公司 Multi-protocol Internet of things gateway for smart construction site
CN115102807B (en) * 2022-05-27 2023-11-28 深圳技术大学 Method, device, server, client and storage medium for gateway data transmission of Internet of things

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002281047A (en) * 2001-01-10 2002-09-27 Ntt Docomo Inc Packet communication controller and its method, data communication repeater system and its method, and network system
CN1562672A (en) * 2004-03-15 2005-01-12 王家法 Method for implementing instruction execution from anti-theft burglar by through mobile phone
CN1969476A (en) * 2004-06-10 2007-05-23 美商内数位科技公司 Method and apparatus for dynamically adjusting data transmission parameters and controlling H-ARQ processes
CN101272230A (en) * 2007-03-15 2008-09-24 国际商业机器公司 Reliable network packet dispatcher with interleaving multi-port circular retry queue
CN104780028A (en) * 2015-04-02 2015-07-15 京信通信技术(广州)有限公司 Method and equipment for retransmitting TCP (transmission control protocol) data messages
CN106712908A (en) * 2015-11-13 2017-05-24 富士通株式会社 Data transmission method, device and system
CN106059950A (en) * 2016-05-25 2016-10-26 四川大学 Adaptive network congestion control method based on SCPS-TP
CN111050309A (en) * 2018-10-12 2020-04-21 奇酷互联网络科技(深圳)有限公司 Mobile terminal, network registration method thereof and storage medium
CN113597806A (en) * 2019-08-08 2021-11-02 Oppo广东移动通信有限公司 Data transmission method and terminal equipment
CN111064674A (en) * 2019-11-05 2020-04-24 珠海格力电器股份有限公司 Data transmission method, device and system
EP3866365A1 (en) * 2020-02-14 2021-08-18 Robert Bosch GmbH Radio device, method to operate a radio device
CN113676605A (en) * 2020-05-15 2021-11-19 腾讯科技(深圳)有限公司 Data transmission method, device, equipment and computer readable storage medium
CN113541885A (en) * 2021-07-27 2021-10-22 广东电网有限责任公司 Transmission performance protection method and system

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
An Efficient Priority-Driven Congestion Control Algorithm for Data Center Networks;Jiahua Zhu;Xianliang Jiang;Yan Yu;Guang Jin;Haiming Chen;Xiaohui Li;Long Qu;;中国通信(第06期);全文 *
严朝阳等.基于LoRa的物联网数据传输系统研究与设计.《重庆邮电大学学报(自然科学版)》.2021,全文. *
无线网络中实时业务的随机超时早检测缓存管理算法;陈远;李乐民;;电子与信息学报(第05期);全文 *

Also Published As

Publication number Publication date
CN115102807A (en) 2022-09-23
WO2023226277A1 (en) 2023-11-30

Similar Documents

Publication Publication Date Title
CN115102807B (en) Method, device, server, client and storage medium for gateway data transmission of Internet of things
CN103618800A (en) Method and device for achieving subscription informing
CN111083168A (en) Configurable data transmission method and device of Internet of things platform gateway and gateway
CN109217983B (en) Industrial Internet of things operation terminal communication protocol design method
CN110650098B (en) Variable frequency acquisition method and device for data of Internet of things
CN113596017B (en) Protocol analysis method and device, soft gateway and storage medium
US7782766B2 (en) Data collection system and data collection method
CN113259391A (en) Data transmission method and device applied to multi-level node network
CN113692019B (en) Wireless networking method and terminal of electric power Internet of things
JP2008304989A (en) Remote monitor system
US6570852B1 (en) Relay communication system
JP2009525707A (en) Congestion management and delay prediction in CSMA transmission media
US20060095518A1 (en) Software application for modular sensor network node
JP2009294706A (en) Radio automatic meter-reading system
CN108259576B (en) Software and hardware real-time information transmission system and method
CN114338516B (en) Traffic forwarding and policy determining method and device
CN114885277A (en) Emergency data transmission method based on Beidou third short message
CN115514682A (en) Data transmission method, device, equipment and storage medium
WO2021073413A1 (en) Method and apparatus for sending system performance parameters, management device, and storage medium
CN114157523A (en) Data reporting method and device, intelligent household equipment and storage medium
US7545793B2 (en) Extended range wireless packetized data communication system
CN113543022A (en) Method and device for determining transmitting power, interphone, equipment and storage medium
CN107885169A (en) A kind of collection method of field data, device and system
CN117424638B (en) Network slice management method, device and storage medium based on satellite-ground fusion
US9743037B2 (en) Method for transmitting device indicator data in network-based AV system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant