Disclosure of Invention
The purpose of the invention is as follows: it is an object of the present invention to provide an optimized wireless channel negotiation method that solves the drawbacks of the prior art.
The technical scheme is as follows: the optimized wireless channel negotiation method comprises the following steps:
s1: after the source node applies to the data channel, the data frame is sent to the target node through the data channel, and a frame header of the data frame carries relevant information required by a frame body, a buffer empty-full mark to be sent from the source node to the target node after the transmission and the priority of the residual data from the source node to the target node after the transmission;
s2: after receiving a data frame sent by a source node, a target node generates an ACK frame and sends the ACK frame to the source node, wherein the ACK frame carries confirmation information of data sent by the source node, indication information of whether the source node is allowed to continue sending, a buffer empty/full flag to be sent from the target node to the source node after the transmission and the priority of the residual data from the target node to the source node after the transmission, and if the data with the highest priority of the target node is sent to the source node and the priority of the data with the highest priority of the target node is higher than the priority of the residual data from the source node to the target node, the ACK frame also carries the data with the highest priority of the target node;
s3: after receiving the ACK frame sent by the target node, the source node performs the following operations:
s3.1: processing the data in the buffer to be sent according to the confirmation information mark in the ACK frame sent by the target node: deleting the data which is confirmed to be received by the target node from the to-be-sent buffer, and keeping the data which is not received by the target node in the to-be-sent buffer;
s3.2: if the source node finds that the ACK frame sent by the target node carries data, the step S3.3 is continued; otherwise, go to step S3.4;
s3.3: judging whether the target node allows the source node to continue sending: if the data is allowed to be sent to the target node, generating an ACK frame to be sent to the target node, and then performing step S4, wherein the ACK frame carries confirmation information of data sent by the target node, indication information of whether the target node is allowed to continue sending, a buffer empty/full flag to be sent from the source node to the target node after the current transmission, and the priority of the remaining data from the source node to the target node after the current transmission, and if the data with the highest priority of the source node is sent to the target node and the priority of the data with the highest priority of the source node is higher than the priority of the remaining data from the target node to the source node, the ACK frame also carries the data with the highest priority of the source node; if not, generating an ACK frame to be sent to the target node, and then performing step S4, wherein the ACK frame carries confirmation information of data sent by the target node, a buffer empty/full flag to be sent from the source node to the target node after the transmission, and a priority of the remaining data from the source node to the target node after the transmission;
s3.4: judging whether the target node allows the source node to continue sending: if the data is allowed to be sent to the target node, generating an ACK frame and sending the ACK frame to the target node, and then performing step S4, wherein the ACK frame carries indication information whether the target node is allowed to continue sending, a buffer empty/full flag to be sent from the source node to the target node after the current transmission and the priority of the remaining data from the source node to the target node after the current transmission, and if the data with the highest priority of the source node is sent to the target node and the priority of the data with the highest priority of the source node is higher than the priority of the remaining data from the target node to the source node, the ACK frame also carries the data with the highest priority of the source node; if not, ending;
s4: after receiving the ACK frame sent by the source node, the target node performs the following operations:
s4.1: processing the data in the buffer to be sent according to the confirmation information mark in the ACK frame sent by the source node: deleting the data which is confirmed to be received by the source node from the to-be-sent buffer, and reserving the data which is not received by the source node in the to-be-sent buffer;
s4.2: if the target node finds that the ACK frame sent by the source node carries data, the step S4.3 is continued; otherwise, go to step S4.4;
s4.3: judging whether the source node allows the target node to continue sending: if the data is allowed to be sent to the source node, generating an ACK frame and sending the ACK frame to the source node, and then returning to the step S3, wherein the ACK frame carries confirmation information of data sent by the source node, indication information of whether the data is allowed to be sent continuously by the source node, a buffer empty/full flag to be sent from the target node to the source node after the transmission, and the priority of the remaining data from the target node to the source node after the transmission, and if the data with the highest priority of the target node is sent to the source node and the priority of the data with the highest priority of the target node is higher than the priority of the remaining data from the source node to the target node, the data with the highest priority of the target node is also carried in the ACK frame; if not, generating an ACK frame to be sent to the source node, and then returning to the step S3, wherein the ACK frame carries confirmation information of data sent by the source node, a buffer empty/full flag to be sent from the target node to the source node after the transmission, and a priority of the remaining data from the target node to the source node after the transmission;
s4.4: judging whether the source node allows the target node to continue sending: if the data is allowed to be sent to the source node, generating an ACK frame and sending the ACK frame to the source node, and then returning to the step S3, wherein the ACK frame carries indication information whether the source node is allowed to continue sending, a buffer empty/full flag to be sent from the target node to the source node after the transmission and the priority of the remaining data from the target node to the source node after the transmission, and if the data with the highest priority of the target node is sent to the source node and the priority of the data with the highest priority of the target node is higher than the priority of the remaining data from the source node to the target node, the ACK frame also carries the data with the highest priority of the target node; if not, the process is ended.
Further, in step S1, if there is new data to be sent to the target node before the source node sends the data frame, the new data is framed together with the original data frame within a range not exceeding the maximum number of symbols, and the data frame to be sent is formed and sent to the target node.
Further, in the steps S2, S4.3 and S4.4, the indication information indicating whether the source node is allowed to continue sending is determined by the following method: if the buffer to be sent of the target node is not empty, the data with the highest priority of the target node is not the data sent to the source node, and the highest priority of the target node is higher than the priority of the residual data from the source node to the target node, indicating that the source node is not allowed to continue sending; otherwise, indicating the source node to allow the continuous transmission;
in steps S3.3 and S3.4, the indication information indicating whether the target node is allowed to continue sending is determined by the following method: if the buffer to be sent of the source node is not empty, the data with the highest priority of the source node is not the data sent to the target node, and the highest priority of the source node is higher than the priority of the residual data from the target node to the source node, indicating that the target node is not allowed to continue sending; otherwise, the target node is instructed to allow the transmission to continue.
Further, in step S2, if the data with the highest priority of the target node is the data sent to the source node, the priority of the data with the highest priority of the target node is higher than the priority of the remaining data from the source node to the target node, and the time domain length of the ACK frame carrying the data with the highest priority of the target node does not exceed the time domain boundary determined by the maximum symbol number, the ACK frame also carries the data with the highest priority of the target node;
in the steps S3.3 and S3.4, if the data with the highest priority of the source node is the data which is sent to the target node, the priority of the data with the highest priority of the source node is higher than the priority of the remaining data from the target node to the source node, and the time domain length of the ACK frame carrying the data with the highest priority of the source node does not exceed the time domain boundary determined by the maximum symbol number, the ACK frame also carries the data with the highest priority of the source node;
in the steps S4.3 and S4.4, if the data with the highest priority of the target node is the data which is sent to the source node, the priority of the data with the highest priority of the target node is higher than the priority of the remaining data from the source node to the target node, and the time domain length of the ACK frame carrying the data with the highest priority of the target node does not exceed the time domain boundary determined by the maximum symbol number, the ACK frame also carries the data with the highest priority of the target node.
Further, the maximum number of symbols is preset.
Further, the maximum symbol number is calculated according to statistical information of data arrival conditions of the source node, as shown in formula (1):
in formula (1), Smax is the maximum symbol number of channel resources that can be occupied by a source node, Prate is a statistically obtained data packet arrival rate, Lavg is an average packet length within a statistical time, t is a time domain length of each symbol, and Lreq is the symbol number of current data to be transmitted; [] Indicating rounding up and max indicating the maximum value.
Has the advantages that: the invention discloses an optimized wireless channel negotiation method, which has the following beneficial effects compared with the prior art:
1) the data transmission of the wireless communication node does not need to compete for the channel every time, the allocated data channel resources can be fully utilized, the negotiation times are reduced, the control information overhead on the negotiation channel is reduced, and the situation that the negotiation channel has higher collision probability to become a performance bottleneck because of more control information when the network load is larger is avoided;
2) the data transmission requirement and the data priority of the opposite end are considered during negotiation in the data transmission process, so that the high-priority data transmission requirement of the target communication node can be met in time.
Detailed Description
The technical solution of the present invention will be further described with reference to the following detailed description and the accompanying drawings.
The specific embodiment discloses an optimized wireless channel negotiation method, which comprises the following steps:
s1: after the source node applies to the data channel, the data frame is sent to the target node through the data channel, and a frame header of the data frame carries relevant information required by a frame body, a buffer empty-full mark to be sent from the source node to the target node after the transmission and the priority of the residual data from the source node to the target node after the transmission;
s2: after receiving a data frame sent by a source node, a target node generates an ACK frame and sends the ACK frame to the source node, wherein the ACK frame carries confirmation information of data sent by the source node, indication information of whether the source node is allowed to continue sending, a buffer empty/full flag to be sent from the target node to the source node after the transmission and the priority of the residual data from the target node to the source node after the transmission, and if the data with the highest priority of the target node is sent to the source node and the priority of the data with the highest priority of the target node is higher than the priority of the residual data from the source node to the target node, the ACK frame also carries the data with the highest priority of the target node;
s3: after receiving the ACK frame sent by the target node, the source node performs the following operations:
s3.1: processing the data in the buffer to be sent according to the confirmation information mark in the ACK frame sent by the target node: deleting the data which is confirmed to be received by the target node from the to-be-sent buffer, and keeping the data which is not received by the target node in the to-be-sent buffer;
s3.2: if the source node finds that the ACK frame sent by the target node carries data, the step S3.3 is continued; otherwise, go to step S3.4;
s3.3: judging whether the target node allows the source node to continue sending: if the data is allowed to be sent to the target node, generating an ACK frame to be sent to the target node, and then performing step S4, wherein the ACK frame carries confirmation information of data sent by the target node, indication information of whether the target node is allowed to continue sending, a buffer empty/full flag to be sent from the source node to the target node after the current transmission, and the priority of the remaining data from the source node to the target node after the current transmission, and if the data with the highest priority of the source node is sent to the target node and the priority of the data with the highest priority of the source node is higher than the priority of the remaining data from the target node to the source node, the ACK frame also carries the data with the highest priority of the source node; if not, generating an ACK frame to be sent to the target node, and then performing step S4, wherein the ACK frame carries confirmation information of data sent by the target node, a buffer empty/full flag to be sent from the source node to the target node after the transmission, and a priority of the remaining data from the source node to the target node after the transmission;
s3.4: judging whether the target node allows the source node to continue sending: if the data is allowed to be sent to the target node, generating an ACK frame and sending the ACK frame to the target node, and then performing step S4, wherein the ACK frame carries indication information whether the target node is allowed to continue sending, a buffer empty/full flag to be sent from the source node to the target node after the current transmission and the priority of the remaining data from the source node to the target node after the current transmission, and if the data with the highest priority of the source node is sent to the target node and the priority of the data with the highest priority of the source node is higher than the priority of the remaining data from the target node to the source node, the ACK frame also carries the data with the highest priority of the source node; if not, ending;
s4: after receiving the ACK frame sent by the source node, the target node performs the following operations:
s4.1: processing the data in the buffer to be sent according to the confirmation information mark in the ACK frame sent by the source node: deleting the data which is confirmed to be received by the source node from the to-be-sent buffer, and reserving the data which is not received by the source node in the to-be-sent buffer;
s4.2: if the target node finds that the ACK frame sent by the source node carries data, the step S4.3 is continued; otherwise, go to step S4.4;
s4.3: judging whether the source node allows the target node to continue sending: if the data is allowed to be sent to the source node, generating an ACK frame and sending the ACK frame to the source node, and then returning to the step S3, wherein the ACK frame carries confirmation information of data sent by the source node, indication information of whether the data is allowed to be sent continuously by the source node, a buffer empty/full flag to be sent from the target node to the source node after the transmission, and the priority of the remaining data from the target node to the source node after the transmission, and if the data with the highest priority of the target node is sent to the source node and the priority of the data with the highest priority of the target node is higher than the priority of the remaining data from the source node to the target node, the data with the highest priority of the target node is also carried in the ACK frame; if not, generating an ACK frame to be sent to the source node, and then returning to the step S3, wherein the ACK frame carries confirmation information of data sent by the source node, a buffer empty/full flag to be sent from the target node to the source node after the transmission, and a priority of the remaining data from the target node to the source node after the transmission;
s4.4: judging whether the source node allows the target node to continue sending: if the data is allowed to be sent to the source node, generating an ACK frame and sending the ACK frame to the source node, and then returning to the step S3, wherein the ACK frame carries indication information whether the source node is allowed to continue sending, a buffer empty/full flag to be sent from the target node to the source node after the transmission and the priority of the remaining data from the target node to the source node after the transmission, and if the data with the highest priority of the target node is sent to the source node and the priority of the data with the highest priority of the target node is higher than the priority of the remaining data from the source node to the target node, the ACK frame also carries the data with the highest priority of the target node; if not, the process is ended.
In step S1, if there is new data to be sent to the target node before the source node sends the data frame, the new data and the original data frame are framed together within a range not exceeding the maximum number of symbols, and a data frame to be sent is formed and sent to the target node.
In steps S2, S4.3 and S4.4, the indication information of whether the source node is allowed to continue sending is determined by the following method: if the buffer to be sent of the target node is not empty, the data with the highest priority of the target node is not the data sent to the source node, and the highest priority of the target node is higher than the priority of the residual data from the source node to the target node, indicating that the source node is not allowed to continue sending; otherwise, indicating the source node to allow the continuous transmission;
in steps S3.3 and S3.4, the indication information whether the target node is allowed to continue sending is determined by the following method: if the buffer to be sent of the source node is not empty, the data with the highest priority of the source node is not the data sent to the target node, and the highest priority of the source node is higher than the priority of the residual data from the target node to the source node, indicating that the target node is not allowed to continue sending; otherwise, the target node is instructed to allow the transmission to continue.
In step S2, if the data with the highest priority of the target node is the data sent to the source node, the priority of the data with the highest priority of the target node is higher than the priority of the remaining data from the source node to the target node, and the time domain length of the ACK frame carrying the data with the highest priority of the target node does not exceed the time domain boundary determined by the maximum symbol number, the ACK frame also carries the data with the highest priority of the target node;
in steps S3.3 and S3.4, if the data with the highest priority of the source node is the time domain boundary determined by the maximum symbol number, which is sent to the target node, the priority of the data with the highest priority of the source node is higher than the priority of the remaining data from the target node to the source node, and the time domain length of the ACK frame carrying the data with the highest priority of the source node does not exceed the maximum symbol number, the ACK frame also carries the data with the highest priority of the source node;
in steps S4.3 and S4.4, if the data with the highest priority of the target node is the time domain boundary determined by the maximum symbol number, which is sent to the source node, and the priority of the data with the highest priority of the target node is higher than the priority of the remaining data from the source node to the target node, and the time domain length of the ACK frame carrying the data with the highest priority of the target node does not exceed the maximum symbol number, the ACK frame also carries the data with the highest priority of the target node.
There are two ways to determine the maximum number of symbols: firstly, a static determination mode is adopted, namely the maximum symbol number is preset; the second is a dynamic determination mode, that is, the determination mode is calculated according to the statistical information of the data arrival condition of the source node, as shown in formula (1):
Smax=max([Prate×Lavg×t×100]×Lavg,Lreq)(1)
in the formula (1), Smax is the maximum number of symbols of a channel resource occupied by a source node, Prate is a data packet arrival rate obtained through statistics, Lavg is an average packet length in a statistical time, t is a time domain length of each symbol, and Lreq is the number of symbols of current data to be sent; [] Indicating rounding up and max indicating the maximum value.
The technical solution of the present invention is further described below by taking a wireless communication network as an example.
Fig. 1 is a wireless communication network in which there are 6 nodes, node a, node B, node C, node D, node E and node F. The connecting line between two adjacent nodes in fig. 1 indicates that the two nodes are adjacent nodes to each other. Each node is configured as shown in fig. 2, and can transmit and receive wireless signals to and from any direction by using an omni-directional antenna. Fig. 3 is a diagram illustrating NAV information maintenance.
Assuming that a node a has data with 5 symbols at a certain time and needs to send to a node B, the node a starts to apply for wireless channel resources, that is, the node a monitors and competes for a negotiation channel, if the competition is successful, the node a sends an RTS frame to the node B on the negotiation channel, and the RTS frame carries a time length 7 symbol for applying for occupying the data channel, a time length 100 symbol for occupying the data channel maximally, a selected data channel fd, and a destination address node B. Wherein, the 7 symbols comprise a frame header and an ACK frame length, and the time length of the maximum occupied data channel is determined by a static determination mode.
After receiving the RTS frame, the one-hop neighbor nodes E and F of the node a keep silent update on the data channel fd in the t-t +6 time period to their NAV1 information, and keep silent update on the data channel fd in the t-t +99 time period to their NAV2 information.
After receiving the RTS frame sent by the node a, the target communication node B queries NAV1 information of the data channel fd maintained by itself for discovery, and if fd is not occupied by other nodes after time t, the node B replies a CTS frame on the negotiation channel for confirmation, where the CTS frame carries the node a applying for occupying the data channel fd, the time period t-t +6 for applying for occupying the data channel, and the time period of occupying the maximum data channel is t-t + 99.
After receiving the CTS frame, the one-hop neighbor nodes C and D of the node B keep silent update on the data channel fd in the t-t +6 time period to their NAV1 information, and keep silent update on the data channel fd in the t-t +99 time period to their NAV2 information.
After receiving the CTS frame from the node B, the source communication node a finds that two additional packets of data are added to the data to be transmitted at this time, the length of each packet is 10 symbols and 20 symbols, the node a determines that the allocated time length 100 symbols is enough to carry the original 1 packet and the newly added 2 packets of data, the node a packs the 3 packets of data together, and carries the number of the packets of data in the header of the data frame as 3, the length of each packet is 5 symbols, 10 symbols and 20 symbols, and the buffer empty-full mark C from a to B to be transmitted is markedflagAfter all, the remaining data priority is set to be the lowest, and node a sends the data header together with the 3 packets of data to node B on data channel fd.
Assuming that a target communication node B successfully receives data sent by a node A, the node B generates corresponding ACK information, wherein the ACK information comprises response information of 3-packet data sent by the node A, assuming that only 2-th packet data is not successfully transmitted, the response information is ACK/Nack/ACK, if no other data is sent in a buffer to be sent of the node B, the ACK frame does not carry extra data information, and meanwhile, the ACK frame carries indication information allowing the node A to continue sending, a buffer to be sent from B to A after the current transmission is marked as empty, and the priority of the remaining data is lowest; after A receives the ACK, it directly starts the retransmission of the 2 nd data packet, and at the same time, the data packet number carried in the data frame head is 1, the length is 10 symbols, and A to B waiting buffer empty-full mark CflagAfter all, the remaining data priority is set to be the lowest, and node a sends the data header together with the 3 packets of data to node B on data channel fd. Assuming that the node B successfully receives the data and no other data needs to be sent, the node B generates corresponding ACK information without carrying the ACK informationAdditional data information, in addition, indication information which is allowed to be continuously sent by the node A, a buffer mark to be sent from B to A after the transmission is empty, and the priority of the residual data is the lowest; after the ACK is received, the transmission is completed.
Assuming that after receiving the data frame sent by the node a, the node B finds that only the 2 nd packet data is unsuccessfully transmitted and there are 15 symbols of data to be sent to the node a, the following information is carried in the ACK frame: acknowledgement information (Ack/Nack/Ack) of 3 data packets, data information of 15 symbols, indication information allowing the node a to continue sending, a buffer mark to be sent from B to a after the transmission is empty, and the priority of the remaining data is the lowest; assuming that the node a correctly receives the ACK frame, if a finds that data is sent along with the path, a generates a corresponding ACK frame, and meanwhile, finds that data indicating 10 symbols in the received ACK frame needs to be retransmitted, the ACK frame sent by a carries the following information: acknowledgement information (Ack) of 1 data packet, retransmission data information of 10 symbols, indication information allowing the node B to continue sending, a pending transmission buffer flag from a to B after the current transmission is empty, and the priority of the remaining data is lowest; if the B successfully receives the ACK frame, the B sends the ACK frame to the A for response, the frame carries acknowledgement information (ACK) of 1 data packet, indication information allowing the node A to continue sending, a buffer mark to be sent from the B to the A after the transmission is empty, and the priority of the residual data is the lowest; after receiving the ACK frame, the node a completes the transmission.
Assuming that the node B finds that all 3 data packets are successfully received, and meanwhile the to-be-sent buffered data of the node B includes data from B to a and data from B to C, but the data priority from B to C is high, the node B carries the following information in the ACK frame fed back to the node a: acknowledgement information (Ack/Ack) of 3 data packets, indication information which does not allow the node A to continue sending, a buffer mark to be sent from B to A after the current transmission is non-empty, and the priority of the remaining data is the priority of the data from B to A; after receiving the ACK frame, the node a finds that the transmission is not allowed to continue, and therefore does not care whether the buffer to be transmitted has data any more, and considers that the transmission is completed.
Assuming that after receiving the data frame sent by the node a, the node B finds that all 3 data packets are successfully received, and in addition, data with 25 symbols is to be sent to the node a, the following information is carried in the ACK frame: acknowledgement information (Ack/Ack) of 3 data packets, data information of 25 symbols, indication information allowing the node A to continue sending, a buffer mark to be sent from B to A after the transmission is empty, and the priority of the remaining data is the lowest; assuming that the node a correctly receives the ACK frame, if a finds that data is sent along with the path, a generates a corresponding ACK frame, and at the same time, a finds that new data of 12 symbols arrives in its own pending buffer, the ACK frame sent by a carries the following information: acknowledgement information (Ack) of 1 data packet, newly transmitted data information of 12 symbols, indication information allowing the node B to continue sending, a buffer mark to be sent from A to B after the current transmission is empty, and the priority of the residual data is the lowest; if the B successfully receives the ACK frame, the B sends the ACK frame to the A for response, the frame carries acknowledgement information (ACK) of 1 data packet, indication information allowing the node A to continue sending, a buffer mark to be sent from the B to the A after the transmission is empty, and the priority of the residual data is the lowest; after receiving the ACK frame, the node a completes the transmission.
After the data transmission is finished, the node again negotiates with the channel competition resource and negotiates with the data transmission resource of other nodes.
In addition, in some wireless systems, the longest frame may be constrained, and in the above example, assuming that the constrained node transmits a data frame of a maximum of 20 symbols at a time, the node needs to modify the pending buffer flag and the remaining data priority.