Data packet sending method, electronic equipment, storage medium, computer program product and application-specific integrated circuit chip
By sending send request messages multiple times on the sending end of the wireless communication device to ensure the response of the receiver, and dynamically adjusting the sending rate according to the duration of the transmission opportunity and the depth of the software queue, the TXOP interrupt problem caused by collision in noisy environments is solved, and the throughput efficiency of wireless communication is improved.
Patent Information
- Application Number
- CN202510110503.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-23
- Publication Date
- 2025-04-25
AI Technical Summary
In noisy environments, the RTS or CTS sent by the wireless communication device may collide with the packets of other devices, causing TXOP to be interrupted, thereby reducing throughput efficiency.
Before sending the data packet, the sending end ensures that the receiving end can receive and respond to sending the clear message, thereby avoiding collisions. At the same time, it is determined whether the current duration of the transmission opportunity is greater than the preset collision time threshold, and if it is greater than, a data packet is sent. If the software queue depth is greater than the preset depth threshold, the packet is sent at the normal rate, otherwise it is sent at the adjusted rate.
By avoiding TXOP interrupts caused by collisions, the transmitter can make full use of transmission opportunities and improve the throughput efficiency of wireless communications. Dynamically adjusting the sending rate also helps avoid the problem of interrupting the transmission opportunity because the software scheduling rate cannot keep up with the air interface rate.
Smart Images

