Bandwidth sampling method and device and congestion control method and device
By using the bandwidth sampling method driven by the system clock and target time interval in network communication, and combining the historical sampling bandwidth to calculate the smooth value, the problem of bandwidth sampling in the prior art is solved, and the accuracy of congestion control is improved.
Patent Information
- Application Number
- CN202410121985.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-29
- Publication Date
- 2025-07-29
AI Technical Summary
The existing bandwidth sampling methods are not very accurate in some network communication scenarios, resulting in inaccurate congestion control strategies.
The clock driving method based on the system clock and the target time interval is adopted to obtain the data transmission amount of the target link during the target sampling period, and calculate the bandwidth smooth value based on the historical sampling bandwidth to determine the target bandwidth.
Improves the accuracy of bandwidth sampling, improves the accuracy of congestion control, and avoids sampling lag problems caused by ack packet aggregation, delay or loss.
Smart Images

Figure CN120389972A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of network communication technologies, and particularly to a bandwidth sampling method and apparatus, and a congestion control method and apparatus. Background Art
[0002] Congestion control in network communication is to prevent too much data from being injected into the network to cause congestion, so that routers or links will not be overloaded, thereby improving the quality of service (QoS) of the network.
[0003] Among them, bandwidth sampling is an important part of the congestion control method. The accuracy of the bandwidth sampling result greatly affects the effectiveness of the congestion control method implementation. However, the accuracy of the network communication bandwidth sampled by the current bandwidth sampling method is not high. Summary of the Invention
[0004] Embodiments of the present disclosure provide a bandwidth sampling method and apparatus, and a congestion control method and apparatus. The bandwidth sampling method can improve the accuracy of bandwidth sampling, and further, the congestion control method based on the bandwidth sampling method can improve the accuracy of congestion control.
[0005] The first aspect of the present disclosure provides a bandwidth sampling method, the method including:
[0006] Based on the system clock and a target time interval, obtaining the data transmission amount corresponding to the acknowledgment data received by a target link within a target sampling period;
[0007] Calculating a sampling bandwidth according to the data transmission amount and the target time interval;
[0008] Obtaining a historical sampling bandwidth of the target link, where the historical sampling bandwidth is calculated based on the data transmission amounts corresponding to the acknowledgment data received within a plurality of sampling periods, and the period lengths of the plurality of sampling periods corresponding to the target sampling period are all the target time interval;
[0009] Calculating a bandwidth smoothing value based on the sampling bandwidth and the historical sampling bandwidth, and determining the bandwidth smoothing value as the target bandwidth of the target link in the target sampling period.
[0010] The second aspect of the present disclosure provides a bandwidth sampling apparatus, the apparatus including:
[0011] A first obtaining unit, configured to obtain the data transmission amount corresponding to the acknowledgment data received by a target link within a target sampling period based on the system clock and a target time interval;
[0012] A first calculation unit for calculating a sampling bandwidth according to the data transmission volume and the target time interval;
[0013] A second acquisition unit for acquiring the historical sampling bandwidth of the target link, where the historical sampling bandwidth is calculated based on the data transmission volumes corresponding to the response data received within a plurality of sampling periods, and the cycle lengths of the plurality of sampling periods corresponding to the target sampling period are all the target time interval;
[0014] A second calculation unit for calculating a bandwidth smoothing value based on the sampling bandwidth and the historical sampling bandwidth, and determining the bandwidth smoothing value as the target bandwidth of the target link in the target sampling period.
[0015] Optionally, in some embodiments, the bandwidth sampling device provided by the present disclosure includes a first time interval determination unit, and the time interval determination unit includes:
[0016] A first acquisition subunit for acquiring a plurality of time interval candidate values;
[0017] A sampling subunit for respectively using each time interval candidate value as the cycle length of the bandwidth sampling period to perform bandwidth sampling on the target link to obtain a plurality of bandwidth sampling results;
[0018] A second acquisition subunit for acquiring a plurality of computing resource consumption amounts when using each time interval candidate value as the cycle length of the bandwidth sampling period to perform bandwidth sampling on the target link;
[0019] A first determination subunit for determining a target time interval from the plurality of time interval candidate values according to the plurality of bandwidth sampling results and the plurality of computing resource consumption amounts.
[0020] Optionally, in some embodiments, the determination subunit includes:
[0021] A first determination module for determining a first evaluation score corresponding to each time interval candidate value based on the plurality of bandwidth sampling results and a reference bandwidth sampling result;
[0022] A second determination module for determining a second evaluation score corresponding to each time interval candidate value according to the plurality of computing resource consumption amounts;
[0023] A first calculation module for calculating a target evaluation score corresponding to each time interval candidate value according to the evaluation score and the second evaluation score;
[0024] A third determination module for determining a target time interval from the plurality of time interval candidate values according to the target evaluation score.
[0025] Optionally, in some embodiments, the bandwidth sampling device provided by the present disclosure further includes a second time interval determination unit, and the second time interval determination unit includes:
[0026] A third acquisition subunit, configured to acquire the system frequency of the bandwidth sampling terminal;
[0027] A first calculation subunit, configured to calculate a target time interval based on the system frequency.
[0028] Optionally, in some embodiments, the second calculation unit includes:
[0029] A fourth acquisition subunit, configured to acquire a smoothing parameter;
[0030] A second calculation subunit, configured to perform smoothing calculation on the sampling bandwidth and the historical sampling bandwidth according to the smoothing parameter to obtain a bandwidth smoothing value;
[0031] A second determination subunit, configured to determine the bandwidth smoothing value as the target bandwidth of the target link.
[0032] Optionally, in some embodiments, the second calculation subunit includes:
[0033] A second calculation module, configured to calculate a first weight coefficient corresponding to the sampling bandwidth and a second weight coefficient corresponding to the historical sampling bandwidth according to the smoothing parameter;
[0034] A third calculation module, configured to perform weighted calculation on the sampling bandwidth and the historical sampling bandwidth based on the first weight coefficient and the second weight coefficient to obtain a bandwidth smoothing value.
[0035] Optionally, in some embodiments, the second calculation unit includes:
[0036] A fifth acquisition subunit, configured to acquire the data sending rate of the data sending end;
[0037] A third calculation subunit, configured to, when the sampling bandwidth is not greater than the data sending rate, calculate a bandwidth smoothing value based on the sampling bandwidth and the historical sampling bandwidth, and determine the bandwidth smoothing value as the target bandwidth of the target link in the target sampling period;
[0038] A fourth calculation subunit, configured to, when the sampling bandwidth is greater than the data sending rate, calculate a bandwidth smoothing value based on the data sending rate and the historical sampling bandwidth, and determine the bandwidth smoothing value as the target bandwidth of the target link in the target sampling period.
[0039] Optionally, in some embodiments, the fourth calculation subunit includes:
[0040] A fourth determination module, configured to determine that the data sending rate is the target bandwidth of the target link in the target sampling period when the sampling bandwidth is greater than the data sending rate and the historical sampling bandwidth is 0;
[0041] A fourth calculation module, configured to calculate a bandwidth smoothing value based on the data sending rate and the historical sampling bandwidth when the sampling bandwidth is greater than the data sending rate and the historical sampling bandwidth is not 0, and determine the bandwidth smoothing value as the target bandwidth of the target link in the target sampling period.
[0042] Optionally, in some embodiments, the bandwidth sampling device provided by the present disclosure further includes:
[0043] A fifth calculation subunit, configured to calculate a ratio between the data sending rate and the sampling bandwidth when it is detected that the sampling bandwidth is greater than the data sending rate in a continuous preset number of sampling periods;
[0044] A correction subunit, configured to correct the target time interval based on the ratio.
[0045] Optionally, in some embodiments, the bandwidth sampling device provided by the present disclosure further includes:
[0046] An update subunit, configured to update the historical sampling bandwidth based on the target bandwidth;
[0047] A storage subunit, configured to store the historical sampling bandwidth to a preset storage location.
[0048] The third aspect of the present disclosure provides a congestion control method, and the method includes:
[0049] Obtaining the link bandwidth of a target link, where the link bandwidth is the target bandwidth sampled by the bandwidth sampling method provided in the first aspect;
[0050] Determining a congestion control strategy based on the link bandwidth;
[0051] Performing congestion control on the target link according to the congestion control strategy.
[0052] The fourth aspect of the present disclosure provides a congestion control device, and the device includes:
[0053] A third obtaining unit, configured to obtain the link bandwidth of a target link, where the link bandwidth is the target bandwidth sampled by the bandwidth sampling method provided in the first aspect;
[0054] A determining unit, configured to determine a congestion control strategy based on the link bandwidth;
[0055] A control unit for performing congestion control on the target link according to the congestion control policy.
[0056] The fifth aspect of the present disclosure provides a storage medium storing a computer program, which when executed by a processor implements the bandwidth sampling method described in the first aspect or the congestion control method described in the third aspect.
[0057] The sixth aspect of the present disclosure provides a computer device including a memory and a processor, the memory storing a computer program, and the processor implementing the bandwidth sampling method described in the first aspect or the congestion control method described in the third aspect when executing the computer program.
[0058] The seventh aspect of the present disclosure provides a computer program product including a computer program, which is read and executed by a processor of a computer device, so that the computer device executes the bandwidth sampling method described in the first aspect or the congestion control method described in the third aspect.
[0059] The bandwidth sampling method provided by the embodiments of the present disclosure obtains the data transmission volume corresponding to the response data received by the target link within the target sampling period based on the system clock and the target time interval; calculates the sampling bandwidth according to the data transmission volume and the target time interval; obtains the historical sampling bandwidth of the target link, where the historical sampling bandwidth is calculated based on the data transmission volume corresponding to the response data received within multiple sampling periods, and the cycle lengths of the multiple sampling periods corresponding to the target sampling period are all the target time interval; calculates the bandwidth smoothing value based on the sampling bandwidth and the historical sampling bandwidth, and determines the bandwidth smoothing value as the target bandwidth of the target link in the target sampling period.
[0060] The embodiments of the present disclosure perform clock-driven bandwidth sampling by using the system clock and the target time interval as the sampling period. Compared with the related art that fixedly uses response data packets and round-trip delay to trigger bandwidth sampling, this solution can avoid the problem of inaccurate link bandwidth obtained by sampling in some scenarios, and thus can improve the accuracy of bandwidth sampling.
[0061] Other features and advantages of the present disclosure will be described in the following specification, and will be partially obvious from the specification, or will be understood by implementing the present disclosure. The objectives and other advantages of the present disclosure can be achieved and obtained through the structures specifically pointed out in the specification, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] The drawings are used to provide a further understanding of the technical solutions of the present disclosure, and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the technical solutions of the present disclosure, and do not constitute a limitation to the technical solutions of the present disclosure.
[0063] Figure 1 A system architecture diagram applied to the bandwidth sampling method of the embodiments of the present disclosure;
[0064] Figure 2 A flowchart diagram of the bandwidth sampling method provided by the present disclosure;
[0065] Figure 3 A scatter plot connection diagram of the sampling bandwidth corresponding to multiple sampling periods;
[0066] Figure 4 A scatter plot connection diagram of the target bandwidth corresponding to multiple sampling periods;
[0067] Figure 5 Another flowchart diagram of the bandwidth sampling method provided by the present disclosure;
[0068] Figure 6 A schematic diagram of bandwidth sampling using the WESTWOOD method in the related art;
[0069] Figure 7 A schematic diagram of bandwidth sampling using the WESTWOOD algorithm in a large RTT scenario;
[0070] Figure 8 A schematic diagram of bandwidth sampling using the WESTWOOD algorithm in an ACK aggregation scenario;
[0071] Figure 9 A schematic diagram of bandwidth sampling using the WESTWOOD algorithm in an RTT fluctuation scenario;
[0072] Figure 10 A schematic diagram of bandwidth sampling using the WESTWOOD algorithm in a random packet loss scenario;
[0073] Figure 11 A schematic diagram of bandwidth sampling using the WESTWOOD algorithm in an application restricted scenario;
[0074] Figure 12 A schematic diagram of bandwidth sampling using the solution provided by the present disclosure in a large RTT scenario;
[0075] Figure 13 A schematic diagram of bandwidth sampling using the solution provided by the present disclosure in an ACK aggregation scenario;
[0076] Figure 14 A schematic diagram of bandwidth sampling using the solution provided by the present disclosure in an RTT fluctuation scenario or a random packet loss scenario
[0077] Figure 15Schematic diagram for bandwidth sampling using the solution provided by the present disclosure in an application - restricted scenario;
[0078] Figure 16 Flow schematic diagram of the congestion control method provided by the present disclosure;
[0079] Figure 17 Structural schematic diagram of the bandwidth sampling device provided by the embodiments of the present disclosure;
[0080] Figure 18 Structural schematic diagram of the congestion control device provided by the embodiments of the present disclosure;
[0081] Figure 19 Terminal structure diagram for implementing the methods according to an embodiment of the present disclosure;
[0082] Figure 20 Server structure diagram for implementing the methods according to an embodiment of the present disclosure. Detailed implementation manners
[0083] In order to make the objectives, technical solutions and advantages of the present disclosure more clear and understandable, the present disclosure will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present disclosure and are not used to limit the present disclosure.
[0084] Before further elaborating on the embodiments of the present disclosure, the nouns and terms involved in the embodiments of the present disclosure are described. The nouns and terms involved in the embodiments of the present disclosure are applicable to the following explanations:
[0085] Congestion control method: From the perspective of the location where the congestion control method is implemented, the congestion control method can be divided into terminal - based congestion control and link (router) - based congestion control. The link method is executed in network devices (such as routers or switches), and its function is to detect the occurrence of network congestion and generate congestion feedback information. The terminal method is executed in hosts or network edge devices, and its function is to adjust the sending rate according to the feedback information. The key words in the design of congestion control algorithms are how to generate feedback information and how to respond to the feedback information.
[0086] Bandwidth: Bandwidth is applied in many fields and can be used to identify the data transmission capacity of signal transmission and the amount of data passing through a link per unit time. In the present disclosure, bandwidth is used to identify the data transmission capacity of a link, that is, the amount of data that can pass through a link per unit time, usually expressed in bps, that is, the number of bits that can be transmitted per second.
[0087] Round Trip Time (RTT): This refers to the time it takes to send data across a network. Specifically, it refers to the time it takes for the sender to send data, for the receiver to receive the data, and for the acknowledgment packet (ACK) to return to the sender. Round Trip Time plays a crucial role in networks, reflecting the network's latency.
[0088] Bandwidth sampling is an important part of the congestion control algorithm. The accuracy of bandwidth sampling greatly affects the effectiveness of congestion control on network links, and thus affects the quality of service of the network. In related technologies, the more commonly used congestion control methods based on bandwidth sampling are WESTWOOD and BBR. Among them, BBR stands for Bottleneck Bandwidth and Round-trip propagation time, which means bottleneck bandwidth and round-trip transmission time. That is, the BBR method is specifically a congestion control algorithm based on bottleneck bandwidth and round-trip delay. The WESTWOOD method is often used to perform bandwidth sampling on wireless link-type connections. Whether it is the BBR algorithm or the WESTWOOD algorithm, the core idea of bandwidth sampling is to trigger bandwidth sampling with ACK packets. Specifically, when the time difference between the reception time of the first ACK packet and the reception time of the second ACK packet received before reaches one RTT, the bandwidth sampling logic is triggered. The method of triggering bandwidth sampling based on ACK packets may have the problem of insufficient sampling accuracy in some scenarios.
[0089] For example, when transmitting data across borders or via satellite networks, the long distance between the data sender and receiver results in a long RTT for a round trip, often reaching seconds. In this scenario, due to the small initial link window and the long RTT, the window grows slowly, and it takes a long time for data to fill the entire link. Consequently, in the early stages of data transmission, the long RTT can cause insufficient data transmission on the data link, leading to a small sampling bandwidth.
[0090] For example, in some scenarios, the receiver aggregates multiple ACK packets when returning them. Therefore, if the ACK packet that triggers bandwidth sampling is received after the RTT, the bandwidth sampling result will lag due to the delayed reception of the ACK packet that triggers bandwidth sampling, which may lead to inaccurate congestion control policy formulation.
[0091] For example, in some scenarios, such as wireless network data transmission, network fluctuations can cause ACK packets to take longer to return to the data sender, resulting in RTT fluctuations. In these RTT fluctuations, the ACK triggering mechanism can be delayed, leading to delayed bandwidth sampling results and inaccurate congestion control strategies.
[0092] For example, in some scenarios, such as wireless network data transmission, random packet loss often occurs in wireless networks. When the data receiver sends an ACK packet to the data sender, if the ACK packet is lost due to random packet loss, the current ACK packet-triggered mechanism will cause bandwidth sampling delays, resulting in inaccurate congestion control policy formulation.
[0093] For example, in some scenarios, such as streaming services where application constraints are frequent (i.e., no data at the application layer), the link cannot be fully utilized because the application layer does not have enough data for the transport layer to perform bandwidth sampling. In this case, due to insufficient ACK packets being returned, triggering bandwidth sampling based on ACK packets will result in a smaller bandwidth value.
[0094] In order to solve the problem in the above scenario that the bandwidth sampling mechanism based on the returned ACK packet triggering bandwidth sampling causes inaccurate or delayed bandwidth sampling, the present disclosure provides a bandwidth sampling method, which can improve the accuracy of bandwidth sampling.
[0095] System Architecture and Scenario Description Applied in Embodiments of the Present Disclosure
[0096] Figure 1 1 is a system architecture diagram for the bandwidth sampling method according to an embodiment of the present disclosure, which includes a terminal 140, the Internet 130, a gateway 120, a server 110, and the like.
[0097] Terminal 140 can take various forms, including desktop computers, laptops, PDAs (personal digital assistants), mobile phones, in-vehicle terminals, home theater terminals, dedicated terminals, intelligent voice interaction devices, smart home appliances, aircraft, or the control terminal of a colposcopy image acquisition system. Furthermore, it can be a single device or a collection of multiple devices. Terminal 140 can communicate with Internet 130 via wired or wireless means to exchange data.
[0098] Server 110 refers to a computer system that can provide certain services to terminal 140. Compared with ordinary terminal 140, server 110 has higher requirements in terms of stability, security, performance, etc. Server 110 can be a high-performance computer in a network platform, a cluster of multiple high-performance computers, a part (such as a virtual machine) partitioned from a high-performance computer, a combination of parts (such as virtual machines) partitioned from multiple high-performance computers, etc.
[0099] The gateway 120 is also called an internetwork connector and protocol converter. The gateway realizes network interconnection at the transport layer and is a computer system or device that acts as a converter. Between two systems using different communication protocols, data formats, or languages, and even with completely different architectures, the gateway is a translator. At the same time, the gateway can also provide filtering and security functions. The message sent by terminal 140 to server 110 needs to be sent to the corresponding server 110 through gateway 120. The message sent by server 110 to terminal 140 also needs to be sent to the corresponding terminal 140 through gateway 120.
[0100] The bandwidth sampling method provided by the embodiments of the present disclosure can be implemented in terminal 140 or in server 110.
[0101] When the bandwidth sampling method provided by the embodiments of the present disclosure is implemented in terminal 140, terminal 140 obtains the data transmission amount corresponding to the response data received by the target link within the target sampling period based on the system clock and the target time interval; calculates the sampling bandwidth according to the data transmission amount and the target time interval; terminal 140 obtains the historical sampling bandwidth of the target link, and the historical sampling bandwidth is calculated based on the data transmission amounts corresponding to the response data received within multiple sampling periods, and the cycle lengths of the multiple sampling periods corresponding to the target sampling period are all the target time interval; calculates the bandwidth smoothing value based on the sampling bandwidth and the historical sampling bandwidth, and determines the bandwidth smoothing value as the target bandwidth of the target link in the target sampling period.
[0102] When the bandwidth sampling method provided by the embodiments of the present disclosure is implemented in server 110, server 110 obtains the data transmission amount corresponding to the response data received by the target link within the target sampling period based on the system clock and the target time interval; calculates the sampling bandwidth according to the data transmission amount and the target time interval; server 110 obtains the historical sampling bandwidth of the target link, and the historical sampling bandwidth is calculated based on the data transmission amounts corresponding to the response data received within multiple sampling periods, and the cycle lengths of the multiple sampling periods corresponding to the target sampling period are all the target time interval; calculates the bandwidth smoothing value based on the sampling bandwidth and the historical sampling bandwidth, and determines the bandwidth smoothing value as the target bandwidth of the target link in the target sampling period.
[0103] The bandwidth sampling method provided by the embodiments of the present disclosure can be applied to various data transmission scenarios, and is specifically applied to congestion control of a data transmission link based on the link bandwidth sampled by the bandwidth sampling method in various data transmission scenarios.
[0104] For example, in a live broadcast application scenario, a server transmits a live broadcast image of a host to each live broadcast application client for live display. After the server transmits the live broadcast image to the client, the client will return an ack packet to the server to confirm receipt of the data transmitted by the server. The server then performs clock-driven periodic bandwidth sampling based on its own system clock and a preset target time interval. Then, the smoothed bandwidth is calculated based on the sampled bandwidth and the historical sampled bandwidth in each period, and the smoothed bandwidth is used as the target bandwidth for the current sampling period. Based on clock-driven bandwidth sampling, the problem of inaccurate bandwidth sampling caused by ack packet-driven bandwidth sampling in the above scenarios can be avoided. In this way, the server can formulate a corresponding congestion control strategy according to the sampled target bandwidth, such as increasing or decreasing the data transmission rate of the live broadcast image sent to perform congestion control on the data transmission link.
[0105] Alternatively, in a cloud game scenario, a terminal transmits operation data of an object to a cloud server for processing. After the cloud server receives the operation data sent by the terminal, it will return an ack packet to the terminal (i.e., the cloud game client) to confirm receipt of the operation data transmitted by the terminal. The terminal then performs clock-driven periodic bandwidth sampling based on its own system clock and a preset target time interval. Then, the smoothed bandwidth is calculated based on the sampled bandwidth and the historical sampled bandwidth in each period, and the smoothed bandwidth is used as the target bandwidth for the current sampling period. Based on clock-driven bandwidth sampling, the problem of inaccurate bandwidth sampling caused by ack packet-driven bandwidth sampling in the above scenarios can be avoided. In this way, the terminal can formulate a corresponding congestion control strategy according to the sampled target bandwidth, such as increasing or decreasing the data transmission rate of the operation data sent to perform congestion control on the data transmission link.
[0106] The above examples do not limit the protection scope of this case.
[0107] General Description of Embodiments of the Present Disclosure
[0108] According to an embodiment of the present disclosure, a bandwidth sampling method is provided. As Figure 2 shown, it is a schematic flowchart of a bandwidth sampling method provided by the present disclosure. This method can be applied to a bandwidth sampling device, and the bandwidth sampling device can be integrated in a computer device, and the computer device can specifically be a terminal or a server. The bandwidth sampling method can include:
[0109] Step 210: Based on the system clock and the target time interval, obtain the data transmission volume corresponding to the response data received by the target link within the target sampling period.
[0110] To address the problem that in the congestion control method of related technologies, bandwidth sampling is triggered based on ack packets, resulting in lag and insufficient accuracy in the bandwidth sampling method triggered by ack packets when ack packets are aggregated, delayed, lost, or when the link is not filled with ack packets, the present disclosure provides a clock-driven bandwidth sampling method. Herein, the clock can specifically be the system clock, and in this case, the system clock can specifically be the system clock of the bandwidth sampling terminal. More precisely, it can be the system clock of the operating system of the bandwidth sampling terminal. The bandwidth sampling terminal in the embodiments of this application is specifically a data sending terminal, which can specifically be a server or a terminal.
[0111] The system clock is used to measure the system time, which is usually implemented as a simple count of the number of ticks that have occurred since a certain arbitrary start date (referred to as the epoch). For example, Unix (an operating system) and Portable Operating System Interface of UNIX (POSIX)-compatible systems encode the system time as the number of seconds elapsed since the Unix epoch began. The system time can be converted into calendar time for better understanding.
[0112] In the embodiments of the present disclosure, the clock-driven bandwidth sampling method is based on the system clock. It can take any system time as the starting point, and then take a sampling point for bandwidth sampling every target time interval. The time between two sampling points is a sampling period, and the end node of the sampling period in the time dimension is the sampling node corresponding to this sampling period. Next, taking any target sampling period as an example, the process of bandwidth sampling provided by the present disclosure will be introduced in detail.
[0113] First, after determining the target sampling period, the data transmission volume corresponding to the response data received by the target link within the target sampling period can be obtained. Among them, bandwidth sampling is performed on the target link for data transmission. The target link can be divided into multiple-hop links by a router, and bandwidth sampling can be to sample the bandwidth of the bottleneck link among these multiple-hop links. After the bandwidth sampling terminal sends data to the data receiver, the data receiver will return an ack packet, which records the data volume of the data received by the data receiver, that is, the data volume transmitted by the bandwidth sampling terminal to the data receiver based on this link. During the target sampling period, the bandwidth sampling terminal may receive one or more response data (i.e., the aforementioned ack packets), or may not receive any response data. If response data is received, the data transmission volume corresponding to these response data can be further determined.
[0114] That is, the bandwidth sampling method provided by the embodiments of the present disclosure may be based on the system clock of the bandwidth sampling terminal, set a moment as the starting moment, and then obtain the data transmission volume corresponding to the response data received in the current sampling period every target time interval, and further determine the sampling bandwidth corresponding to the current sampling node according to the target time interval and the data transmission volume corresponding to the response data received in the sampling period.
[0115] In some embodiments, the process of determining the target time interval includes:
[0116] Obtain multiple candidate values of time intervals;
[0117] Take each candidate value of the time interval as the cycle length of the bandwidth sampling period, and perform bandwidth sampling on the target link to obtain multiple bandwidth sampling results;
[0118] Obtain multiple consumption amounts of computing resources when performing bandwidth sampling on the target link with each candidate value of the time interval as the cycle length of the bandwidth sampling period;
[0119] Determine the target time interval from the multiple candidate values of the time interval according to the multiple bandwidth sampling results and the multiple consumption amounts of computing resources.
[0120] In the clock-driven bandwidth sampling method provided by the present disclosure, when the time interval is set to be relatively large, the bandwidth sampling result will be lagged, which will cause the formulated congestion control strategy to not match the current data transmission state of the link, that is, the formulation of the congestion control strategy is inaccurate. Therefore, generally, a smaller time interval needs to be set, that is, the time length of the sampling period is reduced, and the bandwidth sampling frequency is increased, so as to ensure the timeliness of the sampling result of the bandwidth sampling. Moreover, a higher sampling frequency can also identify the idle periods when the link is not fully occupied by data in the initial stage of the link and the application-limited stage as invalid sampling nodes and eliminate them, thereby improving the accuracy of the bandwidth sampling.
[0121] In the related art, ack packets are used to trigger bandwidth sampling, and the RTT is used as a reference for the sampling period to perform bandwidth sampling. Since the RTT is affected by factors such as the data link transmission state and the link distance and cannot be actively adjusted to increase the sampling frequency, the clock-driven bandwidth sampling method provided in this case can flexibly control the bandwidth sampling frequency by setting different target time intervals, thereby improving the accuracy of the bandwidth sampling and the timeliness of the sampling result.
[0122] However, while theoretically setting a higher bandwidth sampling frequency can improve bandwidth sampling accuracy and the timeliness of sampling results, setting a bandwidth sampling frequency that is too high may also lead to excessive processor computing resources. Furthermore, in some cases, setting a higher bandwidth sampling frequency may also result in excessively large sampling bandwidths, leading to inaccurate sampling results. Therefore, in clock-driven bandwidth sampling methods, setting a reasonable sampling period is extremely important.
[0123] In an embodiment of the present disclosure, a plurality of candidate time interval values may be obtained first. These candidate time interval values may be time interval candidate values determined based on experience. Then, each candidate time interval value may be used as the period length of the bandwidth sampling period to perform bandwidth sampling on the target link to obtain a plurality of bandwidth sampling results. Then, a plurality of computing resource consumptions when bandwidth sampling is performed on the target link using each candidate time interval value as the period length of the bandwidth sampling period are obtained. Here, the computing resource consumption refers to the computing resource consumption of the processor when processing the bandwidth sampling process. Furthermore, the target time interval may be determined from the plurality of candidate time interval values based on the plurality of bandwidth sampling results and the plurality of computing resource consumptions. In this way, the optimal target time interval with accurate bandwidth sampling results and moderate computing resource consumption may be determined based on the bandwidth sampling results and the corresponding computing resource consumption corresponding to each candidate time interval value.
[0124] In some embodiments, determining a target time interval from a plurality of time interval candidate values according to a plurality of bandwidth sampling results and a plurality of computing resource consumptions includes:
[0125] Determine a first evaluation score corresponding to each time interval candidate value based on the multiple bandwidth sampling results and the reference bandwidth sampling result;
[0126] Determine a second evaluation score corresponding to each time interval candidate value according to the plurality of computing resource consumptions;
[0127] Calculate the target evaluation score corresponding to each time interval candidate value based on the evaluation score and the second evaluation score;
[0128] A target time interval is determined from among a plurality of time interval candidates according to the target evaluation score.
[0129] In some embodiments, after obtaining the bandwidth sampling results corresponding to each time interval candidate value and the computing resource consumption corresponding to each time interval candidate value, each time interval candidate value can be further scored based on the bandwidth sampling results and computing resource consumption corresponding to each time interval candidate value, and then the target time interval is determined based on the score of each time interval candidate value.
[0130] Specifically, the reference bandwidth sampling result of the target link can be obtained. The reference bandwidth sampling result can be the ideal value of the target link under stable link conditions, and it can also be the bandwidth sampling result obtained by sampling the bandwidth of the target link under certain constraint conditions. For example, after the data transmission of the target link runs stably, when the window enters the steady state, the data transmission is in the link-limited stage (i.e., there is sufficient data to be sent), and the ack packets are not sent in an aggregated manner, the traditional bandwidth sampling method can be used to sample the bandwidth of the target link for a period of time, and the smoothed value of the sampled bandwidth during this period is calculated to obtain the reference bandwidth sampling result.
[0131] After obtaining the reference bandwidth sampling result, the first evaluation score corresponding to each time interval candidate value can be determined based on the difference between the bandwidth sampling result corresponding to each time interval candidate value and the reference bandwidth sampling result. The first evaluation score can also be understood as the sampling result accuracy score. Specifically, this score can be obtained by calculating the similarity between the bandwidth sampling result corresponding to each time interval candidate value and the reference bandwidth sampling result. The closer the bandwidth sampling result is to the reference bandwidth sampling result, the higher the first evaluation score.
[0132] Then, the second evaluation score corresponding to each time interval candidate value can be determined according to the computing resource consumption corresponding to each time interval candidate value. The second evaluation score can specifically be the computing resource consumption score. Generally, the smaller the computing resource consumption, the higher the second evaluation score.
[0133] After determining the first evaluation score and the second evaluation score corresponding to each time interval candidate value, the target evaluation score corresponding to each time interval candidate value can be further calculated based on the first evaluation score and the second evaluation score corresponding to each time interval candidate value. Specifically, a weight parameter value can be set for the first evaluation score and the second evaluation score respectively. For example, the weight parameter value of the first evaluation score can be set to be larger and the weight parameter value of the second evaluation score can be set to be smaller, that is, the accuracy of the bandwidth sampling result is more important; or in some other scenarios, such as when sampling the bandwidth of a large-scale link, the computing resource consumption may be more important. In this case, the weight parameter value of the second evaluation score can be set to be larger and the weight parameter value of the first evaluation score can be set to be smaller. Then, the first evaluation score and the second evaluation score are weighted based on different weight parameters to obtain the target evaluation score corresponding to each time interval candidate value.
[0134] After calculating the target evaluation score corresponding to each time interval candidate value, the time interval candidate value with the highest target evaluation score can be determined as the target time interval.
[0135] In some embodiments, the process of determining the target time interval includes:
[0136] Obtain the system frequency of the bandwidth sampling terminal;
[0137] Calculate the target time interval based on the system frequency.
[0138] In the embodiments of the present disclosure, a method for efficiently determining the target time interval is provided. Specifically, the target time interval can be directly calculated according to the system frequency of the bandwidth sampling terminal. Taking the linux (an operating system) kernel as an example, for instance, its system frequency (CONFIG_HZ) is 200, then the target time interval can be calculated as 5 milliseconds (ms). This method can directly determine a relatively reasonable target time interval, and this time interval is less than the general RTT, which can increase the bandwidth sampling frequency, thereby improving the accuracy of bandwidth sampling and the timeliness of sampling results.
[0139] In some embodiments, the time interval calculated based on the system frequency of the bandwidth sampling terminal can also be used as a candidate time interval and added to the obtained multiple candidate time intervals, and then the foregoing method is used to uniformly evaluate the optimal target time interval from these candidate time intervals.
[0140] Step 220, calculate the sampling bandwidth according to the data transmission volume and the target time interval.
[0141] After obtaining the data transmission volume corresponding to the response data received within the target sampling period, the sampling bandwidth of the target link within the sampling period can be further calculated according to the data transmission volume and the cycle duration of the sampling period, that is, the target time interval.
[0142] Specifically, calculating the sampling bandwidth within the target sampling period according to the data transmission volume and the target time interval can be to calculate the ratio of the data transmission volume to the target time interval.
[0143] Among them, in some embodiments, multiple response data may be received or no response data may be received within the target sampling period. When no response data is received within the target sampling period, the sampling node corresponding to this sampling period can be determined as an invalid sampling node, and this sampling node can be invalidated. In this way, in the initial stage of link operation, large RTT scenarios, and application-limited scenarios, a large number of sampling periods without receiving ack packets are excluded as invalid sampling nodes, thereby avoiding the problem that the bandwidth sampling value is too small due to insufficient data window in the above scenarios.
[0144] In the bandwidth sampling method provided by the present disclosure, the sampling bandwidth calculated based on the data transmission volume corresponding to the response data received within the target sampling period and the target time interval in this step can only be used as an intermediate value in the bandwidth sampling process of the target sampling period, and further smoothing processing is required to obtain the target bandwidth of the target sampling period. Because during the return process of the ack packet, there may also be a situation where ack packets are piled up and returned in the same sampling period, resulting in an abnormally large data transmission volume corresponding to the ack packets in a certain sampling period. Therefore, smoothing processing is needed to obtain a relatively stable sampling bandwidth. When the ack packet pile-up causes the calculated sampling bandwidth in a certain sampling period to be too large, for example, greater than a certain set value, this sampling node can also be excluded as an abnormal node to avoid affecting the accuracy of the sampling bandwidth.
[0145] Step 230, obtain the historical sampling bandwidth of the target link.
[0146] Among them, after calculating the sampling bandwidth based on the data transmission volume corresponding to the response data received within the target sampling period and the target time interval, the sampling bandwidth can be further smoothed. In the embodiments of the present disclosure, smoothing the sampling bandwidth in the target sampling period can specifically be smoothing the calculated sampling bandwidth according to the historical sampling bandwidth to obtain the smoothed bandwidth. The historical sampling bandwidth in this embodiment can be calculated based on the data transmission volume corresponding to the response data received within multiple sampling periods. Here, the multiple sampling periods are specifically multiple sampling periods before the target sampling period. The multiple sampling periods in the present disclosure have the same period duration as the target sampling period, both being the aforementioned target time interval. Specifically, the historical sampling bandwidth can be the smoothed bandwidth corresponding to a valid sampling period before the target sampling period.
[0147] That is, in the embodiments of the present disclosure, among multiple sampling periods, the target bandwidths obtained by sampling corresponding to different sampling periods are not independent and irrelevant. Instead, in each sampling period, the target bandwidth corresponding to the current sampling period is calculated based on the sampling bandwidth calculated based on the data transmission volume corresponding to the response data received within the current sampling period and the target bandwidth corresponding to the previous sampling period.
[0148] Among them, for the historical sampling bandwidth of the target link, a parameter can be initialized at the start of bandwidth sampling, and then after determining the target bandwidth of the current sampling period in each sampling period, the parameter is updated with the target bandwidth of this sampling period. When the historical sampling bandwidth of the target link needs to be obtained, the value of this parameter can be directly called to obtain the historical sampling bandwidth of the target link.
[0149] Step 240: Calculate a bandwidth smoothing value based on the sampling bandwidth and the historical sampling bandwidth, and determine the bandwidth smoothing value as the target bandwidth of the target link in the target sampling period.
[0150] Among them, after calculating the sampling bandwidth of the target sampling period and obtaining the historical sampling bandwidth of the target link, the bandwidth smoothing value can be obtained through smoothing calculation based on the sampling bandwidth and the historical sampling bandwidth, and then the bandwidth smoothing value can be determined as the target bandwidth of the target link in the target sampling period.
[0151] As Figure 3 shown, it is a scatter plot connection diagram of the sampling bandwidths corresponding to multiple sampling periods. As shown in the figure, the sampling loan fluctuates greatly in multiple sampling periods and is not suitable as a direct basis for congestion control. As Figure 4 shown, it is a scatter plot connection diagram of the target bandwidths corresponding to multiple sampling periods. As shown in the figure, after smoothing the sampling bandwidth calculated in each sampling period to obtain the target bandwidth, a more stable sampling bandwidth value can be obtained. Based on the smoothed target bandwidth for congestion control, a better congestion control effect can be achieved.
[0152] In some embodiments, calculating the bandwidth smoothing value based on the sampling bandwidth and the historical sampling bandwidth and determining the bandwidth smoothing value as the target bandwidth of the target link includes:
[0153] Obtain a smoothing parameter;
[0154] Perform smoothing calculation on the sampling bandwidth and the historical sampling bandwidth according to the smoothing parameter to obtain the bandwidth smoothing value;
[0155] Determine the bandwidth smoothing value as the target bandwidth of the target link.
[0156] In the embodiments of the present disclosure, when calculating the bandwidth smoothing value based on the sampling bandwidth and the historical bandwidth, the smoothing parameter can be obtained first, and then the sampling bandwidth and the historical sampling bandwidth are smoothed according to the smoothing parameter to obtain the bandwidth smoothing value. Among them, performing smoothing calculation on the sampling bandwidth and the historical sampling bandwidth according to the smoothing parameter can specifically be to calculate the weight coefficients corresponding to the sampling bandwidth and the historical sampling bandwidth based on the smoothing parameter first, and then perform weighted calculation on the sampling bandwidth and the historical sampling bandwidth according to the calculated corresponding weight coefficients to obtain the bandwidth smoothing value.
[0157] That is, performing smoothing calculation on the sampling bandwidth and the historical sampling bandwidth according to the smoothing parameter to obtain the bandwidth smoothing value includes:
[0158] Calculate the first weight coefficient corresponding to the sampling bandwidth and the second weight coefficient corresponding to the historical sampling bandwidth according to the smoothing parameter;
[0159] Perform a weighted calculation on the sampling bandwidth and the historical sampling bandwidth based on the weight coefficient and the second weight coefficient to obtain a bandwidth smoothing value.
[0160] That is, in the embodiments of the present disclosure, the sampling bandwidth and the target bandwidth are weighted based on the first weight coefficient corresponding to the sampling bandwidth calculated according to the smoothing parameter and the second weight coefficient corresponding to the target bandwidth to obtain a bandwidth smoothing value. Then, the bandwidth smoothing value can be determined as the target bandwidth corresponding to the target sampling period.
[0161] In some embodiments, calculating a bandwidth smoothing value based on the sampling bandwidth and the historical sampling bandwidth, and determining the bandwidth smoothing value as the target bandwidth of the target link in the target sampling period includes:
[0162] Obtain the data sending rate of the data sending end;
[0163] When the sampling bandwidth is not greater than the data sending rate, calculate a bandwidth smoothing value based on the sampling bandwidth and the historical sampling bandwidth, and determine the bandwidth smoothing value as the target bandwidth of the target link in the target sampling period;
[0164] When the sampling bandwidth is greater than the data sending rate, calculate a bandwidth smoothing value based on the data sending rate and the historical sampling bandwidth, and determine the bandwidth smoothing value as the target bandwidth of the target link in the target sampling period.
[0165] In some cases, for example, when ack packets are piled up due to link congestion when returning, there will be a problem that the calculated sampling bandwidth value is too large. When the congestion situation is not serious, for example, when the calculated sampling bandwidth value does not deviate greatly, the above-mentioned smoothing calculation method can be used for adjustment. However, there may also be some cases where the ack packet pile-up is serious, resulting in a large number of sampling periods in which no ack packet is received, and the sampling node is determined to be an invalid node and excluded, and then suddenly there is a sampling period in which the calculated sampling bandwidth value is particularly large.
[0166] To solve the above problems, in the bandwidth sampling method provided by the embodiments of the present disclosure, the data sending rate of the data sending end can be obtained first, where the data sending end and the bandwidth sampling terminal can be the same terminal. Under normal link operation conditions, the data sending rate of the data sending end should be kept greater than the maximum bandwidth of the link, and then there is an appropriate buffer in the bottleneck link. Therefore, when it is detected that the sampling bandwidth is greater than the obtained data sending rate, it means that there is a pile-up situation when the ack packet returns, resulting in an over-large sampling bandwidth. At this time, the obtained data sending rate can be used as the sampling bandwidth to reduce the impact of ack packet pile-up on the accuracy of bandwidth sampling. If it is detected that the sampling bandwidth is not greater than the data sending rate, then the target bandwidth can be further obtained through smoothing calculation based on the sampling bandwidth and the historical sampling bandwidth.
[0167] In some embodiments, when it is detected that the sampling bandwidth is greater than the data transmission rate, the sampling data of this sampling period can also be excluded as invalid sampling data.
[0168] In some embodiments, when the sampling bandwidth is greater than the data transmission rate, a bandwidth smoothing value is calculated based on the data transmission rate and the historical sampling bandwidth, and the bandwidth smoothing value is determined as the target bandwidth of the target link in the target sampling period, including:
[0169] When the sampling bandwidth is greater than the data transmission rate and the historical sampling bandwidth is 0, determine the data transmission rate as the target bandwidth of the target link in the target sampling period;
[0170] When the sampling bandwidth is greater than the data transmission rate and the historical sampling bandwidth is not 0, calculate a bandwidth smoothing value based on the data transmission rate and the historical sampling bandwidth, and determine the bandwidth smoothing value as the target bandwidth of the target link in the target sampling period.
[0171] Among them, at the beginning of bandwidth sampling, there may be a situation where the historical sampling bandwidth is 0. When it is detected that the sampling bandwidth is greater than the data transmission rate and it is also detected that the historical sampling bandwidth is 0, the data transmission rate can be directly determined as the target bandwidth in the target sampling period, and the historical sampling bandwidth is updated according to the data transmission rate. If it is detected that the sampling bandwidth is greater than the data transmission rate and it is also detected that the historical sampling bandwidth is not 0, then the target bandwidth of the target sampling period can be obtained through smoothing calculation based on the data transmission rate and the historical sampling bandwidth.
[0172] In some embodiments, the bandwidth sampling method provided by the present disclosure further includes:
[0173] When it is detected that the sampling bandwidth is greater than the data transmission rate in continuously preset number of sampling periods, calculate the ratio between the data transmission rate and the sampling bandwidth;
[0174] Modify the target time interval based on the ratio.
[0175] In some cases, if the period duration of the sampling period is set too small, that is, the aforementioned target time interval is set too small, even if there is no accumulation when the ack packet returns, there will still be a problem that some periods are excluded as invalid sampling periods, and then the sampling bandwidth obtained by sampling in the valid sampling periods is too large. To avoid the problem of inaccurate bandwidth sampling caused by setting the target time interval too small, in the present disclosure, the sampling bandwidth sampled in the valid sampling periods can be continuously compared with the data transmission rate. If it is detected that the sampling bandwidth is greater than the data transmission rate in continuously preset number of sampling periods, it indicates that the target time interval is set too small. At this time, the target time interval needs to be corrected according to the sampling bandwidth and the data transmission rate.
[0176] Specifically, the ratio between the data transmission rate and the sampling bandwidth can be calculated first, and then the target time interval can be corrected based on this ratio. Specifically, the current target time interval can be multiplied by the above ratio to obtain a new target time interval.
[0177] In some embodiments, after calculating the bandwidth smoothing value based on the sampling bandwidth and the historical sampling bandwidth and determining the bandwidth smoothing value as the target bandwidth of the target link in the target sampling period, the method further includes:
[0178] Updating the historical sampling bandwidth based on the target bandwidth;
[0179] Storing the historical sampling bandwidth in a preset storage location.
[0180] Among them, in the embodiments of the present disclosure, after calculating the target bandwidth of the target sampling period, the historical sampling bandwidth of the target link can be further updated according to the target bandwidth.
[0181] Then the updated historical sampling bandwidth is stored in a preset storage location for future call. The bandwidth sampling method provided by the embodiments of the present disclosure obtains the data transmission amount corresponding to the response data received by the target link within the target sampling period based on the system clock and the target time interval; calculates the sampling bandwidth according to the data transmission amount and the target time interval; obtains the historical sampling bandwidth of the target link, where the historical sampling bandwidth is calculated based on the data transmission amounts corresponding to the response data received within multiple sampling periods, and the cycle lengths of the multiple sampling periods corresponding to the target sampling period are all the target time interval; calculates the bandwidth smoothing value based on the sampling bandwidth and the historical sampling bandwidth, and determines the bandwidth smoothing value as the target bandwidth of the target link in the target sampling period.
[0182] The embodiments of the present disclosure perform clock-driven bandwidth sampling based on the system clock and the target time interval as the sampling period. Compared with the related art that fixedly uses response data packets and round-trip delays to trigger bandwidth sampling, this solution can avoid the problem of inaccurate link bandwidth obtained by sampling in some scenarios, and thus can improve the accuracy of bandwidth sampling.
[0183] Detailed Description of Embodiments of the Present Disclosure in Combination with Specific Application Scenarios
[0184] As Figure 5 shown, it is another flowchart of the bandwidth sampling method provided by the present disclosure. In this embodiment, the bandwidth sampling method will be introduced in detail in combination with the execution subject of each step. Specifically, this embodiment can refer to the aforementioned live application scenario, and the execution subject of each step can be the server corresponding to the live application. The method specifically includes the following steps:
[0185] Step 501, when a data sending instruction is received in the target link, the server initializes the cumulative returned data volume, the sampling bandwidth, the smoothing bandwidth, and determines the cycle duration of the bandwidth sampling period and the smoothing parameter.
[0186] In this embodiment, the bandwidth sampling method proposed in this application will be introduced in detail. First, the principle of bandwidth sampling in related technologies can be introduced, as well as the problems existing in the bandwidth sampling principles of related technologies in multiple scenarios.
[0187] As Figure 6 shown, it is a schematic diagram of bandwidth sampling using the WESTWOOD method in related technologies. The acknowledgment packet A is the first ack of the current sampling period, and when the time difference between the current time and the reception time of the acknowledgment packet A is greater than 1 RTT when the acknowledgment packet P is received, bandwidth sampling is triggered at this time. Assume that the data transmission volume corresponding to each acknowledgment packet is 1500 Bytes (bits), and the reception time difference between the acknowledgment packet A and the acknowledgment packet P is 200 ms. Then the sampling bandwidth size of this sampling period is:
[0188]
[0189] Among them, BW is the sampling bandwidth, ts_ack P is the reception time of the acknowledgment packet P, ts_ack A is the reception time of the acknowledgment packet A, size_ack i is the data transmission volume corresponding to the i-th acknowledgment packet.
[0190] As Figure 7 shown, it is a schematic diagram of bandwidth sampling using the WESTWOOD algorithm in the aforementioned large RTT scenario. Since in related technologies, the reception time difference between two acknowledgment packets needs to reach one RTT to trigger bandwidth sampling, due to the large RTT, it is necessary to wait until the I-th acknowledgment packet is received to trigger bandwidth sampling, which will cause the bandwidth sampling result to be very lagging and unable to meet the timeliness requirements of congestion control for the bandwidth sampling result.
[0191] As Figure 8 shown, it is a schematic diagram of bandwidth sampling using the WESTWOOD algorithm in the aforementioned ACK aggregation scenario. In this embodiment, the acknowledgment packets A - E are aggregated into one acknowledgment packet, the acknowledgment packets F - I are aggregated into one acknowledgment packet, and the acknowledgment packets J - L are aggregated into one acknowledgment packet. As shown in the figure, when one RTT time arrives after the second acknowledgment packet, but since the acknowledgment packets J and K are both aggregated with the acknowledgment packet L, bandwidth sampling will not be triggered until the reception time of the acknowledgment packet L is reached. This will cause the bandwidth sampling result to lag, and due to the aggregation of the acknowledgment packets, the number of acknowledgment packets corresponding to one RTT has changed, which will also lead to inaccurate bandwidth sampling results.
[0192] As Figure 9 shown, it is a schematic diagram of bandwidth sampling using the WESTWOOD algorithm in the aforementioned RTT fluctuation scenario. As shown in the figure, when the response packet F is received, the sampling time reaches an RTT, but it is necessary to receive the next response packet to trigger bandwidth sampling. Due to network fluctuations, the next response packet may take a long time to be received, resulting in a lag in the bandwidth sampling result in this case.
[0193] As Figure 10 shown, it is a schematic diagram of bandwidth sampling using the WESTWOOD algorithm in the aforementioned random packet loss scenario. As shown in the figure, due to random packet loss, response packets G - I are lost. Thus, when an RTT is reached after response packet F, since it is necessary to receive the next response packet to trigger bandwidth sampling, it has to wait until response packet J is received to trigger bandwidth sampling, which also leads to a delay in the bandwidth sampling result.
[0194] As Figure 11 shown, it is a schematic diagram of bandwidth sampling using the WESTWOOD algorithm in the aforementioned application - restricted scenario. As shown in the figure, due to the lack of link data in the application - restricted scenario, when an RTT is reached after receiving response packet F, since there is no data on the link, it takes a long time to wait for the next response packet. Therefore, the bandwidth sampling result lags behind in this case as well.
[0195] In view of the above - mentioned situations, bandwidth sampling is triggered by the next received response packet after the sampling time reaches an RTT. The uncertainty and lag in the reception time of the next response packet will lead to a lag in the bandwidth sampling result. However, in the congestion control method, the timeliness of the bandwidth sampling result is very important. If the bandwidth sampling result lags, it will cause a serious decline in the effect of the congestion control method. Therefore, in order to improve the timeliness and accuracy of the bandwidth sampling result, the present disclosure provides a clock - driven bandwidth sampling method.
[0196] The present disclosure takes the example of a server sending live video data to a live terminal in a live application to introduce the bandwidth sampling method provided by the present disclosure in detail. First, when a data sending instruction is received in the target link, the server can initiate congestion control, and the congestion control program will trigger bandwidth sampling. At this time, the server can start initializing several parameters that need to be used in the bandwidth sampling process, which can specifically include the cumulative amount of returned data acked, the sampling bandwidth BW, and the smoothed bandwidth SBW. The initial values can all be set to 0. Further, the period duration tick of the bandwidth sampling period can be obtained, for example, it can be 5 ms, and the smoothing parameter α = 1 / 8 can be obtained.
[0197] Step 502, when sending data to the data receiver based on the target link, the server enables bandwidth sampling.
[0198] When the server starts to send live video data to the live client based on the target link, the server can trigger the start of bandwidth sampling. That is, start the bandwidth sampling of the first sampling period. In the first sampling period, since the period duration is short, the returned ack packet may not be received. At this time, this period can be determined as an invalid sampling period and excluded. Until an ack packet is received in a certain sampling period.
[0199] Step 503, when the sampling time does not reach the period duration, the server updates the cumulative returned data volume based on the received ack packet.
[0200] Within a sampling period, if the sampling time does not reach the period duration, then the server can update the cumulative returned data volume based on the received ack packet. Specifically, each time an ack packet is received, the data transmission volume corresponding to the ack packet is added to the cumulative returned data volume.
[0201] Step 504, when the sampling time reaches the period duration, the server updates the sampling bandwidth based on the ratio of the cumulative returned data volume to the period duration.
[0202] When the sampling time in a sampling period reaches the period duration, at this time, the sampling bandwidth BW can be calculated according to the sum of the data transmission volumes of all received ack packets in this sampling period, that is, the aforementioned cumulative returned data volume and the period duration. Specifically, the ratio of the sampling bandwidth to the period duration can be calculated to obtain the sampling bandwidth. The formula is as follows:
[0203]
[0204] Step 505, when it is detected that the sampling bandwidth is 0, the server determines this sampling period as an invalid sampling period and starts the next bandwidth sampling.
[0205] In some sampling periods, the returned ack packet may not be received. At this time, the calculated sampling bandwidth value is 0. In this case, the sampling period with a sampling bandwidth value of 0 can be determined as an invalid sampling period and excluded.
[0206] Such as Figure 12The figure shows a schematic diagram of bandwidth sampling using the solution provided by this disclosure in a large RTT scenario. As shown in the figure, BW-(n) is a valid sampling period, and BW-(n-1), BW-(n-2), BW-(n-3), and BW-(n-4) are all invalid sampling periods. During the valid sampling period, the BW is calculated based on the cumulative amount of returned data received and the cycle duration, solving the problem of small sampling bandwidth obtained by sampling in large RTT scenarios in related technologies.
[0207] like Figure 13 Figure 2 shows a schematic diagram of bandwidth sampling using the solution provided by this disclosure in an ACK aggregation scenario. As shown in the figure, bandwidth sampling is triggered when the sampling time reaches the period length, without waiting for the next ACK packet. This avoids the problem of delayed bandwidth sampling results. BW-(n-2) represents an invalid sampling period.
[0208] like Figure 14 Figure 1 shows a schematic diagram of bandwidth sampling using the solution provided by this disclosure in an RTT fluctuation scenario. As shown in the figure, there is no need to wait for the response packet G to trigger bandwidth sampling. As long as the sampling time reaches the cycle length, bandwidth sampling can be triggered, thus avoiding the problem of delayed bandwidth sampling results. BW-(n-2) and BW-(n-3) are invalid sampling periods.
[0209] Figure 14 This can also serve as a schematic diagram of bandwidth sampling using the solution provided by this disclosure in a random packet loss scenario. As shown in the figure, since this solution does not need to wait for the next response packet after an RTT to trigger bandwidth sampling, it can directly trigger bandwidth sampling when the sampling time reaches the period length without considering whether the response packet is lost, thus avoiding the problem of delayed bandwidth sampling results.
[0210] like Figure 15 The figure shows a schematic diagram of bandwidth sampling using the solution provided by the present disclosure in an application-restricted scenario. As shown in the figure, when the link is in the application-restricted stage, the invalid sampling period can be eliminated so that some already received response packets do not need to wait for subsequent response packets, and bandwidth sampling can be performed directly based on the already received response packets. This can also avoid the problem of bandwidth sampling result lag and improve the accuracy of bandwidth sampling.
[0211] Step 506: When it is detected that the sampling bandwidth is not 0 and the smoothing bandwidth is 0, the server assigns the value of the sampling bandwidth to the smoothing bandwidth.
[0212] When it is detected that the sampling bandwidth is not 0, that is, the sampling period is a valid sampling period, it is possible to further determine whether the smoothing bandwidth is 0, that is, to determine whether the current sampling period is the first valid sampling period. If the smoothing bandwidth SBW is 0, that is, when the current sampling period is the first valid sampling period, the calculated sampling bandwidth can be directly assigned to the smoothing bandwidth, that is, SBW = BW.
[0213] Step 507, when it is detected that the sampling bandwidth is not 0 and the smoothing bandwidth is not 0, the server calculates the target bandwidth according to the smoothing parameter, the sampling bandwidth, and the smoothing bandwidth, and updates the smoothing bandwidth based on the target bandwidth.
[0214] If it is detected that the smoothing bandwidth SBW is not 0, that is, when the current sampling period is not the first valid sampling period, the server can calculate the target bandwidth according to the smoothing parameter, the sampling bandwidth, and the smoothing bandwidth, and update the smoothing bandwidth with the target bandwidth. The specific formula is as follows:
[0215] SBW = α * BW + (1 - α) * SBW.
[0216] Step 508, the server outputs the smoothing bandwidth, initializes the data return amount, and triggers the bandwidth sampling for the next period.
[0217] After calculating the smoothing bandwidth, the server can output the smoothing bandwidth as the final bandwidth sampled in the current sampling period.
[0218] Then, the data return amount can be initialized and reset, and the bandwidth sampling for the next period can be started.
[0219] According to an embodiment of the present disclosure, a congestion control method is provided. As Figure 16 shown, it is a schematic flowchart of a congestion control method provided by the present disclosure. This method can be applied to a congestion control device, which can be integrated in a computer device. The computer device can specifically be a terminal or a server. The congestion control method can include:
[0220] Step 1610, obtain the link bandwidth of the target link.
[0221] Among them, the link bandwidth can specifically be the sampling bandwidth obtained by performing bandwidth sampling on the target link. Performing bandwidth sampling on the target link specifically means obtaining the sampling bandwidth by using the bandwidth sampling method provided by the present disclosure to perform bandwidth sampling on the target link.
[0222] Specifically, obtaining the link bandwidth of the target link can be continuously using the bandwidth sampling method provided by the present disclosure to perform bandwidth sampling on the target link to continuously obtain the link bandwidth of the target link.
[0223] Step 1620: Determine a congestion control policy based on the link bandwidth.
[0224] After obtaining the link bandwidth of the target link, a corresponding congestion control policy can be further formulated according to the link bandwidth of the target link and the sending rate of the current data transmission, such as increasing the data sending rate or decreasing the data sending rate, etc.
[0225] Step 1630: Perform congestion control on the target link according to the congestion control policy.
[0226] After determining the congestion control policy of the target link, the server can execute the congestion control policy. Since the link bandwidth of the target link is continuously sampled, as the sampled bandwidth changes, the congestion control policy also changes in real time to maintain the long-term high-quality operation of the target link.
[0227] Description of Apparatus and Equipment in Embodiments of the Present Disclosure
[0228] It can be understood that although each step in the above flowcharts is shown in sequence according to the arrow representation, these steps do not necessarily have to be executed in the order of the arrow representation. Unless there is a clear description in this embodiment, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, at least a part of the steps in the above flowcharts may include multiple steps or multiple stages. These steps or stages do not necessarily have to be executed at the same time, but can be executed at different times. The execution order of these steps or stages does not necessarily have to be sequential, but can be executed alternately or in turn with at least a part of other steps or steps or stages in other steps.
[0229] It should be noted that in each specific implementation manner of the present disclosure, when it comes to performing relevant processing based on data related to the characteristics of the target object, such as target object attribute information or an attribute information set, etc., the permission or consent of the target object will be obtained first. Moreover, the collection, use, and processing of these data will comply with the relevant laws, regulations, and standards in the relevant regions. In addition, when the embodiments of the present application need to obtain the target object attribute information, the separate permission or separate consent of the target object will be obtained through methods such as pop-up windows or jumping to a confirmation page. After clearly obtaining the separate permission or separate consent of the target object, the necessary target object-related data for the normal operation of the embodiments of the present application will be obtained.
[0230] Figure 17 It is a schematic structural diagram of a bandwidth sampling device 1700 provided by an embodiment of the present disclosure. The device includes:
[0231] A first acquisition unit 1710, configured to acquire a data transmission volume corresponding to the response data received by a target link within a target sampling period based on a system clock and a target time interval;
[0232] A first calculation unit 1720, configured to calculate a sampling bandwidth according to the data transmission volume and the target time interval;
[0233] A second acquisition unit 1730, configured to acquire a historical sampling bandwidth of the target link, where the historical sampling bandwidth is calculated based on data transmission volumes corresponding to response data received within multiple sampling periods, and the cycle lengths of the multiple sampling periods corresponding to the target sampling period are all the target time interval;
[0234] A second calculation unit 1740, configured to calculate a bandwidth smoothing value based on the sampling bandwidth and the historical sampling bandwidth, and determine the bandwidth smoothing value as the target bandwidth of the target link in the target sampling period.
[0235] Optionally, in some embodiments, the bandwidth sampling device provided by the present disclosure includes a first time interval determination unit, and the time interval determination unit includes:
[0236] A first acquisition subunit, configured to acquire a plurality of time interval candidate values;
[0237] A sampling subunit, configured to perform bandwidth sampling on the target link respectively with each time interval candidate value as the cycle length of the bandwidth sampling period, so as to obtain a plurality of bandwidth sampling results;
[0238] A second acquisition subunit, configured to acquire a plurality of calculation resource consumption amounts when performing bandwidth sampling on the target link with each time interval candidate value as the cycle length of the bandwidth sampling period;
[0239] A first determination subunit, configured to determine a target time interval from the plurality of time interval candidate values according to the plurality of bandwidth sampling results and the plurality of calculation resource consumption amounts.
[0240] Optionally, in some embodiments, the determination subunit includes:
[0241] A first determination module, configured to determine a first evaluation score corresponding to each time interval candidate value based on the plurality of bandwidth sampling results and a reference bandwidth sampling result;
[0242] A second determination module, configured to determine a second evaluation score corresponding to each time interval candidate value according to the plurality of calculation resource consumption amounts;
[0243] A first calculation module, configured to calculate a target evaluation score corresponding to each time interval candidate value according to the evaluation score and the second evaluation score;
[0244] A third determination module, configured to determine a target time interval from a plurality of candidate time interval values according to the target evaluation score.
[0245] Optionally, in some embodiments, the bandwidth sampling device provided by the present disclosure further includes a second time interval determination unit, and the second time interval determination unit includes:
[0246] A third acquisition subunit, configured to acquire the system frequency of the bandwidth sampling terminal;
[0247] A first calculation subunit, configured to calculate a target time interval based on the system frequency.
[0248] Optionally, in some embodiments, the second calculation unit includes:
[0249] A fourth acquisition subunit, configured to acquire a smoothing parameter;
[0250] A second calculation subunit, configured to perform a smoothing calculation on the sampled bandwidth and the historical sampled bandwidth according to the smoothing parameter to obtain a bandwidth smoothing value;
[0251] A second determination subunit, configured to determine the bandwidth smoothing value as the target bandwidth of the target link.
[0252] Optionally, in some embodiments, the second calculation subunit includes:
[0253] A second calculation module, configured to calculate a first weight coefficient corresponding to the sampled bandwidth and a second weight coefficient corresponding to the historical sampled bandwidth according to the smoothing parameter;
[0254] A third calculation module, configured to perform a weighted calculation on the sampled bandwidth and the historical sampled bandwidth based on the first weight coefficient and the second weight coefficient to obtain a bandwidth smoothing value.
[0255] Optionally, in some embodiments, the second calculation unit includes:
[0256] A fifth acquisition subunit, configured to acquire the data sending rate of the data sending end;
[0257] A third calculation subunit, configured to, when the sampled bandwidth is not greater than the data sending rate, calculate a bandwidth smoothing value based on the sampled bandwidth and the historical sampled bandwidth, and determine the bandwidth smoothing value as the target bandwidth of the target link in the target sampling period;
[0258] A fourth calculation subunit, configured to, when the sampled bandwidth is greater than the data sending rate, calculate a bandwidth smoothing value based on the data sending rate and the historical sampled bandwidth, and determine the bandwidth smoothing value as the target bandwidth of the target link in the target sampling period.
[0259] Optionally, in some embodiments, the fourth calculation subunit includes:
[0260] A fourth determination module, configured to determine that the data sending rate is the target bandwidth of the target link in the target sampling period when the sampling bandwidth is greater than the data sending rate and the historical sampling bandwidth is 0;
[0261] A fourth calculation module, configured to calculate a bandwidth smoothing value based on the data sending rate and the historical sampling bandwidth and determine the bandwidth smoothing value as the target bandwidth of the target link in the target sampling period when the sampling bandwidth is greater than the data sending rate and the historical sampling bandwidth is not 0.
[0262] Optionally, in some embodiments, the bandwidth sampling device provided by the present disclosure further includes:
[0263] A fifth calculation subunit, configured to calculate a ratio between the data sending rate and the sampling bandwidth when it is detected that the sampling bandwidth is greater than the data sending rate in a continuous preset number of sampling periods;
[0264] A correction subunit, configured to correct the target time interval based on the ratio.
[0265] Optionally, in some embodiments, the bandwidth sampling device provided by the present disclosure further includes:
[0266] An update subunit, configured to update the historical sampling bandwidth based on the target bandwidth;
[0267] A storage subunit, configured to store the historical sampling bandwidth at a preset storage location.
[0268] Figure 18 It is a schematic structural diagram of a congestion control device 1800 provided by an embodiment of the present disclosure. The device includes:
[0269] A third acquisition unit 1810, configured to acquire the link bandwidth of the target link, where the link bandwidth is the target bandwidth sampled according to the bandwidth sampling method provided by the present disclosure;
[0270] A determination unit 1820, configured to determine a congestion control policy based on the link bandwidth;
[0271] A control unit 1830, configured to perform congestion control on the target link according to the congestion control policy.
[0272] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, which works together with other related parts to achieve a predetermined goal, and can be fully or partially implemented by using software, hardware (such as a processing circuit or a memory), or a combination thereof. Similarly, one processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be a part of the overall module or unit that includes the function of the module or unit.
[0273] Refer to Figure 19 , Figure 19 which is a block diagram of a part of the terminal 140 for implementing the bandwidth sampling or congestion control method of the embodiments of the present disclosure. The terminal 140 includes components such as a Radio Frequency (RF) circuit 1410, a memory 1915, an input unit 1930, a display unit 1940, a sensor 1950, an audio circuit 1960, a wireless fidelity (WiFi) module 1970, a processor 1980, and a power supply 1990. Those skilled in the art can understand that Figure 19 the structure of the terminal 140 shown does not limit a mobile phone or a computer, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0274] The RF circuit 1910 can be used for receiving and sending signals during information transceiver or call processes. Specifically, after receiving the downlink information from the base station, it is given to the processor 1980 for processing; in addition, the designed uplink data is sent to the base station.
[0275] The memory 1915 can be used for storing software programs and modules. The processor 1980 executes various functional applications and document editing of the terminal by running the software programs and modules stored in the memory 1915.
[0276] The input unit 1930 can be used for receiving input digital or character information, and generating key signal inputs related to the settings and function controls of the terminal. Specifically, the input unit 1930 may include a touch panel 1931 and other input devices 1932.
[0277] The display unit 1940 can be used for displaying input information or provided information and various menus of the terminal. The display unit 1940 may include a display panel 1941.
[0278] The audio circuit 1960, the speaker 1961, and the microphone 1962 can provide an audio interface.
[0279] In this embodiment, the processor 1980 included in the terminal 140 can execute the bandwidth sampling or congestion control method of the previous embodiments.
[0280] The terminal 140 of the embodiments of the present disclosure includes but is not limited to mobile phones, computers, intelligent voice interaction devices, intelligent household appliances, vehicle-mounted terminals, aircraft, etc.
[0281] Figure 20Block diagram of a portion of server 110 for implementing the bandwidth sampling or congestion control method of the embodiments of the present disclosure. Server 110 may vary significantly due to configuration or performance differences and may include one or more central processing units (CPUs) 2022 (e.g., one or more processors) and a storage device 2032, and one or more storage media 2030 (e.g., one or more mass storage devices) for storing application programs 2042 or data 2044. Among them, the storage device 2032 and the storage medium 2030 may be transient storage or persistent storage. The program stored in the storage medium 2030 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server 110. Further, the central processing unit 2022 may be configured to communicate with the storage medium 2030 and execute a series of instruction operations in the storage medium 2030 on the server 110.
[0282] Server 110 may also include one or more power supplies 2026, one or more wired or wireless network interfaces 2050, one or more input / output interfaces 2058, and / or one or more operating systems 2041, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, and so on.
[0283] The central processing unit 2022 in server 110 may be used to execute the bandwidth sampling or congestion control method of the embodiments of the present disclosure.
[0284] The embodiments of the present disclosure also provide a storage medium for storing program code for executing the bandwidth sampling or congestion control method of the foregoing embodiments.
[0285] The embodiments of the present disclosure also provide a computer program product that includes a computer program. The processor of the computer device reads and executes the computer program, causing the computer device to execute the bandwidth sampling or congestion control method described above.
[0286] In the description of the present disclosure and the above-mentioned drawings, terms such as "first", "second", "third", "fourth", etc. (if any) are used to distinguish similar objects and do not necessarily describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "comprising" and "including" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0287] It should be understood that in the present disclosure, "at least one (item)" means one or more, and "a plurality" means two or more. "And / or" is used to describe the association relationship of associated objects and indicates that there can be three relationships. For example, "A and / or B" can mean: only A exists, only B exists, and both A and B exist at the same time. Among them, A and B can be singular or plural. The character " / " generally means that the associated objects before and after are in an "or" relationship. "At least one (one) of the following" or its similar expression refers to any combination of these items, including any combination of single items (ones) or plural items (ones). For example, at least one (one) of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0288] It should be understood that in the description of the embodiments of the present disclosure, the meaning of "a plurality (or multiple items)" is more than two. Understandings such as "greater than", "less than", "exceeding", etc. do not include the present number, and understandings such as "above", "below", "within", etc. include the present number.
[0289] In several embodiments provided by the present disclosure, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of units is only a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection to each other can be through some interfaces, and the indirect coupling or communication connection of devices or units can be in electrical, mechanical or other forms.
[0290] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0291] In addition, each functional unit in various embodiments of the present disclosure may be integrated in a processing unit, may exist separately as individual physical units, or two or more units may be integrated in one unit. The above integrated units can be implemented in the form of hardware or in the form of software functional units.
[0292] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present disclosure, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods in various embodiments of the present disclosure. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs that can store program codes.
[0293] It should also be understood that the various embodiments provided in the present disclosure can be combined arbitrarily to achieve different technical effects.
[0294] The above is a specific description of the embodiments of the present disclosure, but the present disclosure is not limited to the above embodiments. Those skilled in the art can also make various equivalent deformations or substitutions without departing from the spirit of the present disclosure, and these equivalent deformations or substitutions are all included within the scope defined by the claims of the present disclosure.
Claims
1. A bandwidth sampling method, characterized in that, The method includes: Based on the system clock and the target time interval, obtaining the data transmission volume corresponding to the response data received by the target link within the target sampling period; Calculating the sampling bandwidth according to the data transmission volume and the target time interval; Obtaining the historical sampling bandwidth of the target link, where the historical sampling bandwidth is calculated based on the data transmission volume corresponding to the response data received within multiple sampling periods, and the cycle lengths of the multiple sampling periods corresponding to the target sampling period are all the target time interval; Calculating a bandwidth smoothing value based on the sampling bandwidth and the historical sampling bandwidth, and determining the bandwidth smoothing value as the target bandwidth of the target link in the target sampling period.
2. The method according to claim 1, wherein The determination process of the target time interval includes: Obtaining multiple time interval candidate values; Respectively using each time interval candidate value as the cycle length of the bandwidth sampling period to perform bandwidth sampling on the target link, obtaining multiple bandwidth sampling results; Obtaining the consumption of multiple computing resources when using each time interval candidate value as the cycle length of the bandwidth sampling period to perform bandwidth sampling on the target link; Determining the target time interval from the multiple time interval candidate values according to the multiple bandwidth sampling results and the multiple computing resource consumptions.
3. The method according to claim 2, characterized in that, The determining the target time interval from the multiple time interval candidate values according to the multiple bandwidth sampling results and the multiple computing resource consumptions includes: Determining a first evaluation score corresponding to each time interval candidate value based on the multiple bandwidth sampling results and a reference bandwidth sampling result; Determining a second evaluation score corresponding to each time interval candidate value according to the multiple computing resource consumptions; Calculating a target evaluation score corresponding to each time interval candidate value according to the evaluation score and the second evaluation score; Determining the target time interval from the multiple time interval candidate values according to the target evaluation score.
4. The method according to claim 1, wherein The determination process of the target time interval includes: Obtaining the system frequency of the bandwidth sampling terminal; Calculating the target time interval based on the system frequency.
5. The method according to claim 1, wherein The calculating a bandwidth smoothing value based on the sampling bandwidth and the historical sampling bandwidth, and determining the bandwidth smoothing value as the target bandwidth of the target link in the target sampling period includes: Obtaining a smoothing parameter; Performing smoothing calculation on the sampling bandwidth and the historical sampling bandwidth according to the smoothing parameter to obtain a bandwidth smoothing value; Determining the bandwidth smoothing value as the target bandwidth of the target link.
6. The method according to claim 5, characterized in that, The performing smoothing calculation on the sampling bandwidth and the historical sampling bandwidth according to the smoothing parameter to obtain a bandwidth smoothing value includes: Calculating a first weight coefficient corresponding to the sampling bandwidth and a second weight coefficient corresponding to the historical sampling bandwidth according to the smoothing parameter; Performing weighted calculation on the sampling bandwidth and the historical sampling bandwidth based on the first weight coefficient and the second weight coefficient to obtain a bandwidth smoothing value.
7. The method according to claim 1, characterized in that The calculating a bandwidth smoothing value based on the sampling bandwidth and the historical sampling bandwidth, and determining the bandwidth smoothing value as the target bandwidth of the target link in the target sampling period includes: Obtaining the data sending rate of the data sending end; When the sampling bandwidth is not greater than the data transmission rate, a bandwidth smoothing value is calculated based on the sampling bandwidth and the historical sampling bandwidth, and the bandwidth smoothing value is determined as the target bandwidth of the target link in the target sampling period; When the sampling bandwidth is greater than the data transmission rate, a bandwidth smoothing value is calculated based on the data transmission rate and the historical sampling bandwidth, and the bandwidth smoothing value is determined as the target bandwidth of the target link in the target sampling period.
8. The method according to claim 7, wherein The step of when the sampling bandwidth is greater than the data transmission rate, calculating a bandwidth smoothing value based on the data transmission rate and the historical sampling bandwidth, and determining the bandwidth smoothing value as the target bandwidth of the target link in the target sampling period includes: When the sampling bandwidth is greater than the data transmission rate and the historical sampling bandwidth is 0, determining the data transmission rate as the target bandwidth of the target link in the target sampling period; When the sampling bandwidth is greater than the data transmission rate and the historical sampling bandwidth is not 0, calculating a bandwidth smoothing value based on the data transmission rate and the historical sampling bandwidth, and determining the bandwidth smoothing value as the target bandwidth of the target link in the target sampling period.
9. The method according to claim 7, wherein The method further includes: When it is detected that the sampling bandwidth is greater than the data transmission rate in a continuous preset number of sampling periods, calculating the ratio between the data transmission rate and the sampling bandwidth; Correcting the target time interval based on the ratio.
10. The method according to claim 1, wherein After calculating the bandwidth smoothing value based on the sampling bandwidth and the historical sampling bandwidth and determining the bandwidth smoothing value as the target bandwidth of the target link in the target sampling period, the method further includes: Updating the historical sampling bandwidth based on the target bandwidth; Storing the historical sampling bandwidth at a preset storage location.
11. A congestion control method, characterized in that, The method includes: Obtaining the link bandwidth of the target link, where the link bandwidth is the target bandwidth sampled by the bandwidth sampling method according to any one of claims 1 to 10; Determining a congestion control policy based on the link bandwidth; Performing congestion control on the target link according to the congestion control policy.
12. A bandwidth sampling device, characterized in that, The apparatus includes: A first obtaining unit, configured to obtain the data transmission amount corresponding to the response data received by the target link in the target sampling period based on the system clock and the target time interval; A first calculating unit, configured to calculate the sampling bandwidth according to the data transmission amount and the target time interval; A second obtaining unit, configured to obtain the historical sampling bandwidth of the target link, where the historical sampling bandwidth is calculated based on the data transmission amounts corresponding to the response data received in a plurality of sampling periods, and the period lengths of the plurality of sampling periods corresponding to the target sampling period are all the target time interval; A second calculating unit, configured to calculate a bandwidth smoothing value based on the sampling bandwidth and the historical sampling bandwidth, and determine the bandwidth smoothing value as the target bandwidth of the target link in the target sampling period.
13. A congestion control device, characterized in that, The apparatus includes: A third acquisition unit, configured to acquire the link bandwidth of a target link, where the link bandwidth is a target bandwidth sampled according to the bandwidth sampling method described in any one of claims 1 to 10; A determination unit, configured to determine a congestion control policy based on the link bandwidth; A control unit, configured to perform congestion control on the target link according to the congestion control policy.
14. A storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the bandwidth sampling method described in any one of claims 1 to 10 or the congestion control method described in claim 11.
15. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the bandwidth sampling method described in any one of claims 1 to 10 or the congestion control method described in claim 11.
16. A computer program product, comprising a computer program, where the computer program is read and executed by a processor of a computer device, so that the computer device executes the bandwidth sampling method described in any one of claims 1 to 10 or the congestion control method described in claim 11.