Conflict prediction and avoidance method for CSMA data and TDMA data in asynchronous network
By creating and updating adjacent master node information tables in the asynchronous network, coordinating beacon frame transmission, predicting and avoiding conflicts between CSMA and TDMA data, the conflict problem between TDMA and CSMA data in the asynchronous network is solved, and the normal operation of the network and resource conservation are achieved.
Patent Information
- Application Number
- CN202510241666.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-03
- Publication Date
- 2025-06-03
- Estimated Expiration
- 2045-03-03
AI Technical Summary
In an asynchronous network, there is a conflict between TDMA and CSMA data, resulting in a collision between data frames and beacon frames in the network, affecting the normal operation of the network.
By creating or updating adjacent master node information tables in master nodes and child nodes, coordinating beacon frame transmission between networks, predicting and avoiding conflicts between CSMA and TDMA data, ensuring the normal operation of beacon cycles.
It effectively avoids conflicts between beacon frames and data frames between networks, ensures the normal operation between asynchronous networks, saves network resources, and reduces useless transmission and energy consumption.
Smart Images

Figure CN120090763A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of communication technologies and relates to a method for predicting and avoiding conflicts between CSMA data and TDMA data in an asynchronous network. Background Art
[0002] In communication networks, it is common to use both TDMA and CSMA access methods simultaneously to meet the requirements for sending different types of data in the network. The TDMA mechanism enables multiple nodes to share time resources and send data in an orderly manner. The CSMA mechanism can effectively avoid collisions between CSMA data.
[0003] Most networks can be decomposed into a combination of star networks. The star network structure includes a central node and multiple sub-nodes, and the sub-nodes are connected to the central node, as Figure 1 .
[0004] When both TDMA and CSMA access methods exist simultaneously in a star network, to support the power-saving mechanism of nodes and the reliable transmission of data, the master node periodically sends beacon frames in TDMA mode. The beacon frames carry information such as the master node address, beacon transmission time, and beacon period. The sub-nodes usually stay in the sleep mode. When a sub-node determines based on its own time that a beacon frame is about to be sent or the sub-node itself has data to send, it will exit the sleep mode. After receiving the beacon frame, the sub-node performs time synchronization according to the time information carried in the beacon frame to make its own time consistent with the time of the master node, calculates the beacon transmission time based on the length of the beacon frame, and at the same time knows that the beacon period of the network has started. When there is a data frame to be sent within the beacon period, it sends the data frame in CSMA mode, as Figure 2 . In this network, there is a problem that when a beacon frame transmission time arrives during the transmission of a data frame, it will cause a conflict between the data frame and the beacon frame in the network.
[0005] When multiple adjacent star networks are present, the time between multiple networks is not synchronized, which is called an asynchronous network.
[0006] In an asynchronous network, each network will send beacon frames according to its own network time and send its own data frames in CSMA mode during its own beacon period. When multiple star networks exist, there are two problems: a. Due to the different times of asynchronous networks, there are conflicts between the transmissions of beacon frames of different networks. b. When a data frame of one network is being transmitted, the beacon frame transmission time of other networks arrives, which will cause conflicts between the data frames and beacon frames between networks.
[0007] In summary, in a star network, there is a conflict between CSMA data and TDMA data. In star networks, there is a conflict between TDMA data, and between CSMA data and TDMA data. The following three issues are elaborated in detail:
[0008] (1) Conflict between CSMA frames and TDMA frames in a single network:
[0009] a. Conflict between the master node CSMA frame and TDMA frame:
[0010] For the conflict of the master node itself, when the beacon cycle of the master node is about to end, the master node has a data frame to send. The master node detects that the current channel is idle and directly sends the data frame. However, since the data frame is too long, the data transmission of the second half is no longer within this beacon cycle, and there is a time collision with the beacon frame of the next beacon cycle. Figure 3 .
[0011] b. Conflict between subnode CSMA frame and TDMA frame:
[0012] When the beacon cycle is about to end, the child node has a data frame to send. The child node detects that the current channel is idle and directly sends the data frame. Since the data frame is too long, the second half of the data is no longer within the current beacon cycle, resulting in a collision between the child node's data frame and the master node's beacon frame. Figure 4 .
[0013] (2) TDMA data conflicts between networks
[0014] Each network has its own beacon frame, but because the networks are asynchronous, beacon frame collisions often occur when there are multiple networks, such as Figure 5 .
[0015] like Figure 5 As shown, when beacon frames collide between networks, sub-nodes of multiple networks will not be able to receive beacon frames normally, and thus cannot carry out services normally.
[0016] (3) Conflict between TDMA frames and CSMA frames between networks
[0017] a. Conflict between the master node CSMA frame and TDMA frame:
[0018] When the master node has data frames to send within its own beacon period, it will send them directly when it detects that the channel is idle. However, other network master nodes may send beacon frames during the data frame sending process, resulting in conflicts between data frames and beacon frames. Figure 6 .
[0019] b. Conflict between child node CSMA frame and TDMA frame:
[0020] When multiple asynchronous networks coexist, there are multiple master nodes, and conflicts caused by data transmission are more frequent. There are not only conflicts within the network but also conflicts between networks. When a data frame is sent, it may conflict not only with the beacon frame of its own network but also with the beacon frames of surrounding networks. For example Figure 7 。
[0021] From Figure 7 it can be seen that the child node of Network 2 sends a data frame within the beacon cycle of its own network. After detecting that the channel is idle, it directly sends the data frame. However, when the beacon time slot of Network 1 arrives, it directly sends the beacon frame. At this time, the data frame of the child node of Network 2 has not been sent completely, resulting in a collision between the data frame of the child node of Network 2 and the beacon frame of Network 1.
[0022] In the network, if there is a conflict in the transmission of the beacon frame, the child node cannot correctly receive the beacon frame, which may cause the child node to be unable to obtain the information in the beacon frame, lose control of the current beacon cycle, and be unable to execute the service function normally. Summary of the Invention
[0023] In view of this, the purpose of the present invention is to provide a method for predicting and avoiding conflicts between CSMA data and TDMA data in an asynchronous network.
[0024] Some variables in this method are specifically defined and described below:
[0025] T total : The sum of the maximum time of the CSMA of the service frame and the transmission time of the service frame.
[0026] T slot : The minimum time interval between two adjacent beacon frames, which can support the transmission of service frames and the response of the master node to service frames.
[0027] T period : Beacon cycle.
[0028] T: The guard interval between frames.
[0029] To achieve the above purpose, the present invention provides the following technical solutions:
[0030] A method for predicting and avoiding conflicts between CSMA data and TDMA data in an asynchronous network, the method comprising the following steps:
[0031] The master node creates or updates the adjacent master node information table according to the received beacon frames of other networks;
[0032] The master node coordinates the transmission of the initial beacon frame or subsequent beacon frames between networks according to the adjacent master node information table;
[0033] The master node adds the adjacent master node information table to the beacon frame and assembles the beacon frame;
[0034] The slave node creates or updates the adjacent master node information table according to the received beacon frame;
[0035] When the master node detects a data frame to be sent, it sends the data frame to other nodes in the way of conflict prediction and avoidance of the CSMA frame and TDMA frame of the master node; when the slave node detects a data frame to be sent, it sends the data frame to other nodes in the way of conflict prediction and avoidance of the CSMA frame and TDMA frame of the slave node.
[0036] Furthermore, the process for the master node to create the adjacent master node information table is as follows:
[0037] S111. The master node receives the beacon frame of another master node, calculates its transmission time T according to the length of the beacon frame 1 , and calculates the transmission time T of the beacon frame according to the reception time T 2 = T 3 = T 2 - T 1 ; and parses the beacon frame to obtain the address of the master node and the beacon period T period , and calculates the next beacon transmission time T of the master node 4 = T 3 + T period ;
[0038] S112. Create a new space to save the obtained master node address, transmission time T 1 , beacon transmission time T 4 , and beacon period T period in the adjacent master node information table and mark it as a direct master node;
[0039] S113. Parse the beacon frame to obtain the information in the adjacent master node information table carried in the beacon frame. The information in the adjacent master node information table includes the master node address, beacon period, transmission time difference T 5 and transmission time. Calculate the master node beacon transmission time T in the adjacent master node information table according to the calculation 6 = T 3 + T 5 ;
[0040] S114. Create a new space to save the obtained master node address, transmission time, and beacon transmission time T 6, The beacon period is saved in the adjacent master node information table and marked as an indirect master node; if all the master node information carried in the beacon frame is saved, jump to S115, otherwise jump to S113;
[0041] S115, Sort the node information in the adjacent node information table according to the sequence of beacon sending times.
[0042] Furthermore, the process for the master node to update the adjacent master node information table is as follows:
[0043] S121, The master node receives the beacon frame from another master node, calculates its transmission time T 7 , based on the length of the beacon frame, and calculates the sending time T 8 of the beacon frame according to the reception time T 9 = T 8 - T 7 ; and parses the beacon frame to obtain the address of this master node and the beacon period T period , calculates the next beacon sending time T 10 of this master node 9 = T period + T
[0044] S122, Compare the obtained master node address with the addresses stored in the adjacent master node information table. If the master node address has been saved, update the beacon sending time of the master node. If the beacon period or transmission time has changed, update them; if the master node address has not been saved, create a new space to save the obtained master node address, transmission time T 7 , beacon sending time T 10 , and beacon period T period in the adjacent master node information table and mark it as a direct master node;
[0045] S123, Parse the beacon frame to obtain the information in the adjacent master node information table carried in the beacon frame. The information in the adjacent master node information table includes the master node address, beacon period T 11 , sending time difference T 12 and transmission time. Calculate the master node beacon sending time T 13 in the adjacent master node information table 9 = T 12 + T
[0046] S124, Compare the obtained master node address with the addresses stored in the adjacent master node information table. If the master node address has been saved, update the beacon sending time of the master node. If the beacon period or transmission time has changed, update them; if the master node address has not been saved, create a new space to save the obtained master node address, transmission time, and beacon sending time T12 The beacon period is saved in the adjacent master node information table and marked as an indirect master node; if all the master node information carried in the beacon frame is saved, jump to S125, otherwise jump to S123;
[0047] S125. Sort the node information in the adjacent node information table according to the sequence of beacon transmission times.
[0048] Furthermore, the process for the master node to coordinate the initial TDMA frame is as follows:
[0049] S211. The master node calculates the beacon transmission time T 1 , calculates the intervals between all adjacent beacon transmission times and the interval between the last transmitted beacon frame in the adjacent master node information table and the end of the beacon period according to the node information stored in the adjacent master node information table, compares the calculated intervals, and takes the maximum value of the intervals as T 2 ; if T 2 < 2 * T slot + T 1 , then feedback the result to the master node, and the master node adjusts its own beacon period; if T 2 > 2 * T slot + T 1 , then jump to S212;
[0050] S212. Suppose the two times for calculating the T 1 interval are T 4 , T 5 , and T 4 < T 5 , then set the beacon transmission time to T 3 =(T 4 + T 5 ) / 2;
[0051] The process for the master node to coordinate the subsequent TDMA frame is as follows:
[0052] S221. During the subsequent beacon frame transmission process, each time before transmission, check the adjacent master node information table and calculate the gap between its own transmission time and the previous beacon transmission time recorded in the table, denoted as T 6 ; if T 6 > T slot , then do nothing; if T 6 < T slot , jump to S222;
[0053] S222. Adjust the transmission of the beacon frame. Suppose the original transmission time is T 7 , and set the transmission time of the beacon frame to T 7 +(T slot - T 6)。
[0054] Furthermore, the process of adding the adjacent master node information table to the beacon frame is as follows:
[0055] S31. The master node checks whether there is a direct master node in the adjacent master node information table; if it is empty, jump to S34, otherwise jump to step S32;
[0056] S32. Poll to obtain the next beacon frame transmission time T of the direct master node recorded in the adjacent master node information table 1 , obtain its own beacon frame transmission time T 2 , and calculate the difference T between the two 3 = T 1 - T 2 ;
[0057] S33. Add the time difference T3, node address, beacon period, and transmission time to the beacon frame; if there are still direct master nodes in the table that have not been calculated, jump to S32, otherwise jump to S34;
[0058] S34. Assemble the beacon frame, and when the beacon frame transmission time arrives, send the beacon frame.
[0059] Furthermore, the process for the slave node to create the adjacent master node information table is as follows:
[0060] S411. Receive the beacon frame of its own network, and obtain the master node address, beacon transmission time T 1 , beacon period T period , calculate the beacon transmission time based on the beacon length, and calculate the next beacon transmission time T 2 = T 1 + T period ;
[0061] S412. Create a new space and save the master node address, transmission time, next beacon transmission time, and beacon period obtained in S411 in the adjacent master node information table;
[0062] S413. Obtain the information of the adjacent master node information table from the beacon frame, and obtain the master node address, transmission time, beacon period T 3 , the difference T between beacons 4 , and calculate the transmission time T of the beacon frame carried 5 = T 1 + T 4 ;
[0063] S414. Create a new space, save the master node address, transmission time, beacon sending time, and beacon period obtained in S412 in the adjacent master node information table; if all the master node information carried in the beacon frame has been saved, jump to S415, otherwise jump to S413;
[0064] S415. Sort the node information in the adjacent node information table according to the sequence of the beacon sending time.
[0065] Furthermore, the process for the child node to update the adjacent master node information table is as follows:
[0066] S421. Receive the beacon frame of its own network, obtain the master node address, beacon sending time T 7 , beacon period T period , calculate the beacon transmission time T according to the beacon length 8 , and calculate the sending time T of the beacon 9 = T 7 + T period ;
[0067] S422. Compare the master node address obtained in S421 with the address stored in the adjacent master node information table. If the master node address has been saved, update the beacon sending time of the master node. If the beacon period and transmission time change, update them; if the master node address has not been saved, create a new space to save the master node address, transmission time T 8 , beacon sending time T 9 , beacon period T period obtained in S421 in the adjacent master node information table;
[0068] S423. Obtain the information of the adjacent master node information table from the beacon frame, get the master node address, transmission time T 10 , beacon period T 11 , difference between beacons T 12 , and calculate the sending time T of the beacon frame carrying 13 = T 7 + T 12 ;
[0069] S424. Compare the master node address obtained in S423 with the address stored in the adjacent master node information table. If the master node address has been saved, update the beacon sending time of the master node. If the beacon period and transmission time change, update them; if the master node address has not been saved, create a new space to save the master node address, transmission time T 10 , beacon sending time T 13 , beacon period T 11, saved in the adjacent master node information table; if all the master node information carried in the beacon frame is saved, jump to S425, otherwise jump to S423;
[0070] S425. Sort the node information in the adjacent node information table according to the sequence of beacon sending times.
[0071] Furthermore, the process of collision prediction and avoidance for the CSMA frame and TDMA frame of the master node is as follows:
[0072] S511. When the master node has a data frame to send, call the data frame sending process;
[0073] S512. The master node records the current time of calling the sending, denoted as T 1 ;
[0074] S513. The master node calculates T 1 and the interval with the earliest direct master node beacon sending time T 2 in the adjacent master node information table is denoted as T 3 ;
[0075] S514. The master node calculates whether the current data frame sending will collide with the beacon frame. If T 3 <T total +T, that is, the time interval does not meet the sending of the data frame, jump to S515; if T 3 ≥T total +T, then jump to S517;
[0076] S515. The master node calculates the interval of the adjacent beacon sending times of the direct master nodes in the adjacent master node information table in sequence according to the sending time, denoted as T 3 , assuming two adjacent beacon sending times are T 4 、T 5 ,T 4 <T 5 , obtain the transmission time of T 4 denoted as T beacon , calculate T 3 =T 5 -T 4 -T beacon , if the beacon sending times in the adjacent master node information table have all been calculated, jump to S516; if T 3 <T total +T, that is, the time interval does not meet the sending of the data frame, jump to S515; if T 3 ≥T total +T, then set the sending time of the data frame to T 4 +T beacon +T, and jump to S517 after the sending time arrives;
[0077] S516. Calculate the latest beacon transmission time T in the adjacent master node information table 6 The interval from the end of the beacon period T end is denoted as T 3 , and obtain the transmission time of the latest beacon, denoted as T beacon , that is, T 3 = T end - T 6 - T beacon . If T 3 < T total + T, that is, the time interval does not meet the transmission of the data frame, then jump to S518; if T 3 ≥ T total + T, then set the transmission time of the data frame to T 6 + T beacon + T, and jump to S517 after the transmission time arrives;
[0078] S517. The master node detects whether the channel is idle. If it is idle, it sends directly. If the channel is busy, it randomly backs off for a period of time and then executes S517 again;
[0079] S518. Feedback the result that there is not enough interval between beacon frames to send the data frame to the master node, and the master node adjusts the beacon period.
[0080] Furthermore, the process of collision prediction and avoidance for the CSMA frame and TDMA frame of the slave node is as follows:
[0081] S521. If the slave node has a data frame to send, it exits the sleep mode and calls the data frame sending process;
[0082] S522. The slave node records the current transmission time, denoted as T 1 , and obtains the earliest beacon transmission time T 1 of the direct master node in the adjacent master node information table that is greater than T 2 ;
[0083] S523. The slave node calculates the interval between T 1 and T 2 , denoted as T 3 ;
[0084] S524. The slave node calculates whether the current data frame transmission will collide with the beacon frame. If T 3 < T total + T, that is, the time interval does not meet the transmission of the data frame, then jump to S525; if T 3 ≥ T total + T, then jump to S527;
[0085] S525. The child node calculates the interval between the transmission times of the direct master node's adjacent beacons in the adjacent master node information table in sequence according to the transmission time, denoted as T. 3 , assuming that the transmission times of two adjacent beacons are T 4 and T 5 , T 4 < T 5 , obtain the beacon transmission time at the transmission time of T 4 , denoted as T beacon , that is, T 3 = T 5 - T 4 - T beacon . If the transmission times of all the beacons in the adjacent master node information table have been calculated, jump to S526; if T 3 < T total + T, that is, the time interval does not meet the transmission of the data frame, jump to S525; if T 3 ≥ T total + T, set the transmission time of the data frame to T 4 + T beacon + T, and jump to S527 after the transmission time arrives;
[0086] S526. Calculate the interval between the latest beacon transmission time T 6 in the adjacent master node information table and the end of the beacon period T end , denoted as T 3 , and obtain the transmission time of the latest beacon, denoted as T beacon , that is, T 3 = T end - T 6 - T beacon . If T 3 < T total + T, that is, the time interval does not meet the transmission of the data frame, jump to S528; if T 3 ≥ T total + T, set the transmission time of the data frame to T 6 + T beacon + T, and jump to S527 after the transmission time arrives;
[0087] S527. The child node detects whether the channel is idle. If it is idle, send directly. If the channel is busy, randomly back off for a period of time and then execute S527 again;
[0088] S528. The child node feeds back the result that there is not enough interval between beacon frames to send the data frame to the master node, and the master node adjusts the beacon period.
[0089] The beneficial effects of the present invention are as follows:
[0090] First, the present invention coordinates the transmissions between TDMA frames of different networks. In an asynchronous network, the TDMA frames of each network do not interfere with each other, ensuring the normal operation of the network.
[0091] Second, the present invention avoids collisions between CSMA and TDMA in the network, ensuring that data frames do not disrupt the normal transmission of beacon frames in the network, guaranteeing the normal operation of the beacon cycle, and saving time resources in the network.
[0092] Third, the present invention avoids collisions between CSMA and TDMA among networks, ensuring that asynchronous networks do not interfere with each other and that data frames of other networks do not interfere with the transmission of beacon frames of this network. It guarantees the coexistence of asynchronous networks and enables the orderly operation of asynchronous networks.
[0093] Fourth, the present invention reduces many unnecessary transmissions by avoiding collisions between CSMA and TDMA, saving energy consumption in the network.
[0094] Other advantages, objectives, and features of the present invention will be described to some extent in the subsequent specification, and to some extent, will be obvious to those skilled in the art based on the study of the following text, or can be learned from the practice of the present invention. The objectives and other advantages of the present invention can be achieved and obtained through the following specification. BRIEF DESCRIPTION OF THE DRAWINGS
[0095] In order to make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be described in detail preferably with reference to the accompanying drawings, where:
[0096] Figure 1 is a star network structure;
[0097] Figure 2 is a schematic diagram of information transmission and reception in a single network;
[0098] Figure 3 is a schematic diagram of the collision between CMSA data and TDMA data of the main node in the network;
[0099] Figure 4 is a schematic diagram of the collision between CMSA data and TDMA data of the sub-node in the network;
[0100] Figure 5 is a schematic diagram of the collision between TDMA data of the main nodes among networks;
[0101] Figure 6 is a schematic diagram of the collision between CMSA data and TDMA data of the main nodes among networks;
[0102] Figure 7 Schematic diagram of the collision between the sub-node CMSA data and the master-node TDMA data in the network
[0103] Figure 8 Overall flowchart of the method for predicting and avoiding conflicts between CSMA data and TDMA data in the asynchronous network of the present invention
[0104] Figure 9 Schematic diagram of the asynchronous network structure in the embodiment
[0105] Figure 10 Schematic diagram of the data frame structure of the present invention
[0106] Figure 11 Schematic flowchart of the master node creating the adjacent master node information table of the present invention
[0107] Figure 12 Schematic flowchart of the initial TDMA frame coordination of the master node of the present invention
[0108] Figure 13 Schematic flowchart of the sub-node creating the adjacent master node information table of the present invention
[0109] Figure 14 Schematic flowchart of the conflict prediction and avoidance of the CSMA frame and TDMA frame of the master node of the present invention
[0110] Figure 15 Schematic flowchart of the conflict prediction and avoidance of the CSMA frame and TDMA frame of the sub-node of the present invention
[0111] Figure 16 Schematic flowchart of the master node updating the adjacent master node information table of the present invention
[0112] Figure 17 Schematic flowchart of the master node coordinating the subsequent TDMA frame of the present invention
[0113] Figure 18 Schematic flowchart of the sub-node updating the adjacent master node information table of the present invention Detailed implementation manners
[0114] The following uses specific specific examples to illustrate the implementation manners of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific implementation manners. Various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the diagrams provided in the following embodiments only illustrate the basic concept of the present invention in a schematic manner. Without conflict, the following embodiments and the features in the embodiments can be combined with each other.
[0115] Among them, the accompanying drawings are only for illustrative purposes, showing only schematic diagrams rather than actual diagrams, and should not be construed as limiting the present invention; in order to better illustrate the embodiments of the present invention, some components in the accompanying drawings will be omitted, enlarged or reduced, which does not represent the dimensions of the actual product; for those skilled in the art, it is understandable that some well-known structures and their descriptions in the accompanying drawings may be omitted.
[0116] In the accompanying drawings of the embodiments of the present invention, the same or similar reference numerals correspond to the same or similar components; in the description of the present invention, it should be understood that if there are terms such as "upper", "lower", "left", "right", "front", "rear", etc. indicating the orientation or positional relationship, they are based on the orientation or positional relationship shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation. Therefore, the terms describing the positional relationship in the accompanying drawings are only for illustrative purposes and should not be construed as limiting the present invention. For those of ordinary skill in the art, the specific meanings of the above terms can be understood according to specific circumstances.
[0117] Please refer to Figures 8 to 18 , which is a method for conflict prediction and avoidance of CSMA data and TDMA data in an asynchronous network.
[0118] Figure 8 The overall flow schematic diagram of a method for conflict prediction and avoidance of CSMA data and TDMA data in an asynchronous network according to the present invention is shown, and its steps mainly include:
[0119] The master node creates or updates the adjacent master node information table according to the received beacon frames of other networks;
[0120] The master node coordinates the transmission of the initial beacon frame or subsequent beacon frames between networks according to the adjacent master node information table;
[0121] The master node adds the adjacent master node information table to the beacon frame and assembles the beacon frame;
[0122] The slave node creates or updates the adjacent master node information table according to the received beacon frame;
[0123] When the master node detects a data frame to be sent, it sends the beacon frame to other nodes in a manner of conflict prediction and avoidance of the CSMA frame and TDMA frame of the master node; when the slave node detects a data frame to be sent, it sends the beacon frame to other nodes in a manner of conflict prediction and avoidance of the CSMA frame and TDMA frame of the slave node.
[0124] Embodiment
[0125] This embodiment assumes that there are three networks in the asynchronous network, and the schematic diagram is asFigure 9 Network 2 is the direct master node of Network 1, Network 3 is the indirect master node of Network 1, and Network 3 is the direct master node of Network 2. Assume that the master nodes of Network 2 and Network 3 have been running for some time, and Network 2 has stored the information of the master node of Network 3 in the adjacent master node information table. Assume that the master node in Network 1 has just been powered on. At this time, the master node of Network 1 needs to listen to the surrounding network beacon tables, obtain information from them, and create an adjacent master node information table.
[0126] The structure of the beacon frame is as Figure 10 , which includes a PHY frame header, a MAC control field, a destination address, a source address, a payload field, and an ORC. Among them, the PHY frame header occupies 4 bytes, the MAC control field occupies 2 bytes, the destination address occupies 4 bytes, the source address occupies 4 bytes, the ORC occupies 4 bytes, and the payload field occupies 14 to 34 bytes. The information of the beacon frame and the information in the adjacent master node information table are both in the payload field. The information of the beacon frame includes the beacon transmission time, the beacon period, and the adjacent master node information table. The destination master node address represents the target address of the transmission, usually FFFF, indicating the broadcast address; the source master node address represents the address of the master node that sends the beacon frame; the transmission time of the beacon is used for time synchronization; the beacon period is the time interval between the transmissions of the beacon frames.
[0127] The adjacent master node information table includes the direct master node address, the beacon period, the difference between the beacon transmission time of the master node in the table and the beacon frame transmission time (calculated), and the beacon transmission time. Among them, the source master node address identifies a unique master node, which is obtained from the beacon frame. The transmission time of the beacon is calculated based on the node's own reception time and the transmission time of the beacon frame. The calculation formula is: reception time - transmission time. The beacon period is the time interval between the transmissions of the beacon frames, which is obtained from the beacon frame. The transmission time is the time for the beacon frame to be transmitted in the channel, which is calculated.
[0128] The adjacent master node information table of the master node shown in Table 1 and the star master node information table of the child node shown in Table 2 are as follows:
[0129] Table 1
[0130] Main node address 4 bytes Direct / indirect flag 1 byte Transmission time 7 bytes Beacon period 1 byte Beacon transmission time 1 byte
[0131] Table 2
[0132] Main node address 4 bytes Transmission time 7 bytes Beacon period 1 byte Beacon transmission time 1 byte
[0133] The difference between the adjacent master node information tables of the master node and the child node is that the adjacent master node information table of the master node contains a direct / indirect flag, which is used to mark whether the master node is a direct master node or an indirect master node, and is obtained through the information carried in the beacon frame.
[0134] The master node stores the received beacon frame information in the adjacent master node information table in an orderly manner according to the beacon sending time, and divides them into direct master nodes and indirect master nodes. A direct master node is a master node that can receive the beacon frame by itself, and an indirect master node is a master node that cannot receive the corresponding beacon frame by itself, but the direct master node can directly receive the beacon frame. During the subsequent operation, for the recorded master nodes, only their time information is updated. And they are sorted according to the sequence of sending times, making it more convenient to search.
[0135] Taking the foregoing network connection situation as an example, this embodiment describes a data interaction instance of the method of the present invention, and its steps are as follows:
[0136] (1) The master node of Network 1 creates an adjacent master node information table, and its main process is as Figure 11 shown:
[0137] Step 1a: The master node receives the beacon frame from other master nodes, calculates its transmission time T according to the length of the beacon frame 1 , and calculates the sending time T of the beacon frame according to the receiving time T 2 = T 3 = T 2 - T 1 . Subsequently, the beacon frame is parsed to obtain the address of the master node and the beacon period T period , and the next beacon sending time T of the master node is calculated 4 = T 3 + T period ;
[0138] Step 1b: Create a new space to save the master node address, transmission time T 1 , beacon sending time T 4 , and beacon period T period obtained in Step 1a in the adjacent master node information table, and mark it as a direct master node;
[0139] Step 1c: Parse the beacon frame to obtain the information in the adjacent master node information table carried in the beacon frame, including the master node address, beacon period, sending time difference T 5 and transmission time. According to the calculation, the beacon sending time T of the master node in the adjacent master node information table can be obtained 6 = T 3 + T 5 ;
[0140] Step 1d: Create a new space to save the master node address, transmission time, and beacon sending time T 6, the beacon period is saved in the adjacent master node information table and marked as an indirect master node. If all the master node information carried in the beacon frame is saved, jump to step 1e; otherwise, jump to step 1c;
[0141] Step 1e: Sort the node information in the adjacent node information table according to the sequence of beacon transmission times.
[0142] In this embodiment, the specific process for the master node of Network 1 to create an adjacent master node information table is as follows:
[0143] Step 11: The master node of Network 1 powers on and listens for one beacon period plus a random time of 0 to 10 s;
[0144] Step 12: The master node of Network 1 receives the beacon frame of the master node of Network 2;
[0145] Step 13: Calculate its transmission time T according to the length of the beacon frame 1 , and calculate the transmission time T of the beacon frame according to the reception time T 2 = T 3 = T 2 - T 1 . Subsequently, parse the beacon frame to obtain the address of the master node of Network 2 and the beacon period T period , and calculate the next beacon transmission time T of the master node of Network 2 4 = T 3 + T period ;
[0146] Step 14: Open up new space to save the master node address of Network 2, beacon transmission time, beacon period, and transmission time in step 3 in the adjacent master node information table, and mark this master node as a direct master node;
[0147] Step 15: Parse the beacon frame of Network 2 to obtain the information in the adjacent master node information table carried in the beacon frame, including the master node address of Network 3, beacon period T 5 , transmission time difference T 6 and transmission time. According to the calculation, the transmission time T of the master node in the adjacent master node information table can be obtained 7 = T 3 + T 6 ;
[0148] Step 16: Save the master node address of Network 3, beacon transmission time, beacon period, and transmission time information obtained in step 5 in the adjacent master node information table, and mark this master node as an indirect master node;
[0149] Step 17: Sort the node information in the adjacent master node information table according to the sequence of beacon transmission times.
[0150] After the master node of Network 1 creates its own adjacent master node information table, it will select the transmission time of its beacon according to the content in the table. Assume that the beacon transmission time of the master node of Network 2 is T 网2 , and the beacon transmission time of the master node of Network 3 is T 网3 , and T 网2 < T 网3 , there should be a minimum interval T slot between beacon frames to support the normal operation of node services. Assume that the transmission time of the beacon frame is T beacon .
[0151] When the master node has just started and has not sent a beacon frame, according to the ordered information in the adjacent master node information table, by calculating the interval between beacon frames and the interval between the last beacon frame transmission time in the table and the end of the beacon period, a suitable transmission time is selected. Since the beacon period is the time for a network to send service frames, if there are too many adjacent master nodes, there will be many beacon frame transmissions in the beacon period, resulting in the inability to expand service frames. Therefore, to ensure the normal operation of service frames, it is recommended that there be a minimum interval T slot between beacon frames to support the normal operation of node services.
[0152] When the master node has already sent a beacon frame, since there will be a certain left - right offset in the beacon transmission time, resulting in a change in the interval between beacons, it is necessary to dynamically adjust the interval between beacon transmission times to ensure that the interval between beacon frames is greater than or equal to T slot . Thus, the following steps are:
[0153] (2) Coordinate the initial TDMA frame of the master node of Network 1, and its main process is as Figure 12 shown:
[0154] Step 2a: The master node calculates the beacon transmission time T 1 , and according to the node information stored in the adjacent master node information table, calculates the intervals between all adjacent beacon transmission times and the interval between the last beacon frame transmitted in the adjacent master node information table and the end of the beacon period, compares the calculated intervals, and records the maximum value of the intervals as T 2 . If T 2 < 2 * T slot + T 1 , then feedback this result to the master node to make the master node adjust its own beacon period; if T 2 > 2 * T slot + T 1 , jump to Step 2b;
[0155] Step 2b: Assume that T is calculated 1The two spaced-apart times are T 4 and T 5 (T 4 < T 5 ), then set the beacon transmission time to T 3 =(T 4 + T 5 ) / 2.
[0156] In this embodiment, the initial TDMA frame coordination process of the main node of Network 1 is as follows:
[0157] Step 21, the main node of Network 1 calculates the transmission interval between the beacon frames of the surrounding main nodes according to the adjacent main node information table. Only the beacon transmission times of Network 2 and Network 3 are stored in the adjacent main node information table, denoted as T 网2 and T 网3, respectively, and obtain the beacon transmission time in Network 2, denoted as T beacon2 , calculate the interval T 1 = T 网3 - T 网2 - T beacon , and obtain the beacon transmission time in Network 2, denoted as T beacon3 , and calculate the interval between T 网3 and the end of the beacon T end , denoted as T 2 = T end - T 网3- T beacon3 ;
[0158] Step 22, compare the magnitudes of T 1 and T 2 , T 1 > T 2 ;
[0159] Step 23, if T 1 > 2 * T slot + T, then set its own beacon transmission time T 3 to (T 网2 + T 网3 ) / 2.
[0160] When the beacon frame of Network 1 is transmitted, in addition to carrying the relevant information of the beacon frame of Network 1, it is also necessary to carry the information of the direct main node in the adjacent main node information table, so that the child nodes in the same network can obtain the beacon transmission information of the surrounding networks. Thus, the following steps are:
[0161] (3) The main node of Network 1 adds the adjacent main node information table to the beacon frame and assembles the beacon frame. The main process is as follows:
[0162] Step 3a, the master node checks whether there is a direct master node in the adjacent master node information table. If it is empty, jump to step 3d; if it is not empty, jump to step 3b;
[0163] Step 3b: poll and obtain the next beacon frame sending time of the direct master node recorded in the adjacent master node information table as T 1 , get its own beacon frame sending time T 2 , calculate the difference between the two T 3 =T 1 -T 2 ;
[0164] Step 3c, add the time difference T3, node address, beacon period, and transmission time to the beacon frame. If there is still a direct master node in the table that has not been calculated, jump to step 3b, otherwise jump to step 3d;
[0165] Step 3d: Assemble the beacon frame, and send the beacon frame when the beacon frame sending time arrives.
[0166] In this embodiment, the process of the master node of network 1 carrying the adjacent master node information table in the beacon frame is as follows:
[0167] Step 31, the master node of network 1 polls and checks the adjacent master node information table, checks that the master node of network 2 is the direct master node, and sets the next beacon sending time T of the master node of network 2 stored in the table. 1 The next beacon sending time T of the master node of network 1 2 Calculate the difference, that is, T 3 =T 1 -T 2 , and then the network 2 master node address and time difference T 3 , the beacon period of network 2 is loaded in the beacon frame;
[0168] Step 32, the network 1 master node checks the next node in the adjacent master node information table. The network 3 master node is an indirect master node, so the node is skipped;
[0169] Step 33, the master node of network 1 checks that there is no master node information behind the adjacent master node information table, and then completes the assembly of the beacon and waits for the beacon sending time to arrive.
[0170] When the child node avoids the beacon frames of the surrounding network, it also needs to create an adjacent master node information table. However, the adjacent master node information table of the child node only contains the direct master node, so the following steps are performed:
[0171] (4) The child node of network 1 creates an adjacent master node information table. The main process is as follows: Figure 13 As shown:
[0172] Step 4a: Receive the beacon frame of its own network, obtain the master node address, the beacon transmission time T 1 , the beacon period T period , calculate the beacon transmission time according to the beacon length, and calculate the next beacon transmission time T 2 = T 1 + T period ;
[0173] Step 4b: Create a new space and save the obtained master node address, transmission time, next beacon transmission time, and beacon period in the adjacent master node information table;
[0174] Step 4c: Obtain the information of the adjacent master node information table from the beacon frame, and get the master node address, transmission time, beacon period T 3 , the difference T between beacons 4 , and calculate the transmission time T of the beacon frame carried 5 = T 1 + T 4 ;
[0175] Step 4d: Create a new space and save the obtained master node address, transmission time, beacon transmission time, and beacon period in the adjacent master node information table. If all the master node information carried in the beacon frame has been saved, jump to step 4e, otherwise jump to step 4c;
[0176] Step 4e: Sort the node information in the adjacent node information table in the order of the beacon transmission time.
[0177] In this embodiment, the sub-node of Network 1 creates an adjacent master node information table:
[0178] Step 41, the sub-node of Network 1 receives the beacon frame of its own network, obtains the master node address, the beacon transmission time T 1 , the beacon period T period , calculate the beacon transmission time according to the beacon length, and calculate the next beacon transmission time T 2 = T 1 + T period ;
[0179] Step 42, obtain the information of the adjacent master node information table from the beacon frame, and get the master node address of Network 2, transmission time, beacon period T 3 , the difference T between beacons 4 , and calculate the transmission time T of the beacon frame carried 5 = T 1 + T 4 , calculate the next beacon transmission time T 6 = T 5 + T 3 ;
[0180] Step 43: Save the main node addresses, beacon transmission times, beacon periods, and transmission times of Network 1 and Network 2 in the adjacent main node information table.
[0181] When the main node of Network 1 has a data frame to send, it will predict whether there is a collision with the beacon frame based on the direct main node information recorded in the adjacent main node information table. It is known that there is only one direct main node in the adjacent main node information table of the main node of Network 1, which is the main node of Network 2. The shortest time of the service frame is T total , and the guard interval between frames is T. Therefore, the following steps are executed:
[0182] (5) The main node of Network 1 sends the beacon frame to other nodes in the way of conflict prediction and avoidance of the CSMA frame and TDMA frame of the main node. Assume that the sum of the maximum time of the service frame CSMA and the service frame transmission time is T total , and the guard interval between frames is T. The minimum interval T between beacon frames slot = T total + T. When there is a service frame to send, calculate the interval between the current moment and the adjacent beacon transmission moment. If this interval is greater than or equal to T total + T, immediately execute the CSMA process. When the channel is idle, send the service frame. If this interval is less than T total + T, calculate the interval between the end moment of the beacon frame transmission and the beacon transmission according to the order of the adjacent main node information table. If there is an interval greater than or equal to T total + T, place the transmission of the service frame in this interval. If there is not enough interval between adjacent beacons, calculate the interval between the end moment of the latest beacon in the table and the end of the beacon period. If this interval is greater than or equal to T total + T, place the transmission of the data frame in this interval. Otherwise, feedback the result to the main node to increase the length of the beacon period. Since there is a dynamic coordination mechanism between beacon frames, there will always be enough intervals between beacon frames to allow the service frame to proceed. The main process is as Figure 14 shown:
[0183] Step 5a: The main node has a data frame to send and calls the data frame sending process;
[0184] Step 5b: The main node records the current moment of the call to send, denoted as T 1 ;
[0185] Step 5c: The main node calculates T 1 and the interval with the earliest direct main node beacon transmission moment T 2 in the adjacent main node information table, denoted as T 3 ;
[0186] Step 5d. The master node calculates whether the transmission of the current data frame will collide with the beacon frame. If T 3 <T total + T, that is, the time interval does not meet the transmission of the data frame. Jump to step 5e; if T 3 ≥T total + T, then jump to step 5g;
[0187] Step 5e. The master node calculates the interval between the adjacent beacon transmission times of the direct master node in the adjacent master node information table in sequence according to the transmission time, denoted as T 3 , assuming the adjacent beacon transmission times are T 4 、T 5 ,T 4 <T 5 , obtain the beacon transmission time T 4 at the transmission time of T beacon , that is, T 3 =T 5 -T 4 -T beacon If the beacon transmission times in the adjacent master node information table have all been calculated, then jump to step 5f; if T 3 <T total + T, that is, the time interval does not meet the transmission of the data frame. Jump to step 5e; if T 3 ≥T total + T, set the transmission time of the data frame to T 4 + T beacon + T, and jump to step 5g after the time arrives;
[0188] Step 5f. Calculate the interval T 6 between the latest beacon transmission time T end in the adjacent master node information table and the end of the beacon period, denoted as T 3 , obtain the latest beacon transmission time as T beacon , that is, T 3 =T end -T 6 -T beacon , if T 3 <T total + T, that is, the time interval does not meet the transmission of the data frame. Jump to step 5h; if T 3 ≥T total + T, set the transmission time of the data frame to T 6 + T beacon + T, and jump to step 5g after the time arrives;
[0189] Step 5g. The master node detects whether the channel is idle. If it is idle, send directly. If the channel is busy, randomly back off for a period of time and then execute step 5g again;
[0190] Step 5h: Feed back the result that there is not enough interval between beacon frames to send data frames to the master node, so that the master node adjusts the beacon period.
[0191] In this embodiment, the conflict prediction and avoidance process of the CSMA frame and TDMA frame of the master node of Network 1 is as follows:
[0192] Step 51: When the master node of Network 1 has a data frame to send, call the data frame sending process;
[0193] Step 52: The master node of Network 1 records the current time of calling the sending, denoted as T 1 ;
[0194] Step 53: The master node of Network 1 calculates the interval between T 1 and the beacon sending time T 2 of the master node of Network 2, denoted as T 3 ;
[0195] Step 54: By judgment, T 2 ≥T total +T;
[0196] Step 55: The master node of Network 1 detects that the channel is idle;
[0197] Step 56: Send the data frame.
[0198] It is known that there is only one direct master node in the adjacent master node information table of the sub-node of Network 1, that is, the master node of Network 2. The shortest time of the service frame is T total , and the protection interval between frames is T. When the sub-node of Network 1 calls to send a data frame and the beacon frame of the master node of Network 2 has not been sent yet, there is:
[0199] (6) The sub-node of Network 1 sends the beacon frame to other nodes in the way of conflict prediction and avoidance of the CSMA frame and TDMA frame of the sub-node. Assume that the shortest time required for the service frame is T total , and the protection interval between frames is T. The minimum interval T slot between beacon frames = T total +T. When the sub-node has a service frame to send, calculate whether the interval between beacon frames meets the sending condition. If it meets, send the data. If it does not meet, report it to the master node of this network, so that the master node extends the beacon period.
[0200] Since the update of the beacon frame of the adjacent master node of the sub-node can only be through the beacon frame in the same network, when a data frame is to be sent, some beacon frames in the adjacent master node information table have been sent. When the sub-node avoids, the beacon sending times in the table should be screened; the main steps are as Figure 15As shown below:
[0201] Step 6a: If the child node has a data frame to send, it exits the sleep mode and calls the data frame sending process;
[0202] Step 6b: The child node records the current time of the call to send, denoted as T 1 , and obtains the earliest beacon transmission time T 1 of the direct master node in the adjacent master node information table that is greater than T 2 ;
[0203] Step 6c: The child node calculates the interval between T 1 and T 2 , denoted as T 3 ;
[0204] Step 6d: The child node calculates whether the current data frame transmission will collide with the beacon frame. If T 3 < T total + T, that is, the time interval does not meet the data frame transmission. Jump to step 6e; If T 3 ≥ T total + T, then jump to step 6g;
[0205] Step 6e: The master node successively calculates the interval between adjacent beacons of the direct master node in the adjacent master node information table, denoted as T 3 , assuming the adjacent beacon transmission times are T 4 、T 5 ,T 4 < T 5 , obtains the beacon transmission time T 4 at time T beacon , that is, T 3 = T 5 - T 4 - T beacon If the beacon transmission times in the adjacent master node information table have all been calculated, then jump to step 6f; If T 3 < T total + T, that is, the time interval does not meet the data frame transmission, then jump to step 6h; If T 3 ≥ T total + T, set the data frame transmission time to T 4 + T beacon + T, and jump to step 6g after the time arrives;
[0206] Step 6f: Calculate the interval between the latest beacon transmission time T 6 in the adjacent master node information table and the end of the beacon period T end , denoted as T 3 , and obtain the latest beacon transmission time T beacon , that is, T 3= T end -T 6 -T beacon 。If T 3 < T total + T, that is, the time interval does not meet the transmission of the data frame, jump to step 6h; if T 3 ≥ T total + T, set the transmission time of the data frame to T 6 + T beacon + T, after the time arrives, jump to step 6g;
[0207] Step 6g, the master node detects whether the channel is idle. If it is idle, send directly. If the channel is busy, randomly back off for a period of time and then execute step 6g again;
[0208] Step 6h, feedback the result that there is not enough interval between beacon frames to send the data frame to the master node, so that the master node adjusts the beacon period.
[0209] In this embodiment, the CSMA frame and TDMA frame conflict prediction and avoidance process of the network 1 sub-node is as follows:
[0210] Step 61, the network 1 sub-node has a data frame to send, and calls the data frame sending process;
[0211] Step 62, the network 1 sub-node records the current time of calling the transmission, denoted as T 1 , filters the beacon transmission times in the adjacent master node information table, and finds that the beacon transmission time of the network 2 master node is greater than T 1 , meeting the requirements;
[0212] Step 63, the network 1 sub-node calculates the interval between T 1 and the beacon transmission time T 2 of the network 2 master node, denoted as T 3 ;
[0213] Step 64, through judgment, T 2 < T total + T, that is, this interval is not enough to send the data frame;
[0214] Step 65, calculate the interval between T 2 and the time at the end of the beacon period T 3 , obtain the network 2 beacon transmission time T beacon , then the interval T 4 = T 3 - T 2 - T beacon ;
[0215] Step 66, T4 > T total + T, this interval meets the requirements;
[0216] Step 67, set the data frame transmission time to T 2 ++T beacon +T;
[0217] Step 68, when the transmission time arrives, detect that the channel is idle;
[0218] Step 69, transmit the data frame.
[0219] In the subsequent beacon period, the master node of Network 1 has stored the beacon information of the master nodes of Network 2 and Network 3. Whenever the master node of Network 1 receives the beacon frame of the master node of Network 2, it will obtain the beacon information of Network 2 and Network 3 from the beacon frame and update the beacon transmission time in the adjacent master node information table; the steps to be executed are as follows:
[0220] (7) The master node of Network 1 updates the adjacent master node information table, and its main process is as Figure 16 shown:
[0221] Step 7a: The master node receives the beacon frame of another master node, calculates its transmission time T 7 , and calculates the transmission time T of the beacon frame based on the reception time T 8 = T 9 = T 8 - T 7 . Subsequently, parse the beacon frame to obtain the address of this master node and the beacon period T, and calculate the next beacon transmission time T of this master node 10 = T 9 + T.
[0222] Step 7b: Compare the master node address obtained in Step 7a with the address stored in the adjacent master node information table. If the master node address has been saved, update the beacon transmission time of the master node. By comparing with the adjacent master node information table, if the beacon period and transmission time change, update them. If the master node address has not been saved, create a new space to store the master node address, transmission time T 7 , beacon transmission time T 10 , and beacon period T period obtained in Step 7a in the adjacent master node information table and mark it as a direct master node;
[0223] Step 7c: Parse the beacon frame to obtain the information in the adjacent master node information table carried in the beacon frame, including the master node address, beacon period T 11 , transmission time difference T 12 and transmission time. According to the calculation, the master node beacon transmission time T in the adjacent master node information table can be obtained 13 = T 9+T 12 ;
[0224] Step 7d: Compare the main node address obtained in Step 7c with the addresses stored in the adjacent main node information table. If the main node address has been saved, update the beacon transmission time of the main node. By comparing with the adjacent main node information table, if the beacon period or transmission time has changed, update it; if the main node address has not been saved, create a new space to store the main node address, transmission time, and beacon transmission time T 12 , beacon period obtained in Step 7c in the adjacent main node information table, and mark it as an indirect main node. If all the main node information carried in the beacon frame has been saved, jump to Step 7e; otherwise, jump to Step 7c;
[0225] Step 7e: Sort the node information in the adjacent node information table in the order of the beacon transmission time.
[0226] In this embodiment, the main node of Network 1 updates the adjacent main node information table:
[0227] Step 71: The main node of Network 1 receives the beacon frame of the main node of Network 2;
[0228] Step 72: Calculate its transmission time T 1 according to the length of the beacon frame, and calculate the transmission time T 2 of the beacon frame based on the reception time T 3 = T 2 - T 1 . Then parse the beacon frame to obtain the address of the main node of Network 2 and the beacon period T period , and calculate the next beacon transmission time T 4 = T 3 + T period ;
[0229] Step 73: Parse the beacon frame of Network 2 to obtain the information in the adjacent main node information table carried in the beacon frame, including the address of the main node of Network 2, the beacon period T 5 , the transmission time difference T 6 and the transmission time. According to the calculation, the transmission time T 7 of the main node in the adjacent main node information table can be obtained as T 3 + T 6 ;
[0230] Step 74: Compare the obtained main node address of Network 2 with the addresses stored in the adjacent main node information table. It is found that this address already exists in the adjacent main node information table. Therefore, update the beacon transmission time of the main node of Network 2 in the table. Subsequently, compare the obtained main node address of Network 3 with the addresses in the table. It is found that this address has been saved. Therefore, update the beacon transmission time of the main node of Network 3 in the table.
[0231] Since there are left and right offsets in the transmission time of beacon frames, it may cause the interval between beacon frames not to meet the requirements. To ensure that the interval between beacon frames meets the sum of the time of an uplink service frame, a downlink response frame, and the guard interval time, it is necessary to coordinate between beacon frames during the beacon transmission process. The minimum interval between beacon frames is T slot 。
[0232] (8) The main node of Network 1 coordinates the subsequent TDMA frames. The main process is as Figure 17 shown:
[0233] Step 8a: During the subsequent beacon frame transmission process, check the adjacent main node information table before each transmission, and calculate the gap between its own transmission time and the end time of the previous beacon transmission recorded in the table, denoted as T 6, If T 6 >T slot , then do nothing. If T 6 <T slot , jump to Step 8b;
[0234] Step 8b: Adjust the transmission of the beacon frame. Assume the original transmission time is T 7 , and set the transmission time of the beacon frame to T 7 +(T slot -T 6 ).
[0235] In this embodiment, the subsequent TDMA frame coordination process of the main node of Network 1 is as follows:
[0236] Step 81: Before the main node of Network 1 sends, check the adjacent main node information table, and calculate the gap between its own transmission time and the end time of the beacon transmission of the main node of Network 2, denoted as T 1 . Assume the sum of the time of an uplink service frame and a downlink response frame is T 2 , and the guard interval between the service frame and the beacon frame is T;
[0237] Step 82: By comparison, if T 1 <T slot , then adjust the transmission time of the beacon frame of the main node of Network 1. Assume the original transmission time is T 3, set the transmission time of the beacon frame of the main node of Network 1 to T 3 +(T slot -T 1 ).
[0238] (9) The sub-nodes of Network 1 update the adjacent main node information table, and its main process is as Figure 18 shown:
[0239] Step 9a: Receive the beacon frame of its own network, obtain the main node address, beacon transmission time T 7 , beacon period T period , calculate the beacon transmission time T 8 according to the beacon length, and calculate the transmission time T 9 of the beacon = T 7 +T period ;
[0240] Step 9b: Compare the obtained main node address with the addresses stored in the adjacent main node information table. If the main node address has been saved, update the beacon transmission time of the main node. By comparing with the adjacent main node information table, if the beacon period and transmission time change, update them; if the main node address has not been saved, create a new space to save the obtained main node address, transmission time T 8 , beacon transmission time T 9 , beacon period T period in the adjacent main node information table;
[0241] Step 9c: Obtain the information of the adjacent main node information table from the beacon frame, and get the main node address, transmission time T 10 , beacon period T 11 , the difference T 12 between beacons, and calculate the transmission time T 13 of the beacon frame carrying the beacon = T 7 +T 12 ;
[0242] Step 9d, compare the main node address obtained in Step 9c with the addresses stored in the adjacent main node information table. If the main node address has been saved, update the beacon transmission time of the main node. By comparing with the adjacent main node information table, if the beacon period and transmission time change, update them; if the main node address has not been saved, create a new space to save the main node address, transmission time T 10 , beacon transmission time T 13 , beacon period T 11 obtained in Step 9c in the adjacent main node information table. If all the main node information carried by the beacon frame is saved, jump to Step 9e, otherwise jump to Step 9c;
[0243] Step 9e: Sort the node information in the adjacent node information table according to the sequence of beacon sending times.
[0244] In this embodiment, the network 1 sub-node updates the adjacent master node information table:
[0245] Step 91: The network 1 sub-node receives the beacon frame of its own network, obtains the network 1 master node address, beacon sending time T 1 , beacon period T period , calculates the beacon transmission time according to the beacon length, and calculates the next sending time T 2 = T 1 + T period ;
[0246] Step 92: Obtain the information of the adjacent master node information table from the beacon frame to get the network 2 master node address, transmission time, beacon period T 3 , difference T between beacons 4 , and calculate the sending time T 5 = T 1 + T 4 of the beacon frame carrying, calculate the next beacon sending time T 6 = T 5 + T 3 ;
[0247] Step 93: Compare the obtained network 1 master node address with the addresses in the adjacent master node information table. If the network 1 master node information already exists, update the time information of the network 1 master node;
[0248] Step 94: Compare the obtained network 2 master node address with the addresses in the adjacent master node information table. If the network 2 master node information already exists, update the time information of the network 2 master node.
[0249] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the purpose and scope of the present technical solution, and they should all be covered by the scope of the claims of the present invention.
Claims
1. A method for predicting and avoiding conflicts between CSMA data and TDMA data in an asynchronous network, characterized in that: The method includes the following steps: The master node creates or updates the adjacent master node information table according to the received beacon frames of other networks; The master node coordinates the transmission of initial beacon frames or subsequent beacon frames between networks according to the adjacent master node information table; The master node adds the adjacent master node information table to the beacon frame and assembles the beacon frame; The slave node creates or updates the adjacent master node information table according to the received beacon frame; When the master node detects a data frame to be sent, it sends the data frame to other nodes in a manner of conflict prediction and avoidance of the CSMA frame and TDMA frame of the master node; when the slave node detects a data frame to be sent, it sends the data frame to other nodes in a manner of conflict prediction and avoidance of the CSMA frame and TDMA frame of the slave node.
2. The method for predicting and avoiding conflicts between CSMA data and TDMA data in an asynchronous network according to claim 1, characterized in that: The process for the master node to create the adjacent master node information table is as follows: S111, the master node receives the beacon frame from other master nodes, calculates its transmission time T1 according to the length of the beacon frame, and calculates the sending time T3 = T2-T1 of the beacon frame according to the receiving time T2; and parses the beacon frame to obtain the address of the master node and the beacon period T period , calculate the next beacon sending time of the master node T4 = T3 + T period ; S112. Create a new space to obtain the master node address, transmission time T1, beacon sending time T4, beacon period T period It is saved in the adjacent master node information table and marked as a direct master node; S113. Parse the beacon frame to obtain the information in the adjacent master node information table carried in the beacon frame. The information in the adjacent master node information table includes the master node address, beacon period, transmission time difference T5, and transmission time. Calculate that the master node beacon transmission time T6 in the adjacent master node information table = T3 + T5; S114. Create a new space to save the obtained master node address, transmission time, beacon transmission time T6, and beacon period in the adjacent master node information table and mark it as an indirect master node; if all the master node information carried in the beacon frame is saved, jump to S115, otherwise jump to S113; S115. Sort the node information in the adjacent node information table in the order of the beacon transmission time.
3. The method for predicting and avoiding conflicts between CSMA data and TDMA data in an asynchronous network according to claim 1, characterized in that: The process for the master node to update the adjacent master node information table is as follows: S121, the master node receives the beacon frame from other master nodes, calculates its transmission time T7 according to the length of the beacon frame, and calculates the sending time T9 of the beacon frame according to the receiving time T8 = T8-T7; and parses the beacon frame to obtain the address of the master node and the beacon period T period , calculate the next beacon sending time T of the master node 10 =T9+T period ; S122, compare the obtained master node address with the address stored in the adjacent master node information table. If the master node address has been saved, update the beacon sending time of the master node. If the beacon period and transmission time change, update them. If the master node address has not been saved, create a new space to store the obtained master node address, transmission time T7, beacon sending time T 10 , beacon period T period It is saved in the adjacent master node information table and marked as a direct master node; S123, parsing the beacon frame to obtain the information in the adjacent master node information table carried in the beacon frame, where the information in the adjacent master node information table includes the master node address, beacon period T 11 , Sending time difference T 12 And the transmission time, according to the calculation, the master node beacon sending time T in the adjacent master node information table is obtained 13 =T9+T 12 ; S124, compare the obtained master node address with the address stored in the adjacent master node information table. If the master node address has been saved, update the beacon sending time of the master node. If the beacon period and transmission time change, update them. If the master node address has not been saved, create a new space to store the obtained master node address, transmission time, and beacon sending time T. 12 , the beacon period is saved in the adjacent master node information table and marked as an indirect master node; if all the master node information carried by the beacon frame is saved, jump to S125, otherwise jump to S123; S125. Sort the node information in the adjacent node information table in the order of the beacon transmission time.
4. The method for predicting and avoiding conflicts between CSMA data and TDMA data in an asynchronous network according to claim 1, characterized in that: The process for the master node to coordinate the initial TDMA frame is as follows: S211, the master node calculates the beacon transmission time T1, and calculates the interval between all adjacent beacon transmission times and the interval between the last beacon frame sent in the adjacent master node information table and the end of the beacon period according to the node information stored in the adjacent master node information table, compares the calculated intervals, and takes the maximum interval as T2; if T2<2*T slot +T1, the result is fed back to the master node, and the master node adjusts its own beacon period; if T2>2*T slot +T1, then jump to S212; S212. Suppose the two times for calculating the T1 interval are T4 and T5 respectively, and T4 < T5, then set the beacon transmission time to T3 = (T4 + T5) / 2; The process for the master node in step S2 to coordinate the subsequent TDMA frames is as follows: S221, in the subsequent beacon frame sending process, before each sending, check the adjacent master node information table, calculate the gap between its own sending time and the previous beacon sending time recorded in the table, and record it as T6; if T6>T slot , no processing is done. If T6 <T slot , jump to S222; S222, adjust the sending of the beacon frame, set the original sending time to T7, and set the sending time of the beacon frame to T7+(T slot -T6).
5. The method for predicting and avoiding conflicts between CSMA data and TDMA data in an asynchronous network according to claim 1, characterized in that: The process for adding the adjacent master node information table to the beacon frame is as follows: S31. The master node checks whether there is a direct master node in the adjacent master node information table; if it is empty, jump to S34, otherwise jump to step S32; S32. Poll to obtain that the next beacon frame transmission time of the direct master node recorded in the adjacent master node information table is T1, obtain its own beacon frame transmission time T2, and calculate the difference T3 = T1 - T2 between the two; S33. Add the time difference T3, node address, beacon period, and transmission time to the beacon frame; if there are still direct master nodes in the table that have not been calculated, jump to S32, otherwise jump to S34; S34. Assemble the beacon frame, and when the beacon frame transmission time arrives, send the beacon frame.
6. The method for predicting and avoiding conflicts between CSMA data and TDMA data in an asynchronous network according to claim 1, characterized in that: The process for the slave node to create the adjacent master node information table is as follows: S411, receiving the beacon frame of its own network, obtaining the master node address, beacon sending time T1, beacon period T period , calculate the beacon transmission time according to the beacon length, and calculate the next beacon transmission time T2 = T1 + T period ; S412. Create a new space to save the master node address, transmission time, next beacon transmission time, and beacon period obtained in S411 in the adjacent master node information table; S413, obtain the information of the adjacent master node information table from the beacon frame, obtain the master node address, transmission time, beacon period T3, difference between beacons T4, and calculate the sending time T5=T1+T4 of the beacon frame; S414, creating a new space to store the master node address, transmission time, beacon sending time, and beacon period obtained in S412 in the adjacent master node information table; If all the master node information carried by the beacon frame has been saved, jump to S415, otherwise jump to S413; S415. Sort the node information in the adjacent node information table according to the order of beacon sending time.
7. The method for predicting and avoiding conflicts between CSMA data and TDMA data in an asynchronous network according to claim 1, characterized in that: The process of a child node updating the adjacent master node information table is as follows: S421, receive the beacon frame of its own network, obtain the master node address, beacon sending time T7, beacon period T period , the beacon transmission time T8 is calculated based on the beacon length, and the beacon sending time T9 = T7 + T period ; S422, compare the master node address obtained in S421 with the address stored in the adjacent master node information table. If the master node address has been saved, update the beacon sending time of the master node. If the beacon period and transmission time have changed, update them. If the master node address has not been saved, create a new space and update the master node address, transmission time T8, beacon sending time T9, beacon period T8, and transmission time T9 obtained in S421. period , saved in the adjacent master node information table; S423, obtain the information of the adjacent master node information table from the beacon frame, and obtain the master node address and transmission time T 10 , beacon period T 11 , the difference between beacons T 12 , and calculate the sending time T of the beacon frame 13 =T7+T 12 ; S424, compare the master node address obtained in S423 with the address stored in the adjacent master node information table. If the master node address has been saved, update the beacon sending time of the master node. If the beacon period and transmission time have changed, update them. If the master node address has not been saved, create a new space and replace the master node address and transmission time T obtained in S423. 10 , beacon sending time T 13 , beacon period T 11 , saved in the adjacent master node information table; If all the master node information carried by the beacon frame is saved, jump to S425, otherwise jump to S423; S425. Sort the node information in the adjacent node information table according to the order of beacon sending time.
8. The method for predicting and avoiding conflicts between CSMA data and TDMA data in an asynchronous network according to claim 1, characterized in that: The process of conflict prediction and avoidance between the CSMA frame and the TDMA frame of the master node is as follows: S511, the master node has a data frame to send, and calls the data frame sending process; S512, the master node records the time when the current call is sent, recorded as T1; S513, the master node calculates the interval between T1 and the earliest direct master node beacon sending time T2 in the adjacent master node information table as T3; S514, the master node calculates whether the current data frame transmission will collide with the beacon frame. If T3 <T total +T, that is, the time interval does not meet the transmission of the data frame, jump to S515; if T3 ≥ T total +T, then jump to S517; S515. The master node calculates the interval between the adjacent beacon transmission times of the direct master node in the adjacent master node information table in sequence according to the transmission time, denoted as T3. Assume that the two adjacent beacon transmission times are T4 and T5 respectively, and T4 < T5. Obtain the transmission time of T4, denoted as T beacon , and calculate T3 = T5 - T4 - T beacon ; if the beacon transmission times in the adjacent master node information table have all been calculated, jump to S516; if T3 < T total +T, that is, the time interval does not meet the requirement for sending the data frame, jump to S515; if T3 ≥ T total +T, then set the transmission time of the data frame to T4 + T beacon +T, and jump to S517 after the transmission time arrives; S516, calculate the latest beacon sending time T6 and the end of the beacon period T6 in the adjacent master node information table. end The interval is recorded as T3, and the transmission time of the latest beacon is recorded as T beacon , that is, T3 = T end -T6-T beacon If T3 <T total +T, that is, the time interval does not meet the transmission of the data frame, then jump to S518; if T3 ≥ T total +T, the sending time of the data frame is set to T6+T beacon +T, jump to S517 after the sending time arrives; S517, the master node detects whether the channel is idle. If it is idle, it sends directly. If the channel is busy, it randomly backs off for a period of time and executes S517 again; S518. Feedback the result that there is not enough interval between beacon frames to send data frames to the master node, and the master node adjusts the beacon period.
9. The method for predicting and avoiding conflicts between CSMA data and TDMA data in an asynchronous network according to claim 1, characterized in that: The process of conflict prediction and avoidance between CSMA frames and TDMA frames of the child node is as follows: S521, the child node has a data frame to send, exits from the sleep mode, and calls the data frame sending process; S522, the child node records the time of the current call transmission, recorded as T1, and obtains the earliest beacon transmission time T2 of the direct master node that is greater than T1 in the adjacent master node information table; S523, the sub-node calculates the interval between T1 and T2 and records it as T3; S524, the child node calculates whether the current data frame transmission will collide with the beacon frame. If T3 <T total +T, that is, the time interval does not meet the transmission of the data frame, then jump to S525; if T3 ≥ T total +T, then jump to S527; S525. The child node calculates the interval between the direct master node's adjacent beacon transmission times in the adjacent master node information table in sequence according to the transmission time, denoted as T3. Assume the transmission times of two adjacent beacons are T4 and T5 respectively, where T4 < T5. Obtain the transmission time of the beacon with transmission time T4, denoted as T beacon , that is, T3 = T5 - T4 - T beacon ; If the beacon transmission times in the adjacent master node information table have all been calculated, then jump to S526; If T3 < T total +T, that is, the time interval does not meet the requirement for sending the data frame, then jump to S525; If T3 ≥ T total +T, set the transmission time of the data frame to T4 + T beacon +T. After the transmission time arrives, jump to S527; S526, calculate the latest beacon sending time T6 and the end of the beacon period T6 in the adjacent master node information table. end The interval is recorded as T3, and the transmission time of the latest beacon is recorded as T beacon , that is, T3 = T end -T6-T beacon ; If T3 <T total +T, that is, the time interval does not meet the transmission of the data frame, then jump to S528; if T3 ≥ T total +T, set the sending time of the data frame to T6+T beacon +T, jump to S527 after the sending time arrives; S527, the child node detects whether the channel is idle. If it is idle, it sends directly. If the channel is busy, it randomly backs off for a period of time and executes S527 again; S528: The child node feeds back to the master node the result that there is not enough interval between beacon frames to send data frames, and the master node adjusts the beacon period.
Citation Information
Patent Citations
Method, system and device for indicating beacon frame sending and sending beacon frame
CN103796277A
Sending method for avoiding beacon frame collision in enhanced wireless local area network
CN104853375A
Segmented competitive beacon sending method based on wireless mesh network
CN112153747A
Time slot estimation method based on beacon network
CN113891479A
Method on wake-up scheduling of sensor nodes in multihop sensor networks
KR1020080095697A