Figure CN119893725A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of wireless communication technology, and in particular to a method for sending a data packet, an electronic device, a computer-readable storage medium, a computer program product, and a dedicated integrated circuit chip. Background Art
[0002] Wireless communication devices can use the CSMA (Carrier Sense Multiple Access) protocol to monitor the channel before sending data. If the channel is idle, the data is sent. If the channel is busy, the data is retried after waiting for a period of time. In the CSMA protocol, the sender of the data packet can send RTS (Request to Send). RTS contains the MAC (Media Access Control Address) address of the sender, the MAC address of the receiver, and the duration field (duration) to notify other wireless communication devices that the channel will be occupied in the next time period. After receiving RTS, the receiver can respond with CTS (Clear to Send). CTS also contains the duration field to notify other devices that do not need communication that the channel will be occupied in the next time period.
[0003] However, in a noisy environment, the RTS sent by the sender may collide with the message sent by other devices and thus cannot be received by the receiver; or the CTS sent by the receiver may collide with the message sent by other devices, causing other devices to not receive the CTS and give way. In this case, the sender cannot receive the feedback message during the process of sending the data packet because other devices do not give way, resulting in the interruption of TXOP (Transmission Opportunity).
[0004] Due to the interruption of TXOP, the transmitting end cannot fully utilize TXOP for data transmission, resulting in that the throughput efficiency of the transmitting end cannot be improved. Summary of the invention
[0005] The purpose of the embodiments of the present application is to provide a method for sending a data packet, an electronic device, a computer-readable storage medium, a computer program product, and a dedicated integrated circuit chip, which are used to improve the throughput efficiency of wireless communications in a noisy environment.
[0006] On the one hand, the present application provides a method for sending a data packet, which is applied to a sending end, comprising:
[0007] Sending a sending request message to a target receiving end;
[0008] Determining whether a send clear message corresponding to the send request message is received;
[0009] If so, determining whether the current duration of the transmission opportunity is greater than a preset collision time threshold;
[0010] If the current duration is not greater than the collision time threshold, returning to the step of sending a sending request message to the target receiving end;
[0011] If the current duration is greater than the collision time threshold, a data packet is sent.
[0012] In one embodiment, sending a data packet includes:
[0013] Determine whether the software queue depth is greater than a preset depth threshold;
[0014] If the software queue depth is greater than the depth threshold, sending the data packets in the hardware queue at a normal rate; wherein the normal rate is determined by a rate control algorithm;
[0015] If the software queue depth is not greater than the depth threshold, the data packets in the hardware queue are sent at an adjusted rate; wherein the adjusted rate is not higher than the normal rate.
[0016] In one embodiment, the method further comprises:
[0017] After any data packet is sent, the next data packet is transferred from the software queue to the hardware queue;
[0018] Determine whether the transmission opportunity has ended. If not, return to the step of determining whether the software queue depth is greater than a preset depth threshold. Otherwise, terminate the packet sending process.
[0019] In one embodiment, the step of acquiring the adjusted rate includes:
[0020] In the case where the transmission opportunity is interrupted prematurely, determine whether the interruption is caused by a collision;
[0021] If the interrupt is not caused by a collision, the current time interval is determined based on the historical time interval, the time point when the previous data packet is sent, and the time point when the next data packet arrives at the hardware queue;
[0022] Determine whether the current time interval is greater than zero, and if it is greater than zero, adjust the normal rate according to a preset speed reduction strategy to obtain the adjusted rate;
[0023] If it is not greater than zero, the normal rate is used as the adjusted rate.
[0024] In one embodiment, the step of obtaining the collision time threshold comprises:
[0025] In the case where the transmission opportunity is interrupted prematurely, determine whether the interruption is caused by a collision;
[0026] If the interruption is caused by a collision, the relative duration of the collision is determined by the start time of the transmission opportunity and the collision time point;
[0027] The collision time threshold is updated according to the relative duration of the current collision and the historical collision time threshold.
[0028] In one embodiment, before sending the sending request message to the target receiving end, the method further includes:
[0029] When there are data packets to be sent in the hardware queue, determine whether the channel is idle;
[0030] If the channel is not idle, the carrier sense multiple access backoff process is executed;
[0031] If the channel is idle, the step of sending a sending request message to the target receiving end is performed.
[0032] In one embodiment, the method further comprises:
[0033] If a sending clear message corresponding to the sending request message is not received, the sending process is terminated.
[0034] On the other hand, the present application provides an electronic device, the electronic device comprising:
[0035] processor;
[0036] a memory for storing processor-executable instructions;
[0037] Wherein, the processor is configured to execute the above-mentioned method for sending the data packet.
[0038] Furthermore, the present application provides a computer-readable storage medium, which stores a computer program, and the computer program can be executed by a processor to complete the above-mentioned method for sending a data packet.
[0039] In addition, the present application provides a computer program product, including a computer program / instruction, which implements the above-mentioned method for sending a data packet when executed by a processor.
[0040] In addition, the present application provides a dedicated integrated circuit chip, which is used to execute the above-mentioned data packet sending method.
[0041] In the solution of the present application, before starting to send a data packet, the transmitting end may send a sending request message multiple times (and also require the receiving end to return a sending clear message multiple times), to ensure that other wireless communication devices can receive the sending request message and / or send a sending clear message to avoid it, so that the data packet sent by the transmitting end will not be interrupted due to a collision that causes the transmitting end to be unable to receive a feedback message, thereby making full use of the current transmission opportunity to send packets, thereby effectively improving the throughput efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solution of the embodiments of the present application, the drawings required for use in the embodiments of the present application are briefly introduced below.
[0043] Figure 1 A schematic diagram of an application scenario of a method for sending a data packet provided in an embodiment of the present application;
[0044] Figure 2 A schematic diagram of the structure of an electronic device provided in one embodiment of the present application;
[0045] Figure 3 A schematic diagram of a network communication environment provided in an embodiment of the present application;
[0046] Figure 4 A schematic diagram of message collision provided in an embodiment of the present application;
[0047] Figure 5 A flowchart of a method for sending a data packet provided in an embodiment of the present application;
[0048] Figure 6 A schematic diagram of a flow chart of a method for dynamically adjusting a transmission rate provided in an embodiment of the present application;
[0049] Figure 7 A schematic diagram of the overall sending process of a data packet provided in an embodiment of the present application;
[0050] Figure 8 A schematic diagram of a flow chart of a method for obtaining an adjusted rate provided in an embodiment of the present application;
[0051] Fig. 9 A schematic diagram of a flow chart of a method for obtaining a collision time threshold provided in an embodiment of the present application;
[0052] Fig.10 A schematic diagram of a parameter adjustment process after a transmission opportunity is interrupted according to an embodiment of the present application;
[0053] Fig.11 A block diagram of a device for sending a data packet provided in one embodiment of the present application. DETAILED DESCRIPTION
[0054] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
[0055] Similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0056] Figure 1 Schematic diagram of an application scenario of the method for sending a data packet provided in an embodiment of the present application. Figure 1 As shown, there are multiple wireless communication devices 20 in the wireless communication network environment. The wireless communication device 20 can be a mobile phone, a tablet computer, a Bluetooth headset, a host, a server and other devices. When any wireless communication device 20 needs to send a data packet, it can use the data packet sending method provided by this solution to improve the throughput efficiency.
[0057] like Figure 2 As shown, this embodiment provides an electronic device 1, including: at least one processor 11 and a memory 12, Figure 2 A processor 11 is taken as an example. The processor 11 and the memory 12 are connected via a bus 10. The memory 12 stores instructions that can be executed by the processor 11. The instructions are executed by the processor 11 so that the electronic device 1 can execute all or part of the process of the method in the following embodiment. In one embodiment, the electronic device 1 can be the above-mentioned wireless communication device 20, which is used to execute the method for sending a data packet.
[0058] The memory 12 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable red-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, disk or optical disk.
[0059] The present application also provides a computer-readable storage medium, which stores a computer program. The computer program can be executed by the processor 11 to complete the method for sending a data packet provided in the present application.
[0060] The present application also provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the method for sending a data packet provided in the present application.
[0061] In addition, the present application provides an application specific integrated circuit (ASIC) chip, which is used to execute the method for sending a data packet provided in the present application.
[0062] See also Figure 3 , which is a schematic diagram of a network communication environment provided in an embodiment of the present application.
[0063] like Figure 3 As shown on the left, four wireless communication devices A, B, C, and D are not far apart. The large ellipse is the signal radiation range of the wireless communication devices. Figure 3 The signal radiation ranges of three wireless communication devices are drawn on the left, and these signal radiation ranges can cover four wireless communication devices. In this case, after any wireless communication device sends a message, the RSSI (Received Signal Strength Indication) of other wireless communication devices is higher than their respective CCA (Clear Channel Assessment) thresholds. At this time, the probability of the RTS or CTS sent by any wireless communication device colliding with the messages sent by other wireless communication devices is very low, and even if a collision occurs, it can be correctly avoided later.
[0064] However, if it is Figure 3 In the network communication environment on the right, since the four wireless communication devices A, B, C, and D are far apart, the signal radiation range of any wireless communication device cannot cover all wireless communication devices. In this case, after any wireless communication device sends a message, the RSSI of other wireless communication devices may be lower than the CCA threshold. At this time, the message may be treated as noise. Alternatively, A and C are in adjacent or overlapping frequency states.
[0065] When A needs to send data to B, and C needs to send data to D, collisions may occur because there are many wireless communication devices or because of overlapping adjacent frequencies. A and C both think that they have grabbed the channel and start transmitting messages. Or, A starts to send a message, but because C regards the message sent by A as noise, C will execute the process of sending a message to D. In this way, the signals overlap and cannot be received for B. In this case, the message currently sent by A cannot receive the feedback message returned by B; and the message currently sent by C is a send request message, and C cannot receive the send clear message. In another case, when the physical layer header of the message sent by A has been sent, C sends a message, so the overlapping and colliding part is the payload part of the data. In this case, one of A's data packets will be wrong, and C will try to re-back off and send due to interference.
[0066] See also Figure 4 , is a schematic diagram of message collision provided by an embodiment of the present application, such as Figure 4 As shown in the figure, when the physical layer headers of two messages collide, the two senders of the two messages do not receive the clear-to-send message, and both parties will back off and resend. When the physical layer headers of the two messages do not collide, one party can continue to send the message, and the other party will back off and resend.
[0067] See also Figure 5 , is a flow chart of a method for sending a data packet provided in an embodiment of the present application, such as Figure 5 As shown, the method may include the following steps 510-550.
[0068] Step 510: Send a sending request message to the target receiving end.
[0069] This solution is applied to a wireless communication device serving as a transmitting end.
[0070] The target receiving end is a wireless communication device that receives the message sent by the sending end.
[0071] When a message needs to be sent, the sender can send a send request message (Request to Send) to the target receiver.
[0072] After receiving the send request message, the target receiving end may respond to the send request message and return a clear to send message (Clear to Send).
[0073] Step 520: Determine whether a send clear message corresponding to the send request message is received.
[0074] After sending a sending request message, the sending end may determine whether a sending clear message corresponding to the sending request message is received.
[0075] On the one hand, if the send clear message corresponding to the send request message is not received, it can be considered that the target receiving end has not received the send request message or the target receiving end has not sent the send clear message normally. At this time, the data packet cannot be sent normally and the sending process can be terminated.
[0076] On the other hand, if a send clear message corresponding to the send request message is received, the subsequent step 530 may be continued.
[0077] Step 530: If yes, determine whether the current duration of the transmission opportunity is greater than a preset collision time threshold.
[0078] Each wireless communication device is configured with a corresponding collision time threshold, which indicates the time period when the wireless communication device, as a transmitter, sends messages after each transmission opportunity starts and is most likely to collide. The value range of the collision time threshold is not greater than 1 / N of the maximum duration of the transmission opportunity, where N can be configured as needed, and illustratively, N is a value among 10, 11, 12, etc.
[0079] The current duration of the transmission opportunity is the duration from the start of the current transmission opportunity to the current time point.
[0080] After determining that a send clear message corresponding to a send request message has been received, the sender may calculate the current duration of the transmission opportunity based on the current time point and the time point when this transmission opportunity starts, and determine whether the current duration is greater than a collision time threshold.
[0081] Step 540: If the current duration is not greater than the collision time threshold, return to the step of sending a sending request message to the target receiving end.
[0082] Step 550: If the current duration is greater than the collision time threshold, send a data packet.
[0083] On the one hand, if the current duration is not greater than the collision time threshold, it means that the send request message sent before the current time point may still collide with the message sent by other wireless communication devices, that is, other wireless communication devices may not have received the send request message sent before the current time point. In this case, if the data packet is sent directly, it may collide with the message sent by other wireless communication devices, causing the sender to interrupt the transmission opportunity after sending the data packet because no feedback message is received. Therefore, it is possible to return to step 510 and continue to send the send request message to the target receiving end. When the send request message is resent one by one, it is necessary to determine the remaining duration of this transmission opportunity based on the current duration of the transmission opportunity that has been consumed this time, and update it to the duration field in the send request message.
[0084] On the other hand, if the current duration is greater than the collision time threshold, it means that the probability that the send request message sent before the current time point is received by other wireless communication devices is very high. In this case, other wireless communication devices will give up the channel according to the CSMA avoidance mechanism. Therefore, the sender can start sending data packets.
[0085] Through the above measures, the sender can send a send request message multiple times before starting to send a data packet (and also require the receiver to return a send clear message multiple times), ensuring that other wireless communication devices can receive the send request message and / or send a clear message to avoid it, so that the data packet sent by the sender will not be interrupted due to a collision, resulting in the sender being unable to receive a feedback message and thus interrupting the transmission opportunity, so that the transmission opportunity can be fully utilized to send packets, effectively improving the throughput efficiency.
[0086] In one embodiment, before executing step 510, when there are data packets to be sent in the hardware queue (HardwareQueue) of the transmitting end, it can be determined whether the channel is idle. On the one hand, if the channel is not idle, the carrier sense multiple access backoff process can be executed to wait for the channel to enter the idle state. On the other hand, if the channel is idle, step 510 can be executed to start the message sending process.
[0087] Through the above measures, the wireless communication device as the sending end can start to compete for the channel when there are data packets to be sent in the hardware queue, and then start to send messages when the channel is idle.
[0088] If the wireless communication device cannot make full use of the transmission opportunity after grabbing the channel, the throughput efficiency cannot be improved. The data pre-fetching preparation of the wireless communication device and the speed of the subsequent pipeline must reach a certain value before the data packet can be sent normally. Especially in the current Wi-Fi system, the air interface rate is getting wider and wider, and 160 MHz / 320 MHz bandwidth is becoming more and more common, which requires a relatively high rate for the data path of the wireless communication device. Once the software scheduling rate of the wireless communication device cannot keep up with the Wi-Fi air interface transmission rate, the transmission opportunity will be interrupted, thereby giving up this transmission opportunity in advance. If the transmission opportunity is interrupted frequently because the software scheduling data packet rate cannot keep up with the air interface rate, it will have a direct impact on the TCP (Transmission Control Protocol) slow start. The transport layer will think that the underlying bandwidth is insufficient, thereby reducing the congestion window. The reduction of the congestion window will lead to insufficient data from the upper layer, resulting in earlier interruption of the transmission opportunity. This vicious cycle will cause a serious decrease in the throughput efficiency of the wireless communication device.
[0089] In one embodiment, in order to solve the problem that the transmission opportunity is interrupted because the rate of the software scheduled data packet cannot keep up with the air interface rate, the transmission rate of the Wi-Fi air interface can be dynamically adjusted during the process of executing step 550 to send the packet, see Figure 6 , is a flow chart of a method for dynamically adjusting a transmission rate provided in an embodiment of the present application, such as Figure 6 As shown, the sending rate is dynamically adjusted through the following steps 610 to 630.
[0090] Step 610: Determine whether the software queue depth is greater than a preset depth threshold.
[0091] The software queue depth (Software Queue Depth) indicates the number of data packets in the software queue (Software Queue).
[0092] The depth threshold can be configured as needed. For example, the depth threshold can be a value such as 1, 2 or 3.
[0093] When sending a data packet, it can be determined whether the current software queue depth is greater than a depth threshold, that is, whether the number of data packets in the software queue is greater than the number indicated by the depth threshold.
[0094] Step 620: If the software queue depth is greater than the depth threshold, send the data packets in the hardware queue at a normal rate; wherein the normal rate is determined by a rate control algorithm.
[0095] Step 630: If the software queue depth is not greater than the depth threshold, send the data packets in the hardware queue at an adjusted rate; wherein the adjusted rate is not higher than the normal rate.
[0096] In one case, if the current software queue depth is greater than the depth threshold, it means that there are enough data packets in the software queue for air interface transmission. At this time, the data packets in the hardware queue can be sent based on the normal rate. Among them, the wireless communication device determines the normal rate through the rate control algorithm (Rate Control). This part can refer to the relevant technology and will not be repeated here.
[0097] In another case, if the current software queue depth is not greater than the depth threshold, it means that the number of data packets in the software queue is small. At this time, if data packets continue to be sent at the normal rate, the rate of subsequent software-scheduled data packets may not keep up with the air interface sending rate and interrupt the transmission opportunity. Therefore, the data packets in the hardware queue can be sent at an adjusted rate that is lower than or equal to the normal rate, thereby reducing the air interface sending rate.
[0098] Through the above measures, the air interface sending rate can be dynamically adjusted according to the number of data packets in the software queue during the data packet sending process, thereby reducing the interface sending rate when the number of data packets in the software queue is small, giving the pipeline at the sending end more time to generate data packets, thereby avoiding the problem of interrupting transmission opportunities due to the software scheduling data packet rate being unable to keep up with the interface sending rate.
[0099] In one embodiment, after any data packet is sent, the sender may transfer the next data packet from the software queue to the hardware queue.
[0100] The sender can determine whether the transmission opportunity has ended. Here, based on the start time of this transmission opportunity and the current time point, the current duration of the transmission opportunity can be determined, and it can be determined whether the current duration has reached the maximum duration of the transmission opportunity. If the current duration has reached the maximum duration, the transmission opportunity has ended, and the packet sending process can be terminated at this time.
[0101] If the current duration does not reach the maximum duration and the transmission opportunity interruption is not triggered, it means that the current transmission opportunity has not ended. In this case, the process can return to step 610 to determine whether the current software queue depth is greater than the depth threshold, thereby starting a new round of rate adjustment process.
[0102] Through the above measures, the packet sending rate can be continuously adjusted during the packet sending process within the transmission opportunity.
[0103] See also Figure 7 , is a schematic diagram of the overall sending process of a data packet provided in an embodiment of the present application, such as Figure 7 As shown, as a wireless communication device, when the hardware queue depth is greater than 1, it can be considered that there are data packets to be sent in the hardware queue, and at this time it can be determined whether the channel is idle. On the one hand, if the channel is not idle, the carrier sense multiple access backoff process can be executed. On the other hand, if the channel is idle, a send request message for the target receiving end can be sent.
[0104] After sending a send request message, it can be determined whether a send clear message corresponding to the send request message is received. In one case, if the send clear message is not received, the send process can be terminated. On the other hand, if the send clear message is received, the current duration of the chance to pass on the world can be determined ( Figure 7 Is Now in greater than the collision time threshold ( Figure 7 in K).
[0105] If the current duration is not greater than the collision time threshold, the step of sending a request message to the target receiving end can be returned to. If the current duration is greater than the collision time threshold, preparations for sending a data packet can be started.
[0106] When sending a data packet, it can be determined whether the software queue depth is greater than the depth threshold ( Figure 7 The medium depth threshold is 1). On the one hand, if yes, the data packet is sent at the normal rate. On the other hand, if no, the data packet is sent at the adjusted rate.
[0107] After the current data packet is sent, the next data packet in the software queue can be moved to the hardware queue. Further, it is determined whether the transmission opportunity is over. If not, it returns to the step of determining whether the software queue depth is greater than the depth threshold, otherwise the sending process ends.
[0108] In one embodiment, see Figure 8 , is a flow chart of a method for obtaining an adjusted rate provided in an embodiment of the present application, such as Figure 8 As shown, the adjustment rate can be obtained through the following steps 810 to 840.
[0109] Step 810: When the transmission opportunity is interrupted prematurely, determine whether the interruption is caused by a collision.
[0110] After the transmission opportunity is interrupted, the duration of the transmission opportunity can be calculated according to the collision time point and the start time of the transmission opportunity, and it can be determined whether the duration reaches the maximum duration of the transmission opportunity.
[0111] On the one hand, if the duration reaches the maximum duration, it means that it is not an early interruption and no processing is required.
[0112] On the other hand, if the duration does not reach the maximum duration, it can be said that the transmission opportunity is interrupted in advance. At this time, it can be determined whether the interruption is caused by a collision. Exemplarily, it can be determined whether a corresponding feedback message is received after the last data packet is sent. In one case, if a feedback message is received, it means that the interruption is not caused by a collision, but is caused by the rate of the software scheduling data packet not keeping up with the air interface rate. At this time, step 820 can be executed. In another case, if no feedback message is received, it means that the interruption is caused by a collision. At this time, the collision time threshold needs to be updated. The update process refers to the relevant description below and is not repeated here.
[0113] Step 820: If the interrupt is not caused by a collision, determine the current time interval based on the historical time interval, the time point when the previous data packet is sent, and the time point when the next data packet arrives at the hardware queue.
[0114] When the interrupt is not caused by a collision, the time point when the previous data packet is sent and the time point when the next data packet arrives at the hardware queue can be used to determine the difference between the latter and the former, which is used as the current time interval.
[0115] The historical time interval is the latest current time interval calculated previously. In other words, the calculated current time interval is used as the historical time interval when a new current time interval is calculated next time. In the initial case, the historical time interval is zero.
[0116] The current time interval can be obtained by taking a weighted sum of the current time interval and the historical time interval.
[0117] Exemplarily, the calculation process of the current time interval can be expressed by the following formula (1):
[0118] T gap =α*(T1-T0)+β*T gap′ (1)
[0119] Among them, T gap Indicates the current time interval; T1 indicates the time point when the next data packet arrives at the hardware queue; T0 indicates the time point when the previous data packet is sent; T gap′ represents the historical time interval; α and β are weight coefficients, which can be configured as needed. For example, α=1 / 8, β=7 / 8.
[0120] Step 830: Determine whether the current time interval is greater than zero. If it is greater than zero, adjust the normal rate according to a preset speed reduction strategy to obtain an adjusted rate.
[0121] Step 840: If it is not greater than zero, use the normal rate as the adjusted rate.
[0122] After calculating the current time interval, it can be determined whether the current time interval is greater than zero. On the one hand, if it is greater than zero, it means that the difference between the time point when the next data packet arrives at the hardware queue and the time point when the previous data packet is completed is large, that is, the rate of the software-scheduled data packet lags behind the air interface packet sending rate. In this case, the normal rate needs to be adjusted with a speed reduction strategy to obtain the adjusted rate. Exemplarily, the normal rate can be reduced by one level, or the normal rate can be reduced according to a set ratio or a set value to obtain the adjusted rate. Alternatively, on the basis of the normal rate, according to the number of interruptions caused by non-collision, the normal rate is reduced by several levels or several ratios or several values to obtain the adjusted rate. Here, the adjusted speed is not lower than the specified rate lower limit (for example: the specified rate lower limit is 80% of the normal rate).
[0123] On the other hand, if it is not greater than zero, it means that the difference between the time point when the next data packet arrives at the hardware queue and the time point when the previous data packet is sent is small, that is, the rate of software-scheduled data packets lags behind the air interface packet sending rate by much. In this case, the normal rate can be used as the adjusted rate, that is, the adjusted rate is equal to the normal rate.
[0124] Through the above measures, when the transmission opportunity is interrupted because the software scheduling rate cannot keep up with the air interface rate, the adjusted rate can be effectively determined based on the normal rate. When the software scheduling rate is close to the air interface packet sending rate, the normal rate can be directly used as the adjusted rate.
[0125] In one embodiment, see Fig. 9 , is a flow chart of a method for obtaining a collision time threshold provided in an embodiment of the present application, such as Fig. 9 As shown, the method may include the following steps 910 to 930.
[0126] Step 910: When the transmission opportunity is interrupted prematurely, determine whether the interruption is caused by a collision.
[0127] After the transmission opportunity is interrupted, the duration of the transmission opportunity can be calculated according to the collision time point and the start time of the transmission opportunity, and it can be determined whether the duration reaches the maximum duration of the transmission opportunity.
[0128] On the one hand, if the duration reaches the maximum duration, it means that it is not an early interruption and no processing is required.
[0129] On the other hand, if the duration does not reach the maximum duration, it may indicate that the transmission opportunity is interrupted in advance. At this point, it may be determined whether the interruption is caused by a collision. Exemplarily, it may be determined whether a corresponding feedback message is received after the last data packet is sent. In one case, if a feedback message is received, it indicates that the interruption is not caused by a collision, but is caused by the rate of the software-scheduled data packet not keeping up with the air interface rate. At this point, the adjusted rate may be determined. For details, see the above description. In another case, if no feedback message is received, it indicates that the interruption is caused by a collision. At this point, step 920 may be executed to update the collision time threshold.
[0130] Step 920: If the interruption is caused by a collision, the relative duration of the collision is determined based on the start time of the transmission opportunity and the collision time point.
[0131] Step 930: Update the collision time threshold according to the relative duration of the current collision and the historical collision time threshold.
[0132] When the interruption is caused by a collision, the collision time point minus the start time of the transmission opportunity can be used to obtain the relative duration of the collision. Here, the relative duration of the collision refers to the duration of the collision time point relative to the start time of the transmission opportunity.
[0133] The historical collision time threshold is the latest collision time threshold calculated previously. In other words, the calculated collision time threshold is used as the historical collision time threshold when a new collision time threshold is calculated next time. In the initial case, the historical collision time threshold is the transmission time of a normal data packet.
[0134] The collision time threshold can be obtained by taking a weighted sum of the relative duration of the current collision and the historical collision time threshold.
[0135] Exemplarily, the calculation process of the collision time threshold can be expressed by the following formula (2):
[0136] K=γ*(T e -T s )+σ*K′ (2)
[0137] Where K represents the collision time threshold; T e Indicates the collision time point; T s represents the start time of the transmission opportunity; K' represents the historical collision time threshold; γ and σ are weight coefficients, which can be configured as needed. For example, γ = 1 / 8, σ = 7 / 8.
[0138] Through the above measures, when a transmission opportunity is interrupted due to a collision, the collision time threshold can be adjusted so that the collision probability can be reduced based on the updated collision time threshold later.
[0139] See also Fig.10 , is a schematic diagram of a parameter adjustment process after a transmission opportunity interruption provided by an embodiment of the present application, such as Fig.10 As shown, during the packet sending process, it can be determined whether the transmission opportunity has ended. When the transmission opportunity has ended, it can be determined whether the duration of the transmission opportunity has reached the maximum duration.
[0140] On the one hand, if it is achieved, it means that the transmission opportunity is fully utilized and no parameter adjustment is required. On the other hand, if it is not achieved, it can be determined whether a feedback message (BA / ACK) is received.
[0141] In the case where no feedback message is received, it indicates that the transmission opportunity is interrupted due to a collision, and the collision time threshold may be updated at this time.
[0142] In the case of receiving feedback messages, it means that the transmission opportunity is interrupted because the software scheduling rate cannot keep up with the air interface rate. At this time, the current time interval can be updated and it can be determined whether the current time interval is greater than zero. In one case, the current time interval is greater than zero, and the normal rate can be reduced to obtain the adjusted rate. In another case, the current time interval is not greater than zero, and the normal rate can be used as the adjusted rate.
[0143] Fig.11is a block diagram of a device for sending a data packet according to an embodiment of the present invention, such as Fig.11 As shown, the device may include:
[0144] A first sending module 1110, configured to send a sending request message to a target receiving end;
[0145] A first determination module 1120 is used to determine whether a send clear message corresponding to the send request message is received;
[0146] The second determination module 1130 is configured to determine whether the current duration of the transmission opportunity is greater than a preset collision time threshold;
[0147] A return module 1140 is configured to return to the step of sending a sending request message to a target receiving end if the current duration is not greater than the collision time threshold;
[0148] The second sending module 1150 is configured to send a data packet if the current duration is greater than the collision time threshold.
[0149] The implementation process of the functions and effects of each module in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method for sending data packets, and will not be repeated here.
[0150] In several embodiments provided in the present application, the disclosed devices and methods may also be implemented in other ways. The device embodiments described above are merely schematic, for example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to the multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram may represent a module, a program segment or a part of a code, and a module, a program segment or a part of a code contains one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the box may also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they may sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of boxes in the block diagram and / or the flowchart, can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0151] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0152] If the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program code.
Claims
1. A method for sending a data packet, applied to a sending end, characterized in that: include: Sending a sending request message to a target receiving end; Determining whether a send clear message corresponding to the send request message is received; If so, determining whether the current duration of the transmission opportunity is greater than a preset collision time threshold; If the current duration is not greater than the collision time threshold, returning to the step of sending a sending request message to the target receiving end; If the current duration is greater than the collision time threshold, a data packet is sent.
2. The method according to claim 1, characterized in that: The sending of the data packet comprises: Determine whether the software queue depth is greater than a preset depth threshold; If the software queue depth is greater than the depth threshold, sending the data packets in the hardware queue at a normal rate; wherein the normal rate is determined by a rate control algorithm; If the software queue depth is not greater than the depth threshold, the data packets in the hardware queue are sent at an adjusted rate; wherein the adjusted rate is not higher than the normal rate.
3. The method according to claim 2, characterized in that The method further comprises: After any data packet is sent, the next data packet is transferred from the software queue to the hardware queue; Determine whether the transmission opportunity has ended. If not, return to the step of determining whether the software queue depth is greater than a preset depth threshold. Otherwise, terminate the packet sending process.
4. The method according to claim 2, characterized in that: The step of obtaining the adjusted rate includes: In the case where the transmission opportunity is interrupted prematurely, determine whether the interruption is caused by a collision; If the interrupt is not caused by a collision, the current time interval is determined based on the historical time interval, the time point when the previous data packet is sent, and the time point when the next data packet arrives at the hardware queue; Determine whether the current time interval is greater than zero, and if it is greater than zero, adjust the normal rate according to a preset speed reduction strategy to obtain the adjusted rate; If it is not greater than zero, the normal rate is used as the adjusted rate.
5. The method according to claim 1, characterized in that The step of obtaining the collision time threshold comprises: In the case where the transmission opportunity is interrupted prematurely, determine whether the interruption is caused by a collision; If the interruption is caused by a collision, the relative duration of the collision is determined by the start time of the transmission opportunity and the collision time point; The collision time threshold is updated according to the relative duration of the current collision and the historical collision time threshold.
6. The method according to claim 1, characterized in that Before sending the sending request message to the target receiving end, the method further includes: When there are data packets to be sent in the hardware queue, determine whether the channel is idle; If the channel is not idle, the carrier sense multiple access backoff process is executed; If the channel is idle, the step of sending a sending request message to the target receiving end is performed.
7. The method according to claim 1, characterized in that The method further comprises: If a sending clear message corresponding to the sending request message is not received, the sending process is terminated.
8. An electronic device, characterized in that: The electronic device comprises: processor; a memory for storing processor-executable instructions; The processor is configured to execute the method for sending a data packet as described in any one of claims 1-7.
9. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and the computer program can be executed by a processor to complete the method for sending a data packet as described in any one of claims 1-7.
10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the method for sending a data packet described in any one of claims 1 to 7 is implemented.
11. A dedicated integrated circuit chip, characterized in that: The dedicated integrated circuit chip is used to execute the method for sending a data packet as described in any one of claims 1-7.