Adhoc Adaptive Time Slot Division Method Based on Graph Coloring Theory
By using graph shading algorithm in adhoc ad hoc network to construct topology diagrams and dynamically adjusting slot allocation, conflicts and resource contention problems in distributed slot allocation protocols are solved, and efficient time slot division and network adaptability are achieved under controllable time delays.
Patent Information
- Application Number
- CN202310128109.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2022-11-09
- Filing Date
- 2023-02-15
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2043-02-15
AI Technical Summary
The existing distributed time slot allocation protocol has high conflicts and resource contention problems in adhoc ad hoc network, making it difficult to complete time slot division under controllable delays, and lacks the ability to adapt to network traffic changes and topological changes.
A distributed time slot allocation method based on graph shading algorithm is adopted to construct a topology map through node situation awareness, allocate colors to avoid interference, and dynamically adjust the time slot allocation according to the message queue length to adapt to network traffic changes and topology changes.
It reduces interference between nodes, improves network throughput, enhances the loss resistance and adaptability of the network, and can dynamically adjust the time slot allocation under controllable time delays to adapt to traffic and topological changes.
Smart Images

Figure CN116321505B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of ad hoc wireless network communication, and more particularly, to a method for dividing time slots in an ad hoc network. Background Art
[0002] Adhoc (also known as Peer to Peer) refers to a wireless network based on an ad hoc network, which is composed of two or more STAs by themselves, and there is no AP in the network. This type of network is a loose structure, and all STAs in the network can communicate directly. With the in-depth development of ad hoc clustering technology, the number of nodes in the ad hoc network is increasing, the network topology formed by the ad hoc network is becoming more and more complex, and the communication density of the link is increasing. The basic wireless network (Infra) formed by the AP: Infra: also known as the infrastructure network, is a wireless network created by the AP and joined by many STAs. The characteristic of this type of network is that the AP is the center of the entire network, and all communications in the network are forwarded through the AP. The AP, that is, the wireless access point, is the creator of a wireless network and the central node of the network. The STA station refers to each terminal connected to the wireless network (such as a laptop computer, a PDA, and other user devices that can be connected to the network) can be called a station. Since the scale of the wireless ad hoc network is gradually expanding, the competition for communication resources within the cluster is becoming more and more intense. During the transmission process, especially in the network transmission of a large-scale wireless ad hoc network, a reasonable scheduling and allocation scheme plays a very important role in the allocation of communication resources and the avoidance of interference between nodes. It is crucial to perform reasonable time slot division for ad hoc nodes.
[0003] An ad hoc network composed of multiple nodes has many characteristics, including dynamic topology change, serious network resource contention, frequent position movement, etc. These characteristics make ad hoc more in need of considering reasonable time slot division than traditional networks, and this method needs to complete convergence in a short time to ensure that it can cope with topology changes.
[0004] In the channel access protocol, the competitive protocol adopts a competitive algorithm, which allows ad hoc nodes to freely compete for the channel according to the agreed rules. However, considering the network throughput, the channel access method based on time division multiple access has better overall throughput, and can better cope with point-to-point unicast transmission. The transmission delay is usually within an estimable range, and the priority can also be controlled. The channel access protocol based on time division multiple access is divided into two categories: centralized time slot allocation protocol and distributed time slot allocation protocol.
[0005] The allocation method of the centralized time slot allocation protocol is based on a centralized approach and is scheduled according to the data center of the network. The data center receives information from each node in the entire network. After aggregating the relevant information of all nodes, it divides time slots for all nodes according to the determined time slot allocation method and time slot allocation protocol. The collision avoidance between nodes is ensured by the data center and the time slot division method of the data center. The problem with this method is that the network must have a data center. In addition, the damage of the data center will lead to the collapse of the entire network. Therefore, the centralized time slot allocation protocol is not conducive to the expansion of the network and is not suitable for ad hoc self-organizing networks with high requirements for scalability.
[0006] The allocation method of the distributed time slot allocation protocol is based on the allocation principle of the node itself. It determines the time slot allocation situation according to the information of the node itself and the information of its neighbors, that is, the node directly determines the time slot division method according to its own situation and the situation of its neighbors, without the need for a data center to schedule. The channel utilization efficiency of this allocation method may be lower than that of the centralized channel allocation protocol as a whole. However, the distributed time slot allocation protocol has better scalability and can better adapt to the topological changes of the distributed network. After the topological relationship changes, the distributed time slot allocation protocol only needs to perform local reallocation for the changed positions, without consuming network resources to re-divide time slots for other unchanged positions. The damage or disconnection of any node will not affect the entire network, enhancing the overall damage resistance and robustness of the network.
[0007] Currently, the main problems in the TDMA time slot allocation of ad hoc self-organizing networks using the distributed time slot allocation protocol are how to determine a suitable time slot allocation method, improve resource utilization, complete reliable time slot allocation under acceptable delay constraints, ensure that node losses do not affect the entire network, have a certain adaptability to topological changes, and adapt to changes in network traffic. However, the available resources in ad hoc self-organizing networks are very limited, and there are still non-negligible network resource competition and conflict phenomena in the existing transmission allocation methods for ad hoc distributed networks. See Rhee I, Warrier A, Min J, et al. DRAND: distributed randomized TDMA scheduling for wireless ad-hoc networks[C] / / Proceedings of the 7th ACM international symposium on Mobile ad hoc networking and computing. 2006:190-201.
[0008] In view of this, a time slot allocation protocol suitable for distributed networks is needed to complete the time slot division of ad hoc under controllable delay, dynamically adjust the time slot allocation according to the changes in network traffic, and have a certain adaptability to topological changes. Summary of the Invention
[0009] The object of the present invention is to solve the following problems: 1) centralized coloring algorithms are difficult to apply in ad hoc self-organizing networks; 2) existing distributed algorithms still have relatively high conflict problems and resource contention problems; 3) the coloring algorithm needs to be suitable for TDMA and consider the changes in the traffic of network nodes in ad hoc self-organizing networks to achieve traffic-based adaptive time slot allocation; 4) the coloring algorithm needs to be completed within a certain delay and have a certain adaptability to topological changes.
[0010] The technical solution of the present invention is an ad hoc distributed time slot allocation method based on a graph coloring algorithm, and the method includes:
[0011] 1) Each node in the ad hoc self-organizing network completes the situation awareness within the collision domain, obtains the topological situation within the communication range of this node, and obtains the node information and link parameters within the topology.
[0012] 2) After each node obtains the topological information within the collision domain, a node distribution state graph within the collision domain is constructed with the nodes as vertices. According to the time slot settings preset in the system configuration, parameters such as the degrees of the nodes and neighbors obtained by sensing, colors are assigned to each node to avoid interference between interfering nodes, and each node occupies a time slot according to the obtained color.
[0013] 3) According to parameters such as the message queue length of the node, a color allocation algorithm is used to adjust the allocation of the remaining time slots in the data subframe.
[0014] Among them, in the step 2), the method of graph coloring for allocating time slots to all vertices according to the interference state graph to avoid interference between interfering nodes includes: mapping the time slots in the ad hoc network to multiple different colors, using colors to represent time slots, for example, color 1 can represent time slot 1. Based on the graph coloring algorithm, colors are assigned to all ad hoc nodes, so that all ad hoc nodes obtain time slots; in the topological relationship graph, if the distance between any two ad hoc nodes is within two hops, then these two nodes cannot reuse time slots.
[0015] Among them, in the step 2), the method of graph coloring for allocating colors and time slots to each vertex in the topological graph according to the preset time slot reuse distance further includes:
[0016] 20) Use a long frame to complete the color allocation during initialization, ensure that the long frame is sufficient for use, and nodes initially access time slots in a randomly selected manner. A long frame refers to a frame with a relatively large number of time slots, and the specific number of time slots is generated by the system configuration file. Sufficient for use means that the number of time slots is greater than the number of nodes; reference can be made to Figure 4 ;
[0017] 21) According to the initial time slot number allocation method, determine the number of initial data sub-frame time slots that each ad hoc node itself needs to obtain within the topology graph;
[0018] 22) Select the color for each node according to the distributed coloring algorithm and broadcast the remaining color situation;
[0019] 23) After all nodes within the collision domain obtain the colors corresponding to the nodes, end the use of the long frame and divide each frame into a control sub-frame and a data sub-frame. Assume that the maximum number of required time slots is N, and use N as the number of time slots for the control sub-frame N ctl , and use βN as the number of time slots for the data sub-frame N d . Among them, β is set by the system configuration file. Each node occupies the earliest corresponding time slot among the colors it obtains within the control sub-frame and occupies the time slots corresponding to all the obtained colors within the data sub-frame.
[0020] Among them, the initial data sub-frame time slot number allocation method in step 21) includes: obtaining the number of one-hop neighbors of the nodes within the collision domain while performing neighbor awareness. When determining the number of time slots that a node should be allocated, set the weight of the node according to the centralization degree of the node in the topology. Nodes at the center of the topology need to be allocated more time slots to achieve fast scheduling of multi-hop transmission.
[0021] Among them, the initial time slot number allocation method in step 21) further includes the following sub-steps:
[0022] 211) With the help of the neighbor awareness result, obtain the number of one-hop neighbors of each node within the collision domain, so as to calculate the weight of each node itself. The definition of the weight information is as follows. For any node in the ad hoc network, obtain the topological relationship between the node and the surrounding nodes, and obtain the degrees of the node and other nodes within the collision domain. The corresponding weight relationship is calculated as follows, where d i represents the degree of node i, and d j represents the degree of other nodes j within the collision domain:
[0023]
[0024] 212) According to the weight w di of this node, obtain the number of time slots allocated to this node. γ is generated by the system configuration file. Among them, floor means rounding down:
[0025]
[0026] Among them, the color allocation method in step 22) further includes the following sub-steps:
[0027] 221) Each node calculates the weight w within its own collision domain ci , and broadcasts it, attaching its own ID information in the broadcast message:
[0028]
[0029] Among them, r(i) represents the set of one-hop neighbors of i whose color selection is not completed, r(j) represents the set of one-hop neighbors of j whose color selection is not completed, j represents a one-hop neighbor of i, |r(i)| represents the size of r(i), |r(j)| represents the size of r(j), rand(0,1) represents a randomly selected number within the range (0,1), C(i) represents the set of remaining available colors, and |C(i)| represents the size of the set of remaining available colors;
[0030] 222) The node with the smallest weight among those in the collision domain whose color selection is not completed selects the currently available smallest color from the available colors. If there are multiple nodes with the smallest weight, then the node with the smallest ID assigned during initialization gets the selection opportunity, and broadcasts the selection situation and the remaining color situation;
[0031] 223) The nodes in the collision domain that have not selected colors this time update the color selection situation according to the received information. If a color has been selected, then broadcast the color selection situation in the time slot corresponding to the earliest color obtained by this node. Otherwise, randomly select a time slot to access among the unoccupied time slots and broadcast the current color selection situation;
[0032] 224) If the number of colors selected by this node reaches the number assigned during initialization, then it is considered that this node has completed the selection. If no node selects a color after two rounds of selection, then the color selection situation in the information received by the node remains unchanged, and at this time, the color selection process ends.
[0033] Among them, step 3) adjusting the allocation of the remaining time slots in the data sub-frame according to the message queue length of the node and the color allocation algorithm includes the following steps:
[0034] 301) Each node is divided into four states: Idle, Request, Agree, Finish;
[0035] After initialization is completed, each node is in the Idle state. Only when there are remaining time slots available for application can the node enter the Request state to apply for time slots. To ensure that the Restart information can be broadcast when a new node joins, one data sub-frame time slot needs to be reserved; only when the number of time slots contained in the data sub-frame of this node is greater than 1 is the node allowed to enter the Request state to release time slots, and the time slot situation in the control sub-frame remains unchanged;
[0036] 303) The node extracts the message queue length of the current service data. The message queue parameter of node i is represented by queuelen i If queuelen i is greater than the threshold θ up set in the configuration file, then the node needs to apply to occupy one more time slot of a data sub-frame, that is, obtain another color. If queuelen i is less than the threshold θ down set in the configuration file, then the node needs to apply to release one time slot of a data sub-frame, that is, release a color of a non-control sub-frame. Among them, θ up and θ down are set by the system configuration file;
[0037] 304) If the node needs to occupy or release a color, meets the conditions described in 32), and the k backoff ends, then the node changes to the Request state in its corresponding time slot in the control sub-frame and broadcasts the Request information, including the ID of this node and the request type;
[0038] 305) If the node receives the Request information and is in the Idle state or Finish state, then the state of the node becomes Agree, and it is ready to broadcast the Agree information in the control sub-frame time slot of the node, including the ID of the requesting node contained in the Request information;
[0039] 306) If the node receives the Request information and is in the Agree state, then the state of the node remains Agree, and still retains the ID in the original Request information;
[0040] 307) If the node is in the Request state, receives the Agree information, and the ID in the Agree information is not this node, then the node becomes the Idle state, randomly selects the backoff value k, and cannot apply for time slots or release time slots within k frames, and broadcasts the Fail information in its own control time slot;
[0041] 308) If the node is in the Request state, and receives an Agree message, and the IDs of the Agree messages are all the node itself, then the node changes to the Finsh state, and broadcasts a Finish message in its own control time slot for two hops, including the occupied or released time slots;
[0042] 309) If the node is in the Agree state, and receives a Fail message or a Finsh message, then the node reverts to its previous state. If the node was previously in the Finsh state, then the node remains in the Finsh state; otherwise, the node changes to the Idle state, and broadcasts a Finish message in the node's control time slot, with the ID information of the node carried in the Finish message;
[0043] 310) If the node is in the Finish state, and does not receive a Request message and a Fail message within m control sub-frames, then the node changes to the Idle state, where m is defined by the configuration file;
[0044] 311) The node collects Finish messages in the control sub-frame, senses the time slot selection situation in the current collision domain, records the source ID information in the Finish message. If the node does not receive any information from node i within n frames, then it is considered that node i has left. The node adds the information of the leaving node to the next Finish message, and the node releases all the time slots occupied by the leaving node according to this information;
[0045] 312) The newly joined node collects Finish messages, senses the time slot selection situation in the current collision domain. If the time slots in the control sub-frame have been exhausted, then re-initialization is required at this time. At this time, the newly joined node broadcasts a Restart message in the remaining random data sub-frame time slots, and the nodes in the collision domain re-initialize. If there are still remaining time slots, the newly joined node attempts to enter the Request state and tries to obtain time slots according to the method in step 304;
[0046] 313) The timeout of the node is set to three times the one-hop delay time, where the one-hop delay time is obtained from the network, and the one-hop delay time is estimated and updated regularly using the time difference between sending and receiving messages. If the timeout counter expires, and at this time the node does not receive a reply, or the received reply fails the verification, then the node re-sends the message to be replied to the node that did not reply and the node with verification failure.
[0047] Among them, the state transition diagram described in step 3 is as Figure 2 shown.
[0048] The present invention proposes an adhoc adaptive time slot division method based on graph coloring theory in adhoc ad hoc wireless communication. Calculate weights based on degrees; select colors in the order of weight size; broadcast the selection of colors; update the selection of colors and continue the process of color selection; consider the selection completed when the selection of colors is fixed; after the color selection is completed, read the message queue length and dynamically adjust the time slots of nodes, and dynamically adjust the time slot allocation when nodes join or leave.
[0049] Beneficial effects: Compared with the prior art, the above TDMA time slot division method and system based on graph coloring theory color each node according to the distributed coloring algorithm according to the topological relationship, link conditions, and node information between ad hoc nodes, so that different colors are used for interfering nodes, and communication resources are allocated to each node. After the initialization is completed, the node reads the length of the message queue and dynamically adjusts the time slot allocation of each node. The dynamic time slot division method of the present invention is somewhat similar to Rhee I, Warrier A, Min J, but the existing method is applied to a fixed network and cannot dynamically allocate time slots according to traffic changes. The present invention can dynamically allocate time slots according to traffic changes and can adapt to node mobility to a certain extent. There is a need for a time slot allocation protocol suitable for distributed networks to complete the time slot division of adhoc under controllable delay, and at the same time can dynamically adjust the time slot allocation according to the change of network traffic, and has a certain adaptability to topological changes, improve the adaptability of ad hoc to traffic changes, and reduce the possibility of collisions. Brief Description of the Drawings
[0050] Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings, wherein:
[0051] Figure 1 Schematically shows the coloring process during initialization used in an embodiment of the present invention;
[0052] Figure 2 Schematically shows the state transition diagram of the traffic adaptation time slot allocation method used in an embodiment of the present invention;
[0053] Figure 3 Schematically shows the state transition message structure diagram of an embodiment of the present invention;
[0054] Figure 4 Schematically shows the frame structure diagram of an embodiment of the present invention;
[0055] Figure 5 、 Figure 6 Schematically shows the result diagram of the coloring algorithm of an embodiment of the present invention;
[0056] Figure 7Schematically shows the overall working process of an embodiment of the present invention. Detailed implementation manners
[0057] As mentioned above, the ad hoc network needs to allocate time slots under limited network resources to reduce collisions in the network and improve the overall throughput of the network. However, in many current implementation methods, the centralized architecture is not conducive to the expansion of the ad hoc network, and some distributed implementations do not consider changes in network traffic and adapt to the mobility of nodes. The present invention studies the time slot access method for ad hoc self-organizing networks in this situation and gives a traffic-adaptive time slot allocation method based on graph coloring theory, which is beneficial to the improvement of system performance.
[0058] Figure 1 Gives the time slot allocation method based on graph coloring theory during initialization adopted by an embodiment of the present invention. The following specifically introduces the time slot access method during initialization:
[0059] Step 100: During the start of initialization, complete the situation awareness within the collision domain of each node, sense the topological situation within the collision domain of this node, and obtain link information and node information. The initialization neighbor awareness is based on contention-based broadcasting, and accesses the channel in a random time slot to complete the neighbor awareness task within the collision domain;
[0060] Step 200: After each node obtains the topological information within the collision domain, construct a node distribution state graph within the collision domain with the nodes as vertices, and assign colors to each node according to parameters such as the time slot settings preset in the system configuration and the degrees of the sensed nodes and neighbors, so as to avoid interference between interfering nodes, and each node occupies a time slot according to the obtained color;
[0061] Step 300: While the network generates traffic, adjust the time slot allocation situation within a certain limit according to the changes in the traffic of each node. Each node reads the length of the message queue and tries to adjust the time slot occupancy of the node itself when the conditions are met.
[0062] Among them, the specific details of step 200 are as follows:
[0063] Step 210: During the initialization process, use a long frame to complete color allocation. The length of the long frame ensures that the nodes can be correctly allocated. When the nodes do not obtain time slots, they access the time slots in a random access manner. A long frame refers to a frame with a relatively large number of time slots. The specific number of time slots is generated by the system configuration file. Sufficient for use means that the number of time slots is greater than the number of nodes. In one embodiment, the number of time slots is the number of neighbors plus 20, and the random function uses the library random function;
[0064] Step 220: According to the method of slot number allocation, determine the initial number of slots that each node should be allocated. Control each node in the control subframe to obtain one slot, and each node in the data subframe can obtain multiple slots. In this step, since the nodes have not obtained slots yet, when the nodes perform random slot access in the long frame, each node can finally obtain the degree situation within the collision domain;
[0065] Step 230: Select colors for each node according to the coloring algorithm and notify the remaining situation of the colors in a broadcast manner. The nodes that have obtained colors perform broadcasts at the position of the earliest obtained slot by themselves, and the nodes that have not obtained slots access the channel at random positions in the remaining slots;
[0066] Step 240: After all nodes within the collision domain obtain the colors corresponding to the nodes, end the use of the long frame and divide each frame into a control subframe and a data subframe. Assume that the maximum number of required slots is N, and use N as the number of slots in the control subframe N ctl , and use βN as the number of slots in the data subframe N d . Among them, β is set by the system configuration file. In one embodiment, β = 9. Each node occupies the earliest corresponding slot among the colors it has obtained in the control subframe and occupies the slots corresponding to all the obtained colors in the data subframe.
[0067] Among them, the method for allocating the number of slots in the data subframe at the beginning of Step 220 includes: obtaining the number of one-hop neighbors of the nodes within the collision domain while performing neighbor awareness. When determining the number of slots that a node should be allocated, set the weight of the node according to the degree of centralization of the node in the topology. The nodes at the center of the topology need to be allocated more slots to achieve fast scheduling of multi-hop transmission. Nodes with a higher degree are more likely to forward data in the network than nodes with a lower degree. Therefore, nodes with a higher degree should reserve more slots in the data subframe to ensure the normal progress of forwarding scheduling.
[0068] Among them, the method for allocating the number of slots at the beginning of Step 220 further includes the following sub-steps:
[0069] Step 221: When performing neighbor awareness, the number of one-hop neighbors and two-hop neighbors of each node can be obtained, and the weight is calculated based on the number of neighbors. Use the information of the neighbors within the collision domain to determine the number of one-hop neighbors of the node itself, and obtain the number of one-hop neighbors of the neighbors within the collision domain through broadcast, so as to calculate the weight of each node itself. The definition of the weight information is as follows: For any node in the ad hoc network, obtain the topological relationship between the node and the surrounding nodes, obtain the degrees of the node and other nodes within the collision domain, and the corresponding weight relationship is calculated as follows, where d i represents the degree of node i, and d j represents the degree of other nodes j within the collision domain:
[0070]
[0071] Step 222: According to the weight w of this node di , obtain the number of time slots allocated to this node. γ is generated from the system configuration file. In one embodiment, γ is taken as 3. Here, floor means rounding down:
[0072]
[0073] Wherein, the color allocation method in the step 230 further includes the following sub-steps:
[0074] Step 231: Each node calculates the weight within its own collision domain and broadcasts it, attaching its own ID information in the broadcast message. As described above, the number of neighbors has been obtained during neighbor awareness and can be directly calculated:
[0075]
[0076] Wherein, r(i) represents the set of one-hop neighbors of i that have not completed color selection, r(j) represents the set of one-hop neighbors of j that have not completed color selection, j represents a one-hop neighbor of i, |r(i)| represents the size of r(i), |r(j)| represents the size of r(j), rand(0,1) represents randomly selecting a number within the range of (0,1), C(i) represents the set of remaining available colors, and |C(i)| represents the size of the set of remaining available colors. Random numbers are used to reduce the situation where the weights may be the same during color selection. If the weights are still the same, at this time, the priority is distinguished based on the ID number. The ID number is generated from the system configuration file and forms a one-to-one mapping relationship with the MAC address of the device;
[0077] Step 232: The node with the smallest weight that has not completed color selection within the collision domain selects the currently available smallest color from the available colors. If there are multiple nodes with the smallest weight, then the node with the smallest ID assigned during initialization gets the selection opportunity and broadcasts the selection situation and the remaining color situation. The ID number is obtained by reading the system configuration file as described above;
[0078] Step 233: The nodes that have not completed color selection within the collision domain update the color selection situation according to the received information. If the color has been selected, then broadcast the color selection situation within the time slot corresponding to the earliest color obtained by this node. Otherwise, randomly select a time slot to access from the unoccupied time slots and broadcast the current color selection situation. All nodes need to receive and broadcast the current color selection situation. When the color selection is completed, the color selection situation should no longer change;
[0079] Step 234: If the number of colors selected by this node reaches the number allocated during initialization, then it is considered that the selection of this node is completed. If no node selects a color after two rounds of selection, then the color selection situation in the information received by the node remains unchanged, and at this time, the color selection process ends.
[0080] After the time slot division during initialization is completed, it is necessary to end the use of the long frame and change to using the control sub-frame and data sub-frame. A schematic diagram of an embodiment of the change process of this frame structure is as Figure 4 shown. The control sub-frame is responsible for broadcasting the dynamic adjustment status information of the time slot when conditions are met, and the data sub-frame is responsible for sending service data.
[0081] Among them, the adjustment of the allocation of the remaining time slots in the data sub-frame according to the message queue length and color allocation algorithm of the node in step 300 includes the following steps:
[0082] Step 301: Each node is in one of four states: Idle, Request, Agree, Finish;
[0083] Step 302: After the initial color allocation is completed, all nodes are in the Idle state. Only when there are still remaining time slots can a node try to enter the Request state to apply for an increased time slot. To ensure that the Restart information can be broadcast when a new node joins, one time slot of the data sub-frame needs to be reserved; only when the number of time slots of this node is greater than 1 is it allowed to release a time slot, and the number of time slots in the control sub-frame should not change;
[0084] Step 303: The message queue parameter of node i is represented by queuelen i If the length of queuelen i is greater than the threshold θ up set in the configuration file, then at this time the node tends to increase its own time slot. When conditions are met, the node will try to increase its own time slot, that is, obtain another color; if the length of queuelen i is less than the threshold θ down set in the configuration file, then the node needs to apply to release a time slot of the data sub-frame, that is, release a color, and this time slot can be obtained by other nodes at this time; among them, θ up and θ down are set by the system configuration file. In one embodiment, the total length of the message queue is set to 255, θ up is taken as 150, and θ down is taken as 50;
[0085] Step 304: If a node needs to occupy or release a color and also meets the conditions described in Step 302, and the k-backoff ends, then the node changes to the Request state within its corresponding time slot in the control subframe and broadcasts Request information, which should contain necessary content such as the ID of this node and the request type;
[0086] Step 305: If a node receives Request information and the node is in the Idle state or Finish state at this time, then the state of the node becomes Agree, and it is ready to broadcast Agree information in the time slot of the node's control subframe, including the ID information of the requesting node contained in the Request information. The ID information is formed by a one-to-one mapping of the MAC address of each node as described above;
[0087] Step 306: If a node receives Request information and the node is in the Agree state at this time, then the state of the node does not change, that is, the node remains in the Agree state and still retains the ID information in the original Request information without changing the ID information in the saved Request information;
[0088] Step 307: If a node is in the Request state and receives Agree information, if the ID contained in the Agree information is not the ID of this node, then the node changes from the Request state to the Idle state, and randomly selects a backoff value k. It cannot apply for or release a time slot within k frames. At the same time, the node needs to broadcast Fail information in its own control time slot. The role of k-backoff is to make the node that fails the request enter a frozen state and cannot attempt to enter the Request state within the next k frames. In one embodiment, k is a random number between 1 and 5;
[0089] Step 308: If a node is in the Request state and the node receives Agree information, if the ID of the Agree information is the ID of this node, then the node changes from the Request state to the Finsh state and broadcasts Finish information in two hops in its own control time slot. The information contains necessary content such as the occupied or released time slot;
[0090] Step 309: If a node is in the Agree state and receives Fail information or Finish information, then the node reverts to its previous state. If the node was in the Finish state before, then the node becomes the Finish state; otherwise, the node becomes the Idle state and broadcasts Finish information in the node's control time slot. The Finish information carries the ID information of this node;
[0091] Step 310: If the node is in the Finish state and no Request information and Fail information are received within m control subframes, then this node changes from the Finish state to the Idle state. In one embodiment, m is 6;
[0092] Step 311: The node collects Finish information in the control subframe, senses the slot selection situation in the current collision domain, and records the source ID information in the Finish information. If no information from node i is received within n frames, then it is considered that node i has left. The node adds the information of the leaving node in the next Finish information, and the node releases all the slots occupied by the leaving node according to this information. In one embodiment, n is 10;
[0093] Step 312: The newly added node collects Finish information and senses the slot selection situation in the current collision domain. If the control subframe slots are exhausted, then re-initialization is required at this time. At this time, the newly added node broadcasts Restart information in the remaining random data subframe slots, and the nodes in the collision domain re-perform the initialization process. If there are still remaining slots, the newly added node attempts to enter the Request state and attempts to obtain slots according to the method in Step 304;
[0094] Step 313: The timeout of the node is set to three times the one-hop delay time, where the one-hop delay time is obtained from the network, and the one-hop delay time is regularly estimated and updated using the time difference between sending and replying to information. If the timeout counter expires and this node does not receive a reply at this time, or the received reply fails the verification, then the information to be replied is re-sent to the node that did not reply and the node that failed the verification.
[0095] The schematic diagram of an embodiment of the process of Step 300 is as Figure 2 shown, and the schematic diagram of a message structure is as Figure 3 shown.
[0096] Finally, it should be noted that the above embodiments are only used to illustrate the technical method of the present invention, rather than to limit the present invention. The present invention can be extended to other modifications, changes, uses and embodiments in specific applications, and thus it is considered that such modifications, changes, uses and embodiments are all within the protection scope of the present invention.
Claims
1. An adhoc distributed time slot allocation method based on a graph coloring algorithm, characterized in that, It includes the following steps: 1) Each node in the ad hoc self-organizing network completes the situation awareness within the collision domain, obtains the topology within the communication range of this node, and obtains the node information and link parameters within the topology; 2) After each node in the ad hoc self-organizing network obtains the topology information within the collision domain, taking the nodes as vertices, construct a node distribution state diagram within the collision domain, and assign colors to each node according to the time slot settings preset in the system configuration and the degree parameters of the nodes and neighbors obtained by sensing, so as to avoid interference between interfering nodes. Each node occupies the time slot according to the obtained color; 3) According to the message queue length parameter of the node, use the color allocation algorithm to adjust the allocation of the remaining time slots in the data sub-frame; Among them, in step 2), the method of graph coloring for allocating time slots to all vertices according to the interference state diagram to avoid interference between interfering nodes includes: mapping the time slots in the ad hoc network to multiple different colors, using colors to represent time slots, color 1 can represent slot 1, and so on; allocating colors to all ad hoc nodes based on the graph coloring algorithm, so that all ad hoc nodes obtain time slots; in the topology relationship graph, if the distance between any two ad hoc nodes is within two hops, then these two nodes cannot reuse time slots; In the said step 2), the method of graph coloring for allocating colors and time slots to each vertex in the topology graph according to the preset time slot reuse distance further includes: 20) Use a long frame to complete the color allocation during initialization, ensure that the long frame is sufficient, and the node initially accesses the time slot by randomly selecting according to a random function; a long frame refers to a frame with a large number of time slots, and the specific number of time slots is generated by the system configuration file, and sufficient means that the number of time slots is greater than the number of nodes; 21) According to the initial time slot number allocation method, determine the number of initial data sub-frame time slots that each ad hoc node itself needs to obtain within the topology graph; 22) Select the color of each node according to the distributed coloring algorithm and broadcast the remaining color situation; 23) After all nodes in the collision domain obtain the colors corresponding to the nodes, the use of the long frame ends, and each frame is divided into a control sub-frame and a data sub-frame; assuming that the required maximum number of time slots is N, N is used as the number of time slots in the control sub-frame ctl , and βN is used as the number of time slots in the data sub-frame d ; where β is set by the system configuration file; each node occupies the corresponding first time slot in the color it obtains in the control sub-frame and occupies the time slots corresponding to all the obtained colors in the data sub-frame; Among them, the initial data sub-frame time slot number allocation method in the said step 21) includes: obtaining the number of one-hop neighbors of the nodes within the collision domain while sensing the neighbors, and setting the weight of the node according to the centralization degree of the node in the topology when determining the number of time slots that the node should be allocated. The nodes at the center of the topology need to be allocated more time slots, so as to realize the fast scheduling of multi-hop transmission.
2. The ad hoc distributed time slot allocation method based on the graph coloring algorithm according to claim 1, Its characteristics are, Among them, the initial time slot number allocation method in the said step 21) further includes the following sub-steps: (211) Obtain the number of one-hop neighbors of each node in the collision domain based on the result of neighbor perception, and thus calculate the weight of each node itself. The definition of the weight information is as follows: For any node in the ad hoc network, obtain the topological relationship between the node and its surrounding nodes, obtain the degrees of the node and other nodes in the collision domain, and the corresponding weight relationship is calculated as follows, where d i represents the degree of node i, and d j represents the degree of other nodes j in the collision domain: 212) According to the weight w of this node di , obtain the number of time slots allocated to this node, where γ is generated from the system configuration file; here, floor means rounding down: Among them, the color allocation method in the said step 22) further includes the following sub-steps: 221) Each node calculates the weight w within its own collision domain ci , and broadcasts, attaching its own ID information in the broadcast message: Among them, r(i) represents the set of one-hop neighbors of i that have not been colored yet, r(j) represents the set of one-hop neighbors of j that have not been colored yet, j represents the one-hop neighbor of i, |r(i)| represents the size of r(i), |r(j)| represents the size of r(j), rand(0,1) represents a random number selected within the range of (0,1), C(i) represents the set of remaining available colors, and |C(i)| represents the size of the set of remaining available colors; 222) The node with the smallest weight that has not completed color selection in the collision domain selects the currently available smallest color from the available colors. If there are multiple nodes with the smallest weight, the node with the smallest ID assigned during initialization gets the selection opportunity, and broadcasts the selection situation and the remaining color situation. 223) The nodes that have not selected colors in this round in the collision domain update their color selection situations according to the received information. If a node has already selected a color, it broadcasts the color selection situation in the time slot corresponding to the earliest color obtained by this node. Otherwise, it randomly selects a time slot to access from the unoccupied time slots and broadcasts the current color selection situation. 224) If the number of colors selected by this node reaches the number assigned during initialization, it is considered that this node has completed the selection. If no node has selected a color after two rounds of selection, the color selection situation in the information received by the nodes will remain unchanged, and at this time, the color selection process ends.
3. The ad hoc distributed time slot allocation method based on the graph coloring algorithm according to claim 1, Its feature is that Among them, step 3) adjusting the allocation of the remaining time slots in the data subframe according to the message queue length of the node and the color allocation algorithm includes the following steps: 301) Each node is divided into four states: Idle, Request, Agree, Finish. 302) After initialization, each node is in the Idle state. Only when there are remaining time slots available for application can a node enter the Request state to apply for a time slot. To ensure that a new node can broadcast the Restart information when it joins, one data subframe time slot needs to be reserved. Only when the number of time slots contained in the data subframe of this node is greater than 1 is it allowed to enter the Request state to release a time slot, and the time slot situation in the control subframe remains unchanged. 303) The node extracts the message queue length of the current service data, and the message queue parameter of node i is represented by queuelen i If queuelen i is greater than the threshold θ set in the configuration file up , then the node needs to apply for occupying one more time slot of a data subframe, that is, obtaining one more color. If queuelen i is less than the threshold θ set in the configuration file down , then the node needs to apply for releasing one time slot of a data subframe, that is, releasing the color of a non-control subframe. Among them, θ up and θ down are set by the system configuration file; 304) If a node needs to occupy or release a color, when it meets the conditions of 302) and the k backoff ends, the node changes to the Request state in its corresponding time slot in the control subframe and broadcasts the Request information, including the ID of this node and the request type. 305) If a node receives the Request information and is in the Idle state or the Finish state, the state of the node changes to Agree, and it is ready to broadcast the Agree information in the control subframe time slot of the node, including the ID of the requesting node contained in the Request information. 306) If a node receives the Request information and is in the Agree state, the state of the node remains Agree, and it still retains the ID in the original Request information. 307) If a node is in the Request state, receives the Agree information, and the ID in the Agree information is not this node, the node becomes the Idle state, randomly selects a backoff value k, and cannot apply for a time slot or release a time slot within k frames, and broadcasts the Fail information in its own control time slot. 308) If the node is in the Request state, and receives the Agree message, and the IDs of the Agree messages are all the current node, then the node changes to the Finsh state, and broadcasts the Finish message in two hops during its own control time slot, including the occupied or released time slots; 309) If the node is in the Agree state, and receives the Fail message or the Finsh message, then the node reverts to the previous state. If the node was previously in the Finsh state, then the node remains in the Finsh state; otherwise, the node changes to the Idle state, and broadcasts the Finish message during the node's control time slot, with the ID information of the current node carried in the Finish message; 310) If the node is in the Finish state, and does not receive the Request message and the Fail message within m control subframes, then the node changes to the Idle state, where m is defined by the configuration file; 311) The node collects the Finish messages in the control subframe, senses the time slot selection situation in the current collision domain, records the source ID information in the Finish message. If the node does not receive any information from node i within n frames, then it is considered that node i has left. The node adds the information of the leaving node to the next Finish message, and the node releases all the time slots occupied by the leaving node according to this information; 312) The newly joined node collects the Finish messages, senses the time slot selection situation in the current collision domain. If the time slots in the control subframe are exhausted, then re-initialization is required at this time. At this time, the newly joined node broadcasts the Restart message in the remaining random data subframe time slots, and the nodes in the collision domain re-perform the initialization process; if there are still remaining time slots, the newly joined node attempts to enter the Request state and tries to obtain time slots according to the method in step 304; 313) The timeout period of the node is set to three times the one-hop delay time. Among them, the one-hop delay time is obtained from the network, and the one-hop delay time is estimated and updated regularly using the time difference between sending and receiving messages. If the timeout counter expires, and the node has not received a reply at this time, or the received reply fails the verification, then the node re-sends the message to be replied to the node that did not reply and the node with verification failure.
Citation Information
Patent Citations
Wireless Mesh network low time delay optimization method based on dynamic time slot distribution
CN106879071A
Anti-collision graph coloring two-stage distribution method for RFID reader
CN110113733A