Communication rejection scene long-distance low-power LoRa relay networking method
Through the LoRa relay networking method, frequency division and dynamic spectrum management are used to solve the problem of limited communication distance of traditional LoRaWAN in complex deep foundation pit scenarios, and low-power long-distance communication and network coverage expansion are achieved, which is suitable for underground space projects.
Patent Information
- Application Number
- CN202510610411.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-13
- Publication Date
- 2025-09-05
AI Technical Summary
In communication denial scenarios, the traditional LoRaWAN star architecture cannot meet the communication requirements in complex deep foundation pit scenarios, resulting in limited communication distance and increased costs, and unable to achieve low-power long-distance communication.
The LoRa relay networking method is adopted, the frequency band is divided by the frequency division method between the intelligent gateway and the relay device, the spectrum resources are dynamically managed, and the wake-up and sleep switching control and timeline switching are combined to achieve network coverage expansion and low power consumption control.
It ensures the timeliness and reliability of network communication, reduces network energy consumption, and expands communication coverage. It is suitable for the perception and transmission of life characteristic indicator parameters in underground spaces such as complex deep foundation pits.
Smart Images

Figure CN120602949A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent sensing technology for the Internet of Things, and in particular to a long-distance, low-power LoRa relay networking method for communication denial scenarios. Background Art
[0002] A communications-denied environment, also known as a communications-blocked or restricted environment, refers to an area where conventional communications methods are difficult to operate effectively due to natural factors, technical limitations, or human interference. In this scenario, conventional cellular network communications, such as 5G, face signal loss and the possibility of communication failure.
[0003] Complex deep foundation pits at construction sites are typical communication-denied environments. With the gradual advancement of smart cities, the development of underground spaces, such as complex deep foundation pits, has also been put on the agenda. These underground projects are characterized by large scale, long communication distances, and great depth. Furthermore, as project development progresses, the structural safety risks of these spaces continue to increase. To achieve comprehensive, systematic, and in-depth digital perception and cloud service management of underground space projects, the next generation of IoT technologies is urgently needed to enhance the digital service level of these projects.
[0004] The main challenge encountered in expanding the application of IoT sensing terminal sensing technology to underground spaces in traditional ground-based smart city construction is the shielding of communication signals in underground spaces, which limits the communication range of IoT sensing terminals and prevents the establishment of communication links from IoT sensing terminals to cloud networks. Currently, low-power long-range modulation technology (LoRa) is a typical technology for transmitting vital characteristic parameter sensing in underground spaces such as complex deep foundation pits. LoRa inherits the advantages of linear pulse spread spectrum (CSS) and is robust to interference, multipath, and Doppler effects. LoRa technology achieves long-distance transmission while maintaining low power consumption and high sensitivity. As a supplement to traditional cellular and short-range wireless technologies in IoT applications, LoRaWAN is key to smart city construction and the advancement of the IoT. Its main architecture is a star-shaped network centered on the gateway, connecting IoT sensing terminals to the gateway.
[0005] However, since deep foundation pits are mostly complex reinforced concrete mesh structures, as they continue to extend underground, they form an interference shielding cage effect, which greatly attenuates wireless signals. As a result, the traditional LoRaWAN classic star architecture cannot meet the communication requirements in complex deep foundation pit scenarios. On the other hand, as engineering projects expand, the demand for gateways also increases, which invisibly increases communication costs. Summary of the Invention
[0006] The technical problem to be solved by the present invention is to provide a long-distance, low-power LoRa relay networking method for communication denial scenarios, which can achieve low-power control of the network while ensuring communication timeliness and reliability.
[0007] The technical solution adopted by the present invention to solve its technical problem is: to provide a long-distance, low-power LoRa relay networking method for communication denial scenarios, which is applied to a communication system including an intelligent gateway, a relay device, and a terminal node. The intelligent gateway and the relay device use LoRa to build a private network, including the following steps:
[0008] The intelligent gateway broadcasts a fixed hello frame on a public channel. After receiving the hello frame, the relay device parses the hello frame, randomly selects a channel with the device available identification code set to 0 in the hello frame, converts the frequency to the corresponding frequency, and sends a registration frame to the intelligent gateway via the frequency band corresponding to the corresponding frequency. After receiving the registration frame, the intelligent gateway determines whether to register the relay device according to the relay device table. The hello frame includes a fixed frame header, a timestamp, and a device available identification code. The registration frame includes the remaining battery power and signal strength.
[0009] After the relay device completes registration, the intelligent gateway listens to the relay device messages. After receiving the WN_U frame sent by the relay device, the intelligent gateway calculates the remaining working time of the relay device, and sends a start frame when the remaining working time of the relay device meets the link round-trip time required for one communication. After receiving the start frame, the relay device starts sending downlink data, and repeats this step until the remaining working time of the relay device cannot meet the link round-trip time required for one communication. The intelligent gateway caches the data to be sent and waits for the next working cycle between the relay device and the searching intelligent gateway.
[0010] Before the intelligent gateway broadcasts the hello frame on the public channel, the intelligent gateway also includes an intelligent gateway startup process, and the intelligent network startup process includes:
[0011] After powering on, the smart gateway performs self-test and initialization, then sends a registration frame to the cloud management platform and starts a timer; if a reply is received before the timer expires, the configuration information is parsed and spectrum resources are obtained to complete the registration; otherwise, registration is attempted again after a random period of time until registration is completed.
[0012] Before the intelligent gateway broadcasts the hello frame on the public channel, the intelligent gateway further includes:
[0013] The intelligent gateway divides the available spectrum resources of the network into several independent sub-bands, where each independent sub-band uses the center frequency as the carrier frequency; one of the several independent sub-bands is used as a public channel to send broadcast information, and the remaining independent sub-bands are used to be allocated to each relay device. The relay device uses the allocated independent sub-band to communicate with the intelligent gateway; each terminal node uses the independent sub-band allocated to the relay device to which it belongs to communicate with the relay device.
[0014] After receiving the registration frame, the intelligent gateway determines whether to register the relay device according to the relay device table, specifically including:
[0015] Query the relay device table to check whether the frequency band corresponding to the corresponding frequency is idle;
[0016] If the frequency band corresponding to the corresponding frequency is idle, determining whether the remaining battery power and signal strength of the relay device exceed a set threshold;
[0017] If the remaining battery power and signal strength of the relay device exceed the set threshold, the relay device is considered to be able to serve as a relay node, and a registration confirmation frame is sent to the relay device;
[0018] After receiving the registration confirmation frame, the relay device performs an initialization operation, starts a timer, sets the time of the timer to the communication time with the intelligent gateway, completes the registration, and enters the working cycle of the relay device.
[0019] The communication denial scenario long-distance low-power LoRa relay networking method also includes:
[0020] The intelligent gateway unpacks the data packet uploaded by the relay device to obtain the remaining power and signal strength of the relay device;
[0021] When the remaining power and signal strength of the relay device are both lower than the set threshold, it is determined that the relay device cannot serve as a relay node, the command buffer area opened for the relay device is cleared, and a logout frame is sent to the relay device;
[0022] After receiving the deregistration frame, the relay device waits for the communication time with the intelligent gateway to end before entering the communication phase with the terminal node, broadcasts the deregistration frame, and receives the last round of data from the terminal node. The terminal node uniformly enters the dormant state; after waiting for the communication time with the terminal node to end, the relay device enters the communication state with the intelligent gateway, reports the deregistration confirmation frame to the intelligent gateway, and then enters the dormant state;
[0023] After receiving the deregistration confirmation frame from the relay device, the intelligent gateway updates the spectrum resource table and the relay device table, and reports the change to the cloud device management platform.
[0024] The communication denial scenario long-distance low-power LoRa relay networking method also includes:
[0025] After the relay device receives the collection instruction from the intelligent gateway, the collection work and the communication work are run in parallel. When the service cycle with the intelligent gateway ends, the relay device enters the service cycle with the terminal node, and the relay device unpacks and assembles the collection instruction of the intelligent gateway;
[0026] When the relay device has a command to send, it enters a downlink service cycle. During the downlink service cycle, the command is sent to the terminal node specified by the intelligent gateway. After the commands cached in the command buffer are sent, the downlink service cycle ends and the uplink service cycle begins. During the uplink service cycle, the relay device receives data from the terminal node.
[0027] When the relay device has no command to send, it directly enters the uplink service period. During the uplink service period, the relay device receives data from the terminal node.
[0028] The communication denial scenario long-distance low-power LoRa relay networking method also includes a terminal node registration process, which includes:
[0029] After receiving the wake-up frame, the terminal node waits for a preset time and selects a free token group to send a registration frame to the relay device;
[0030] After receiving the registration frame, the relay device communicates with the intelligent gateway and replies to the terminal node confirmation frame in the next round of communication. The terminal node starts working after successful registration;
[0031] When a terminal node fails to register once, the waiting time for resending the registration frame needs to be plus a random fluctuation time on the preset time.
[0032] The communication denial scenario long-distance low-power LoRa relay networking method also includes: if the relay device has not received the data uploaded by the terminal node for n times during the uplink service period of the terminal node service period, the token owned by the terminal node is cancelled to complete the cancellation of the terminal node.
[0033] The communication denial scenario long-distance low-power LoRa relay networking method also includes: the relay device monitors the remaining power of the terminal node, and when the remaining power of the terminal node is lower than the power threshold, the relay device actively sends a deregistration frame to the terminal node to deregister the terminal node.
[0034] Beneficial effects
[0035] Due to the adoption of the above-mentioned technical solution, the present invention has the following advantages and positive effects compared with the prior art: the present invention ensures the timeliness of uplink and downlink communications in the network through dynamic time-frequency resource reuse management, flexible wake-up and sleep switching control, efficient timeline switching and network spectrum resource registration and recovery mechanism, expands the communication coverage of the network, reduces network energy consumption, and has higher deployment flexibility. Combined with the method of the present invention, it can effectively meet the low-power long-distance communication access requirements in communication denial scenarios, and serve the life characteristic indicator parameter perception and transmission applications of underground space projects such as complex deep foundation pits. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 This is a diagram of the overall network architecture of an embodiment of the present invention;
[0037] Figure 2 This is a communication protocol diagram between the intelligent gateway and the cloud management platform in an embodiment of the present invention;
[0038] Figure 3 This is a flowchart of the intelligent gateway startup in an embodiment of the present invention;
[0039] Figure 4 This is a flowchart of relay device registration in an embodiment of the present invention;
[0040] Figure 5 Flowchart of communication between a relay device and an intelligent gateway in an embodiment of the present invention;
[0041] Figure 6 This is a flowchart of relay device deregistration in an embodiment of the present invention;
[0042] Figure 7 Flowchart of communication between a relay device, a terminal node, and an intelligent gateway in an embodiment of the present invention;
[0043] Figure 8 This is a flowchart of terminal node registration in an embodiment of the present invention.
[0044] Figure 9 This is a block diagram of the intelligent gateway in the embodiment of the present invention
[0045] Figure 10 A block diagram of a relay device according to an embodiment of the present invention
[0046] Figure 11 4 is a block diagram of a terminal node in an embodiment of the present invention. DETAILED DESCRIPTION
[0047] Below in conjunction with specific embodiment, further set forth the present invention.Should be understood that these embodiments are only used to illustrate the present invention and are not used in limiting the scope of the present invention.In addition, should be understood that after reading the content taught by the present invention, those skilled in the art can make various changes or modifications to the present invention, and these equivalent forms fall equally within the scope limited by the appended claims of the application.
[0048] The embodiment of the present invention relates to a long-distance low-power LoRa relay networking method for communication denial scenarios, which can be applied to Figure 1 In the network architecture shown, the network architecture consists of intelligent gateways, relay devices and terminal nodes. Through the operating logic and functional design of the intelligent gateways, relay devices and terminal nodes, low-power consumption control of the network is achieved while ensuring the timeliness and reliability of communication.
[0049] In this embodiment, the intelligent gateway divides the available communication frequency band into several independent frequency bands in a frequency division manner, combining the available frequency band width and the scale of the relay equipment. Each frequency band uses the center frequency point of the frequency band as the carrier frequency for wireless communication between the intelligent gateway device and the relay device. The intelligent gateway supports multi-channel reception and can monitor multiple relay devices at the same time, using device addresses to distinguish them. Due to hardware resource limitations, it supports one-way transmission, and uplink data is sent sequentially. The gateway will process data packets one by one according to the priority queue. The intelligent gateway supports unicast, multicast, and broadcast communication modes. The unicast communication mode is mainly used to communicate with a specified relay device, and the message content includes downlink control instructions, uplink message confirmation, etc. The multicast communication mode is mainly used to broadcast communication to the relay devices in the group according to the specified group, and the message content includes downlink control instructions, network status broadcast, etc. The broadcast communication mode is mainly used to broadcast communication to all relay devices, and the message content includes downlink control instructions, network status broadcast, etc.
[0050] like Figure 9As shown in the figure, the intelligent gateway consists of a LoRa gateway module, a time resource management module, a spectrum resource management module, a relay device management module, an intelligent information processing module, a public network module, a time synchronization module and an energy module. The LoRa gateway module is responsible for communicating with each relay node in the relay network. It includes two parts: sending and receiving, and has the characteristics of multi-channel reception and one-way transmission. Among them, the receiving channel covers the network communication frequency band f1, f2,…, f8, and the sending module covers the broadcast frequency band f0; the spectrum resource management module is responsible for matching independent frequency bands fi,i∈[1,8] for each relay device Ri, and synchronously updates them according to the registration and deregistration of the subordinate devices. The spectrum resource management module is used to manage the frequency allocation of the network, record all available frequencies and dynamically manage them, allocate frequencies to devices when devices register, and recycle and release the spectrum resources when devices disconnect; the time resource management module calculates the remaining working time of the relay device and the smart gateway, and manages the timer allocated to each relay device. The remaining working time is calculated as T_G-Nmeass*Ta, where T_G is the service working period of the relay device and the smart gateway, Nmeass is the number of data packets, and Ta is the data packet transmission time; the relay device management module is responsible for managing each relay device Ri and its corresponding resources and the terminal node Uij under Ri, facilitating route tracking. The intelligent information processing module is responsible for parsing instructions from the IoT cloud and converting them into downlink command frames, while also integrating data packets from terminal nodes and forwarding them to the cloud server. The public network communication module is used for the gateway to access the Internet. The device communicates with the cloud server by accessing the public network, building a classic IoT architecture. Optional methods include 5G / 4G / WiFi, etc. The time synchronization module is used to manage the synchronization between relay devices and intelligent gateways to confirm that the network's working timeline is correct. The energy module is responsible for providing energy for the gateway to work, supporting both 220V and battery forms, and the battery is rechargeable.
[0051] In this implementation, the LoRa gateway module of the smart gateway can use the SX1302 series, which supports multi-channel reception (8 channels) and single-channel transmission, operating in the 470-510MHz frequency band. The smart gateway has high requirements for the main control, requiring the ability to run the Linux system for easy implementation, and can use the Allwinner H3 series chip. The energy module can use the STM32L4 chip as a coprocessor to manage power switching and other matters. The public network module is equipped with a 4G communication module (such as the SIM7600) and interacts with the cloud platform via the MQTT protocol, with uplink data encapsulated in JSON format.
[0052] The relay device uses a frequency band allocated by the smart gateway as the carrier frequency to implement wireless signal modulation and demodulation for uplink transmission to the smart gateway or terminal node. Communication between the smart gateway and the relay device mostly uses unicast or broadcast, so the relay device uses a public frequency band for monitoring. To achieve dynamic network control, the relay device supports unicast and broadcast communication modes. In the communication link with the smart gateway, the uplink uses unicast mode to send data, and the downlink monitors unicast and broadcast messages from the smart gateway. In the communication link with the terminal node, the downlink uses unicast mode to send confirmation messages, and uses multicast or broadcast communication mode to periodically send relay device activity information. The uplink uses unicast mode to receive uplink messages from the terminal node.
[0053] like Figure 10 As shown in the figure, the relay device consists of a data acquisition module, a LoRa module, a time-frequency management module, an intelligent data processing module, a terminal node management module, a low-power energy-saving module, and an energy module. The data acquisition module is the core module of the wireless sensor network, used to obtain the real-world environment and convert it into digital information; the LoRa module, as a node in the LoRa network, supports half-duplex communication and single-channel transmission and reception. The anti-interference ability of communication is enhanced by a suitable anti-interference factor. During the communication process with the intelligent gateway, the uplink works in the frequency band fi and the downlink works in the frequency band f0. During the communication process with the terminal node, the frequency band fi is used in both directions; the time-frequency management module, since the node working mode is half-duplex, needs to design a time axis to design time windows for the uplink and downlink between the terminal node and the relay device, and between the relay device and the intelligent gateway. In the design, the communication frequency point needs to be switched on time by the time manager, which schedules and manages the relay device and the intelligent gateway according to the set period T_R=70s. The service working cycle T_G and the service working cycle T_E of the relay device and the terminal node, as well as the uplink service cycle and downlink service cycle subdivided into each cycle, set the waiting time T_Ewait = 15s; the intelligent data processing module is used for the relay device to disassemble the commands issued by the gateway and convert them into instructions sent to the terminal node or its own collection instructions. At the same time, it is necessary to package and group the data packets from the terminal node to facilitate the gateway to perform routing tracing; the terminal node management module is responsible for the management of the number of terminal nodes and tokens, and rejects registration requests from other terminal nodes when the number is full; the low-power energy-saving module controls the relay device to enter a dormant state when waiting to receive a signal, listens through the LoRa module, and wakes up the MCU when there is a message; the energy module is responsible for the energy supply of the device and is powered by a battery.
[0054] In this implementation, the LoRa module in the relay device can use the M-HL10 series low-power product, with an anti-interference factor (SF=10), an operating frequency range consistent with the gateway, and support for half-duplex communication. For low-power design, the main control uses the STM32L4 series low-power chip. Low-power management is implemented by shutting down the RF circuit and other modules during non-communication windows, retaining only the LoRa module's preamble detection function. Specific parameters and duration depend on the specific scenario.
[0055] End nodes use the same carrier frequency as the selected relay devices to implement wireless signal modulation, demodulation, and transmission and reception for wireless communication with the relay devices. To achieve dynamic network control, end nodes must support unicast communication mode. End nodes use unicast mode to send messages to relay devices in the uplink and receive unicast confirmation messages and multicast or broadcast relay device periodic activity plans in the downlink.
[0056] like Figure 11 As shown in the figure, the terminal node includes a data acquisition module, an intelligent processing module, a LoRa module, a time synchronization module, a management module, and a power supply module. The data acquisition module is the core module of the wireless sensor network, used to obtain analog information from the real-world environment and convert it into digital information. The intelligent processing module provides intelligent processing of the collected data and intelligent adjustment of the establishment and optimization of the request for sending the processed results. The LoRa module is responsible for communication within the LoRa network and supports half-duplex communication. The time synchronization module is used to receive time synchronization information and achieve time synchronization of the terminal node. The management module controls the sleep and wake-up state switching of the terminal node device, device registration management, and data upload of the data acquisition module. The power supply module provides the power required for node operation and is battery-powered.
[0057] In this implementation, the terminal node is kept in a dormant state most of the time by the master control, retaining the preamble code listening function of the LoRa module, setting WI_U = 2s, sending tokens in sequence to avoid interference, and waiting for RAND (6) * Ta when registering, with Ta = 2s before registration. In this implementation, the relay device and the terminal node can use the same hardware device, but the code logic runs differently. For hardware aspects, please continue to refer to the relay device hardware design.
[0058] From the perspective of the gateway, we can describe the following step by step: Figure 1 The network construction process shown in Figure 2 is as follows:
[0059] In this implementation, the intelligent gateway is responsible for converting instructions from the cloud server into instructions sent to the relay device, which can be customized, such as scheduled data collection tasks; processing data packets from relay devices and terminal nodes, unpacking them to build routes, and using intelligent perception algorithms to process data; processing registration requests from relay devices and terminal nodes; managing the spectrum resource pool, relay device table, and maintaining the routing table.
[0060] The spectrum planning of the LoRa network is as follows: BW represents the spectrum resources available to the entire network, and bw represents the frequency range occupied by the LoRa modulated signal on the spectrum.
[0061] The intelligent gateway divides the available spectrum resources (BW) across the entire network into eight independent sub-bands (f1, f2, …, fm). Because each band uses the center frequency as the carrier frequency, the frequency interval Δf must satisfy Δf ≥ 2 × bw. This means that the frequency difference between two independent sub-bands must be greater than the bandwidth (bw) of the modulated signal to avoid spectrum overlap and interference between different relay devices. The intelligent gateway receives information using the independent sub-bands (fi,i∈[1,8]), supporting parallel reception on all eight sub-bands. It transmits information using sub-band f0, supporting unicast, multicast, and broadcast modes.
[0062] Each independent frequency band fi,i∈[1,8] is fixedly assigned to the corresponding relay device Ri,i∈[1,8]. When each relay device communicates with the smart gateway, it uses the independent frequency band fi,i∈[1,8] to send information to the smart gateway, and the frequency band f0 is used for the relay device to receive information sent by the smart gateway. When communicating with the terminal node, the relay device uses the independent frequency band fi,i∈[1,8] in both directions.
[0063] Each independent frequency band fi,i∈[1,8] is also permanently assigned to terminal nodes Uij,i∈[1,8],j∈[1,6] for communication with relay devices. In this embodiment, each relay device can access up to six terminal nodes. During communication with the relay device, the terminal node uses the independent frequency band fi,i∈[1,8] in both directions.
[0064] Because terminal nodes Uij use an independent frequency band fi,i∈[1,8] for their transmit and receive frequencies, and the intelligent gateway uses an independent frequency band fi,i∈[1,8] to monitor messages from relay devices Ri, the intelligent gateway may receive signals from terminal nodes, causing interference. To address this issue, this implementation adds a device management code to the frame header to distinguish the source of information. This, combined with a timeline design, prevents overlapping messages between terminal nodes Uij and relay devices Ri.
[0065] The smart gateway has faster computing speed and larger storage space than relay devices and terminal nodes, so many functions on the smart gateway side are parallel. For example, communication with the public network and communication with the LoRa private network can occur at the same time.
[0066] The communication protocol process between the intelligent gateway and the cloud management platform is as follows Figure 2 As shown in the figure, the smart gateway and cloud management platform communicate via the MQTT protocol. Upon startup, the smart gateway device first sends a registration request to the cloud management platform via the MQTT server to complete power-on registration. Subsequently, the gateway device regularly uploads collected data to the cloud management platform via the MQTT protocol and receives configuration information and work instructions from the cloud management platform. Simultaneously, the cloud management platform issues commands to the gateway device via the MQTT server. Upon receiving the commands, the gateway device executes the corresponding operations and uploads the data to the cloud management platform in real time. The entire communication process uses the MQTT server as middleware, ensuring efficient and reliable two-way data transmission and command exchange between the gateway device and the cloud management platform.
[0067] The startup process of the smart gateway is as follows: Figure 3 As shown in the figure, after powering on, the smart gateway device first performs a self-test and initialization, then sends a registration frame and starts the Timer_Re timer. If a reply is received before the Timer_Re timer expires, the device parses the configuration information and acquires spectrum resources. Otherwise, it attempts to register again after a random interval until registration is successful. After successful registration, the smart gateway device subscribes to topics and listens for commands. Upon receiving a command, it parses and sends it to the relay device, receives data from the relay device uplink, and uploads it in real time.
[0068] LoRa is used to build a private network between the smart gateway and the relay device. The communication protocol includes three parts: registration protocol, normal communication protocol, and deregistration protocol.
[0069] Due to limited spectrum resources, an intelligent gateway can only accommodate a limited number of relay devices Ri, with an upper limit of m. Different relay nodes are distinguished by frequency division. The intelligent gateway maintains the correspondence between the spectrum resource table Table_Fre and the relay device table Table_R, maintains the timer table Table_Timer for each relay device, and maintains the terminal node management table of the relay device manager.
[0070] Table 1 Table_Fre entry format
[0071] Frequency (470MHz-510MHz) Is it occupied?
[0072] Table 2 Table_R entry format
[0073] Relay device ID Frequency of use Timer (pointer) Message receiving time (timestamp)
[0074] Table 3 Table_Timer entry format
[0075] Relay device ID Timer Is the timer started?
[0076] The registration protocol process between the relay device and the smart gateway is as follows: Figure 4 The intelligent gateway processes the relay device registration protocol in the following steps:
[0077] (a) The LoRa gateway equipped with the smart gateway has independent transmit and receive channels and supports full-duplex mode. The smart gateway broadcasts a fixed Hello frame on public channel f0 (relay device Ri monitors public channel f0). The Hello frame consists of a fixed header and a payload. The payload contains a timestamp and a 1-byte device identification code. 0x00 indicates that all frequency bands are currently available for registration, while 0x01 indicates that frequency band f1 is already in use and cannot be registered. See Tables 4 and 5 for details.
[0078] Table 4 Hello frame
[0079] meaning header Device Code Device usable identification code other length XX 1 byte 1 byte XX value XX 0x01 XX
[0080] Table 5 Available equipment identification codes
[0081]
[0082] (b) After the relay device Ri starts, it adjusts the receiving frequency f0 and parses the Hello frame after receiving it. It randomly selects one from the channels set to 0, converts and calculates the corresponding frequency, and sends the registration frame Reg to the smart gateway. Relay , as shown in Table 6, the registration frame Reg Relay The data content includes the remaining battery power POW and signal strength RSSI.
[0083] Table 6 RegRelay frame
[0084]
[0085] (c) The smart gateway receives the registration frame Reg Relay Finally, in order to avoid repeated confirmation caused by multiple applications, the relay device table is first queried to check whether the frequency band is idle, and then the remaining battery power POW and signal strength RSSI are used to determine whether the relay device can serve as a relay node, and the registration confirmation frame Reg_ack is unicasted back (see Table 7).
[0086] Table 7 Reg_ack frame
[0087]
[0088] (d) Relay device Ri receives a reply frame. If the reply frame is a registration confirmation frame Reg_ack, it is initialized as relay device Ri, initializes the terminal node management table, starts the timer Timer_gateway, sets the time to the communication time with the intelligent gateway T_G = 20s, and enters the working cycle of relay device Ri T_R = 70s; if it is rejected, it waits for the next Hello frame and records the number of registrations N reg , if the number of registrations N reg If it is greater than a certain value, it means that the current network is saturated and the relay cannot be registered.
[0089] (e) The intelligent gateway maintains the correspondence between the spectrum resource table Table_Fre and the relay device table Table_R, maintains the timer table Table_Timer of each relay device, and maintains the terminal node management table of the relay device manager (see Table 8).
[0090] Table 8 Terminal Node Management Table
[0091] Device ID Allocate time slots Last message received time deviceID <![CDATA[Token i ]]> timeStamp
[0092] The normal communication protocol process between the intelligent gateway and the relay is as follows: Figure 5 As shown, specifically including:
[0093] (a) The smart gateway listens to the relay device messages in the set independent frequency bands fi, i∈[1,8]. If the relay device Ri switches to the communication mode with the smart gateway, it will send a WN_U frame (see Table 9). The data content in the WN_U frame includes the remaining power Voltage of the relay device and the number of messages to be sent N mess .
[0094] Table 9 WN_U frame
[0095]
[0096] (b) After receiving the WN_U frame, the intelligent gateway sends a Hello frame from the intelligent gateway and calculates the remaining working time R_T_G of the relay device based on T_G-T_Gate, where T_Gate is the value of the timer Timer_gateway. If R_T_G>2*Ta, that is, the remaining working time meets the link round-trip time required for one communication (that is, twice the sending time), then downlink data transmission is started.
[0097] (c) Repeat the above steps and continue sending until the remaining working time does not meet the link round-trip time required for one communication. The smart gateway will then cache the data that needs to be sent and wait for the next working cycle between the relay device and the smart gateway.
[0098] The intelligent gateway listens on multiple channels but only sends on one channel. Therefore, after receiving the data, the listening thread corresponding to each relay device will apply for the use of the sending channel and wait in queue order. The broadcast command has a higher priority. After it is idle, it will determine whether it can be sent within the specified time.
[0099] The cancellation protocol process of the relay device is as follows Figure 6 There are two scenarios for relay device deregistration: First, receiving an active deregistration command from the gateway, deregistering the terminal nodes layer by layer, and putting them into a dormant state. This applies to situations where the relay device battery is low and needs to be replaced. Second, when the smart gateway has not received any messages from the relay device for a long time, it passively deregisters the relay device and notifies the cloud device management platform.
[0100] The first method is as follows:
[0101] (a1) The smart gateway receives data packets uploaded by relay device Ri by monitoring the independent frequency bands fi, i∈[1,8]. It unpacks the packets to obtain the remaining power voltage and signal strength RSSI from relay device Ri, and uses an algorithm to analyze whether it can continue to serve as a relay node.
[0102] (a2) If it is determined that it cannot continue to serve as a relay node, the command buffer originally allocated for the relay device Ri is cleared, and a deregistration delete frame is sent through the normal communication protocol process (see Table 10).
[0103] Table 10 delete frame
[0104]
[0105] (a3) After receiving the delete frame, relay device Ri waits for the expiration of timer Timer_gateway and enters the communication phase with the terminal node. It broadcasts a delete frame and receives the final round of data from the terminal node. The terminal node then enters a sleep state. After waiting for timer Timer_end to expire, relay device Ri enters a communication state with the intelligent gateway, reports a delete confirmation frame to the intelligent gateway (see Table 11), and then enters a sleep state.
[0106] Table 11 delete confirmation frame
[0107]
[0108] (a4) After receiving the delete confirmation frame from the relay device, the intelligent gateway updates the spectrum resource table and relay device management table and reports the change to the cloud device management platform.
[0109] In this embodiment, the relay device operates using a fixed time period T_P, which includes the communication time T_G with the smart gateway plus the communication time T_E with the terminal node, T_P = T_G + T_E. The length of the time period depends on the number of terminal nodes N assigned to the relay device. end At the beginning of communication, the intelligent gateway starts the timer Timer_r belonging to the relay device, sets Timer_r>TP_R, that is, the relay device works for one round. If the timeout is exceeded and no message is received from the relay device, the timer is restarted and repeated N times. to After that, confirm that the device has been offline, deregister the relay device and upload the relay device table to notify the cloud device management platform.
[0110] The protocol flow on the relay device side is as follows Figure 7 The relay device is the most critical part of the network. It communicates with both the smart gateway and the terminal node, and supports the sensor module of the device to collect data in parallel during the communication process.
[0111] (a) Relay device Ri uses a fixed duty cycle T_P = 70s for scheduling management. Within a duty cycle, it can be divided into a duty cycle for serving the intelligent gateway T_G = 20s and a duty cycle for serving the terminal nodes T_E = 50s. The duty cycle T_P is set during network design. The duty cycle for serving the intelligent gateway T_G and the duty cycle for serving the terminal nodes T_E depend on the maximum number of terminal nodes N that the relay device can support. end , limited by the maximum number of unicast commands supported by the network in a communication round, that is, the time required for the gateway to issue the maximum number of unicast commands. Both can be further divided into the uplink service period and the downlink service period (both are non-fixed values), namely T_G = T_G_U + T_G_D, and T_E = T_E_U + T_E_D.
[0112] (b) After initialization, the relay device Ri starts the Timer_gateway timer first. At this time, T_G_U starts and sends an uplink wake-up frame WN_U, which contains the number of message frames to be uploaded N. mess , then send the data packet. The intelligent gateway sends the data packet in the number of message frames N mess When it decreases to 0, the message is sent to the relay device, and T_G_U ends. The intelligent gateway listens on multiple channels but only sends on one channel. Therefore, after receiving data, the listening thread corresponding to each relay device will apply for the use of the sending channel and wait in queue order. Broadcast commands have a higher priority. After being idle, it will determine whether it can complete the transmission within the specified time.
[0113] (c) According to the above mechanism, the relay device completes the communication process with the intelligent gateway. After receiving the command message from the intelligent gateway, the relay device checks whether it is a collection or configuration command message for its own device. If it is a collection command, the collection work and communication work are carried out in parallel. At the end of the T_G period, the relay device enters the downlink service period and starts the timer Timer_end. The relay device unpacks and repacks the instructions from the intelligent gateway. In the point-to-point case, it completes unicast and broadcast by changing the IP address of the frame header. Depending on whether the relay device has a command to issue, it is divided into two cases.
[0114] (c1) If the relay device Ri needs to send a relay message downlink, it enters the downlink phase T_E_D cycle of the relay device. In this network scenario, the terminal node is only responsible for data collection and is in a dormant state at other times. If a device receives a command while collecting data, it will cache it and wait for the current command to be executed. After entering the T_E_D cycle, the relay device Ri unpacks and repacks the command to the terminal node Uij specified by the smart gateway. Due to the limited communication time resources and energy consumption resources, the terminal node uses the setting of the LoRa preamble to perform periodic listening and dormancy to reduce energy consumption. By combining the appropriate sending preamble Pre_T and receiving preamble Pre_R, the power consumption effect is reduced, for example, Pre_T = 250 and Pre_R = 130. When the relay device Ri completes sending the command buffer cmd_buff, the T_E_D cycle ends and then enters the T_E_U cycle, that is, the relay device Ri receives data from the terminal node Uij. Because the terminal node Uij is in a dormant state when not in operation, the terminal node Uij does not support spontaneous uploading of the collected sensor data. Therefore, the relay device will broadcast a wake-up frame R_WN_U (see Table 12) to the terminal node Uij at the beginning of the T_E_U phase. The wake-up frame is also a hello frame. On the one hand, it informs the terminal node Uij to select the data to be uploaded on demand. The terminal node Uij receives the Token assigned by the relay device Ri during registration. i , according to the data packet transmission time Ta according to Token i On the other hand, it also serves as a hello frame, which is similar to the hello frame of a relay device. The relay device manages the terminal node and manages Nend tokens. The identification bit indicates the tokens that the current relay device has issued and the remaining unused tokens.
[0115] Table 12 R_WN_U frame
[0116]
[0117]
[0118] Since the data acquisition process of analog data acquisition sensors involves a series of steps such as excitation, stabilization, multiple acquisitions and tuning, it takes a long time. The reporting time will be later than the terminal node that prepares the data in advance, and the relay device Ri needs to wait for more time. Therefore, in order to avoid the relay device Ri waiting time timeout before the data report of this type of terminal node arrives, the relay device Ri needs to set a longer maximum waiting time T_Rwait in this scenario, and the terminal node Uij sets a slightly shorter maximum waiting time T_Ewait. After waiting for the corresponding time, check the data cache area to see if data needs to be reported.
[0119] (c2) If the relay device Ri does not need to send a relay message downlink, it directly enters the T_E_U cycle and executes the subsequent steps described in c1.
[0120] (d) After receiving the wake-up frame R_WN_U, the terminal node starts the timer Timer_wait with a length of T_W = T_Ewait + tokeni * Ta, and uses time division to independently divide the time when the same relay device sends uplink messages to all terminal nodes.
[0121] After relay device Ri sends the message, all modules except the LoRa module enter a dormant state. The LoRa module monitors frequency band fi with a period of WI_U = 1s to receive data from the terminal node. When Timer_End reaches T_E, communication between relay device Ri and the terminal device ends and communication with the smart gateway resumes.
[0122] The second method of deregistering a relay device is as follows:
[0123] At the beginning of communication, the smart gateway will start the timer Timer_r belonging to the relay device, T_P = 70s. If it times out and still does not receive a message from the relay device, it will restart the timer and repeat N times. to =5 times, it is confirmed that the device has been offline. The terminal device under the corresponding relay device will enter the dormant state to save energy if it does not receive the command from the relay device.
[0124] The terminal node registration flow chart is as follows Figure 8 As shown. The T_E_D period also needs to cut out a time period for terminal node registration to avoid overlapping of unregistered terminal nodes sending registration frame signals after receiving hello frames. That is, T_E_D = T_Ewait + N end *Ta+T reg ,T reg This is the time period reserved for terminal nodes to register. The terminal node receives the hello frame and waits for T_Ewait+N end*Ta, a free token is selected to group and send a registration frame. After receiving the registration frame, the relay device communicates with the smart gateway according to the above process, updates the device-IP correspondence, and replies to the terminal node with a confirmation frame in the next round of communication. After successful registration, it begins operation. To avoid signal overlap interference when multiple devices register simultaneously, the terminal node Uij needs to add a random fluctuation time Rand(N)*Ta_reg to the previous waiting time after a registration failure, where Ta_reg is the air propagation time of a registration frame.
[0125] There are two scenarios for deregistering a terminal node. If, after issuing a command, the relay device does not receive the data uploaded by the terminal node in T_E_U, a limit of n can be set. After n times, the terminal node Uij is considered "dead," its token is deregistered, the relay device manager is updated, and the data is synchronized to the gateway and cloud device management platform. Another scenario is to monitor the remaining battery power of the terminal node Uij. If it falls below a certain threshold Vol, a delete frame (see Table 13) is actively sent to deregister the device and request a scheduled battery replacement. Since the terminal node Uij is a wake-up mechanism and is in a dormant state when not in operation, the terminal node Uij does not need to respond.
[0126] Table 13 Delete frame (relay device and terminal node)
[0127]
[0128] It is not difficult to find that the present invention ensures the timeliness of uplink and downlink communications in the network through dynamic time-frequency resource reuse management, flexible wake-up and sleep switching control, efficient timeline switching and network spectrum resource registration and recovery mechanism, expands the network's communication coverage, reduces network energy consumption, and has higher deployment flexibility. Combined with the method of the present invention, it can effectively meet the demand for low-power long-distance communication access in communication denial scenarios, and serve the perception and transmission application of life characteristic indicator parameters of underground space projects such as complex deep foundation pits.
Claims
1. A long-distance, low-power LoRa relay networking method for communication denial scenarios, applied to a communication system including an intelligent gateway, a relay device, and a terminal node, wherein LoRa is used to build a private network between the intelligent gateway and the relay device, characterized in that: The following steps are involved: The intelligent gateway broadcasts a fixed hello frame on a public channel. After receiving the hello frame, the relay device parses the hello frame, randomly selects a channel with the device available identification code set to 0 in the hello frame, converts the frequency to the corresponding frequency, and sends a registration frame to the intelligent gateway via the frequency band corresponding to the corresponding frequency. After receiving the registration frame, the intelligent gateway determines whether to register the relay device according to the relay device table. The hello frame includes a fixed frame header, a timestamp, and a device available identification code. The registration frame includes the remaining battery power and signal strength. After the relay device completes registration, the intelligent gateway listens to the relay device messages. After receiving the WN_U frame sent by the relay device, the intelligent gateway calculates the remaining working time of the relay device, and sends a start frame when the remaining working time of the relay device meets the link round-trip time required for one communication. After receiving the start frame, the relay device starts sending downlink data, and repeats this step until the remaining working time of the relay device cannot meet the link round-trip time required for one communication. The intelligent gateway caches the data to be sent and waits for the next working cycle between the relay device and the searching intelligent gateway.
2. The communication denial scenario long-distance low-power LoRa relay networking method according to claim 1, characterized in that: Before the intelligent gateway broadcasts the hello frame on the public channel, the intelligent gateway also includes an intelligent gateway startup process, and the intelligent network startup process includes: After powering on, the smart gateway performs self-test and initialization, then sends a registration frame to the cloud management platform and starts a timer; if a reply is received before the timer expires, the configuration information is parsed and spectrum resources are obtained to complete the registration; otherwise, registration is attempted again after a random period of time until registration is completed.
3. The communication denial scenario long-distance low-power LoRa relay networking method according to claim 1, characterized in that: Before the intelligent gateway broadcasts the hello frame on the public channel, the intelligent gateway further includes: The intelligent gateway divides the available spectrum resources of the network into several independent sub-bands, where each independent sub-band uses the center frequency as the carrier frequency; one of the several independent sub-bands is used as a public channel to send broadcast information, and the remaining independent sub-bands are used to be allocated to each relay device. The relay device uses the allocated independent sub-band to communicate with the intelligent gateway; each terminal node uses the independent sub-band allocated to the relay device to which it belongs to communicate with the relay device.
4. The communication denial scenario long-distance low-power LoRa relay networking method according to claim 1, characterized in that: After receiving the registration frame, the intelligent gateway determines whether to register the relay device according to the relay device table, specifically including: Query the relay device table to check whether the frequency band corresponding to the corresponding frequency is idle; If the frequency band corresponding to the corresponding frequency is idle, determining whether the remaining battery power and signal strength of the relay device exceed a set threshold; If the remaining battery power and signal strength of the relay device exceed the set threshold, the relay device is considered to be able to serve as a relay node, and a registration confirmation frame is sent to the relay device; After receiving the registration confirmation frame, the relay device performs an initialization operation, starts a timer, sets the time of the timer to the communication time with the intelligent gateway, completes the registration, and enters the working cycle of the relay device.
5. The communication denial scenario long-distance low-power LoRa relay networking method according to claim 1, characterized in that: Also includes: The intelligent gateway unpacks the data packet uploaded by the relay device to obtain the remaining power and signal strength of the relay device; When the remaining power and signal strength of the relay device are both lower than the set threshold, it is determined that the relay device cannot serve as a relay node, the command buffer area opened for the relay device is cleared, and a deregistration frame is sent to the relay device; after receiving the deregistration frame, the relay device waits for the communication time with the intelligent gateway to end before entering the communication phase with the terminal node, broadcasts the deregistration frame, and after receiving the last round of data from the terminal node, the terminal node uniformly enters the dormant state; after waiting for the communication time with the terminal node to end, the relay device enters the communication state with the intelligent gateway, reports the deregistration confirmation frame to the intelligent gateway, and then enters the dormant state; After receiving the deregistration confirmation frame from the relay device, the intelligent gateway updates the spectrum resource table and the relay device table, and reports the change to the cloud device management platform.
6. The communication denial scenario long-distance low-power LoRa relay networking method according to claim 1, characterized in that: Also includes: After the relay device receives the collection instruction from the intelligent gateway, the collection work and the communication work are run in parallel. When the service cycle with the intelligent gateway ends, the relay device enters the service cycle with the terminal node, and the relay device unpacks and assembles the collection instruction of the intelligent gateway; When the relay device has a command to send, it enters a downlink service cycle. During the downlink service cycle, the command is sent to the terminal node specified by the intelligent gateway. After the commands cached in the command buffer are sent, the downlink service cycle ends and the uplink service cycle begins. During the uplink service cycle, the relay device receives data from the terminal node. When the relay device has no command to send, it directly enters the uplink service period. During the uplink service period, the relay device receives data from the terminal node.
7. The communication denial scenario long-distance low-power LoRa relay networking method according to claim 1, characterized in that: The terminal node registration process is also included, and the terminal node registration process includes: After receiving the wake-up frame, the terminal node waits for a preset time and selects a free token group to send a registration frame to the relay device; After receiving the registration frame, the relay device communicates with the intelligent gateway and replies to the terminal node confirmation frame in the next round of communication. The terminal node starts working after successful registration; When a terminal node fails to register once, the waiting time for resending the registration frame needs to be plus a random fluctuation time on top of the preset time.
8. The communication denial scenario long-distance low-power LoRa relay networking method according to claim 6, characterized in that: Also includes: If the relay device has not received the data uploaded by the terminal node for n times during the uplink service cycle of the terminal node service cycle, the relay device cancels the token owned by the terminal node and completes the cancellation of the terminal node.
9. The communication denial scenario long-distance low-power LoRa relay networking method according to claim 6, characterized in that: Also includes: The relay device monitors the remaining power of the terminal node. When the remaining power of the terminal node is lower than a power threshold, the relay device actively sends a deregistration frame to the terminal node to deregister the terminal node.