A data packet scheduling method based on wireless channel conflict analysis
By employing FIFO packet scheduling and channel conflict detection and reselection in IoT devices, the problem of spectrum overlap and conflict between heterogeneous devices is solved, enabling parallel distribution of data packets and reducing communication latency.
Patent Information
- Application Number
- CN202210663739.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-10
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2042-06-10
AI Technical Summary
In heterogeneous IoT devices, existing technologies cannot effectively solve the problem of spectrum overlap and conflict between different communication protocols, resulting in data packet transmission blockage and increased communication latency.
By employing FIFO packet scheduling and a method based on packet collision detection and spectrum reselection, the channel collision relationships of various protocols are abstracted, and the topology relationships are stored using a graph data structure to realize channel collision detection and reselection, thereby avoiding channel collisions and achieving parallel distribution of data packets.
In heterogeneous IoT devices, optimizing the data packet scheduling mechanism avoids channel conflicts, maximizes concurrency, and reduces communication latency.
Smart Images

Figure CN115065990B_ABST
Abstract
Description
Technical Field
[0001] The present invention proposes a data packet scheduling method based on wireless channel conflict analysis, which can realize efficient communication between devices in a complex Internet of Things scenario containing a large number of heterogeneous devices. Background Art
[0002] In recent years, the Internet of Things technology has developed rapidly, gradually giving rise to a variety of application fields such as smart cities and smart homes. In actual application scenarios, an IoT system frequently communicates between nodes and between nodes and the Internet. Regarding communication, it is naturally inseparable from various underlying communication protocols. Currently, there are various protocols used in IoT scenarios: 802.15.4, Zigee, BLE, 6LoWPAN, LoRa, etc. Among them, the 802.15.4 protocol is a relatively mature technology, which defines the protocol of low-rate wireless personal area network (LR-WPAN). It specifies the physical layer and media access control of LR-WPAN. Its low power consumption and low cost advantages have made it widely used in many fields; Bluetooth and BLE (Bluetooth Low Energy) are widely used in our daily lives. The Bluetooth 4.0 standard includes traditional Bluetooth modules and low-power Bluetooth modules, namely BLE; LoRa is a representative LP WAN (Low Power Wide Area Network) technology. LoRa devices and LoRaWAN standards provide IoT applications with functions including long-range, low power consumption and secure data transmission. The technology is utilized by public, private or hybrid networks and offers greater range than cellular networks.
[0003] In today's deployments, many IoT applications require communication between heterogeneous IoT devices (i.e., devices using different communication stacks). As a result, multi-mode gateways that can distribute data packets to multiple devices with different protocols have emerged. In order to be compatible with various devices that use different protocols at the bottom layer, multi-standard chips are implanted in the gateway to achieve the above functions. In the device, the IoT device supports multiple communication technologies and becomes a "super terminal" similar to a gateway. However, due to the shortage of spectrum resources, the communication protocols supported by different devices may have spectrum overlap. For example, the communication module nRF52832 on the Arduino Primo can support the communication of three protocols: BLE, WiFi, and NFC; the STM32WB55 module on the STM Nucleo can support three protocols: BLE, 6LoWPAN, and Zigbee. When the gateway distributes data packets to Arduino Primo, it uses BLE's A channel. At this time, a task to distribute data packets to STM Nucleo arrives, which needs to be transmitted through the Zigbee protocol. However, the B and C channels of the Zigbee protocol conflict with the frequency band of the A channel. To avoid this phenomenon, the traditional method directly blocks this task and waits for the previous task to be distributed before executing this task. However, some channels in the Zigbee protocol will not conflict with the A channel in BLE. If a scheduling algorithm is designed to check channel conflicts and reselect channels, other channels in Zigbee that do not conflict with the A channel frequency band can be selected for concurrent transmission. Therefore, a data packet scheduling algorithm that can successfully solve the problem of spectrum conflicts can greatly improve the concurrency of data distribution and is an efficient method to reduce the communication delay of the Internet of Things.
[0004] In the process of data forwarding, the protocol used by the device is determined. From another perspective, by abstracting the channels of the spectrum band used by each protocol, analyzing the conflict relationship between different channels of each protocol, and adding a conflict avoidance mechanism, data packets can be successfully distributed simultaneously on different protocols, greatly reducing latency overhead. For example: when the gateway uses BLE to transmit to Arduino Primo, the gateway also needs to use Zigbee to distribute data packets to STM Nucleo. Due to the conflict between some channels of Zigbee and BLE, the second thread will be blocked under the normal process. However, through conflict analysis, we can use Zigbee's non-conflicting channels to transmit data packets and achieve simultaneous distribution of data packets.
[0005] Based on this, we hope to abstract the conflict relationship between different channels of each protocol and implant the conflict detection algorithm in the gateway to greatly improve the communication efficiency. Summary of the invention
[0006] The present invention aims to overcome the above-mentioned shortcomings of the prior art and provide a data packet scheduling method based on wireless channel conflict analysis.
[0007] To achieve the above objectives, the technical solutions adopted by the present invention are: FIFO packet scheduling and technology based on packet conflict detection and spectrum reselection. A packet scheduling method based on wireless channel conflict analysis of the present invention comprises the following steps:
[0008] (1) Packet preprocessing. First, parse the data packet transmitted from the network layer to obtain key information such as the destination address, underlying transmission protocol, packet length, and flags. The purpose is to extract key information of the data packet. Then label the data packet and transmit it to the data queue.
[0009] (2) Data packets are queued. Data packets are entered into the execution queue. According to the first-in-first-out principle, the first data packet to enter the queue will be first to obtain the processor to operate on the data packets in the queue.
[0010] (3) Packet conflict detection. Specifically including:
[0011] a. Detection of packet spectrum conflict. This step mainly performs spectrum conflict detection on packets. By querying the data table in the route, it is determined whether there is a conflict relationship. If there is a conflict relationship, the transmission channel needs to be changed until there is no conflict in the channel. Concurrent transmission is avoided by setting a busy flag before the first transmission. By checking the busy flag, it is avoided to enter the second transmission event immediately. If the busy flag is detected, it means that there is a conflict and the channel spectrum reselection mechanism will be entered.
[0012] b. Data packet spectrum reselection. The topological relationship of multiple IoT underlying protocols is abstracted in advance, converted into graph data, and stored in the data table in the form of triples. Based on the conflict relationship and all spectrum channel numbers contained in each protocol, a resource pool of available spectrum channel numbers corresponding to each protocol is generated. After having the spectrum signal resource pool corresponding to each protocol, the spectrum used by the data packet is reselected, and the spectrum signal used is reselected from the resource pool until there is no conflict.
[0013] (4) Packet aggregation. Receive the processed data packets, attach specific information in a specified manner, pass the data to the packet parser, encapsulate the data packets, add headers, slice the data, add flags, and transmit the data packets to the network layer with IPV6 as the core.
[0014] (5) Data packet distribution: The aggregated data packets are distributed according to the data packet headers they carry.
[0015] The implementation of data packet distribution uses one of two implementation schemes: LPL-based data relay and channel-hopping-based data relay.
[0016] (6) Data packet upload: Get the data packets transmitted from the bottom layer, encapsulate them, add headers, slice them, add flags, and transmit them to the network layer with IPV6 as the core.
[0017] Preferably, the implementation of the data packet distribution described in step (5) adopts an LPL-based data relay scheme: the relay node receives packets from the downstream node by periodically performing CCA and receives packets when a high energy level is detected. The relay node can receive subsequent packets or forward the packet immediately. This implementation is applicable to the LPLMAC protocol built on 802.15.4 and LoRa.
[0018] Alternatively, the implementation of the data packet distribution described in step (5) adopts a data relay solution based on channel hopping: to make data packets acceptable to different protocols, the relay node allocates receiving slots and synchronizes channel hopping when forwarding. The system performs channel scanning at the downstream node, and the relay node broadcasts. In order to achieve transmission, the downstream node applies for a transmission slot from the relay node, and the relay node sends this request to the upstream node. After the two links ensure the synchronization of channel hopping, the data packet is transmitted.
[0019] The present invention is mainly aimed at solving the channel conflict problem under different protocols in the Internet of Things scenario, realizing the parallel distribution of data packets of the underlying protocol, and maximizing the degree of concurrency. Different protocols at the bottom layer overlap in the channel frequency domain. Therefore, as long as the data packets are distributed in the non-overlapping parts of various protocols, the data packets can be distributed to different protocols at the same time. The data packet scheduling scheme is deployed at the 2.5L layer, between the network layer and the data link layer. The channel conflict problem between different protocols is modeled into a graph relationship. By querying the graph data, it is detected whether there is a channel conflict. If there is a channel conflict, the channel used by the protocol is changed until the conflict is resolved. The parallel distribution of different protocols can be realized, which greatly reduces the communication delay in the heterogeneous device scenario.
[0020] The beneficial effects of the present invention are: by optimizing the scheduling mechanism of data packets, maximum concurrency is achieved while avoiding conflicts, thereby reducing the communication delay between IoT devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 Network architecture diagram for application of this method.
[0022] Figure 2 The conflict relationship topology diagram of the present invention. DETAILED DESCRIPTION
[0023] The present invention provides a data packet scheduling method based on conflict detection, which can achieve maximum concurrency of data packet scheduling for devices or media with different underlying protocols in IoT scenarios with multiple services and multiple types of heterogeneous devices, and avoid channel conflicts. The specific steps for processing data packets are as follows:
[0024] (1) Packet preprocessing. First, parse the data packet transmitted from the network layer to obtain key information such as the destination address, underlying transmission protocol, packet length, and flags. The purpose is to extract key information of the data packet, label the data packet, transmit the data packet to the data queue, and determine whether the data queue is full. If the queue is full, the data packet can be temporarily stored in the buffer of the transmission module.
[0025] (2) Data packets are queued. Data packets are put into the data queue. Data packets are input into the execution queue. According to the first-in-first-out principle, the first data packet to enter the queue will get the processor first to operate on the data packets in the queue.
[0026] (3) Packet conflict detection. This step mainly involves conflict detection of packets. By querying the data table in the route, it is determined whether there is a conflict relationship. If there is a conflict relationship, the sending channel needs to be changed until there is no conflict in the channel. Our design avoids concurrent transmission by setting a busy flag before the first transmission. By checking the busy flag, we avoid entering the second transmission event immediately. If the busy flag is detected, it means that there is a conflict and the channel spectrum reselection mechanism will be entered. In advance, we abstract the topological relationship of multiple IoT underlying protocols, convert it into graph data, store it in the form of triples in the data table, and generate an available spectrum channel resource pool based on this. If there is a conflict, we replace other spectrum channels from the resource pool until there is no conflict.
[0027] The specific implementation of this step requires two aspects: the storage design of the data table items in the routing, and the design of the relevant functions for packet conflict judgment. In this way, the channel information of the underlying protocol and the conflict relationship between each protocol can be maintained, and the functions of packet channel selection, packet channel conflict detection, and packet channel reselection can be realized. The specific implementation is as follows:
[0028] Storage structure design: The main storage structure is divided into the following four aspects: 1. Maintain a queue of the classic FIFO algorithm to store the information of the data packet; 2. Design a storage table to store the parameters of the ID of each protocol channel and the conflict situation. 3. Build a graph data structure to record the protocol channel IDs with conflicting relationships in the same connected graph or tree. 4. Used to store a channel cache pool for specific protocols to select channel IDs.
[0029] Function design: The main requirements in this scenario are: channel conflict detection and channel reselection mechanism. When each data packet arrives, it first enters the data packet queue. After the data packet enters the processor, read out the underlying protocol that the data packet needs to distribute, write these protocols including the channel into the cache pool, and use the channel detection algorithm to determine whether there is a conflict. If there is a conflict, reselect the channel until the channel does not conflict. Therefore, according to this requirement, the following function is designed to implement the above functions (omitting simple queue operations and listing the core function functions directly):
[0030] Get_protocol(): Gets all the underlying protocol types that the data packet needs to be distributed to the device, and returns the name of the protocol as the return value.
[0031] Write_channel_pool(): Write all available channels of the protocol into the channel buffer pool according to the id. If there are multiple protocols, multiple buffer pools are generated and written. After a channel conflict is detected, the channel reselection can be processed by directly reading the channel id from the buffer pool.
[0032] Get_channel_pool(): Gets the status of the channel buffer pool. If the buffer pool is empty, it returns 0. If it is not empty, it returns the content of the buffer pool and the type of protocol.
[0033] Clear_channel_pool(): After the program ends, you can use this function to clear the buffer pool to facilitate the next use of the buffer pool. Or before the program starts, clear the buffer pool to prevent errors.
[0034] Find_collision_node(): Conflict node search, through the union-find algorithm, calculate whether there are other nodes in the conflict graph with the node of the data packet, and read out the nodes with potential conflicts.
[0035] Collision_detection(): Based on the read potential conflict nodes, determine whether there are any running nodes in the set. If so, it means that there is a channel conflict and the channel needs to be changed. If not, it means that there is no channel conflict.
[0036] Channel_reselect(): implements the channel reselection mechanism. After detecting a channel conflict, the potential conflicting node is obtained. At this time, the channel node other than the potential conflicting node is searched in the cache pool to re-detect whether the channel will conflict. This function returns the reselected channel node.
[0037] Send_package(): Sends the data packet to the specified channel according to the selected channel number. After selecting a specific channel, the data packet is distributed and delivered to the data receiving module using this function, and the specified channel number is returned.
[0038] (4) Data packet aggregation. Receive data packets that have been scheduled by the data queue and the data scheduling algorithm after the data queue, attach specific information in a specified manner, and pass the data to the data parser to allow it to encapsulate and slice the scheduled data packets. A buffer is designed in this part to prevent data loss caused by excessive data volume in a short period of time, when the previous data packet has not been processed and the next data packet is distributed to the parsing module.
[0039] (5) Data packet distribution. The aggregated data packets are distributed according to the data packet headers they carry. The design of data packet distribution generally includes two implementation schemes: a data relay module based on LPL and a data relay module based on channel hopping.
[0040] a. Data relay scheme based on LPL: The relay node can receive packets from downstream nodes by performing CCA periodically and receiving packets when a high energy level is detected. The relay node can receive subsequent packets or forward the packet immediately. This implementation is suitable for the LPLMAC protocol built on 802.15.4 and LoRa.
[0041] b. Data relay scheme based on channel hopping: In order for the relay node to receive data packets from downstream nodes, since both BLE and LoRaWAN are receiving, it is necessary to allocate receiving slots and synchronize channel hopping. The system performs channel scanning at the downstream node and the relay node broadcasts. The downstream node can request one or more transmission slots, and the relay node coordinates the allocation and confirms the final decision to the downstream node. In order for the relay node to forward data packets to the upstream node, it is also necessary to allocate transmission slots and synchronize transmission / reception with the upstream node. When the relay node and the upstream node perform channel scanning, the system allocates transmission slots. The relay node can request one or more transmission slots and wait for confirmation from the upstream node. In order to optimize the performance of multiple consecutive data packets, all three radio technologies have a default delay after receiving mechanism. The relay node will remain in the receiving state for a period of time after receiving a packet and will try to receive more subsequent packets.
[0042] (6) Data packet upload: Get the data packets transmitted from the bottom layer, encapsulate them, add headers, slice them, add flags, and transmit them to the network layer with IPV6 as the core.
[0043] The contents described in the embodiments of this specification are merely an enumeration of the implementation forms of the inventive concept. The protection scope of the present invention should not be regarded as limited to the specific forms described in the embodiments. The protection scope of the present invention also extends to equivalent technical means that can be conceived by those skilled in the art based on the inventive concept.
Claims
1. A data packet scheduling method based on wireless channel conflict analysis, comprising the following steps: (1) Packet preprocessing: First, parse the data packets transmitted from the network layer to obtain key information, including the destination address, underlying transmission protocol, packet length, and flags; then label the data packets and transmit them to the data queue; (2) Data packets are queued: Data packets are input into the execution queue. According to the first-in-first-out principle, the first data packet to enter the queue will get the processor first, and the data packets in the queue will be operated. (3) Packet conflict detection; specifically including: a. Detection of packet spectrum conflicts: by querying the data table in the route, determine whether there is a conflict relationship. If there is a conflict relationship, the transmission channel needs to be changed until there is no conflict in the channel; avoid concurrent transmission by setting a busy flag before the first transmission; avoid entering the second transmission event immediately by checking the busy flag. If the busy flag is detected, it means there is a conflict and the channel spectrum reselection mechanism will be entered; b. Data packet spectrum reselection: The topological relationship of multiple IoT underlying protocols is abstracted in advance, converted into graph data, and stored in the form of triples in a data table. Based on the conflict relationship and all spectrum channel numbers contained in each protocol, a resource pool of available spectrum channel numbers corresponding to each protocol is generated. After the spectrum signal resource pool corresponding to each protocol is obtained, the spectrum used by the data packet is reselected, and the spectrum signal used is reselected from the resource pool until there is no conflict. (4) Data packet aggregation: accept the processed data packets, attach specific information in a specified manner, pass the data to the data packet parser, encapsulate the data packets, add headers, slice the data, add flags, and transmit the data packets to the network layer with IPV6 as the core; (5) Data packet distribution: distribute the aggregated data packets according to the data packet headers they carry; (6) Data packet upload: obtain the data packet transmitted from the bottom layer, encapsulate the data packet, add a header, slice the data, add a flag bit, and transmit the data packet to the network layer with IPV6 as the core.
2. The method for data packet scheduling based on wireless channel conflict analysis according to claim 1, characterized in that: The implementation of the data packet distribution described in step (5) adopts an LPL-based data relay scheme: the relay node receives packets from the downstream node by periodically performing CCA and receives packets when a high energy level is detected; the relay node can receive subsequent packets or forward the packet immediately; this implementation is applicable to the LPLMAC protocol built on 802.15.4 and LoRa.
3. The method for data packet scheduling based on wireless channel conflict analysis as claimed in claim 1, characterized in that: The implementation of the data packet distribution described in step (5) adopts a data relay solution based on channel hopping: to make data packets acceptable to different protocols, the relay node allocates receiving slots and synchronizes channel hopping when forwarding; the system scans channels at downstream nodes and the relay node broadcasts; in order to achieve transmission, the downstream node applies for a transmission slot from the relay node, and the relay node sends this request to the upstream node. After the two links ensure the synchronization of channel hopping, the data packet is transmitted.
4. The method for data packet scheduling based on wireless channel conflict analysis as claimed in claim 1, characterized in that: The storage design of the data table items in the routing described in step (3) includes: S1. Maintaining a queue of a classic FIFO algorithm for storing the information of data packets; S2. Designing a storage table item to store the parameters of the ID of each protocol channel and the conflict situation; S3. Constructing a graph data structure to record the protocol channel IDs with conflicting relationships in the same connected graph or tree; S4. A channel cache pool for storing specific protocols for selecting channel IDs.
5. The method for data packet scheduling based on wireless channel conflict analysis as claimed in claim 1, characterized in that: The design of the relevant function for judging the data packet conflict relationship in step (3) includes: The requirements in the packet conflict relationship judgment scenario include: detecting channel conflicts and channel reselection mechanisms; when each packet arrives, it first enters the packet queue; after the packet enters the processor, it reads out the underlying protocol that the packet needs to be distributed, writes these protocols including the channel into the cache pool, and uses the channel detection algorithm to determine whether there is a conflict. If there is a conflict, reselect the channel until there is no channel conflict; design the following functions according to the requirements: Get_protocol(): Gets all the underlying protocol types that the data packet needs to be distributed to the device, and returns the protocol name as the return value; Write_channel_pool(): Write all available channels of the protocol into the channel buffer pool according to the id. If there are multiple protocols, multiple buffer pools are generated and written. After a channel conflict is detected, the channel reselection can be processed by directly reading the channel id from the buffer pool. Get_channel_pool(): Gets the status of the channel buffer pool. If the buffer pool is empty, it returns 0. If it is not empty, it returns the content of the buffer pool and the type of protocol. Clear_channel_pool(): After the program ends, this function can be used to clear the buffer pool to facilitate the next use of the buffer pool; or before the program starts, clear the buffer pool to prevent errors; Find_collision_node(): Find the conflicting nodes. Use the union-find algorithm to calculate whether there are other nodes in the conflict graph with the node of the data packet, and read out the nodes with potential conflicts. Collision_detection(): Based on the read potential conflict nodes, determine whether there are running nodes in the potential conflict node set. If yes, it means that there is a channel conflict and the channel needs to be changed. If no, it means that there is no channel conflict. Channel_reselect(): implements the channel reselection mechanism. After detecting the channel conflict, the potential conflict node is obtained. At this time, the channel node other than the potential conflict node is searched in the cache pool to re-detect whether the channel will conflict; this function returns the reselected channel node; Send_package(): Sends the data packet to the specified channel according to the selected channel number; after selecting a specific channel, distributes the data packet, delivers it to the data receiving module using this function, and returns the specified channel number.
