A mutual synchronization neighbor discovery method for TDMA wireless ad hoc network
By dividing the time slot structure and synchronization algorithm in the TDMA wireless ad hoc network, and combining the neighbor discovery module and the election of secondary nodes, the synchronization problem of network nodes without external timing equipment is solved. This enables dynamic adjustment of the number of nodes and maximization of time slot utilization, and supports time synchronization of multi-hop neighbor nodes and rapid access of new nodes.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINESE PEOPLES LIBERATION ARMY NO 6905 FACTORY
- Filing Date
- 2022-12-14
- Publication Date
- 2026-05-29
AI Technical Summary
Existing TDMA wireless ad hoc networking methods cannot achieve accurate synchronization of network nodes without external timing equipment, and cannot adjust the network node scale according to the actual number of nodes in the network, resulting in low time slot utilization or loss of synchronization.
The time slot structure is divided into H time slot, G time slot, C time slot and D time slot. Combined with synchronization algorithm, neighbor discovery module and secondary node election, the clock synchronization of the whole network is achieved by electing the master node, and the network scale is dynamically adjusted according to the actual number of nodes.
It enables time synchronization of multi-hop neighbor nodes in the absence of BeiDou clock synchronization, ensuring the stability of the communication channel and maximizing the utilization of time slots, and supporting rapid access of new nodes and automatic election of master nodes.
Smart Images

