CN115426689B - Message transmission method, device, electronic device and storage medium - Google Patents
Message transmission method, device, electronic device and storage medium Download PDFInfo
- Publication number
- CN115426689B CN115426689B CN202211056200.XA CN202211056200A CN115426689B CN 115426689 B CN115426689 B CN 115426689B CN 202211056200 A CN202211056200 A CN 202211056200A CN 115426689 B CN115426689 B CN 115426689B
- Authority
- CN
- China
- Prior art keywords
- message
- scheduling
- transmitted
- time
- control algorithm
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 71
- 230000005540 biological transmission Effects 0.000 title claims abstract description 49
- 230000007704 transition Effects 0.000 claims description 28
- 238000004891 communication Methods 0.000 claims description 18
- 238000001514 detection method Methods 0.000 claims description 15
- 125000004122 cyclic group Chemical group 0.000 claims description 13
- 230000008569 process Effects 0.000 claims description 12
- 230000001960 triggered effect Effects 0.000 claims description 10
- 238000004590 computer program Methods 0.000 claims description 8
- 238000012544 monitoring process Methods 0.000 claims description 6
- 238000012546 transfer Methods 0.000 claims description 4
- 238000010586 diagram Methods 0.000 description 7
- 238000012545 processing Methods 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 230000004044 response Effects 0.000 description 3
- 230000002093 peripheral effect Effects 0.000 description 2
- 239000007787 solid Substances 0.000 description 2
- 238000013500 data storage Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000000802 evaporation-induced self-assembly Methods 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 238000012804 iterative process Methods 0.000 description 1
- 230000009191 jumping Effects 0.000 description 1
- 230000002045 lasting effect Effects 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000002035 prolonged effect Effects 0.000 description 1
- 239000000523 sample Substances 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000035945 sensitivity Effects 0.000 description 1
- 230000002459 sustained effect Effects 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W28/00—Network traffic management; Network resource management
- H04W28/16—Central resource management; Negotiation of resources or communication parameters, e.g. negotiating bandwidth or QoS [Quality of Service]
- H04W28/18—Negotiating wireless communication parameters
- H04W28/22—Negotiating communication rate
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
- H04L43/0823—Errors, e.g. transmission errors
- H04L43/0829—Packet loss
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W24/00—Supervisory, monitoring or testing arrangements
- H04W24/08—Testing, supervising or monitoring using real traffic
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W28/00—Network traffic management; Network resource management
- H04W28/02—Traffic management, e.g. flow control or congestion control
- H04W28/0289—Congestion control
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Environmental & Geological Engineering (AREA)
- Quality & Reliability (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The embodiment of the invention provides a message transmission method, a device, electronic equipment and a storage medium, wherein the method comprises the steps of acquiring a current message transmission rate under the condition of triggering message scheduling, determining the cut-off time of the message scheduling according to an estimated bandwidth by a target congestion control algorithm, iterating according to the following steps until the transmission time of a next message to be transmitted is greater than or equal to the cut-off time, stopping the message scheduling, namely acquiring the transmission time of the message to be transmitted, transmitting the message to be transmitted in the message scheduling, and determining the transmission time of the next message to be transmitted according to the transmission time, the message size and the message transmission rate of the message to be transmitted. Therefore, the broadband can be utilized to the maximum extent, and the broadband utilization rate is improved.
Description
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a method and apparatus for transmitting a message, an electronic device, and a storage medium.
Background
In a P2P network, packet transmission is a reliable transmission process based on the UDP protocol, and the congestion control algorithm used in the whole transmission process has a significant impact on the performance of the transmission. Currently known reliable network transmission schemes, such as a TCP protocol and the like, default adopted congestion control algorithms are algorithms based on packet loss detection, such as Reno, cube and the like, and the basic principle of the algorithms is to consider packet loss as a sign of congestion of a network link, which means that the transmission rate is reduced after the packet loss is detected. However, these algorithms have the disadvantage of being too sensitive to packet loss, and perform poorly in wireless network environments where random packet loss is often caused by channel noise, and the broadband utilization is low. Today, wireless networks are becoming more and more popular, and these algorithms are difficult to adapt to the current network usage environment.
Disclosure of Invention
In order to solve the technical problems of poor performance and low broadband utilization rate of the wireless network environment with random packet loss caused by channel noise, the embodiment of the invention provides a message transmission method, a device, electronic equipment and a storage medium. The specific technical scheme is as follows:
In a first aspect of the embodiment of the present invention, there is first provided a method for transmitting a message, where the method includes:
Under the condition of triggering message scheduling, acquiring the current message sending rate, wherein the message sending rate is determined by a target congestion control algorithm based on the estimated bandwidth;
Determining the cut-off time of the current 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 cut-off time, and stopping the current message scheduling:
Acquiring the sending time of a message to be transmitted, and sending the message to be transmitted in the message scheduling;
and determining the sending time of the next message to be transmitted according to the sending time, the message size and the message sending rate of the message to be transmitted.
In an optional embodiment, the determining the deadline of the current packet scheduling includes:
Acquiring the current moment;
Determining the scheduling time length of the current message scheduling;
And obtaining the sum of the current time and the scheduling time length to obtain the deadline of the current message scheduling.
In an optional embodiment, the determining the scheduling duration of the current packet scheduling includes:
Acquiring a current minimum round trip delay, wherein the minimum round trip delay is determined by the target congestion control algorithm;
And acquiring a preset scheduling time interval, and selecting a minimum value from the minimum round trip delay and the preset scheduling time interval as the scheduling time length of the current message scheduling.
In an optional implementation manner, the selecting the minimum value from the minimum round trip delay and the preset scheduling time interval as the scheduling duration of the current packet scheduling includes:
and obtaining the product between the minimum round trip delay and a preset gain factor, and selecting a minimum value from the product and the preset scheduling time interval as the scheduling time length of the current message scheduling.
In an optional embodiment, after the sending the message to be transmitted in the current message scheduling, the method further includes:
adding one to the message scheduling number of the message scheduling;
After stopping the message scheduling, the method further comprises the following steps:
And returning the message scheduling number of the message scheduling.
In an optional embodiment, the 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 the message scheduling, the current time is taken as the sending time of the message to be transmitted;
and if the message to be transmitted is not the first message to be transmitted in the current message scheduling, taking the sending time of the next message to be transmitted, which is determined by the last iteration, as the sending time of the message to be transmitted.
In an alternative embodiment, the method further comprises:
When the target congestion control algorithm is in a starting state or a cyclic detection bandwidth state, monitoring whether packet loss occurs in a network link;
If packet loss occurs, determining the number of times of completion of message scheduling, the packet loss rate of message transmission and the data volume of successful message transmission from the moment of packet loss retransmission;
judging whether the target congestion control algorithm meets the requirement of state transition according to the number of times of completion, the packet loss rate and the data volume;
if the target congestion control algorithm meets the requirement of state transition, the target congestion control algorithm is transferred to a state of avoiding packet loss;
under the condition that the target congestion control algorithm is in a state of avoiding packet loss, keeping the bottleneck bandwidth and the sending rate gain factor of the target congestion control algorithm unchanged;
And after a preset time period, transferring the target congestion control algorithm to the cyclic detection bandwidth state.
In an optional implementation manner, the determining whether the target congestion control algorithm meets the requirement of state transition according to the number of times of completion, the packet loss rate and the data volume includes:
And if the number of completion times is between the first preset number of completion times and the second preset number of completion times, the data volume is larger than a first threshold value, and the packet loss rate is larger than a second threshold value, determining that the target congestion control algorithm meets the requirement of state transition.
In an alternative embodiment, the method further comprises:
and if the number of completion times is greater than the second preset number of completion times, clearing the packet loss record, and jumping to the step of monitoring whether the network link is lost when the target congestion control algorithm is in a starting state or a cyclic detection bandwidth state.
In an optional embodiment, before the transferring the target congestion control algorithm to the avoid packet loss state, the method further includes:
Determining state transition time when the target congestion control algorithm meets the state transition requirement, and acquiring a target time period from the time of packet loss retransmission to the state transition time;
And determining the average sending rate of the message in the target time, and changing the bottleneck bandwidth of the target congestion control algorithm into the average sending rate of the message.
In a second aspect of the embodiment of the present invention, there is also provided a device for transmitting a packet, where the device includes:
the rate acquisition module is used for acquiring the current message sending rate under the condition of triggering message scheduling, wherein the message sending rate is determined by a target congestion control algorithm based on the estimated bandwidth;
The time determining module is used for determining the cut-off time of the message scheduling;
and the iteration module is used for carrying out iteration until the sending time of the next message to be transmitted is greater than or equal to the cut-off time, stopping the message scheduling, namely acquiring the sending time of the message to be transmitted, sending the message to be transmitted in the message scheduling, and determining the sending time of the next message to be transmitted according to the sending time, the message size and the message sending rate of the message to be transmitted.
In a third aspect of the embodiment of the present invention, there is also provided an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
A memory for storing a computer program;
and the processor is used for realizing the message transmission method in any one of the first aspect when executing the program stored in the memory.
In a fourth aspect of the embodiments of the present invention, there is further provided a storage medium having stored therein instructions that, when executed on a computer, cause the computer to perform the method for transmitting a message according to any one of the first aspect.
In a fifth aspect of embodiments of the present invention, there is also provided a computer program product comprising instructions which, when run on a computer, cause the computer to perform the method of transmitting a message as described in any of the above.
According to the technical scheme provided by the embodiment of the invention, under the condition of triggering message scheduling, the current message sending rate is obtained, wherein the message sending rate is determined by a target congestion control algorithm based on the evaluated bandwidth, the cut-off time of the message scheduling is determined, iteration is carried out according to the following steps until the sending time of the next message to be transmitted is greater than or equal to the cut-off time, the message scheduling is stopped, the sending time of the message to be transmitted is obtained, the message to be transmitted is sent in the message scheduling, and the sending time of the next message to be transmitted is determined according to the sending time, the message size and the message sending rate of the message to be transmitted. Under the condition of triggering message scheduling, the current message sending rate determined by the target congestion control algorithm based on the evaluated bandwidth is obtained, the cut-off time of the message scheduling is determined, and the message to be transmitted is sent at the message sending rate before the cut-off time, so that the broadband can be utilized to the greatest extent, and the broadband utilization rate is improved.
Drawings
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.
In order to more clearly illustrate the embodiments of the invention or the technical solutions of the prior art, the drawings which are used in the description of the embodiments or the prior art will be briefly described, and it will be obvious to a person skilled in the art that other drawings can be obtained from these drawings without inventive effort.
Fig. 1 is a schematic flow chart of an implementation of a method for transmitting a message according to an embodiment of the present invention;
fig. 2 is a schematic implementation flow chart of a method for determining a deadline of current packet scheduling in the embodiment of the present invention;
Fig. 3 is a schematic implementation flow chart of a scheduling duration determining method for current message scheduling in the embodiment of the present invention;
FIG. 4 is a diagram showing a Next-send-time less than the current time in an embodiment of the present invention;
fig. 5 is a schematic flow chart of an implementation of another method for transmitting a message according to an embodiment of the present invention;
Fig. 6 is a schematic flow chart of an implementation of a target congestion algorithm control method according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of a BBR algorithm state transition, which is shown in an embodiment of the present invention;
FIG. 8 is a schematic flow chart of controlling BBR algorithm state transition in the embodiment of the present invention;
Fig. 9 is a schematic structural diagram of a message transmission device according to an embodiment of the present invention;
Fig. 10 is a schematic structural diagram of another electronic device according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In the embodiment of the 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, the method does not take the packet loss as a sign of congestion of the network, but controls the transmission rate by means of the estimated bandwidth, so that the BBR algorithm can utilize more bandwidth in a wireless network environment and a weak network environment with more packet loss, and better transmission performance is realized.
The BBR algorithm is used as a congestion control algorithm based on broadband estimation, and the core of the BBR algorithm is to control the transmission rate according to the estimated bandwidth. The BBR algorithm continuously updates the estimated bandwidth value during operation and gives the current transmission rate, which is noted as the serving_rate. In order to prevent a plurality of messages from being instantaneously and burst-type once-through transmission, the BBR algorithm requires that the transmission time of each message is accurately scheduled according to the paging_rate. Specifically, assuming that a certain message length to be currently transmitted is packet_size, the earliest transmission time of the next message is next_send_time=now+packet_size≡packet_rate, and now is the current time.
In actual transmission, the size of each packet is limited by the MTU size of the underlying network, and is typically 1500 bytes at maximum, and when the paging_rate value is large and the transmission rate is high, the scheduling interval of (e.g. data) packets may be small, or even less than 1ms. Because the algorithm needs to run in a user mode instead of a kernel mode, microsecond-level accurate scheduling is realized in the user mode, the actual programming is difficult to realize, and the requirements on the performance of equipment are high. Low performance devices using ARM, MIPS architecture chips are ubiquitous in P2P networks, for which the performance pressure from accurate scheduling cannot be sustained.
In view of the limitation of low performance of practical equipment, it is not practical to perform accurate scheduling completely, so that time precision of scheduling needs to be properly sacrificed, and coarse-grained scheduling is performed on message transmission. When the message is sent by each scheduling, a plurality of messages can be sent at one time, and the time interval between each scheduling is properly enlarged, so that the CPU pressure is reduced. The common implementation method of the scheduling is that the message scheduling is triggered once every fixed time, and the message scheduling can be triggered by the trigger of other events during the interval.
Based on the above thought, under the condition of triggering message scheduling, the current message sending rate is obtained, wherein the message sending rate is determined by a target congestion control algorithm (for example, the BBR algorithm) based on the evaluated bandwidth, the cut-off time of the message scheduling is determined, iteration is carried out according to the following steps until the sending time of the next message to be transmitted is greater than or equal to the cut-off time, the message scheduling is stopped, the sending time of the message to be transmitted is obtained, the message to be transmitted is sent in the message scheduling, 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 size of the message and the sending rate of the message.
Under the condition of triggering message scheduling, the current message sending rate determined by the target congestion control algorithm based on the evaluated bandwidth is obtained, the cut-off time of the message scheduling is determined, and the message to be transmitted is sent at the message sending rate before the cut-off time, so that the broadband can be utilized to the maximum extent, the broadband utilization rate is improved, the CPU pressure of the equipment can be reduced, and the equipment does not need to bear the performance pressure brought by accurate scheduling.
Specifically, as shown in fig. 1, a schematic implementation flow chart of a message transmission method provided by an embodiment of the present invention is applied to an electronic device, and the method may specifically include the following steps:
S101, under the condition that message scheduling is triggered, acquiring the current message sending rate, wherein the message sending rate is determined by a target congestion control algorithm based on the evaluated bandwidth.
In the embodiment of the invention, the message scheduling can be triggered once every fixed time interval, so that the current message sending rate can be obtained under the condition of triggering the message scheduling, wherein the message sending rate is determined by a target congestion control algorithm based on the evaluated bandwidth. In addition, the message schedule may also be triggered during the interval with the opportunity for other events to occur.
For example, in the embodiment of the present invention, the message scheduling is triggered once every 1 second, so that under the condition that the message scheduling is triggered, the current message sending rate is obtained, where the BBR algorithm continuously updates the estimated bandwidth value and gives the current message sending rate in the running process, and the rate is recorded as the serving_rate.
S102, determining the deadline of the current 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 stopping the current message scheduling.
S103, obtaining the sending time of the message to be transmitted, and sending the message to be transmitted in the message scheduling.
S104, determining the sending time of the next message to be transmitted according to the sending time, the message size and the message sending rate of the message to be transmitted.
In the embodiment of the invention, under the condition of triggering message scheduling, on one hand, the current message sending rate is obtained, and on the other hand, the cut-off time of the message scheduling is determined. The deadline here means that, in the process of the current message scheduling, if the sending time of a certain message to be transmitted is greater than or equal to the deadline, the current message scheduling is stopped.
Based on the above, in the embodiment of the invention, iteration is performed according to the steps of obtaining the sending time of the message to be transmitted, sending the message to be transmitted in the message scheduling, and determining the sending time of the next message to be transmitted according to the sending time, the message size and the message sending rate of the message to be transmitted until the sending time of the next message to be transmitted is greater than or equal to the cut-off time.
And regarding the message to be transmitted, if the message to be transmitted is the first message to be transmitted in the message schedule, taking the current time as the sending time of the message to be transmitted, and if the message to be transmitted is not the first message to be transmitted in the message schedule, taking the sending time of the next message to be transmitted, which is determined by the last iteration, as the sending time of the message to be transmitted.
For example, when the current time is 10:00:00, and the ending time of the current message scheduling is determined to be 10:00:01, the sending time of the first message to be transmitted in the current message scheduling is 10:00:00, and the message is to be sent in the current message scheduling. The size of the first message to be transmitted is packet_size 1, and the sending time of the next message to be transmitted of the first message to be transmitted is 10:00:00+packet_size 1/packet_rate. For the next message to be transmitted of the first message to be transmitted, namely a second message to be transmitted, the sending time of the second message to be transmitted is 10:00:00+packet_size 1/packet_rate, if the sending time is not greater than or equal to the ending time of the current message scheduling of 10:00:01, the second message to be transmitted is also sent in the current message scheduling, the size of the second message to be transmitted is packet_size 2, and 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_size2/packet_rate.
And iterating continuously according to the steps 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 cut-off time 10:00:01 of the message scheduling, so that the message scheduling can be stopped.
Through the description of the technical scheme provided by the embodiment of the invention, under the condition of triggering message scheduling, the current message sending rate is obtained, wherein the message sending rate is determined by a target congestion control algorithm based on the evaluated bandwidth, the cut-off time of the message scheduling is determined, iteration is carried out according to the following steps until the sending time of the next message to be transmitted is greater than or equal to the cut-off time, the message scheduling is stopped, the sending time of the message to be transmitted is obtained, the message to be transmitted is sent in the message scheduling, 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.
Under the condition of triggering message scheduling, the current message sending rate determined by the target congestion control algorithm based on the evaluated bandwidth is obtained, the cut-off time of the message scheduling is determined, and the message to be transmitted is sent at the message sending rate before the cut-off time, so that the broadband can be utilized to the maximum extent, the broadband utilization rate is improved, the CPU pressure of the equipment can be reduced, and the equipment does not need to bear the performance pressure brought by accurate scheduling.
In the step S102, as shown in fig. 2, an implementation flow diagram of a method for determining a deadline of current packet scheduling according to an embodiment of the present invention may be shown, where the method specifically includes the following steps:
s201, acquiring the current moment.
S202, determining the scheduling time length of the current message scheduling.
In the embodiment of the present invention, under the condition of triggering the message scheduling, the message scheduling of this time is to be performed, and the current time can be obtained at this time, and for the current time, the current time is used as the sending time of the first message to be transmitted in the message scheduling of this time, and is used as the starting time of the message scheduling of this time, so as to determine the ending time of the message scheduling of this time.
In addition, in the embodiment of the present invention, the scheduling duration of the present message scheduling needs to be determined, where the scheduling duration is used to characterize the duration of the present message scheduling, where the scheduling duration may be an empirical value, and certainly, the scheduling duration may also be determined by using a subsequent method.
For example, the current time 10:00:00 is obtained, and the scheduling duration of the current message scheduling is determined to be 1 second, which means that the duration of the current message scheduling is 1 second from 10:00:00, and exceeds 1 second, and then the current message scheduling is automatically ended.
The determining of the scheduling duration of the present message scheduling may be shown in fig. 3, which is a schematic implementation flow diagram of a method for determining the scheduling duration of the present message scheduling according to an embodiment of the present invention, where the method specifically may include the following steps:
s301, acquiring the current minimum round trip delay, wherein the minimum round trip delay is determined by the target congestion control algorithm.
In the embodiment of the 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, a current minimum RTT is obtained, wherein the minimum RTT is given by the BBR algorithm.
S302, 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 to serve as scheduling time length of the current message scheduling.
In the embodiment of the invention, a fixed scheduling time interval can be preset, so that message scheduling can be triggered once every other fixed scheduling time interval. Therefore, a preset scheduling time interval can be obtained, and the minimum value is selected from the minimum round trip delay and the preset scheduling time interval to serve as the scheduling time length of the current message scheduling.
When the minimum round trip delay (i.e., the minimum RTT) is lower than the fixed scheduling time interval, the scheduling interval caused by transmitting multiple messages at a time should not be higher than the minimum RTT. However, due to the fluctuation of the network link delay, the RTT actually passing from sending the message to receiving the ACK response is slightly higher than the minimum RTT, if the program does not schedule the sending message until the time of passing the minimum RTT, the sending time of the next message to be transmitted in the algorithm (i.e. the above iterative process) is less than the current time after receiving the ACK response at a certain time, as shown in fig. 4, and further the BBR algorithm estimates a lower bandwidth, thereby affecting the transmission rate.
For this purpose, this problem is avoided by appropriately amplifying the minimum RTT by some. But setting a smaller fixed scheduling time interval is a better method than this method. The lower the fixed scheduling time interval is, the higher the accuracy of message scheduling is, but the higher the CPU pressure is, so the fixed scheduling time interval is required to be weighted between the accuracy and the CPU pressure.
Based on this, in the embodiment of the present invention, a product between the minimum round trip delay and a preset gain factor is obtained, and a scheduling duration of the current message scheduling with a minimum value is selected from the product and the preset scheduling time interval.
For example, if the preset scheduling time interval is interval, the minimum RTT is minrtt, and the preset gain factor is rtt_factor, the product between the minimum round trip delay and the preset gain factor is obtained, and the scheduling duration of the message scheduling with the minimum value is selected from the product and the preset scheduling time interval, as shown below.
Scheduling duration=min (interval, min_rtt×rtt_factor) of the present packet scheduling.
S203, obtaining the sum of the current time and the scheduling time length to obtain the deadline of the current message scheduling.
In the embodiment of the invention, the deadline of the current message scheduling can be determined according to the current time and the scheduling time of the current message scheduling, namely, the sum of the current time and the scheduling time is obtained, and the deadline of the current message scheduling is obtained.
In addition, in the embodiment of the present invention, the number of messages that can be sent once in the present message scheduling may also be obtained, as shown in fig. 5, which is an implementation flow diagram of another message transmission method provided in the embodiment of the present invention, where the method is applied to an electronic device, and specifically may include the following steps:
s501, under the condition that message scheduling is triggered, the current message sending rate is obtained, wherein the message sending rate is determined by a target congestion control algorithm based on the evaluated bandwidth.
In the embodiment of the present invention, the step is similar to the step S101, and the embodiment of the present invention is not described here again.
S502, determining the cut-off time of the current message scheduling, iterating according to the following steps until the sending time of the next message to be transmitted is greater than or equal to the cut-off time, stopping the current message scheduling, and returning the message scheduling quantity of the current message scheduling.
S503, obtaining the sending time of the message to be transmitted, and sending the message to be transmitted in the message scheduling.
S504, adding one to the message scheduling number of the message scheduling.
S505, determining the sending time of the next message to be transmitted according to the sending time of the message to be transmitted, the size of the message and the sending rate of the message.
In the embodiment of the invention, under the condition of triggering message scheduling, on one hand, the current message sending rate is obtained, and on the other hand, the cut-off time of the message scheduling is determined. The deadline here means that, in the process of the current message scheduling, if the sending time of a certain message to be transmitted is greater than or equal to the deadline, the current message scheduling is stopped, and the number of message scheduling of the current message scheduling is returned.
Based on the above, in the embodiment of the invention, iteration is performed according to the steps of stopping the current message scheduling until the sending time of the next message to be transmitted is greater than or equal to the cut-off time, and returning the message scheduling number of the current message scheduling, wherein the sending time of the message to be transmitted is obtained, the message to be transmitted is sent in the current message scheduling, the message scheduling number of the current message scheduling is increased by one, and the sending time of the next message to be transmitted is determined according to the sending time, the message size and the message sending rate of the message to be transmitted.
Under the condition of triggering message scheduling, the current message sending rate determined by the target congestion control algorithm based on the evaluated bandwidth is obtained, the cut-off time of the message scheduling is determined, and the message to be transmitted is sent at the message sending rate before the cut-off time, so that the broadband can be utilized to the maximum extent, the broadband utilization rate is improved, the CPU pressure of the equipment can be reduced, the equipment does not need to bear the performance pressure caused by accurate scheduling, and the message quantity of the message scheduling can be obtained.
In addition, for the target congestion control algorithm, namely the BBR algorithm, the characteristic of insensitivity to packet loss also causes the BBR algorithm to generate more retransmission traffic and waste more bandwidth compared with the algorithm based on packet loss detection. And in consideration of bandwidth cost control, the BBR algorithm needs to be adjusted, the sensitivity of the BBR algorithm to packet loss is properly increased, and when the packet loss is more than a certain degree, the bandwidth estimated value and the sending rate of the BBR algorithm are actively reduced.
For this reason, as shown in fig. 6, a schematic implementation flow chart of a target congestion algorithm control method provided by an embodiment of the present invention may specifically include the following steps:
s601, when the target congestion control algorithm is in a starting state or a cyclic detection bandwidth state, whether packet loss occurs to a network link is monitored.
In the embodiment of the invention, for the target congestion control algorithm, when the target congestion control algorithm is in a starting state or a cyclic detection bandwidth state, whether packet loss occurs to a network link is monitored. Where it may be monitored whether a network link first experiences a packet loss.
For example, for the BBR algorithm, when the BBR algorithm is in the STARTUP state (start state) or the probe_bw state (loop PROBE bandwidth state), it is monitored whether packet loss occurs for the first time on the network link.
S602, if packet loss occurs, determining the number of times of completion of message scheduling, the packet loss rate of message transmission and the data volume of successful message transmission from the moment of packet loss retransmission.
In the embodiment of the invention, for a network link, if packet loss occurs, namely if packet loss occurs for the first time, from the moment of packet loss retransmission, the number of times of completion of message scheduling, the packet loss rate of message transmission and the data volume of successful message transmission are determined.
It should be noted that, for the message scheduling, when the message in the message scheduling process is sent completely and an ACK response is received, the message scheduling is considered to be completed once, which is not limited in the embodiment of the present invention.
And S603, judging whether the target congestion control algorithm meets the requirement of state transition according to the number of times of completion, the packet loss rate and the data volume.
S604, if the target congestion control algorithm meets the requirement of state transition, the target congestion control algorithm is transferred to a state of avoiding packet loss.
In the embodiment of the invention, for the completion times of message scheduling, the packet loss rate of message transmission and the data volume of successful message transmission, whether the target congestion control algorithm meets the requirement of state transition can be judged according to the completion times, the packet loss rate and the data volume.
And if the target congestion control algorithm meets the requirement of state transition, the target congestion control algorithm is transferred to a state of avoiding packet loss. In the embodiment of the invention, the state transition process of the original target congestion control algorithm is expanded, and the state of avoiding packet loss is newly increased.
For example, the state transition process of the original BBR algorithm is extended, and the avoid_loss state (the packet LOSS avoidance state) is newly added, as shown in fig. 7. And when the BBR algorithm meets the requirement of state transition, transferring the BBR algorithm to an AVOID_LOSS state.
And determining that the target congestion control algorithm meets the requirement of state transition if the completion times are between the first preset completion times and the second preset completion times and the data quantity is larger than a first threshold and the packet loss rate is larger than a second threshold for the completion times of message scheduling, the packet loss rate of message transmission and the data quantity of successful message transmission.
For example, the number of times of completion of message scheduling is between 5 and 20 (including the cases of 5 and 20), the data volume of successful message transmission is larger than N bytes, the packet LOSS rate of message transmission is larger than a threshold value loss_thresh, at this time, all the 3 conditions are met, and at this time, the BBR algorithm can enter an avoid_loss state.
In addition, if the number of completion times is greater than the second preset number of completion times, the packet loss record is emptied, and the step of monitoring whether the network link is lost when the target congestion control algorithm is in the start state or the cyclic detection bandwidth state is skipped, which means that the number of completion times of packet scheduling exceeds the second preset number of completion times (for example, 20), the judgment of the 3 conditions is canceled, the packet loss record is emptied, and when the packet loss occurs again in the following time, the judgment process is restarted, as shown in fig. 8.
And S605, keeping the bottleneck bandwidth and the sending rate gain factor of the target congestion control algorithm unchanged under the condition that the target congestion control algorithm is in a state of avoiding packet loss.
S606, after a preset time period, the target congestion control algorithm is transferred to the cyclic detection bandwidth state.
In the embodiment of the present invention, in the case that the target congestion control algorithm is in a state of avoiding packet loss, the bottleneck bandwidth and the transmission rate gain factor (here, the transmission rate gain factor may be a certain threshold, for example, 1.0) of the target congestion control algorithm are kept unchanged, and after a preset period of time, the target congestion control algorithm is transferred to the state of the cyclic detection bandwidth.
Before the target congestion control algorithm is transferred to the state of avoiding packet loss, the state transfer time when the target congestion control algorithm meets the requirement of state transfer can be determined, a target time period from the time of packet loss retransmission to the state transfer time is acquired, the average sending rate of the messages in the target time is determined, and the bottleneck bandwidth of the target congestion control algorithm is changed into the average sending rate of the messages.
For example, when all the above 3 conditions are met, the state transition time when the target congestion control algorithm meets the requirement of state transition can be determined, the target time period from the time of packet LOSS retransmission to the state transition time is acquired, the average sending rate of the messages in the target time is determined, the bottleneck bandwidth of the BBR algorithm is changed into the average sending rate of the messages, and then the BBR algorithm enters the avoid_loss state.
The time consumption of message transmission is prolonged due to packet loss, and the new bottleneck bandwidth is obviously reduced. When the BBR algorithm is in the AVOID_LOSS state, the bottleneck bandwidth remains unchanged, and the sending rate gain factor paging_gain remains 1.0 unchanged. The state automatically exits and turns to the PROBE_BW state after lasting for 1 second, and if the network packet loss condition is improved, the BBR algorithm can automatically detect a new bottleneck bandwidth after turning to the PROBE_BW state.
Corresponding to the above method embodiment, the embodiment of the present invention further provides a device for transmitting a message, as shown in fig. 9, where the device may include a rate obtaining module 910, a time determining module 920, and an iteration module 930.
A rate obtaining module 910, configured to obtain a current packet sending rate when triggering packet scheduling, where the packet sending rate is determined by a target congestion control algorithm based on the estimated bandwidth;
a time determining module 920, configured to determine a deadline of the current packet scheduling;
And the iteration module 930 is used for iterating until the sending time of the next message to be transmitted is greater than or equal to the cut-off time, stopping the message scheduling, namely acquiring the sending time of the message to be transmitted, sending the message to be transmitted in the message scheduling, and determining the sending time of the next message to be transmitted according to the sending time, the message size and the message sending rate of the message to be transmitted.
The embodiment of the invention also provides an electronic device, as shown in fig. 10, which comprises 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 complete communication with each other through the communication bus 104,
A memory 103 for storing a computer program;
The processor 101 is configured to execute a program stored in the memory 103, and implement the following steps:
under the condition of triggering message scheduling, acquiring the current message sending rate, wherein the message sending rate is determined by a target congestion control algorithm based on the evaluated bandwidth, determining the ending time of the message scheduling, iterating according to the following steps until the sending time of the next message to be transmitted is greater than or equal to the ending time, stopping the message scheduling, acquiring the sending time of the message to be transmitted, sending the message to be transmitted in the message scheduling, and determining the sending time of the next message to be transmitted according to the sending time, the message size and the message sending rate of the message to be transmitted.
The communication bus mentioned by the above electronic device may be a peripheral component interconnect standard (PERIPHERAL COMPONENT INTERCONNECT, abbreviated as PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, abbreviated as EISA) bus, etc. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface is used for communication between the electronic device and other devices.
The memory may include random access memory (Random Access Memory, RAM) or may include non-volatile memory (non-volatile memory), such as at least one disk memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central Processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), a digital signal processor (DIGITAL SIGNAL Processing, DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable gate array (FPGA) or other Programmable logic device, discrete gate or transistor logic device, or discrete hardware components.
In yet another embodiment of the present invention, a storage medium is provided, where instructions are stored, when the storage medium runs on a computer, to cause the computer to perform the method for transmitting a message according to any one of the foregoing embodiments.
In yet another embodiment of the present invention, a computer program product containing instructions that, when executed on a computer, cause the computer to perform the method for transmitting a message according to any of the above embodiments is also provided.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may 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 loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present invention, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in a storage medium or transmitted from one storage medium to another, for example, from one website, computer, server, or data center by a wired (e.g., coaxial cable, fiber optic, digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The storage media may be any available media that can be accessed by a computer or a data storage device such as a server, data center, or the like that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk Solid STATE DISK (SSD)), etc.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises an element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, as relevant to see a section of the description of method embodiments.
The foregoing description is only of the preferred embodiments of the present invention and is not intended to limit the 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 (12)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211056200.XA CN115426689B (en) | 2022-08-31 | 2022-08-31 | Message transmission method, device, electronic device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211056200.XA CN115426689B (en) | 2022-08-31 | 2022-08-31 | Message transmission method, device, electronic device and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115426689A CN115426689A (en) | 2022-12-02 |
CN115426689B true CN115426689B (en) | 2025-03-14 |
Family
ID=84199449
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211056200.XA Active CN115426689B (en) | 2022-08-31 | 2022-08-31 | Message transmission method, device, electronic device and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115426689B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116016359B (en) * | 2022-12-13 | 2025-06-24 | 北京天融信网络安全技术有限公司 | Message processing method, device, storage medium and equipment |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102752076A (en) * | 2012-06-20 | 2012-10-24 | 华为技术有限公司 | Control method, device and computer system for data transmission |
CN110809288A (en) * | 2019-11-04 | 2020-02-18 | 腾讯科技(深圳)有限公司 | Network congestion control method, device, equipment and medium |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2011150651A1 (en) * | 2010-12-29 | 2011-12-08 | 华为技术有限公司 | Congestion control method and device for data transmission |
EP3103218A4 (en) * | 2014-02-04 | 2017-09-06 | Distrix Networks Ltd. | Bandwidth and latency estimation in a communication network |
CN108075988A (en) * | 2017-11-16 | 2018-05-25 | 华为技术有限公司 | Data transmission method and device |
CN110460533B (en) * | 2019-07-12 | 2023-09-19 | 锐捷网络股份有限公司 | RDMA (remote direct memory Access) -based data transmission method and device |
CN113852563B (en) * | 2021-09-22 | 2023-10-31 | 深圳市元征科技股份有限公司 | Message data transmission method and device, terminal equipment and readable storage medium |
CN114945004B (en) * | 2022-05-23 | 2024-01-02 | 国网信息通信产业集团有限公司 | Congestion control method, congestion control device, electronic equipment and storage medium |
-
2022
- 2022-08-31 CN CN202211056200.XA patent/CN115426689B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102752076A (en) * | 2012-06-20 | 2012-10-24 | 华为技术有限公司 | Control method, device and computer system for data transmission |
CN110809288A (en) * | 2019-11-04 | 2020-02-18 | 腾讯科技(深圳)有限公司 | Network congestion control method, device, equipment and medium |
Also Published As
Publication number | Publication date |
---|---|
CN115426689A (en) | 2022-12-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9923821B2 (en) | Managing communication congestion for internet of things devices | |
US10057150B2 (en) | Managing communication congestion for internet of things devices | |
CN110430457B (en) | Method and device for playing different-end audio and video and audio playing system | |
US8493859B2 (en) | Method and apparatus for adaptive bandwidth control with a bandwidth guarantee | |
JP4491257B2 (en) | Controlling the admission of data streams to the network based on end-to-end measurements | |
US20170187642A1 (en) | Managing communication congestion for internet of things devices | |
CN110535861B (en) | Method and device for counting SYN packet number in SYN attack behavior identification | |
CN115396067A (en) | Retransmission control method, communication interface and electronic device | |
CN114938354B (en) | Congestion control method, device, equipment and storage medium | |
CN110830460B (en) | Connection establishing method and device, electronic equipment and storage medium | |
CN115426689B (en) | Message transmission method, device, electronic device and storage medium | |
CN112653635A (en) | Congestion control algorithm improvement method, device, equipment and storage medium | |
CN113872870B (en) | Method for controlling network congestion and related device | |
CN108965066B (en) | Method and device for detecting transmission path | |
JP2015225574A (en) | Control device, control method and program | |
CN112737940A (en) | A method and device for data transmission | |
WO2025139039A1 (en) | Reporting control method, system and apparatus for internet-of-things device, and medium | |
CN113726691B (en) | Bandwidth reservation method, device, equipment and storage medium | |
US20100246422A1 (en) | Network device and method of measuring upstream bandwidth employed thereby | |
CN112866767B (en) | Screen projection control method and device, electronic equipment and storage medium | |
CN116827853A (en) | Path processing method and device and electronic equipment | |
JP6093317B2 (en) | Non-freeze video distribution network system | |
CN115190157A (en) | RPC timeout mechanism setting method, device, equipment and medium | |
JPWO2017077704A1 (en) | Throughput measuring apparatus, method and program | |
US9882751B2 (en) | Communication system, communication controller, communication control method, and medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |