Methods, devices, electronic equipment and storage media for message transmission
By acquiring the packet transmission rate and determining the cutoff time in a wireless network environment, iterative scheduling of packets is achieved, and the problem of packet loss in the prior art is solved, and broadband utilization and equipment performance are improved.
Patent Information
- Application Number
- CN202211056200.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-31
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2042-08-31
AI Technical Summary
The prior art is too sensitive to packet loss in wireless network environments, resulting in poor performance and low broadband utilization.
By obtaining the current message transmission rate, the cut-off time of this message scheduling is determined, and the message to be transmitted is sent at the message transmission rate before the cut-off time, realizing iterative scheduling.
Maximize broadband utilization, improve broadband utilization, and reduce the CPU pressure of the device to avoid the performance pressure caused by precise scheduling.
Smart Images

Figure CN115426689B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a message transmission method, device, electronic equipment and storage medium. Background Art
[0002] In a P2P network, message transmission is a reliable transmission process based on the UDP protocol. The congestion control algorithm used in the entire transmission process has a significant impact on the performance of the transmission. Currently, the congestion control algorithms used by well-known network reliable transmission solutions such as the TCP protocol are all based on packet loss detection algorithms, such as Reno and Cubic. The basic principle of these algorithms is to regard packet loss as a sign of congestion in the network link, which means reducing the transmission rate after detecting packet loss. However, the disadvantage of these algorithms is that they are too sensitive to packet loss. In a wireless network environment where random packet loss is often caused by channel noise, the performance is poor and the bandwidth utilization is low. Nowadays, the use of wireless networks is becoming more and more common, and these algorithms are difficult to adapt to the current network usage environment. Summary of the invention
[0003] In order to solve the above-mentioned technical problems of being overly sensitive to packet loss, poor performance in a wireless network environment where random packet loss is often caused by channel noise, and low bandwidth utilization, the embodiments of the present invention provide a message transmission method, device, electronic device, and storage medium. The specific technical solution is as follows:
[0004] In a first aspect of an embodiment of the present invention, a method for transmitting a message is first provided, the method comprising:
[0005] In the case of triggering message scheduling, obtaining a current message sending rate, wherein the message sending rate is determined by a target congestion control algorithm based on an evaluated bandwidth;
[0006] Determine the deadline for this message scheduling, and iterate according to the following steps until the sending time of the next message to be transmitted is greater than or equal to the deadline, and then stop this message scheduling:
[0007] Obtaining the sending time of the message to be transmitted, and sending the message to be transmitted in this message scheduling;
[0008] The sending time of the next message to be transmitted is determined according to the sending time of the message to be transmitted, the message size, and the message sending rate.
[0009] In an optional implementation manner, determining the deadline for current message scheduling includes:
[0010] Get the current time;
[0011] Determine the scheduling duration of this message scheduling;
[0012] The sum of the current time and the scheduling duration is obtained to obtain the deadline for this message scheduling.
[0013] In an optional implementation manner, determining the scheduling duration of the current message scheduling includes:
[0014] Obtaining a current minimum round trip delay, wherein the minimum round trip delay is determined by the target congestion control algorithm;
[0015] A preset scheduling time interval is obtained, and a minimum value is selected from the minimum round-trip delay and the preset scheduling time interval as the scheduling duration of this message scheduling.
[0016] In an optional implementation manner, selecting a minimum value from the minimum round-trip delay and the preset scheduling time interval as the scheduling duration of this message scheduling includes:
[0017] The product of the minimum round-trip delay and the preset gain factor is obtained, and a minimum value is selected from the product and the preset scheduling time interval as the scheduling duration of this message scheduling.
[0018] In an optional implementation, after sending the message to be transmitted in this message scheduling, the method further includes:
[0019] The number of message dispatches for this message dispatch is increased by one;
[0020] After stopping the current message scheduling, the method further includes:
[0021] Returns the number of messages scheduled for this message scheduling.
[0022] In an optional implementation, the acquiring the sending time of the message to be transmitted includes:
[0023] If the message to be transmitted is the first message to be transmitted in this message scheduling, the current time is used as the sending time of the message to be transmitted;
[0024] If the message to be transmitted is not the first message to be transmitted in the current message scheduling, the sending time of the next message to be transmitted determined in the previous iteration is used as the sending time of the message to be transmitted.
[0025] In an optional embodiment, the method further comprises:
[0026] When the target congestion control algorithm is in a startup state or a cyclic bandwidth detection state, monitoring whether a network link has packet loss;
[0027] If packet loss occurs, the number of completed message scheduling, the packet loss rate of message transmission, and the amount of data successfully transmitted are determined from the moment of packet retransmission;
[0028] Determining whether the target congestion control algorithm meets the state transition requirement according to the completion times, the packet loss rate and the data volume;
[0029] If the target congestion control algorithm meets the state transition requirement, transferring the target congestion control algorithm to a packet loss avoidance state;
[0030] When the target congestion control algorithm is in a packet loss avoidance state, keeping the bottleneck bandwidth and the sending rate gain factor of the target congestion control algorithm unchanged;
[0031] After a preset time period, the target congestion control algorithm is transferred to the cyclic bandwidth detection state.
[0032] In an optional implementation, judging whether the target congestion control algorithm meets the state transition requirement according to the number of completions, the packet loss rate, and the data volume includes:
[0033] If the completion number is between the first preset completion number and the second preset completion number, and the data volume is greater than the first threshold, and the packet loss rate is greater than the second threshold, it is determined that the target congestion control algorithm meets the state transfer requirements.
[0034] In an optional embodiment, the method further comprises:
[0035] If the completion times are greater than the second preset completion times, the packet loss record is cleared, and the process jumps to the step of monitoring whether packet loss occurs in the network link when the target congestion control algorithm is in the startup state or the cyclic bandwidth detection state.
[0036] In an optional implementation, before transferring the target congestion control algorithm to a packet loss avoidance state, the method further includes:
[0037] Determine the state transition time at which the target congestion control algorithm meets the state transition requirements, and obtain the target time period from the moment of packet loss retransmission to the state transition time;
[0038] An average message sending rate within the target time is determined, and the bottleneck bandwidth of the target congestion control algorithm is changed to the average message sending rate.
[0039] In a second aspect of the embodiments of the present invention, a message transmission device is further provided, the device comprising:
[0040] A rate acquisition module, used to acquire a current message sending rate when message scheduling is triggered, wherein the message sending rate is determined by a target congestion control algorithm based on an evaluated bandwidth;
[0041] A time determination module is used to determine the deadline for this message scheduling;
[0042] The iterative module is used to iterate according to the following steps until the sending time of the next message to be transmitted is greater than or equal to the deadline, and the message scheduling is stopped: obtaining the sending time of the message to be transmitted, and sending the message to be transmitted in this message scheduling; determining the sending time of the next message to be transmitted according to the sending time of the message to be transmitted, the message size, and the message sending rate.
[0043] In a third aspect of an embodiment of the present invention, there is further provided an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0044] Memory, used to store computer programs;
[0045] The processor is used to implement the message transmission method described in any one of the first aspects above when executing the program stored in the memory.
[0046] In a fourth aspect of an embodiment of the present invention, a storage medium is further provided, wherein instructions are stored in the storage medium, and when the storage medium is run on a computer, the computer executes the message transmission method described in any one of the first aspects above.
[0047] In a fifth aspect of the embodiments of the present invention, a computer program product comprising instructions is also provided, which, when executed on a computer, enables the computer to execute any of the above-mentioned message transmission methods.
[0048] The technical solution provided by the embodiment of the present invention, in the case of triggering message scheduling, obtains the current message sending rate, wherein the message sending rate is determined by the target congestion control algorithm based on the evaluated bandwidth, determines the deadline of this message scheduling, and iterates according to the following steps until the sending time of the next message to be transmitted is greater than or equal to the deadline, and stops this message scheduling: obtains the sending time of the message to be transmitted, and sends the message to be transmitted in this message scheduling; determines the sending time of the next message to be transmitted according to the sending time, message size, and message sending rate of the message to be transmitted. In this way, in the case of triggering message scheduling, obtains the current message sending rate determined by the target congestion control algorithm based on the evaluated bandwidth, determines the deadline of this message scheduling, and sends the message to be transmitted at the message sending rate before the deadline, which can maximize the use of broadband and improve broadband utilization. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0050] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0051] Figure 1 A schematic diagram of an implementation flow of a message transmission method shown in an embodiment of the present invention;
[0052] Figure 2 Schematic diagram of an implementation flow of a method for determining the deadline of message scheduling in an embodiment of the present invention;
[0053] Figure 3 Schematic diagram of an implementation flow of a method for determining the scheduling duration of this message scheduling shown in an embodiment of the present invention;
[0054] Figure 4 This is a schematic diagram showing a case where Next-send-time is less than the current time in an embodiment of the present invention;
[0055] Figure 5 It is a schematic diagram of an implementation flow of another message transmission method shown in an embodiment of the present invention;
[0056] Figure 6 A schematic diagram of an implementation flow of a target congestion algorithm control method shown in an embodiment of the present invention;
[0057] Figure 7 A schematic diagram of a BBR algorithm state transition shown in an embodiment of the present invention;
[0058] Figure 8 A schematic diagram of a process for controlling the state transition of a BBR algorithm shown in an embodiment of the present invention;
[0059] Fig. 9 A schematic diagram of the structure of a message transmission device shown in an embodiment of the present invention;
[0060] Fig.10 It is a schematic diagram of the structure of another electronic device shown in an embodiment of the present invention. DETAILED DESCRIPTION
[0061] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0062] In the embodiment of the present invention, the BBR (Bottleneck Bandwidth and Round-trip) algorithm is a congestion control algorithm based on broadband estimation. Compared with the traditional congestion control algorithm, it does not regard packet loss as a sign of network congestion, but relies on the estimated bandwidth to control the transmission rate, which enables the BBR algorithm to utilize more bandwidth in wireless network environments and weak network environments with more packet loss, and achieve better transmission performance.
[0063] Among them, the BBR algorithm is a congestion control algorithm based on broadband estimation, and its core lies in controlling the transmission rate according to the estimated bandwidth. During operation, the BBR algorithm will continuously update the estimated bandwidth value and give the current sending rate, which is recorded as pacing_rate. In order to prevent multiple messages from being sent at once in an instant, the BBR algorithm requires that the sending time of each message must be accurately scheduled according to pacing_rate. Specifically, assuming that the length of a message to be sent is packet_size, the earliest sending time of the next message is next_send_time = now + packet_size ÷ pacing_rate, and now is the current time.
[0064] In actual transmission, the size of each message is limited by the MTU size of the underlying network, which is generally 1500 bytes at most. When the pacing_rate value is large and the transmission rate is high, the scheduling interval of (for example, data) messages will be very small, even less than 1ms. Since the algorithm needs to run in user mode rather than kernel mode, it is not only difficult to implement microsecond-level precise scheduling in user mode, but also has high requirements on device performance. In P2P networks, there are generally low-performance devices using ARM and MIPS architecture chips, which cannot withstand the performance pressure brought by precise scheduling.
[0065] Given the low performance of actual devices, it is not realistic to perform completely accurate scheduling. Therefore, it is necessary to appropriately sacrifice the time accuracy of scheduling and perform coarse-grained scheduling for message sending. When scheduling to send messages each time, multiple messages can be sent at one time, and the time interval between each scheduling can be appropriately expanded to reduce CPU pressure. The usual way to implement scheduling is to trigger message scheduling at fixed intervals, and other events can also be used to trigger message scheduling during the interval.
[0066] Based on the above idea, when message scheduling is triggered, the current message sending rate is obtained, wherein the message sending rate is determined by the target congestion control algorithm (such as the above BBR algorithm) based on the evaluated bandwidth, the deadline of this message scheduling is determined, and iterates according to the following steps until the sending time of the next message to be transmitted is greater than or equal to the deadline, and then stops this message scheduling: obtain the sending time of the message to be transmitted, and send the message to be transmitted in this message scheduling; determine the sending time of the next message to be transmitted according to the sending time of the message to be transmitted, the message size, and the message sending rate.
[0067] In this way, when message scheduling is triggered, the current message sending rate determined by the target congestion control algorithm based on the evaluated bandwidth is obtained, the deadline for this message scheduling is determined, and the messages to be transmitted are sent at the message sending rate before the deadline. This can not only maximize the use of broadband and improve broadband utilization, but also reduce the CPU pressure of the device, so that the device does not have to bear the performance pressure brought by precise scheduling.
[0068] Specifically, Figure 1 As shown, it is a schematic diagram of an implementation flow of a message transmission method provided by an embodiment of the present invention. The method is applied to an electronic device and may specifically include the following steps:
[0069] S101, when message scheduling is triggered, obtaining a current message sending rate, wherein the message sending rate is determined by a target congestion control algorithm based on an evaluated bandwidth.
[0070] In the embodiment of the present invention, message scheduling can be triggered once every fixed time interval, so that when message scheduling is triggered, the current message sending rate can be obtained, wherein the message sending rate is determined by the target congestion control algorithm based on the evaluated bandwidth. In addition, message scheduling can also be triggered by the occurrence of other events during the interval.
[0071] For example, in an embodiment of the present invention, message scheduling is triggered once every 1 second, so that when message scheduling is triggered, the current message sending rate is obtained, wherein the BBR algorithm continuously updates the estimated bandwidth value during operation and gives the current message sending rate, which is recorded as pacing_rate.
[0072] S102, determining the deadline for this message scheduling, and iterating according to the following steps until the sending time of the next message to be transmitted is greater than or equal to the deadline, and then stopping this message scheduling.
[0073] S103, obtaining a sending time of the message to be transmitted, and sending the message to be transmitted in this message scheduling.
[0074] S104: Determine the sending time of the next message to be transmitted according to the sending time of the message to be transmitted, the message size, and the message sending rate.
[0075] In the embodiment of the present invention, when message scheduling is triggered, the current message sending rate is obtained on the one hand, and the deadline of this message scheduling is determined on the other hand. The deadline here means that during the process of this message scheduling, if the sending time of a message to be transmitted is greater than or equal to the deadline, the message scheduling is stopped.
[0076] Based on this, in an embodiment of the present invention, iterations are performed according to the following steps until the sending time of the next message to be transmitted is greater than or equal to the deadline, and the message scheduling is stopped: obtaining the sending time of the message to be transmitted, and sending the message to be transmitted in this message scheduling; determining the sending time of the next message to be transmitted based on the sending time of the message to be transmitted, the message size, and the message sending rate.
[0077] Among them, for the message to be transmitted, if the message to be transmitted is the first message to be transmitted in this message scheduling, the current time is used as the sending time of the message to be transmitted; if the message to be transmitted is not the first message to be transmitted in this message scheduling, the sending time of the next message to be transmitted determined in the previous iteration is used as the sending time of the message to be transmitted.
[0078] For example, if the current time is 10:00:00 and the deadline for this message scheduling is determined to be 10:00:01, then for the first message to be transmitted in this message scheduling, its sending time is the current time 10:00:00, and this message will be sent in this message scheduling. The size of the first message to be transmitted is packet_size 1 , then the sending time of the next message to be transmitted after the first message to be transmitted is 10:00:00 + packet_size 1 / pacing_rate. For the next packet to be transmitted after the first packet to be transmitted, that is, the second packet to be transmitted, its sending time is 10:00:00 + packet_size 1 / pacing_rate, if it is not greater than or equal to the deadline of this message scheduling, 10:00:01, the second message to be transmitted will also be sent in this message scheduling, and the size of the second message to be transmitted is packet_size 2 , then the sending time of the next message to be transmitted of the second message to be transmitted is 10:00:00 + packet_size 1 / pacing_rate+packet_size 2 / pacing_rate.
[0079] In this way, the above steps are continuously iterated until the sending time of the next message to be transmitted of the message to be transmitted in a certain iteration process is greater than or equal to the deadline time 10:00:01 of this message scheduling, so the current message scheduling can be stopped.
[0080] Through the above description of the technical solution provided by the embodiment of the present invention, when message scheduling is triggered, the current message sending rate is obtained, wherein the message sending rate is determined by the target congestion control algorithm based on the evaluated bandwidth, the deadline of this message scheduling is determined, and iterates according to the following steps until the sending time of the next message to be transmitted is greater than or equal to the deadline, and then the message scheduling is stopped: the sending time of the message to be transmitted is obtained, and the message to be transmitted is sent in this message scheduling; according to the sending time of the message to be transmitted, the message size, and the message sending rate, the sending time of the next message to be transmitted is determined.
[0081] In this way, when message scheduling is triggered, the current message sending rate determined by the target congestion control algorithm based on the evaluated bandwidth is obtained, the deadline for this message scheduling is determined, and the messages to be transmitted are sent at the message sending rate before the deadline. This can not only maximize the use of broadband and improve broadband utilization, but also reduce the CPU pressure of the device, so that the device does not have to bear the performance pressure brought by precise scheduling.
[0082] In the above step S102, the deadline for this message scheduling can be as follows: Figure 2 As shown, it is a schematic diagram of an implementation flow of a method for determining the deadline of message scheduling provided by an embodiment of the present invention. The method may specifically include the following steps:
[0083] S201, obtaining the current time.
[0084] S202, determine the scheduling duration of this message scheduling.
[0085] In an embodiment of the present invention, when message scheduling is triggered, it means that the message scheduling is to be carried out. At this time, the current time can be obtained. For the current time, on the one hand, it serves as the sending time of the first message to be transmitted in this message scheduling, and on the other hand, it serves as the starting time of this message scheduling, which is used to determine the end time of this message scheduling.
[0086] In addition, in the embodiment of the present invention, it is also necessary to determine the scheduling duration of this message scheduling, which is used to characterize the duration of this message scheduling. Here, the scheduling duration can be an empirical value. Of course, the scheduling duration can also be determined by subsequent methods. The embodiment of the present invention does not limit this.
[0087] For example, obtaining the current time 10:00:00 and determining the scheduling duration of this message scheduling to be 1 second means that starting from 10:00:00, the duration of this message scheduling is 1 second. If it exceeds 1 second, this message scheduling will automatically end.
[0088] Among them, the scheduling duration of this message scheduling can be determined as follows: Figure 3 As shown, it is a schematic diagram of an implementation flow of a method for determining the scheduling duration of this message scheduling provided by an embodiment of the present invention. The method may specifically include the following steps:
[0089] S301, obtaining a current minimum round trip delay, wherein the minimum round trip delay is determined by the target congestion control algorithm.
[0090] In an embodiment of the present invention, the current minimum round trip delay can be obtained, wherein the minimum round trip delay is determined by the target congestion control algorithm, which means that the minimum round trip delay is given by the target congestion control algorithm. For example, the current minimum RTT is obtained, wherein the minimum RTT is given by the BBR algorithm.
[0091] S302: Obtain a preset scheduling time interval, and select a minimum value from the minimum round-trip delay and the preset scheduling time interval as the scheduling duration of this message scheduling.
[0092] In the embodiment of the present invention, a fixed scheduling time interval can be preset, so that a message scheduling can be triggered every fixed scheduling time interval. Thus, the preset scheduling time interval can be obtained, so that the minimum value is selected from the minimum round-trip delay and the preset scheduling time interval as the scheduling duration of this message scheduling.
[0093] Among them, when the minimum round-trip delay (i.e., minimum RTT) is lower than the fixed scheduling interval, the scheduling interval caused by sending multiple messages at one time should not be higher than the minimum RTT. However, due to the fluctuation of network link delay, the actual RTT from sending a message to receiving an ACK response will be slightly higher than the minimum RTT. If the program does not have time to continue scheduling the sending of messages after the minimum RTT, it will cause the sending time of the next message to be transmitted in the algorithm (i.e., the above iterative process) to be less than the current time after receiving an ACK response. Figure 4 As shown, the BBR algorithm estimates a lower bandwidth, which in turn affects the transmission rate.
[0094] To this end, this problem can be avoided by appropriately increasing the minimum RTT. However, compared with this method, setting a smaller fixed scheduling time interval is a better method. The lower the fixed scheduling time interval, the higher the accuracy of message scheduling, but the CPU pressure will also increase. Therefore, the setting of the fixed scheduling time interval needs to make a trade-off between accuracy and CPU pressure.
[0095] Based on this, in an embodiment of the present invention, the product of the minimum round-trip delay and the preset gain factor is obtained, and the minimum scheduling duration of this message scheduling is selected from the product and the preset scheduling time interval.
[0096] For example, the preset scheduling time interval is interval, the minimum RTT is minrtt, and the preset gain factor is rtt_factor, then the product of the minimum round-trip delay and the preset gain factor is obtained, and the minimum value is selected from the product and the preset scheduling time interval as the scheduling duration of this message scheduling, as shown below.
[0097] The scheduling duration of this message scheduling = min(interval, min_rtt×rtt_factor).
[0098] S203, obtaining the sum of the current time and the scheduling duration to obtain the deadline for this message scheduling.
[0099] In the embodiment of the present invention, the deadline of this message scheduling can be determined according to the current time and the scheduling duration of this message scheduling, that is, the sum of the current time and the scheduling duration is obtained to obtain the deadline of this message scheduling.
[0100] In addition, in the embodiment of the present invention, the number of messages that can be sent at one time in this message scheduling can also be obtained, such as Figure 5 As shown, it is a schematic diagram of an implementation flow of another message transmission method provided by an embodiment of the present invention. The method is applied to an electronic device and may specifically include the following steps:
[0101] S501, when message scheduling is triggered, obtaining a current message sending rate, wherein the message sending rate is determined by a target congestion control algorithm based on an evaluated bandwidth.
[0102] In the embodiment of the present invention, this step is similar to the above step S101, and the embodiment of the present invention will not be described in detail here.
[0103] S502, determine the deadline for this message scheduling, and iterate according to the following steps until the sending time of the next message to be transmitted is greater than or equal to the deadline, stop this message scheduling, and return the message scheduling quantity of this message scheduling.
[0104] S503, obtaining a sending time of the message to be transmitted, and sending the message to be transmitted in this message scheduling.
[0105] S504, increase the number of message scheduling for this message scheduling by one.
[0106] S505: Determine the sending time of the next message to be transmitted according to the sending time of the message to be transmitted, the message size, and the message sending rate.
[0107] In the embodiment of the present invention, when message scheduling is triggered, the current message sending rate is obtained on the one hand, and the deadline of this message scheduling is determined on the other hand. The deadline here means that during the process of this message scheduling, if the sending time of a message to be transmitted is greater than or equal to the deadline, the message scheduling is stopped and the number of messages scheduled for this message scheduling is returned.
[0108] Based on this, in an embodiment of the present invention, iterations are performed according to the following steps until the sending time of the next message to be transmitted is greater than or equal to the deadline, the message scheduling is stopped, and the message scheduling quantity of this message scheduling is returned: the sending time of the message to be transmitted is obtained, and the message to be transmitted is sent in this message scheduling; the message scheduling quantity of this message scheduling is increased by one; and the sending time of the next message to be transmitted is determined according to the sending time of the message to be transmitted, the message size, and the message sending rate.
[0109] In this way, when message scheduling is triggered, the current message sending rate determined by the target congestion control algorithm based on the evaluated bandwidth is obtained, the deadline for this message scheduling is determined, and the messages to be transmitted are sent at the message sending rate before the deadline. This can not only maximize the use of broadband and improve broadband utilization, but also reduce the CPU pressure of the device, so that the device does not have to bear the performance pressure brought by precise scheduling. In addition, the number of messages for this message scheduling can also be obtained.
[0110] In addition, for the target congestion control algorithm, namely the BBR algorithm, the characteristic of being insensitive to packet loss also makes the BBR algorithm generate more retransmission traffic and waste more bandwidth compared to the algorithm based on packet loss detection. For the sake of bandwidth cost control, the BBR algorithm needs to be adjusted to appropriately increase the sensitivity of the BBR algorithm to packet loss. When the packet loss reaches a certain level, the bandwidth estimation value and sending rate of the BBR algorithm are actively reduced.
[0111] For this reason, Figure 6 FIG. 1 is a schematic diagram of an implementation flow of a target congestion algorithm control method provided by an embodiment of the present invention. The method may specifically include the following steps:
[0112] S601, when the target congestion control algorithm is in a startup state or a cyclic bandwidth detection state, monitor whether a network link has packet loss.
[0113] In the embodiment of the present invention, for the target congestion control algorithm, when it is in the startup state or the cyclic bandwidth detection state, it monitors whether the network link has packet loss, which may be the first time that the network link has packet loss.
[0114] For example, for the BBR algorithm, when the BBR algorithm is in the STARTUP state (startup state) or the PROBE_BW state (cyclic bandwidth detection state), the network link is monitored to see whether packet loss occurs for the first time.
[0115] S602: If packet loss occurs, the number of completed message scheduling, the packet loss rate of message transmission, and the amount of data of successfully transmitted messages are determined from the moment of packet retransmission.
[0116] In an embodiment of the present invention, for a network link, if packet loss occurs, that is, if it is the first packet loss, the number of completions of message scheduling, the packet loss rate of message transmission, and the amount of data successfully transmitted are determined from the moment of packet retransmission.
[0117] It should be noted that, for message scheduling, when the messages in the message scheduling process are sent and an ACK response is received, the message scheduling is considered to be completed, and the embodiment of the present invention does not limit this.
[0118] S603: Determine whether the target congestion control algorithm meets the state transfer requirement according to the number of completions, the packet loss rate, and the data volume.
[0119] S604: If the target congestion control algorithm meets the state transition requirement, the target congestion control algorithm is transferred to a packet loss avoidance state.
[0120] In an embodiment of the present invention, for the number of completions of message scheduling, the packet loss rate of message transmission, and the amount of data successfully transmitted by the message, it is possible to judge whether the target congestion control algorithm meets the requirements of state transfer based on the number of completions, the packet loss rate, and the data amount.
[0121] If the target congestion control algorithm meets the state transition requirements, the target congestion control algorithm is transferred to the packet loss avoidance state. In the embodiment of the present invention, the original target congestion control algorithm state transition process is expanded, and the packet loss avoidance state is added.
[0122] For example, the state transition process of the original BBR algorithm has been expanded, and the AVOID_LOSS state (avoid packet loss state) has been added. Figure 7 When the BBR algorithm meets the state transition requirements, the BBR algorithm is transferred to the AVOID_LOSS state.
[0123] Among them, for the number of completions of message scheduling, the packet loss rate of message transmission and the amount of data successfully transmitted by the message, if the number of completions is between the first preset number of completions and the second preset number of completions, and the amount of data is greater than the first threshold, and the packet loss rate is greater than the second threshold, it is determined that the target congestion control algorithm meets the requirements of state transfer.
[0124] For example, if the number of completed message scheduling is between 5 and 20 (including 5 and 20), the amount of data successfully transmitted by the message is greater than N bytes, and the packet loss rate of the message transmission is greater than the threshold LOSS_THRESH, then the above three conditions are met, and the BBR algorithm can enter the AVOID_LOSS state.
[0125] In addition, if the completion count is greater than the second preset completion count, the packet loss record is cleared, and the process jumps to the step of monitoring whether packet loss occurs in the network link when the target congestion control algorithm is in the startup state or the cyclic detection bandwidth state, which means that the completion count of the message scheduling exceeds the second preset completion count (for example, 20), then the judgment of the above three conditions is canceled, and the packet loss record is cleared. When packet loss occurs again, the above judgment process is restarted. Figure 8 shown.
[0126] S605: When the target congestion control algorithm is in a packet loss avoidance state, keep the bottleneck bandwidth and the sending rate gain factor of the target congestion control algorithm unchanged.
[0127] S606: After a preset time period, the target congestion control algorithm is transferred to the cyclic detection bandwidth state.
[0128] In an embodiment of the present invention, when the target congestion control algorithm is in a packet loss avoidance state, the bottleneck bandwidth and the sending rate gain factor (the sending rate gain factor here can be a certain threshold, such as 1.0) of the target congestion control algorithm are kept unchanged, and after a preset time period, the target congestion control algorithm is transferred to the cyclic detection bandwidth state.
[0129] Among them, before the target congestion control algorithm is transferred to the packet loss avoidance state, the state transition time at which the target congestion control algorithm meets the state transition requirements can also be determined, the target time period from the moment of packet loss retransmission to the state transition time is obtained, the average message sending rate within the target time is determined, and the bottleneck bandwidth of the target congestion control algorithm is changed to the average message sending rate.
[0130] For example, when all the above three conditions are met, the state transition moment at which the target congestion control algorithm meets the state transition requirements can be determined, the target time period from the moment of packet loss retransmission to the state transition moment can be obtained, the average message sending rate within the target time can be determined, the bottleneck bandwidth of the BBR algorithm can be changed to the average message sending rate, and then the BBR algorithm enters the AVOID_LOSS state.
[0131] Since packet loss makes the message transmission time longer, the new bottleneck bandwidth will be significantly reduced. When the BBR algorithm is in the AVOID_LOSS state, the bottleneck bandwidth remains unchanged, and the sending rate gain factor pacing_gain remains unchanged at 1.0. This state will automatically exit after 1 second and enter the PROBE_BW state. If the network packet loss situation improves, the BBR algorithm can also automatically detect the new bottleneck bandwidth after entering the PROBE_BW state.
[0132] Corresponding to the above method embodiment, the embodiment of the present invention further provides a message transmission device, such as Fig. 9 As shown, the device may include: a rate acquisition module 910, a time determination module 920, and an iteration module 930.
[0133] A rate acquisition module 910, configured to acquire a current message sending rate when message scheduling is triggered, wherein the message sending rate is determined by a target congestion control algorithm based on an evaluated bandwidth;
[0134] The time determination module 920 is used to determine the deadline of this message scheduling;
[0135] Iteration module 930 is used to iterate according to the following steps until the sending time of the next message to be transmitted is greater than or equal to the deadline, and then stop the message scheduling: obtain the sending time of the message to be transmitted, and send the message to be transmitted in this message scheduling; determine the sending time of the next message to be transmitted according to the sending time of the message to be transmitted, the message size, and the message sending rate.
[0136] The embodiment of the present invention further provides an electronic device, such as Fig.10 As shown, it includes a processor 101, a communication interface 102, a memory 103 and a communication bus 104, wherein the processor 101, the communication interface 102, and the memory 103 communicate with each other through the communication bus 104.
[0137] Memory 103, used for storing computer programs;
[0138] The processor 101 is used to execute the program stored in the memory 103, and implements the following steps:
[0139] In the case of triggering message scheduling, the current message sending rate is obtained, wherein the message sending rate is determined by the target congestion control algorithm based on the evaluated bandwidth; the deadline of this message scheduling is determined, and iterates according to the following steps until the sending time of the next message to be transmitted is greater than or equal to the deadline, and the message scheduling is stopped: the sending time of the message to be transmitted is obtained, and the message to be transmitted is sent in this message scheduling; according to the sending time of the message to be transmitted, the message size, and the message sending rate, the sending time of the next message to be transmitted is determined.
[0140] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0141] The communication interface is used for communication between the above electronic device and other devices.
[0142] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0143] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0144] In another embodiment of the present invention, a storage medium is provided. The storage medium stores instructions. When the storage medium is executed on a computer, the computer executes the message transmission method described in any one of the above embodiments.
[0145] In another embodiment of the present invention, a computer program product including instructions is provided. When the computer program product is run on a computer, the computer executes the message transmission method described in any one of the above embodiments.
[0146] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a storage medium, or transmitted from one storage medium to another storage medium. For example, the computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.
[0147] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0148] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0149] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims
1. A message transmission method, characterized in that: The method comprises: In the case of triggering message scheduling, obtaining a current message sending rate, wherein the message sending rate is determined by a target congestion control algorithm based on an evaluated bandwidth; Determine the deadline for this message scheduling, and iterate according to the following steps until the sending time of the next message to be transmitted is greater than or equal to the deadline, and then stop this message scheduling: Obtaining the sending time of the message to be transmitted, and sending the message to be transmitted in this message scheduling; Determine the next sending time of the message to be transmitted according to the sending time of the message to be transmitted, the message size, and the message sending rate; When the target congestion control algorithm is in a startup state or a cyclic bandwidth detection state, monitoring whether a network link has packet loss; If packet loss occurs, the number of completed message scheduling, the packet loss rate of message transmission, and the amount of data successfully transmitted are determined from the moment of packet retransmission; Determining whether the target congestion control algorithm meets the state transition requirement according to the completion times, the packet loss rate and the data volume; If the target congestion control algorithm meets the state transition requirement, transferring the target congestion control algorithm to a packet loss avoidance state; When the target congestion control algorithm is in a packet loss avoidance state, keeping the bottleneck bandwidth and the sending rate gain factor of the target congestion control algorithm unchanged; After a preset time period, the target congestion control algorithm is transferred to the cyclic bandwidth detection state.
2. The method according to claim 1, characterized in that Determining the deadline for this message scheduling includes: Get the current time; Determine the scheduling duration of this message scheduling; The sum of the current time and the scheduling duration is obtained to obtain the deadline for this message scheduling.
3. The method according to claim 2, characterized in that The determining of the scheduling duration of the current message scheduling includes: Obtaining a current minimum round trip delay, wherein the minimum round trip delay is determined by the target congestion control algorithm; A preset scheduling time interval is obtained, and a minimum value is selected from the minimum round-trip delay and the preset scheduling time interval as the scheduling duration of this message scheduling.
4. The method according to claim 3, characterized in that The selecting a minimum value from the minimum round-trip delay and the preset scheduling time interval as the scheduling duration of this message scheduling includes: The product of the minimum round-trip delay and the preset gain factor is obtained, and a minimum value is selected from the product and the preset scheduling time interval as the scheduling duration of this message scheduling.
5. The method according to claim 1, characterized in that After sending the message to be transmitted in this message scheduling, the method further includes: The number of message dispatches for this message dispatch is increased by one; After stopping the current message scheduling, the method further includes: Returns the number of messages scheduled for this message scheduling.
6. The method according to claim 1, characterized in that The step of obtaining the sending time of the message to be transmitted includes: If the message to be transmitted is the first message to be transmitted in this message scheduling, the current time is used as the sending time of the message to be transmitted; If the message to be transmitted is not the first message to be transmitted in the current message scheduling, the sending time of the next message to be transmitted determined in the previous iteration is used as the sending time of the message to be transmitted.
7. The method according to claim 1, characterized in that The determining, according to the number of completions, the packet loss rate, and the data volume, whether the target congestion control algorithm meets the state transition requirement includes: If the completion number is between the first preset completion number and the second preset completion number, and the data volume is greater than the first threshold, and the packet loss rate is greater than the second threshold, it is determined that the target congestion control algorithm meets the state transfer requirements.
8. The method according to claim 7, characterized in that The method further comprises: If the completion times are greater than the second preset completion times, the packet loss record is cleared, and the process jumps to the step of monitoring whether packet loss occurs in the network link when the target congestion control algorithm is in the startup state or the cyclic bandwidth detection state.
9. The method according to claim 1, characterized in that: Before transferring the target congestion control algorithm to a packet loss avoidance state, the method further includes: Determine the state transition time at which the target congestion control algorithm meets the state transition requirements, and obtain the target time period from the moment of packet loss retransmission to the state transition time; An average message sending rate within the target time is determined, and the bottleneck bandwidth of the target congestion control algorithm is changed to the average message sending rate.
10. A message transmission device, characterized in that: The device comprises: A rate acquisition module, used to acquire a current message sending rate when message scheduling is triggered, wherein the message sending rate is determined by a target congestion control algorithm based on an evaluated bandwidth; A time determination module is used to determine the deadline for this message scheduling; The iteration module is used to iterate according to the following steps until the sending time of the next message to be transmitted is greater than or equal to the deadline, and the message scheduling is stopped: obtaining the sending time of the message to be transmitted, and sending the message to be transmitted in this message scheduling; determining the sending time of the next message to be transmitted according to the sending time of the message to be transmitted, the message size, and the message sending rate; Wherein, when the target congestion control algorithm is in a startup state or a cyclic detection bandwidth state, monitoring whether a network link has packet loss; If packet loss occurs, the number of completed message scheduling, the packet loss rate of message transmission, and the amount of data successfully transmitted are determined from the moment of packet retransmission; Determining whether the target congestion control algorithm meets the state transition requirement according to the completion times, the packet loss rate and the data volume; If the target congestion control algorithm meets the state transition requirement, transferring the target congestion control algorithm to a packet loss avoidance state; When the target congestion control algorithm is in a packet loss avoidance state, keeping the bottleneck bandwidth and the sending rate gain factor of the target congestion control algorithm unchanged; After a preset time period, the target congestion control algorithm is transferred to the cyclic bandwidth detection state.
11. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 9 when executing a program stored in a memory.
12. A storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
Control method, device and computer system for data transmission
CN102752076A
Network congestion control method, device, equipment and medium
CN110809288A