Figure CN116017671B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of wireless ad hoc network technology, and specifically to a method for mutual synchronization neighbor discovery in TDMA wireless ad hoc networks. Background Technology
[0002] With the rapid development of wireless communication technology, mobile adhoc networks, characterized by decentralization, self-organization, multi-hop transmission, and time-varying topology, have been widely used. Due to their distributed network node-shared wireless channel characteristics, Time Division Multiple Access (TDMA) is a commonly used channel access technology in adhoc networks. TDMA divides time into multiple time slots, and a certain number of time slots form periodic frames, which are allocated to nodes in the network statically or dynamically. Static allocation has a simple protocol but low time slot utilization, leading to wasted time slots. Dynamic allocation is flexible and versatile, but its protocol is complex and difficult to implement.
[0003] All nodes must initialize the same time slot frame structure with a unified starting time, meaning all node clocks must be synchronized. Currently, some systems use the BeiDou time synchronization system, where network nodes synchronize their clocks by capturing second pulses. However, BeiDou synchronization requires external auxiliary timing equipment, and this method has limited usage environments. Other methods use mutual synchronization, where one node is the master node and the rest are slave nodes. Slave nodes synchronize with the master node's clock through a hierarchical synchronization process. However, if the master node is lost, the entire network will lose its synchronized master clock, making it impossible to maintain time slot synchronization between nodes.
[0004] Network node capacity is a key indicator affecting frame structure design. Different node capacities require corresponding changes to the time slot frame structure. When the designed node capacity is too large while the actual number of nodes on the network is small, it will result in wasted time slots. Summary of the Invention
[0005] The purpose of this invention is to provide a method for mutual synchronization neighbor discovery in TDMA wireless ad hoc networks, which enables precise synchronization of network nodes without the need for external timing equipment, and solves the technical problem in existing networking methods that cannot adjust the network node scale according to the actual number of nodes in the network.
[0006] To achieve the above objectives, the present invention provides a method for mutual synchronization neighbor discovery in a TDMA wireless ad hoc network, comprising the following steps:
[0007] Select a time slot structure and divide the time slots into H time slots, G time slots, C time slots, and D time slots;
[0008] Clock synchronization is achieved using a synchronization algorithm;
[0009] Use the neighbor discovery module to control node access;
[0010] Maintain communication through the election of secondary nodes;
[0011] Adjust the network scale.
[0012] The time slot structure is based on time, with each time slot divided into 500µs segments. Each 250 time slots constitute a frame, which is 125ms long. Each 32 frames constitute a multiframe, which is 4s long.
[0013] The H time slot is the neighbor discovery time slot, and the destination node ID of the H time slot is 0xFF. It is used to send broadcast data to the entire network.
[0014] The G time slot is a shared time slot used for requesting node IDs during the neighbor discovery process;
[0015] The C time slot is a control time slot used for link maintenance between network nodes. Different types of messages are identified by the message type field.
[0016] The D time slot is a data service time slot used to transmit upper-layer service data.
[0017] The synchronization algorithm includes three steps: time slot synchronization, frame synchronization, and deviation correction. Time slot synchronization ensures the initial time synchronization of the two nodes at the time slot level. Frame synchronization ensures the initial frame alignment of the frame structure of each node at the multiframe level. Deviation correction is used to eliminate clock offset errors caused by distance transmission delay or crystal oscillator error.
[0018] The process of using the neighbor discovery module for node access control includes the following steps:
[0019] Node ID application: Nodes that have not joined the network do not have an initial node ID of 0xFF. Only after broadcasting a node ID application message to the master node in the G time slot will they obtain a unique node ID number in the entire network. Only those with a valid node ID have the right to use the time slot.
[0020] In the optimal sector selection process, a fast transmit and slow receive method is used to select the optimal sector for each node. The transmitting node rapidly transmits HELLO messages, incrementing by 1 in a cyclic manner across 8 sectors, while the receiving node slowly receives HELLO messages, incrementing by 1 in a cyclic manner across 8 sectors. The receiving node can calculate the Received Signal Strength (RSSI) of the transmitting node when it sends HELLO messages across the 8 sectors, thus obtaining an 8*8 table of Received Signal Strength (RSSI) corresponding to the transmitting and receiving sectors. By looking up the maximum or average value, the optimal sector value corresponding to the transmitting and receiving nodes can be obtained.
[0021] In the process of maintaining communication through the election of secondary nodes, if the primary node loses power or leaves the network, the secondary node temporarily takes over the function of the primary node to ensure the clock synchronization of network nodes.
[0022] In the process of adjusting the network size, dynamic adjustment of node size is adopted to ensure the highest utilization of H and C time slots. After adopting dynamic adjustment of node size, the network size will be dynamically adjusted according to the actual number of nodes in the network, which ensures that the network can accommodate all nodes and maximizes the utilization of time slots.
[0023] This invention provides a method for mutual synchronization neighbor discovery in TDMA wireless ad hoc networks. By implementing time slot structure, synchronization algorithm, neighbor discovery, secondary node election, and network size adjustment steps, it achieves time synchronization of multi-hop neighbor nodes even without a BeiDou clock synchronization model. Through the election of a master node, this invention ensures a unique master clock for the entire network and enables rapid access for new nodes, thereby guaranteeing stable and reliable communication channel quality. Simultaneously, it counts the actual number of nodes in the network and adjusts the network node size accordingly, thus overcoming the shortcomings of existing ad hoc networking methods. Attached Figure Description
[0024] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0025] Figure 1 This is a flowchart illustrating a method for mutual synchronization neighbor discovery in a TDMA wireless ad hoc network according to the present invention.
[0026] Figure 2 This is a diagram of the clock asynchronous wireless frame structure according to a specific embodiment of the present invention.
[0027] Figure 3 This is a diagram of the clock synchronization wireless frame structure according to a specific embodiment of the present invention.
[0028] Figure 4 This is a time slot adjustment diagram for unsynchronized nodes in a specific embodiment of the present invention.
[0029] Figure 5 This is a network node topology distribution diagram of a specific embodiment of the present invention. Detailed Implementation
[0030] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain the present invention, and should not be construed as limiting the present invention.
[0031] Please see Figure 1 This invention provides a method for discovering mutual synchronization neighbors in a TDMA wireless ad hoc network, comprising the following steps:
[0032] S1: Select the time slot structure and divide the time slots into H time slot, G time slot, C time slot and D time slot;
[0033] S2: Clock synchronization is achieved using a synchronization algorithm;
[0034] S3: Use the neighbor discovery module to control node access;
[0035] S4: Maintain communication through the election of a secondary node;
[0036] S5: Adjust the network size.
[0037] The present invention will be further described below with reference to specific implementation steps:
[0038] 1. Time Slot Structure: With time as the axis, each time slot is divided into 500µs segments. Every 250 time slots constitute a frame, which is 125ms long. Every 32 frames constitute a multiframe, which is 4s long. Based on the different functions of time slots in the network, time slots are divided into four types: H time slots, G time slots, C time slots, and D time slots.
[0039] The H time slot is the neighbor discovery time slot, with a destination node ID of 0xFF, used to send network-wide broadcast data. Since each smart antenna has 8 sectors, transmitting and receiving nodes must be grouped into sets of 8 H time slots to achieve fast transmission and slow reception of broadcast messages. Within each H time slot, a node can send a HELLO message using its corresponding sector for neighbor discovery. To prevent conflicts caused by two nodes simultaneously occupying an H time slot, the H time slot is allocated to the corresponding node according to Formula 1. All other nodes are in receiving mode, and the sector is incremented cyclically to receive HELLO messages.
[0040] ID = F%M (1)
[0041] Where: % represents the remainder operation;
[0042] ID is the node ID;
[0043] F represents the frame number to which slot H belongs, with a value range of [0~31].
[0044] M represents the network size, with values of 2, 4, 8, 16, and 32.
[0045] The G-slot is a shared time slot, primarily used for node ID application during neighbor discovery. Before neighbor discovery, since the node ID is unknown, a usable node ID must be applied for through the shared time slot. Once successfully applied for, the shared time slot is no longer occupied and is released for new nodes needing to access the network. Each frame is allocated 2 G-slots, one for transmission and one for reception. When multiple nodes join simultaneously, conflicts may occur, so retransmission, timing, and flag setting protection mechanisms are required.
[0046] The C time slot is a control time slot used for link maintenance between network nodes. It identifies different message types using a message type field, such as network decommissioning announcements, node status announcements, time slot requests, time slot releases, and node ID requests. Messages are inserted into a linked list based on their urgency to ensure the real-time nature of important messages. To prevent conflicts caused by two nodes simultaneously occupying the C time slot, the C time slot is allocated to the corresponding node according to Formula 2, while the remaining nodes are in a receiving state.
[0047] ID = (F*8+C)%M (2)
[0048] in:
[0049] % represents the remainder operation;
[0050] F is the frame number, with a value in the range [0, 31].
[0051] C is the C time slot index number, with a value range of [0,7].
[0052] ID is the node ID;
[0053] M represents the network size, with values of 2, 4, 8, 16, and 32.
[0054] D-slot is the data service slot, which is the main channel resource for realizing dynamic bandwidth allocation between nodes and is mainly used to transmit upper-layer service data.
[0055] 2. Synchronization Algorithm: This algorithm mainly completes the synchronization of clocks between nodes.
[0056] In the initial state, the initial timestamps of any two nodes in the network deviate to some extent, resulting in an unsynchronized state. This invention is implemented in three steps: time slot synchronization, frame synchronization, and deviation correction. To quickly achieve clock synchronization, time slot synchronization can be achieved through correlation peak search. Furthermore, a frame consists of 250 time slots; time slot synchronization is not equivalent to frame synchronization. Only by achieving frame synchronization can time slot sharing and independent allocation be realized. Secondly, when nodes are in a moving state, the distance between nodes changes over time, causing a distance delay when matching correlation peaks between two nodes. This delay is negligible when the two nodes are close, but may lead to time slot out-of-bounds situations when they are far apart. Finally, because quartz crystals are susceptible to external temperature influences, the generated clock pulses have a certain error, causing clock drift between two nodes, resulting in a clock deviation that increases over time.
[0057] a) Time slot synchronization
[0058] This node is initialized with a slotted clock asynchronous frame wireless frame structure, with all time slots being H time slots, and is stored in the state of receiving HELLO messages. Time slots are grouped into groups of 8, and each group of time slots corresponds to a sector. HELLO messages are received by cyclically incrementing the sector, realizing the slow reception mode of the receiving node (the fast and slow modes correspond to the sector switching method when the transmitting and receiving nodes send and receive HELLO messages).
[0059] The device is in master node listening state for 4 seconds before power-on. If the master node exists, it can be seen from the wireless frame structure after synchronization that the master node will send 8 HELLO messages in 8 sectors within 4 seconds. Therefore, if any sector is aligned between the listening node and the parent node, the listening node will receive at least one HELLO message from the parent node. By matching the relevant peaks, the start time of the time slot frame is detected, thereby achieving time slot synchronization.
[0060] When the master node loses power and restarts, since the slave node has already taken over the position of the master node, the entire network uses the slave node's clock as the master clock for clock synchronization. Therefore, the master node also needs to listen for the HELLO message for 4 seconds after powering on. Only after it has completed the synchronization with the entire network clock can the master-slave node switch be realized.
[0061] b) Frame synchronization
[0062] When a node is in a state of asynchronous synchronization, it achieves time slot synchronization by listening to HELLO messages from its neighbors. If a HELLO message with valid CRC check is received, the node can adjust the initial time slot offset based on the content of the HELLO message to achieve frame synchronization.
[0063] c) Deviation Correction
[0064] Deviation correction primarily addresses the time delay caused by electromagnetic wave propagation in the air, as well as the drift problem caused by crystal oscillator differences. Network nodes publish status announcement messages to their neighbors every 4 seconds. Upon receiving this message, a node calculates the deviation between the received time and its initial time, adds this deviation to its status announcement, and then sends it to the corresponding destination node. If the source node of the status announcement is its parent node, the node compares the value in this field with the deviation it calculated from the source node. If the former is greater than the latter, the node adjusts its initial time slot forward by half the difference; otherwise, it adjusts it backward by half the difference. Only child nodes adjust their deviation based on the parent node's status announcement message. After this hierarchical adjustment, the network will achieve a unique clock across the entire network, using either the primary or secondary node's clock.
[0065] 3. Neighbor Discovery: Neighbor discovery mainly solves two problems: node ID allocation and optimal sector selection. a) Node ID Allocation
[0066] After a node achieves frame synchronization, it can send a node ID request message to its parent node through the first G-slot. The source node ID is 0xFF and includes the timestamp identifier of this node.
[0067] After receiving the message, the parent node adds its own node ID to the node table of the message, and then waits for the appropriate C time slot to forward it to its parent node, until the message is forwarded to the master node.
[0068] After receiving the message, the master node assigns an unused ID based on the neighbor node messages reported by the neighbor nodes, copies the node table through which the message passed to construct a response message, and finally forwards the message to the last node in the node table. The response message will return along the original path until it reaches the destination node.
[0069] After receiving the message, the node compares the timestamp information to see if it is the same node ID that it sent to request a response. If the timestamp is equal to the timestamp at the time of sending, the request is successful; otherwise, the request fails.
[0070] If no response is received after 4 seconds, you can send the node ID request message again.
[0071] After multiple failed attempts, clock synchronization should be performed again to avoid loss of synchronization due to prolonged lack of clock deviation correction.
[0072] b) Optimal sector selection
[0073] This invention employs a fast-send, slow-receive method for neighbor search in network nodes. Specifically, the sending node transmits its HELLO messages in rotation across sectors 8 during the H time slot, while the receiving node receives HELLO messages in rotation across one sector per frame. Based on the time slot allocation, with 32 nodes, all network nodes can send a set of HELLO messages every 4 seconds, and the transmission and reception between any sector can be completed every 64 seconds. This means neighbor discovery can be achieved in 4 seconds, and optimal sector selection can be achieved in 64 seconds. By statistically analyzing the RSSI values of neighboring nodes' HELLO messages, the optimal sector for each node can be determined.
[0074] 4. Secondary Node Election: The secondary node election module mainly solves the function of secondary nodes replacing primary nodes after the primary node is lost, and maintains the uniqueness of node clocks in the network.
[0075] In a network, the status announcement messages reported by child nodes to their parent nodes include a child node ID table. Each subsequent parent node, upon receiving a status announcement message from a child node, adds its child node information to this table and reports it to its own parent node. This cascading child node ID table is then aggregated at the master node, which calculates the total number of network nodes and their corresponding IDs. The master node then selects the child node with the most descendant nodes and designates it as the secondary node, notifying all its child nodes of this designation.
[0076] Network nodes determine that their parent node is lost if they haven't received any HELLO messages and status announcements from it within a certain period. If a secondary node detects its parent node is lost, it keeps its own clock unchanged. If a non-secondary node detects its parent node is lost, it selects the node with the highest synchronization level in its neighbor list as its parent node and configures its synchronization level to be one level lower than the parent node's. If there are multiple nodes with the highest synchronization level, the one with the best link quality is selected as the parent node. Through continuous iteration, the network will eventually converge to a clock with the secondary node as the master clock.
[0077] 5. Network Size Adjustment: Network size adjustment is mainly based on the actual number of network nodes in the actual network, dynamically adjusting the network node size. This invention sets the supported network size N to 2, 4, 8, 16, and 32, for a total of five network sizes.
[0078] After a node discovers its neighbors, it reports its child and descendant node lists to its parent node level by level. The parent node, upon receiving the reports from its child nodes, summarizes the lists, adds directly connected child nodes to the list, and then reports it to its own parent node. The master node receives the network's node information and thus calculates the actual number of nodes in the network.
[0079] After receiving a node ID request message, the master node checks if there are any idle node IDs. If not, it expands the network size by adjusting the number of network nodes that sent the HELLO message.
[0080] Compared with existing technical solutions, the advantages of the present invention are as follows:
[0081] 1. Solving the problem of time synchronization among multi-hop neighbor nodes in the absence of a BeiDou clock synchronization model.
[0082] 2. Even when nodes are far apart, it can still overcome distance delay and achieve time synchronization.
[0083] 3. There is no need to manually set the master and slave nodes in the network. The master node election is achieved through the master node election algorithm.
[0084] 4. If the master node loses network access or is shut down, the backup master node will replace the original master node's function to ensure that the clock is unique across the entire network.
[0085] 5. This synchronization algorithm is highly adaptable and can be applied to various occasions where time synchronization is required.
[0086] 6. When a new node needs to join the network, it can quickly discover its neighbors.
[0087] 7. By statistically analyzing the actual number of nodes on the network, node IDs can be effectively allocated and managed to maximize the utilization of control time slots.
[0088] Furthermore, the present invention provides three specific embodiments for further illustration:
[0089] Example 1
[0090] This implementation case mainly describes the process of implementing time slot synchronization. Since the power-on time of nodes is not fixed, the starting time of each node in the network system is inconsistent, and there is no unified reference clock. Therefore, it is necessary to manually designate a master node, and the other nodes maintain the same clock reference with the master node through signaling interaction, so as to achieve a unique clock for the entire network.
[0091] See Figure 2 , Figure 3 Using time as the axis, each 500µs is divided into a time slot, and every 250 time slots constitute a frame, i.e., each frame is 125ms long. Every 32 frames constitute a multiframe, i.e., each multiframe is 4s long. For nodes whose clocks are not synchronized, all time slots are initialized to H time slot receiving state, such as... Figure 2As shown. If no HELLO message is received within 32 seconds, the node will adjust its local reference clock forward by 50µs to accommodate the low overlap between the two nodes' time slots. For nodes that have already synchronized their time or are the master node, the 125ms time axis is divided into 8 H time slots, 8 C time slots, 232 D time slots, and 2 G time slots, depending on the functions performed by the node in each time period. Figure 3 As shown. Time slot C is the control time slot. It is assigned to a user-defined node ID according to the index value of the C time slot, and sends relevant control signaling to the destination node. Other nodes align their sectors with this node in this time slot, ensuring that the node sends messages to the designated destination node with a narrow beam. Time slot D is the data service time slot. Upper-layer service data is packaged and forwarded to the designated node through this time slot, achieving transparent transmission. Time slot G is the public time slot. After a node achieves frame synchronization, since no node ID has been assigned, it can send an RTS message requesting a node ID to its parent node through time slot G. The parent node forwards this message level by level to the master node. The master node assigns an unused ID number based on the child node ID table reported by the child node and constructs a CTS message to return to the original node.
[0092] like Figure 4 As shown, due to the random power-on time, there is an uncertain time deviation between the reference time of a node and the master node before the node joins the network. To achieve time-division multiplexing and sharing of wireless channel resources among nodes without transmission collisions, the time deviation must be reduced to an acceptable range to ensure that each time slot can be occupied by at most one node, while the remaining nodes are in receiving mode during that time slot. By dividing the time into the smallest unit time slot, as long as the time slot numbers are aligned, the reference time deviation can be reduced to within half a time slot length.
[0093] Synchronized nodes broadcast a HELLO message in the corresponding H time slot. This message contains the H number when the node sent the message, corresponding to slot number T1 in the multiframe. When an unsynchronized node receives this message, the corresponding time slot in the multiframe is numbered T2. The node can then calculate the number of leading time slots using Formula 3.
[0094] ΔT=(T2+32*250-T1)%(32*250) (3)
[0095] Where: % represents the modulo operation.
[0096] ΔT is the number of time slots that the receiving node leads the transmitting node.
[0097] T2 represents the frame number when the receiving node receives the message.
[0098] T1 represents the frame number when the sending node sent the message;
[0099] By checking if ΔT is 0, the receiving node can determine whether its time slot is aligned with the sending node. If ΔT is not zero, meaning the node's reference clock is significantly out of sync, the receiving node can advance its reference clock by ΔT time slots, receive the HELLO message again, and adjust in the same way. If ΔT is zero, it indicates that time slot synchronization has been achieved, meaning the node's reference clock is only slightly out of sync and within a tolerable range.
[0100] Example 2
[0101] This implementation case primarily describes the neighbor discovery process. Because channel resources are shared using time-division multiplexing, only nodes with valid node IDs can occupy the channel in a designated time slot and send corresponding signaling; nodes without the specified ID are in receiving mode. To achieve dynamic network scaling, a dynamic node ID request mechanism is needed. A node wishing to join the network must send a node ID request signaling, which is forwarded between nodes and ultimately reaches the master node for unified allocation and management. When node ID resources are insufficient, the master node needs to expand the network to accommodate more nodes.
[0102] After implementing Case 1, nodes have achieved time-slot synchronization and can send node ID request messages in time slot G0, waiting for feedback in time slot G1. Neighboring nodes, upon receiving the node ID request message, forward it to their parent nodes, and ultimately, the message is forwarded to the master node. The master node queries the remaining available node IDs and returns the selected result via the same path. From this point on, each node possesses a unique node ID number across the entire network. Using this ID number, the node can broadcast a HELLO message in the designated H time slot. Since the HELLO message contains relevant node information, neighbor discovery is achieved when two nodes receive each other's HELLO messages. By counting the number of HELLO messages received over a period of time, the quality of wireless channel resources and the status of nodes, such as whether they have been lost, can be determined.
[0103] Example 3
[0104] This implementation case primarily describes the optimal sector selection process. To ensure the directional antenna covers the entire upper hemisphere, the sphere is divided into eight sectors, each corresponding to a different direction. This ensures concentrated energy during beamforming by the smart antenna, minimizing interference in the opposite direction. For broadcast HELLO messages, the message needs to be sent in turn across all eight sectors to ensure coverage of neighboring nodes. However, for unicast control signaling, the destination node's azimuth information is required, thus only one sector needs to be used to send the message, improving the effective utilization of time slots. Therefore, optimal sector selection is necessary before sending control commands in time slot C. Optimal sector selection is mainly achieved by statistically analyzing the received signal strength of the receiving nodes across the eight sectors. After rotating through each sector once, the sector with the optimal signal strength can be identified.
[0105] Table 1 - Node Received Signal Strength Table
[0106]
[0107] As shown in Table 1, each row represents a receiving node residing in one sector, while transmitting nodes take turns sending HELLO signals across eight sectors. When a receiving node receives a HELLO message, it calculates the received signal strength and constructs a two-dimensional received signal strength table for that neighboring node, using the receiving sector index as the row number and the transmitting node's sector as the column number. If no message is received, the minimum value of -120 is written. Since time slots are assigned to specific node IDs, a received signal strength table is constructed for each node in the network. By comparing the average values of each row, the sector with the strongest average value is considered the best sector for that node.
[0108] Example 4
[0109] refer to Figure 5 Network node clock synchronization and neighbor discovery are the same as in Examples 1 and 2. After the master node is lost, the slave node takes over as the master node to realize clock synchronization and node ID allocation management. There are 5 nodes in the figure. The center of the ring represents the node ID. The center of the ring is marked with 8 sector numbers. The red line marks the one-hop neighbors of the node. The dashed circle is the communication distance of the node. According to the neighbor relationship between the nodes, the node partial attribute table in Table 2 can be obtained. When the master node 0 suddenly loses power, nodes 1 and 2 can calculate how long they have not received messages from the master node by counting the time when they received HELLO messages or status announcement messages from the master node. They can then set appropriate thresholds and detect whether the master node is lost. Except for the slave node, after a slave node detects that its parent node 0 is lost, it will look up the node with the highest synchronization level in the neighbor table as the parent node and adjust the synchronization level of the slave node to be one level lower than that of the parent node, as shown in Table 3.
[0110] Table 2 Node Attributes
[0111]
[0112] Table 3. Some attributes of the node after the master node is disconnected from the network.
[0113]
[0114] The above description discloses only one preferred embodiment of the present invention, and should not be construed as limiting the scope of the present invention. Those skilled in the art will understand that all or part of the processes of the above embodiments can be implemented, and equivalent changes made in accordance with the claims of the present invention are still within the scope of the invention.
Claims
1. A method for discovering mutual synchronization neighbors in a TDMA wireless ad hoc network, characterized in that, Includes the following steps: Select a time slot structure and divide the time slots into H time slots, G time slots, C time slots, and D time slots; Clock synchronization is achieved using a synchronization algorithm; The synchronization algorithm includes three steps: time slot synchronization, frame synchronization, and deviation correction. Time slot synchronization ensures the initial time synchronization of the two nodes at the time slot level. Frame synchronization ensures the initial frame alignment of the frame structure of each node at the multiframe level. Deviation correction is used to eliminate clock offset errors caused by distance transmission delay or crystal oscillator error. Use the neighbor discovery module to control node access; The process of using the neighbor discovery module to control node access includes the following steps: Node ID application; Optimal sector selection; During the node ID application process, the sending and receiving permissions of time slots are closely related to the node ID. Only those with a valid node ID have the right to use time slots. In the process of selecting the best sector, the best sector of the node is selected by fast transmission and slow reception. The transmitting node transmits HELLO messages quickly by incrementing by 1 in cyclically on 8 sectors, and the receiving node receives HELLO messages slowly by incrementing by 1 in cyclically on 8 sectors. The receiving node can count the received signal strength RSSI when the transmitting node transmits HELLO messages in 8 sectors, so as to obtain an 8*8 RSSI table corresponding to the transmitting and receiving sectors. The best sector value corresponding to the transmitting and receiving nodes can be obtained by looking up the maximum value. Maintain communication through the election of secondary nodes; Adjust the network size; The time slot structure is based on time, with each time slot divided into 500µs. Each 250 time slots constitute a frame, which is 125ms long. Each 32 frames constitute a multiframe, which is 4s long. The time slots are divided into H time slot, G time slot, C time slot, and D time slot. The H time slot is the neighbor discovery time slot, and the destination node ID of the H time slot is 0xFF, which is used to send broadcast data to the entire network; The G-slot is a shared time slot used for node ID application during neighbor discovery. Two G-slots are allocated per frame, one for transmission and one for reception. The C time slot is a control time slot used for link maintenance between network nodes. Different types of messages are identified by the message type field, and messages are inserted into the linked list according to their urgency. The D time slot is a data service time slot used to transmit upper-layer service data; During the process of maintaining communication through the election of a secondary node, in the event of a power outage or network shutdown of the primary node, the secondary node temporarily assumes the function of the primary node to ensure clock synchronization of network nodes. The status announcement messages reported by child nodes to their parent nodes contain child node ID table messages. When a parent node receives a status announcement message from a child node, it adds the child node information of its own node to the table and reports it to its own parent node. The child node ID table reported level by level is summarized by the primary node, which has a statistical analysis of the actual number of network nodes and their corresponding node IDs. The primary node then selects the child node with the most descendant nodes and designates it as the secondary node, and notifies all its child nodes of the designated secondary node message.
2. The method for mutual synchronization neighbor discovery in a TDMA wireless ad hoc network as described in claim 1, characterized in that, During the network scaling process, dynamic adjustment of node size is adopted to ensure the highest utilization rate of H and C time slots. After adopting dynamic adjustment of node size, the network size will be dynamically adjusted according to the actual number of nodes in the network, which ensures that the network can accommodate all nodes and maximizes the utilization rate of time slots.