Congestion control method and device, storage medium and vehicle

By obtaining the cache queue length and buffer rate of the network layer for congestion control, dynamically adjusting the probability of discarding requests, solving the problems of low data transmission efficiency and serious loss in existing TCP congestion control, and achieving efficient network data transmission.

CN120455369APending Publication Date: 2025-08-08BYD CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411053683.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-31
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

The existing TCP congestion control method avoids network congestion by discarding TCP requests when the network load is high, resulting in low data transmission efficiency and serious data loss.

Method used

By obtaining the waiting queue length of the cache queue of the network layer and the data reception rate of the buffer, congestion control is performed based on these two, and the probability of discarding requests is dynamically adjusted to avoid network congestion.

Benefits of technology

It improves the data transmission efficiency of the network layer, reduces data loss, and ensures that the network can quickly restore stable state under high load conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120455369A_ABST
    Figure CN120455369A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a congestion control method and device, a storage medium and a vehicle, and the method comprises the steps: obtaining the waiting queue length of a buffer queue of a network layer and the data receiving rate of a buffer area of the network layer when an nth request is received; and performing congestion control on a network layer based on the waiting queue length and the data receiving rate. By adopting the embodiment of the invention, the problem of serious data loss when congestion control is carried out on the network layer is solved, and the data transmission efficiency of the network layer is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of network communication technology, and in particular to a congestion control method, device, storage medium and vehicle. Background Art

[0002] As intelligent driving technology develops, intelligent driving domain controllers will use Ethernet to connect to various sensors and other domain controllers related to the smart cockpit for related data transmission. As intelligent driving domain controllers gain more network connections, the amount of data they receive will continue to increase, potentially causing network congestion.

[0003] Intelligent driving domain controllers typically use the Transmission Control Protocol (TCP) for data transmission. Existing TCP congestion control uses common queue scheduling and queue management algorithms to appropriately discard TCP requests when network load is high, allowing the sender to initiate a retransmission mechanism and resubmit the request. This delay is then used to avoid network congestion. The Random Early Detection (RED) algorithm, a representative active queue management mechanism, plays a key role in congestion control. This method begins discarding TCP requests before the waiting queue length of the buffer queue reaches a maximum value and sends congestion feedback information to the sender, thereby alleviating network congestion.

[0004] The RED algorithm can ensure the stability of network layer communication, but it only manages the waiting queue length at the network layer. Once the waiting queue length reaches the threshold, it starts to discard TCP requests, resulting in serious data loss and low data transmission efficiency. Summary of the Invention

[0005] In order to solve the above-mentioned problems existing in the prior art, the embodiments of the present application provide a congestion control method, device, storage medium and vehicle. By obtaining the waiting queue length of the cache queue of the network layer and the data receiving rate of the buffer of the network layer, congestion control is performed on the network layer based on the waiting queue length and the data receiving rate. This solves the problem of serious request data loss due to the long waiting queue length when the data receiving rate of the buffer is fast, thereby improving the data transmission efficiency of the network layer.

[0006] In a first aspect, an embodiment of the present application provides a congestion control method, including:

[0007] Upon receiving the nth request, obtaining a waiting queue length of a cache queue of the network layer and a data receiving rate of a buffer of the network layer;

[0008] Congestion control is performed on the network layer based on the waiting queue length and the data receiving rate.

[0009] In a second aspect, an embodiment of the present application provides a congestion control device, the congestion control device comprising an acquisition unit and a processing unit;

[0010] The acquiring unit is configured to acquire, upon receiving the nth request, a waiting queue length of a cache queue of the network layer and a data receiving rate of a buffer of the network layer;

[0011] The processing unit is used to perform congestion control on the network layer based on the waiting queue length and the data receiving rate.

[0012] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor and a memory, wherein the processor is connected to the memory, the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the electronic device performs the method described in the first aspect.

[0013] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program enables a computer to execute the method described in the first aspect.

[0014] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer is operable to enable the computer to execute the method described in the first aspect.

[0015] In a sixth aspect, an embodiment of the present application provides a vehicle, comprising the congestion control device as described in the second aspect.

[0016] The implementation of the embodiments of the present application has the following beneficial effects:

[0017] In an embodiment of the present application, when the nth request is received, the congestion control device obtains the waiting queue length of the cache queue of the network layer and the data receiving rate of the buffer of the network layer, determines the change in the waiting queue length after the nth request data arrives at the cache queue based on the waiting queue length, and determines the rate at which the buffer receives and processes data based on the data receiving rate, and performs congestion control on the network layer in combination with the change in the waiting queue length and the rate at which the buffer receives and processes data. Thus, the congestion control device can perform congestion control on the network layer based on the waiting queue length and the data receiving rate. When the data receiving rate and data transmission rate of the buffer are fast, even if the waiting queue length is long, the network layer can transmit data to the receiving end at a high throughput rate, thereby being able to restore a stable state after a short period of high-load work without discarding the nth request, thereby solving the problem of serious data loss caused by discarding the received request due to changes in the waiting queue length, and improving the data transmission efficiency of the network layer. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0019] Figure 1 A schematic diagram of a congestion control system provided in an embodiment of the present application;

[0020] Figure 2 A schematic diagram of an intelligent driving control system provided in an embodiment of the present application;

[0021] Figure 3 A flowchart of a transmitting end requesting transmission provided in an embodiment of the present application;

[0022] Figure 4 A flowchart of a network layer request for data transmission provided in an embodiment of the present application;

[0023] Figure 5 A flowchart of a congestion control method provided in an embodiment of the present application;

[0024] Figure 6 A flowchart of a request discarding method provided in an embodiment of the present application;

[0025] Figure 7 A flowchart of a method for determining a discard probability provided in an embodiment of the present application;

[0026] Figure 8A flowchart of a method for determining a discard probability provided in an embodiment of the present application;

[0027] Figure 9 A schematic diagram of a congestion control device provided in an embodiment of the present application;

[0028] Figure 10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0029] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0030] The terms "first," "second," "third," and "fourth," etc., in the specification and claims of this application and the accompanying drawings are used to distinguish between different objects, rather than to describe a specific order. In addition, the terms "including," "having," and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or elements is not limited to the listed steps or elements, but may optionally include steps or elements not listed, or may optionally include other steps or elements inherent to the process, method, product, or apparatus.

[0031] References herein to "embodiments" mean that a particular feature, result, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0032] First, see Figure 1 , Figure 1 Schematic diagram of a congestion control system provided in an embodiment of the present application. Figure 1 As shown, the congestion control system includes: a sending end, a congestion control device and a receiving end.

[0033] In an embodiment of the present application, the congestion control device may be, for example, an intelligent driving domain controller (Domain Control Unit, DCU) of a car. DCU is a device that integrates multiple electronic control units (ECUs), and is mainly used to realize the intelligent driving and intelligent cockpit functions of a car. Among them, ECU is an electronic control unit for a specific function or multiple functions of a car, and is mainly composed of large-scale integrated circuits such as a microcontroller (MCU), memory, input / output interface, analog-to-digital converter, and driver. ECU is also called a car computer or an on-board computer, and is a core component of the electrical and electronic architecture (EEA). The intelligent driving domain controller is the core processor of each functional domain in the car. The functional domain of the car can be divided based on the actual functions of the car, and each functional domain is centrally controlled by a multi-core central processing unit (CPU) and / or a graphics processing unit (GPU).

[0034] For example, Figure 2 As shown, the transmitting end in the congestion control system can be, for example, domain controllers for multiple functional domains of a vehicle. These can be categorized into autonomous driving domain controllers, chassis domain controllers, power domain controllers, cockpit domain controllers, body domain controllers, and so on, depending on the actual functions of the vehicle. Optionally, the transmitting end can also be multiple sensors in the vehicle, such as suspension sensors and balance sensors. The intelligent driving domain controller can use Ethernet to access these multiple domain controllers and / or multiple sensors, and transmit data with multiple functional units within the vehicle via Ethernet.

[0035] For example, the receiving end in the congestion control system may be multiple functional units of a car, such as Figure 2 As shown, multiple functional units may include, for example: lidar, suspension sensors, seat information, over-the-air (OTA) interfaces, balance sensors, and so on. The domain controller of each functional domain can be connected to the intelligent driving domain controller via Ethernet and send functional data to the intelligent driving domain controller. After receiving the functional data, the intelligent driving domain controller transmits the functional data to the functional unit corresponding to the functional data via Ethernet to implement the corresponding function. At the same time, each functional data can also send feedback data of the corresponding function to the intelligent driving domain controller, which is then transmitted to the domain controller of the functional domain corresponding to the feedback data.

[0036] In the embodiment of the present application, data transmission between the sending end and the congestion control device can be based on TCP, for example. Figure 1 As shown in the figure, when the sender needs to send data to the receiver, it sends a TCP request to the network layer of the congestion control device, and the request enters the cache queue in the network layer to wait. The data in the cache queue is gradually received by the buffer of the network layer and transmitted to the receiver through the buffer. Figure 3 As shown, the sender sends a request to the receiver and waits for a response signal from the receiver. The request is forwarded to the receiver via the network layer of the congestion control device. The receiver responds with a response signal, establishing a connection between the sender and receiver. The sender can now send packaged data to the receiver. If the sender does not receive a response signal from the receiver within a preset period of time after sending the request, it initiates a fast retransmit mechanism and resubmits the request.

[0037] It should be noted that when a sender requests a large amount of data, given the network bandwidth of the congestion control device's network layer, the amount of data received at the network layer will continue to grow, causing data transmission performance to continue to degrade until the maximum capacity of the network bandwidth is exceeded, resulting in network congestion. In this situation, failure to implement congestion control at the network layer can significantly impact the network, potentially paralyzing it and preventing data from being transmitted to the intended destination.

[0038] Currently, based on TCP's sending end congestion control, especially the fast retransmit mechanism, the network layer can improve the stability of the network system through data packet scheduling strategy and discard strategy at the receiving end. Figure 4 As shown, the network layer of the congestion control device uses the RED algorithm to discard requests sent by the sender. Based on the RED algorithm, the waiting queue length of the buffer queue is monitored, and TCP requests are appropriately discarded before the waiting queue length reaches a threshold. If the congestion control device discards a request, it instructs the sender to initiate a fast retransmit mechanism to resubmit the request, thereby utilizing the delay in the sender's resubmission to avoid network congestion. If the congestion control device determines that the request does not need to be discarded, it establishes a connection between the sender and the receiver and transmits the data packaged by the sender to the receiver.

[0039] It's understandable that current congestion control only manages the waiting queue length of the cache queue. However, changes in the waiting queue are also determined by the rate at which the network layer's buffer receives and transmits data. When the buffer receives and transmits data at a faster rate, even if the waiting queue length is long, the network layer can transmit data to the receiving end at a higher throughput, allowing it to return to a stable state after a short period of high-load operation. Therefore, in this situation, there's no need to discard requests sent by the sender. Using existing congestion control methods, requests would be discarded in this situation, resulting in significant data loss and, consequently, lower data transmission efficiency.

[0040] To this end, in an embodiment of the present application, applied to the above-mentioned congestion control system, the congestion control device obtains the waiting queue length of the cache queue of the network layer and the data receiving rate of the buffer of the network layer when receiving the nth request;

[0041] Congestion control is performed on the network layer based on the waiting queue length and data reception rate.

[0042] It can be seen that, when applied to the above-mentioned congestion control system, the sending end sends a request to the congestion control device, and the data corresponding to the request enters the cache queue and waits for the buffer to receive it. After the buffer receives the data corresponding to the request, it transmits the data corresponding to the request to the receiving end, thereby realizing data transmission between the sending end and the receiving end. The congestion control device can monitor the waiting queue length of the cache queue and the data receiving rate of the buffer, and perform congestion control on the network layer based on the waiting queue length and the data receiving rate, so as to improve the stability of the congestion control system.

[0043] The congestion control method provided by the embodiment of the present application is described below. Figure 5 , Figure 5 A flow chart of a congestion control method provided in an embodiment of the present application is provided. The method is applied to the congestion control device of the above-mentioned congestion control system. The method includes but is not limited to the following steps:

[0044] 501: When the nth request is received, obtain the waiting queue length of the cache queue of the network layer and the data receiving rate of the buffer of the network layer.

[0045] In this embodiment of the present application, the nth request is sent by the sending end to the congestion control device. After the network layer of the congestion control device receives the nth request, it places the nth request in a cache queue, waiting for the network layer's buffer to receive and transmit the request. When the nth request enters the cache queue, the waiting queue length of the cache queue changes. The congestion control device then obtains the waiting queue length at the time of the arrival of the nth request and the data reception rate of the buffer.

[0046] It should be noted that, given a fixed network bandwidth, the data reception rate of the buffer may vary at each moment. Therefore, the congestion control device can determine the traffic status of the buffer based on the data reception rate of the buffer. Furthermore, combining the waiting queue length of the cache queue and the traffic status of the buffer, the congestion control device can determine whether to discard the nth request, thereby performing congestion control at the network layer. Optionally, the congestion control device can also obtain the data transmission rate of the buffer and determine the traffic status of the buffer based on the data transmission rate of the buffer.

[0047] Optionally, the congestion control device may further obtain the amount of data received by the buffer during a third time period, and determine the flow status of the buffer based on the amount of data received by the buffer during the third time period. The third time period is a preset time period before the moment the congestion control device receives the nth request. Optionally, the congestion control device may further obtain the amount of data transmitted by the buffer during the third time period, and determine the flow status of the buffer based on the amount of data received by the buffer during the third time period and the amount of data transmitted by the buffer during the third time period.

[0048] It can be understood that the embodiment of the present application is only explained by obtaining the data receiving rate of the buffer to determine the flow status of the buffer. Using other methods to determine the flow status of the buffer is similar to the embodiment of the present application and will not be repeated here.

[0049] 502: Perform congestion control on the network layer based on the waiting queue length and data receiving rate.

[0050] In an embodiment of the present application, the congestion control device can determine whether to discard the nth request sent by the sender based on the waiting queue length and the data receiving rate of the buffer, so as to avoid network congestion, keep the network layer in a stable state, and improve the stability of data transmission.

[0051] Exemplarily, performing congestion control on the network layer based on the waiting queue length and the data receiving rate may include the following steps:

[0052] Based on the waiting queue length, determine the average waiting queue length and the average waiting queue length change when the nth request arrives;

[0053] When the average waiting queue length is greater than a first threshold and less than a second threshold, determining a discard probability of the nth request based on a change in the average waiting queue length and a data receiving rate;

[0054] Based on the drop probability, determine whether to drop the nth request to perform congestion control on the network layer.

[0055] In an embodiment of the present application, the first and second thresholds may be pre-set based on the load capacity of the network layer, with the first threshold being less than the second threshold. A maximum drop probability corresponding to the second threshold may be set based on the load capacity of the network layer. The congestion control device may determine the average waiting queue length when the nth request arrives by performing a smoothing filter on the waiting queue length, and determine the change in the average waiting queue length. The load state of the cache queue is thereby determined based on the average waiting queue length, and the drop probability of the nth request is determined based on the change in the average waiting queue length and the data reception rate. Based on the drop probability, the congestion control device determines whether to drop the nth request. The congestion control device makes a random determination based on the drop probability. For example, when the drop probability is determined, an element in a random list is selected, the random list including both drop requests and non-drop requests. The result of the random selection serves as the determination result. If the determination result is a drop request, the nth request is dropped, thereby implementing congestion control at the network layer. Optionally, when the drop request exceeds a seventh threshold, the congestion control device may directly drop the nth request, thereby implementing congestion control at the network layer. The seventh threshold may be pre-set based on the actual load capacity of the network layer.

[0056] Specifically, the congestion control device can average the waiting queue lengths to obtain an average waiting queue length and an average change in waiting queue length based on the waiting queue length at the time the nth request arrives. The average waiting queue length and the average change in waiting queue length are used to determine the state of the cache queue, thereby reducing the impact of short-term fluctuations at the network layer on the state of the cache queue and improving the accuracy of congestion control.

[0057] Exemplarily, based on the waiting queue length, determining the average waiting queue length and the average waiting queue length change when the nth request arrives may include the following steps:

[0058] Get the average waiting queue length when the (n-1)th request arrives;

[0059] Determine the average waiting queue length based on the waiting queue length and the average waiting queue length when the (n-1)th request arrives;

[0060] Get the average waiting queue length change when the (n-1)th request arrives, and the waiting queue length when the (n-1)th request arrives;

[0061] Based on the waiting queue length when the (n-1)th request arrives, the waiting queue length, and the average waiting queue length change when the (n-1)th request arrives, the average waiting queue length change is obtained.

[0062] In an embodiment of the present application, the congestion control device can obtain the average waiting queue length and the average change in the waiting queue length when the nth request arrives by smoothing and filtering the waiting queue length. In some feasible embodiments, the waiting queue length can be smoothed and filtered by a first-order RC low-pass digital filter. The first-order RC low-pass digital filter can smooth and filter the waiting queue length at the time of each request arrival, and average the waiting queue length at the time of each request arrival by integrating in the time domain and attenuating high frequencies in the frequency domain to obtain the average waiting queue length and the average change in the waiting queue length.

[0063] For example, when designing a first-order RC low-pass digital filter, the waiting queue length is used as the input of the first-order RC low-pass digital filter, and the average waiting queue length is used as the output of the first-order RC low-pass digital filter. The relationship between the obtained waiting queue length and the average waiting queue length can be expressed by the following formula (1):

[0064]

[0065] Where mlen(n) represents the waiting queue length of the cache queue when the nth request sent by the sender arrives, alen(n) represents the average waiting queue length when the nth request arrives, τ represents the time constant of the first-order RC low-pass digital filter, and △t represents the difference between the arrival time of the nth request and the arrival time of the (n-1)th request.

[0066] By setting the coefficient before the waiting queue length of the cache queue when the nth request arrives in formula (1) to the weight q, the average waiting queue length can be obtained. The average waiting queue length can be expressed by the following formula (2):

[0067] alen(n)=(1-q)alen(n-1)+q*mlen(n) Formula (2)

[0068] Therefore, based on formula (2) and the load capacity of the network layer, an appropriate weight q can be set. The setting of the weight q determines the time constant τ of the first-order RC low-pass digital filter. Based on the time constant τ, a first-order RC low-pass digital filter is designed.

[0069] Then, the waiting queue length is input into a first-order RC low-pass digital filter. From formula (2), it can be seen that the congestion control device also needs to obtain the average waiting queue length when the (n-1)th request arrives, and thus obtain the average waiting queue length when the nth request arrives based on the waiting queue length when the nth request arrives, the average waiting queue length when the (n-1)th request arrives, and the weight q.

[0070] It can be understood that when each request arrives, the congestion control device will determine the average waiting queue length when each request arrives through a first-order RC low-pass digital filter. Therefore, the congestion control device can directly obtain the average waiting queue length when the (n-1)th request arrives to determine the average waiting queue length when the nth request arrives.

[0071] Among them, based on the first-order RC low-pass digital filter designed above, when the difference between the waiting queue length when the nth request arrives and the waiting queue length when the (n-1)th request arrives is selected as the input of the first-order RC low-pass digital filter, that is, when the change in the waiting queue length between the arrival time of the (n-1)th request and the arrival time of the nth request is used as the input of the first-order RC low-pass digital filter, the average waiting queue length change when the nth request arrives is used as the output of the first-order RC low-pass digital filter, the obtained average waiting queue length change can be expressed by the following formula (3):

[0072] rlen(n)=(1-q)rlen(n-1)+q[mlen(n)-mlen(n-1)] Formula (3)

[0073] Among them, rlen(n) represents the change in the average waiting queue length when the nth request arrives.

[0074] Thus, the congestion control device obtains the average change in the waiting queue length when the (n-1)th request arrives, and the waiting queue length when the (n-1)th request arrives. Based on the average change in the waiting queue length when the (n-1)th request arrives, the waiting queue length when the (n-1)th request arrives, the waiting queue length when the nth request arrives, and the weight q, the average change in the waiting queue length when the nth request arrives is obtained.

[0075] It can be understood that when each request arrives, the congestion control device will determine the average change in the waiting queue length when each request arrives through a first-order RC low-pass digital filter. Therefore, the congestion control device can directly obtain the average change in the waiting queue length when the (n-1)th request arrives to determine the average change in the waiting queue length when the nth request arrives.

[0076] The average waiting queue length change reflects the changing trend of the buffer queue's waiting queue length. A positive average waiting queue length change indicates that the waiting queue length is increasing and the network layer is becoming congested. A negative average waiting queue length change indicates that the waiting queue length is decreasing and the network layer is becoming idle.

[0077] It should be noted that the embodiment of the present application is only described by inputting the waiting queue length into a first-order RC low-pass digital filter for smoothing filtering to obtain the average waiting queue length and the average waiting queue length change. Those skilled in the art can also obtain the average waiting queue length and the average waiting queue length change based on the waiting queue length through other methods such as iterative algorithms, which is not limited here.

[0078] It can be seen that in the embodiment of the present application, the congestion control device can obtain the average waiting queue length when the (n-1)th request arrives, determine the average waiting queue length when the nth request arrives based on the average waiting queue length when the (n-1)th request arrives, and obtain the average waiting queue length change when the (n-1)th request arrives and the waiting queue length when the (n-1)th request arrives, so as to obtain the average waiting queue length change when the nth request arrives based on the waiting queue length when the (n-1)th request arrives, the waiting queue length when the nth request arrives, and the average waiting queue length change when the (n-1)th request arrives, thereby determining the congestion state of the network layer based on the average waiting queue length and the average waiting queue length change. Compared with directly performing congestion control through the waiting queue length, the embodiment of the present application is conducive to improving the accuracy of congestion control.

[0079] Furthermore, the congestion control device can determine whether congestion occurs at the network layer based on the average waiting queue length to determine whether the nth request needs to be discarded. Figure 6 As shown, when the average waiting queue length is less than or equal to the first threshold, the cache queue is idle, there is no need to discard requests, and the nth request enters the cache queue and waits to be received by the buffer zone.

[0080] When the average waiting queue length is greater than or equal to the second threshold, the cache queue is full and network layer congestion is occurring. The congestion control device discards all pending requests in the cache queue. It should be noted that when the average waiting queue length is greater than the second threshold, network layer congestion is occurring. At this point, all pending requests in the cache queue should be discarded to prevent network layer paralysis. After discarding all requests, the congestion control device sends a fast retransmit response to the sender. Upon receiving the fast retransmit response, the sender resends a request to the congestion control device.

[0081] When the average waiting queue length is greater than the first threshold and less than the second threshold, the congestion control device can determine the discard probability of the nth request based on the change in the average waiting queue length and the data receiving rate, and thus determine whether to discard the nth request based on the discard probability of the nth request to perform congestion control on the network layer.

[0082] It should be noted that a maximum drop probability is pre-set based on the actual load capacity of the network layer, and the maximum drop probability is less than 1. This allows the network layer to begin dropping requests before reaching congestion, thus avoiding network layer congestion. Therefore, the drop probability obtained above is between 0 and the maximum drop probability. Based on the drop probability of the nth request, it is possible that the nth request will not be dropped, thus avoiding excessive data loss and improving data transmission efficiency.

[0083] It can be seen that in the embodiment of the present application, the congestion control device can determine the average waiting queue length and the average waiting queue length change when the n-th request arrives based on the waiting queue length. When the average waiting queue length is greater than the first threshold and less than the second threshold, the discard probability of the n-th request can be determined based on the average waiting queue length change and the data receiving rate, and thus determine whether to discard the n-th request based on the discard probability. Thus, the congestion control device can determine whether congestion occurs at the network layer based on the average waiting queue length, and determine the discard probability of the n-th request based on the average waiting queue length change and the data receiving rate, so as to perform congestion control on the network layer, thereby improving the accuracy of congestion control and avoiding excessive data discard.

[0084] For example, Figure 7 As shown, determining the discard probability of the nth request based on the average waiting queue length change and the data receiving rate may include the following steps:

[0085] 701: Determine the waiting queue state of the cache queue based on the average waiting queue length change.

[0086] In an embodiment of the present application, the congestion control device may analyze the waiting queue state of the cache queue based on the average waiting queue length change, and the waiting queue state is used to characterize the changing trend of the waiting queue length.

[0087] It should be noted that the embodiment of the present application is only explained by taking the example of determining the waiting queue state of the cache queue based on the average waiting queue length change, and then determining the discard probability of the nth request based on the waiting queue state. Those skilled in the art can also directly determine the discard probability of the nth request based on the value range of the average waiting queue length change. Among them, the method of determining the discard probability of the nth request based on the value range of the average waiting queue length change is similar to the embodiment of the present application and will not be repeated here.

[0088] Exemplarily, determining the waiting queue state of the cache queue based on the average waiting queue length change may include the following steps:

[0089] When the average waiting queue length change is less than a third threshold, determining that the waiting queue state is the first state;

[0090] When the average waiting queue length change is greater than a fourth threshold, it is determined that the waiting queue state is the second state.

[0091] The first state indicates that the rate of decrease of the waiting queue length of the cache queue is greater than a first rate threshold, and the second state indicates that the rate of increase of the waiting queue length of the cache queue is greater than a second rate threshold.

[0092] In the embodiment of the present application, the third threshold and the fourth threshold can be pre-set based on the actual capacity of the buffer queue, and the third threshold is less than 0, and the fourth threshold is greater than 0. Therefore, when the average waiting queue length change is less than the third threshold, it indicates that the waiting queue length of the buffer queue is decreasing at a rate greater than the first rate threshold, and the congestion control device determines the waiting queue state at this time as the first state.

[0093] When the average waiting queue length change is greater than the fourth threshold, indicating that the waiting queue length of the cache queue is increasing at a rate greater than the second rate threshold, the congestion control device determines the waiting queue state at this time as the second state.

[0094] When the average waiting queue length change is greater than or equal to the third threshold and the average waiting queue length change is less than or equal to the fourth threshold, it indicates that the waiting queue length of the cache queue is decreasing at a rate less than the first rate threshold, or that the waiting queue length of the cache queue is increasing at a rate less than the second rate threshold. At this time, the release rate of requests in the cache queue is less than the third rate threshold, or the increase rate of requests in the cache queue is less than the fourth rate threshold, and the change in the waiting queue length of the cache queue tends to be stable. The congestion control device determines the waiting queue state at this time as the fifth state.

[0095] It should be noted that when the average waiting queue length change is greater than or equal to the third threshold, and the average waiting queue length change is less than or equal to the fourth threshold, the average waiting queue length change may be less than 0 or greater than 0. An average waiting queue length change of less than 0 indicates that the waiting queue length is decreasing, and an average waiting queue length change of greater than 0 indicates that the waiting queue length is increasing. For this reason, when the average waiting queue length change is greater than or equal to the third threshold, and the average waiting queue length change is less than or equal to 0, the waiting queue length representing the cache queue is decreasing at a decreasing rate that is less than the first rate threshold. When the average waiting queue length change is greater than 0, and the average waiting queue length change is less than or equal to the fourth threshold, the waiting queue length representing the cache queue is increasing at an increasing rate that is less than the second rate threshold. The congestion control device jointly determines the above two states of the cache queue as the fifth state.

[0096] It can be seen that in the embodiment of the present application, the congestion control device can determine the waiting queue state of the cache queue based on the value range of the average waiting queue length change. The first state characterizes that the decrease rate of the waiting queue length of the cache queue is greater than the first rate threshold, the second state characterizes that the increase rate of the waiting queue length of the cache queue is greater than the second rate threshold, and the fifth state characterizes that the change of the waiting queue length of the cache queue tends to be stable. Therefore, by determining the waiting queue state of the cache queue, the change of requests entering the network layer can be reflected to determine whether congestion occurs in the network layer, thereby improving the accuracy of congestion control.

[0097] 702: Determine the traffic status of the buffer based on the data receiving rate.

[0098] In an embodiment of the present application, the congestion control device reflects the buffer's data processing efficiency and the buffer's traffic status through the buffer's data receiving rate and the buffer's data transmission rate, so as to determine the discard probability of the nth request based on the buffer's traffic status.

[0099] Exemplarily, determining the traffic status of the buffer based on the data receiving rate may include the following steps:

[0100] Obtaining a first ratio of a data receiving rate to a bandwidth of a buffer for transmitting data;

[0101] Get the total amount of data received and transmitted by the buffer during the first time period;

[0102] Obtaining a second ratio based on the total amount of data, the first time period, and the bandwidth;

[0103] Based on the first ratio and the second ratio, a flow state is determined.

[0104] In this embodiment of the present application, the first time period is a preset time period before the moment the nth request is received. The bandwidth of the buffer for transmitting data is used to represent the data transmission rate of the buffer. Thus, the congestion control device obtains the data reception rate of the buffer and the bandwidth of the buffer for transmitting data, and uses the ratio of the data reception rate to the bandwidth for transmitting data as the first ratio.

[0105] It should be noted that since the first ratio is the ratio of the data reception rate to the bandwidth for transmitting data, when the first ratio is greater than 1, it indicates that the amount of data in the buffer is increasing. When the first ratio is greater than or equal to 0 and less than 1, it indicates that the amount of data in the buffer is decreasing. When the first ratio is equal to 1, it indicates that the amount of data in the buffer remains unchanged. Furthermore, the data reception rate does not fall below 0, and therefore, the first ratio does not fall below 0.

[0106] Furthermore, the congestion control device obtains the total amount of data received and transmitted by the buffer during the first time period, and uses the ratio of the total amount of data received and transmitted by the buffer during the first time period to (first time period * bandwidth) as the second ratio. It should be noted that because the actual receiving rate and actual transmission rate of the network layer may vary, and the buffer may contain previously unprocessed data, the total amount of data received and transmitted by the buffer during the first time period is not equal to the total amount of data received by the buffer during the first time period or the total amount of data transmitted by the buffer during the first time period.

[0107] Then, based on the relationship between the first ratio and the second ratio, the congestion control device may determine the flow status of the buffer.

[0108] It can be seen that in the embodiment of the present application, the congestion control device obtains a first ratio of the data receiving rate of the buffer and the bandwidth of the buffer transmitting data, then obtains the total amount of data received and transmitted by the buffer in the first time period, and obtains a second ratio based on the total amount of data, the first time period and the bandwidth. Then, based on the first ratio and the second ratio, the flow state of the buffer is determined. Thus, the flow state of the buffer can be determined, and then based on the flow state of the buffer and the waiting queue state of the cache queue, it is determined whether the network layer is congested, which solves the problem of serious data loss caused by determining whether the network layer is congested only by the waiting queue state, and improves the data transmission efficiency of the network layer.

[0109] Exemplarily, determining the flow state based on the first ratio and the second ratio may include the following steps:

[0110] When the first ratio is greater than (1+the second ratio), determining that the flow state is the third state;

[0111] When the first ratio is less than (1-the second ratio), the flow state is determined to be the fourth state.

[0112] The third state indicates that the total amount of data received by the buffer during the first time period is greater than the sum of the total amount of data transmitted by the buffer during the first time period and the total amount of data predicted to be transmitted by the buffer during the second time period. The second time period is a preset time period after the moment the nth request is received. The fourth state indicates that the total amount of data received by the buffer during the first time period is less than the difference between the total amount of data transmitted by the buffer during the first time period and the total amount of data predicted to be received by the buffer during the second time period.

[0113] In an embodiment of the present application, when the total amount of data received by the buffer in the first time period is greater than the sum of the total amount of data transmitted by the buffer in the first time period and the total amount of data predicted to be transmitted by the buffer in the second time period, that is, (data receiving rate * first time period) is greater than [(bandwidth * first time period) + the total amount of data predicted to be transmitted by the buffer in the second time period], it indicates that even if the buffer does not receive data in the second time period after the arrival time of the nth request, the total amount of data transmitted by the buffer is less than the total amount of data received by the buffer, and data accumulates in the buffer.

[0114] It should be noted that in this embodiment of the present application, the total amount of data received and transmitted by the buffer during the first time period is used as the predicted total amount of data transmitted by the buffer during the second time period, where the first and second time periods are equal in length. Therefore, by transforming the above relationship, it can be seen that when the first ratio is greater than (1 + the second ratio), data is accumulated in the buffer, and the congestion control device determines the traffic state of the buffer at this time as the third state.

[0115] When the total amount of data received by the buffer in the first time period is less than the difference between the total amount of data transmitted by the buffer in the first time period and the total amount of data predicted to be received by the buffer in the second time period, that is, (data reception rate * first time period) is less than [(bandwidth * first time period) - total amount of data predicted to be received by the buffer in the second time period], it indicates that even if the buffer does not transmit data in the second time period after the arrival time of the nth request, the total amount of data received by the buffer is less than the total amount of data transmitted by the buffer, and the buffer occupancy rate is low.

[0116] It should be noted that the embodiment of the present application uses the total amount of data received and transmitted by the buffer during the first time period as the predicted total amount of data received by the buffer during the second time period. Therefore, by transforming the above relationship, it can be seen that when the first ratio is less than (1-second ratio), the buffer occupancy rate is low, and the congestion control device determines the traffic state of the buffer at this time as the fourth state.

[0117] It can be understood that when the total amount of data received by the buffer in the first time period is greater than or equal to the difference between the total amount of data transmitted by the buffer in the first time period and the total amount of data predicted to be received by the buffer in the second time period, and the total amount of data received by the buffer in the first time period is greater than the sum of the total amount of data transmitted by the buffer in the first time period and the total amount of data predicted to be transmitted by the buffer in the second time period, that is, the first ratio is greater than or equal to (1-second ratio) and the first ratio is less than or equal to (1+second ratio), the buffer is in a stable working state, and the congestion control device determines the flow state of the buffer at this time as the sixth state.

[0118] It should be noted that the embodiments of the present application are only described by taking the total amount of data received and transmitted by the buffer in the first time period as the total amount of data predicted to be received by the buffer in the second time period or the total amount of data predicted to be transmitted by the buffer in the second time period as an example. Those skilled in the art can also use other methods to determine the total amount of data predicted to be received by the buffer in the second time period or the total amount of data predicted to be transmitted by the buffer in the second time period to determine the traffic status of the buffer, which is not limited here.

[0119] It can be seen that in the embodiment of the present application, the congestion control device can determine the flow state of the buffer based on the relationship between the first ratio and the second ratio, characterize the data accumulation in the buffer by the third state, characterize the low occupancy of the buffer by the fourth state, and characterize the buffer in a stable working state by the sixth state. Therefore, based on the flow state of the buffer and the waiting queue state of the cache queue, it can be determined whether congestion occurs in the network layer, so as to solve the problem of serious data loss caused by the cache queue being in a high-load working state when the data transmission efficiency of the buffer is high, thereby improving the data transmission efficiency of the network layer.

[0120] 703: Determine the drop probability based on the waiting queue status and traffic status.

[0121] In an embodiment of the present application, the congestion control device combines the waiting queue status and the traffic status to determine the changing trend of the waiting queue and the data reception and transmission efficiency of the buffer zone, determines whether the network layer is in a high-load working state, and thus determines the discard probability of the nth request.

[0122] For example, Figure 8 As shown, based on the waiting queue state and the traffic state, determining the drop probability may include, for example, the following steps:

[0123] When the waiting queue state is the first state and the traffic state is the fourth state, obtaining a drop probability based on an average waiting queue length and an average waiting queue length change;

[0124] When the waiting queue state is the first state and the traffic state is the third state, obtaining a drop probability based on an average waiting queue length, an average waiting queue length change, and a fourth threshold;

[0125] When the waiting queue state is the second state and the traffic state is the fourth state, obtaining a drop probability based on a fifth threshold and an average waiting queue length;

[0126] When the waiting queue state is the second state and the traffic state is the third state, the discard probability is obtained based on the fourth threshold, the fifth threshold, the average waiting queue length and the average waiting queue length change; or, the discard probability is obtained based on the fifth threshold and the average waiting queue length.

[0127] In the embodiment of the present application, the fifth threshold value can be dynamically adjusted based on the waiting queue state, wherein the fifth threshold value is greater than the first threshold value and less than the second threshold value. Figure 8 As shown, when the waiting queue state is the first state and the traffic state is the fourth state, the waiting queue length of the cache queue decreases at a rate greater than the first rate threshold, and the occupancy rate of the buffer is low. Therefore, in order to reduce the rate of decrease of the waiting queue length of the cache queue and increase the occupancy rate of the buffer to improve the utilization of the network layer, the congestion control device should appropriately reduce the drop probability of the nth request to avoid excessive data drop. Therefore, the congestion control device will obtain the drop probability based on the average waiting queue length and the average waiting queue length change. The drop probability at this time can be expressed by the following formula (4):

[0128]

[0129] Wherein, P represents the drop probability of the nth request, min represents the first threshold, max represents the second threshold, and maxp represents the maximum drop probability corresponding to the second threshold.

[0130] When the waiting queue state is the first state and the traffic state is the third state, the waiting queue length of the cache queue decreases at a rate greater than the first rate threshold, and data in the buffer accumulates. Therefore, in order to reduce the rate of decrease of the waiting queue length of the cache queue and reduce the occupancy rate of the buffer so that the network layer is in a saturated working state, the congestion control device will obtain the drop probability based on the average waiting queue length, the average waiting queue length change, and the fourth threshold. The drop probability at this time can be expressed by the following formula (5):

[0131]

[0132] Wherein, a represents the fourth threshold, [rlen(n)+a] is the waiting queue attenuation coefficient at this time, and the waiting queue attenuation coefficient is used to characterize the rate of decrease of the waiting queue length.

[0133] When the waiting queue state is the second state and the traffic state is the fourth state, the waiting queue length of the cache queue increases at a rate greater than the second rate threshold, and the buffer occupancy rate is low. Therefore, in order to reduce the rate of increase of the waiting queue length of the cache queue and increase the buffer occupancy rate to ensure that the accelerated increase in the waiting queue length does not affect the buffer, the congestion control device should determine the drop probability based on the average waiting queue length and the fifth threshold.

[0134] For example, Figure 8As shown, when the waiting queue state is the second state and the traffic state is the fourth state, obtaining the drop probability based on the fifth threshold and the average waiting queue length may include the following steps:

[0135] When the average waiting queue length is greater than the fifth threshold, the drop probability is determined to be 1;

[0136] When the average waiting queue length is less than or equal to the fifth threshold, the discard probability is obtained based on the average waiting queue length.

[0137] In this embodiment of the present application, the fifth threshold value can be dynamically adjusted based on the waiting queue state. Since the waiting queue state is the second state, the waiting queue length of the cache queue at this time increases at a rate greater than the second rate threshold. In order to avoid congestion at the network layer, it is necessary to set the fifth threshold value to prevent the average waiting queue length from reaching the second threshold value. The drop probability at this time can be expressed by the following formula (6):

[0138]

[0139] Where mid represents the fifth threshold. As can be seen from formula (6), when the average waiting queue length is greater than the fifth threshold, the congestion control device determines the drop probability to be 1, so as to drop the nth request in advance, thereby preventing the increase in the waiting queue length from affecting the buffer, thereby avoiding network congestion.

[0140] When the average waiting queue length is less than or equal to the fifth threshold, the congestion control device determines the discard probability of the nth request based on the waiting queue length when the nth request arrives, the first threshold, the fifth threshold and the maximum discard probability.

[0141] It can be seen that when the waiting queue state is the second state and the traffic state is the fourth state, the congestion control device can dynamically determine the discard probability of the nth request through the set fifth threshold. When the average waiting queue length is greater than the fifth threshold, the nth request is discarded to avoid the increase in the waiting queue length affecting the buffer, thereby avoiding network congestion and improving the stability of the network layer.

[0142] When the waiting queue state is the second state and the traffic state is the third state, the waiting queue length of the cache queue increases at a rate greater than the second rate threshold, and data accumulates in the buffer. Therefore, to reduce the rate of increase of the waiting queue length of the cache queue and reduce the buffer occupancy rate to avoid premature congestion at the network layer, the congestion control device discards more requests. Thus, the congestion control device determines a discard probability based on the fourth threshold, the fifth threshold, the average waiting queue length, and the average waiting queue length change; or, alternatively, determines a discard probability based on the fifth threshold and the average waiting queue length.

[0143] For example, Figure 8 As shown, when the waiting queue state is the second state and the traffic state is the third state, obtaining the drop probability based on the fourth threshold, the fifth threshold, the average waiting queue length, and the average waiting queue length change may include the following steps:

[0144] When the average waiting queue length is less than or equal to the fifth threshold, obtaining a drop probability based on the fourth threshold, the average waiting queue length, and the average waiting queue length change;

[0145] When the waiting queue state is the second state and the traffic state is the third state, the drop probability is obtained based on the fifth threshold and the average waiting queue length, which may include:

[0146] When the average waiting queue length is greater than the fifth threshold, the discard probability is determined to be 1.

[0147] In the embodiment of the present application, when the waiting queue state is the second state and the traffic state is the third state, the waiting queue length of the cache queue increases at a rate greater than the second rate threshold, and data in the buffer accumulates, and the probability of congestion in the network layer increases. To this end, it is necessary to set a fifth threshold to prevent the average waiting queue length from reaching the second threshold, and when the average waiting queue length is less than or equal to the fifth threshold, the drop probability should also be higher than that in other waiting queue states and traffic states. The drop probability at this time can be expressed by the following formula (7):

[0148]

[0149] It can be seen from formula (7) that when the average waiting queue length is greater than the fifth threshold, the congestion control device determines the discard probability of the nth request to be 1, so as to discard the nth request in advance, thereby avoiding the continuous increase in the waiting queue length and the continuous accumulation of data in the buffer, which leads to congestion in the network layer.

[0150] When the average waiting queue length is less than or equal to the fifth threshold, the congestion control device determines the drop probability of the nth request based on the waiting queue length at the time the nth request arrives, the first threshold, the fourth threshold, the fifth threshold, the maximum drop probability, and the change in the average waiting queue length at the time the nth request arrives. It should be noted that the drop probability of the nth request determined in this case is higher than that in other waiting queue states and traffic states, so as to avoid premature congestion at the network layer.

[0151] Therefore, when the waiting queue state is the second state and the traffic state is the third state, the congestion control device can determine the discard probability of the nth request to 1 when the average waiting queue length is greater than the fifth threshold, so as to discard the nth request in advance and avoid congestion at the network layer. When the average waiting queue length is less than or equal to the fifth threshold, a higher discard probability is determined based on the fourth threshold, the average waiting queue length and the change in the average waiting queue length, and determine whether to discard the nth request with the higher discard probability to avoid network congestion and improve the stability of data processing at the network layer.

[0152] For example, when the waiting queue state is the fifth state, the congestion control device may determine the drop probability of the nth request based on the first threshold, the second threshold, the maximum drop probability, and the average waiting queue length. The drop probability at this time can be expressed by the following formula (8):

[0153]

[0154] It can be seen that in the embodiment of the present application, the congestion control device can dynamically adjust the method of determining the discard probability based on the waiting queue status and the traffic status of the buffer, so as to perform congestion control on the network layer based on the changes in the cache queue and the occupancy of the buffer, thereby improving the accuracy of congestion control and solving the problem of serious data loss caused by determining whether to discard a request only by the waiting queue length, thereby improving data transmission efficiency.

[0155] Therefore, the congestion control device can determine the waiting queue state of the cache queue based on the change in the average waiting queue length, and then determine the flow state of the buffer based on the data receiving rate, and thus determine the discard probability of the nth request based on the waiting queue state and the flow state, solving the problem of serious data loss caused by determining whether to discard a request only by the waiting queue length, thereby improving data transmission efficiency.

[0156] In some feasible embodiments, the method further includes the following steps:

[0157] When it is determined that the waiting queue state is the first state, adding a preset constant to the sixth threshold value to obtain a fifth threshold value;

[0158] When it is determined that the waiting queue state is the second state, the fifth threshold is obtained by subtracting a preset constant from the sixth threshold.

[0159] The sixth threshold is determined when the (n-1)th request is received.

[0160] It should be noted that the user will set an initial threshold based on the actual load capacity of the network layer. When the first request arrives, the congestion control device will adjust the initial threshold based on the waiting queue status when the first request arrives to obtain the fifth threshold when the first request arrives.

[0161] When the nth request arrives, if it is determined that the waiting queue state at the time of the nth request arrival is the first state, that is, the waiting queue length of the cache queue is decreasing at a rate greater than the first rate threshold, the congestion control device obtains the fifth threshold determined at the (n-1)th moment, that is, the sixth threshold, and adds a preset constant to the sixth threshold to obtain the fifth threshold. Optionally, the preset constant may be, for example, 1.

[0162] When the nth request arrives, when it is determined that the waiting queue state when the nth request arrives is the second state, that is, when the waiting queue length of the cache queue increases at an increasing rate greater than the second rate threshold, the congestion control device will obtain the fifth threshold determined at the (n-1)th moment, that is, the sixth threshold, and subtract the preset constant from the sixth threshold to obtain the fifth threshold.

[0163] It should be noted that since the waiting queue state is used to represent the changing trend of the waiting queue length in the buffer queue, the fifth threshold is adjusted based on the waiting queue state so that the drop probability determined by the congestion control device based on the fifth threshold more accurately reflects the load status of the network layer. As a result, the congestion control device can determine whether to drop the nth request based on the dynamically adjusted fifth threshold, thereby improving the accuracy of congestion control and avoiding excessive data loss.

[0164] In summary, in an embodiment of the present application, when the nth request sent by the sender arrives, the congestion control device obtains the waiting queue length of the cache queue of the network layer and the data receiving rate of the buffer of the network layer, and determines the change in the waiting queue length after the nth request data sent by the sender arrives at the cache queue based on the waiting queue length, and determines the rate at which the buffer receives and processes data based on the data receiving rate, and performs congestion control on the network layer in combination with the change in the waiting queue length and the rate at which the buffer receives and processes data. Thus, the congestion control device can perform congestion control on the network layer based on the waiting queue length and the data receiving rate. When the data receiving rate and data transmission rate of the buffer are fast, even if the waiting queue length is long, the network layer can transmit data to the receiving end at a higher throughput rate, thereby being able to restore a stable state after a short period of high-load work, without discarding the nth request, thereby solving the problem of serious data loss caused by discarding the sender's request due to changes in the waiting queue length, and improving the data transmission efficiency of the network layer.

[0165] See Figure 9 , Figure 9A schematic diagram of a congestion control device provided in an embodiment of the present application. The congestion control device 900 includes: an acquisition unit 901 and a processing unit 902;

[0166] The acquiring unit 901 is configured to acquire the waiting queue length of the cache queue of the network layer and the data receiving rate of the buffer of the network layer when receiving the nth request;

[0167] The processing unit 902 is configured to perform congestion control on the network layer based on the waiting queue length and the data receiving rate.

[0168] In a feasible embodiment, in terms of performing congestion control on the network layer based on the waiting queue length and the data receiving rate, the processing unit 902 is specifically configured to:

[0169] Based on the waiting queue length, determine the average waiting queue length and the average waiting queue length change when the nth request arrives;

[0170] When the average waiting queue length is greater than a first threshold and less than a second threshold, determining a discard probability of the nth request based on a change in the average waiting queue length and a data receiving rate;

[0171] Based on the drop probability, determine whether to drop the nth request to perform congestion control on the network layer.

[0172] In a feasible embodiment, in determining the probability of discarding the nth request based on the average waiting queue length change and the data receiving rate, the processing unit 902 is specifically configured to:

[0173] Determining a waiting queue state of the cache queue based on a change in the average waiting queue length;

[0174] Determine the traffic status of the buffer based on the data receiving rate;

[0175] The drop probability is determined based on the waiting queue status and traffic status.

[0176] In a feasible embodiment, in determining the waiting queue state of the cache queue based on the average waiting queue length change, the processing unit 902 is specifically configured to:

[0177] When the average waiting queue length change is less than the third threshold, determining that the waiting queue state is the first state; the first state indicates that the decreasing rate of the waiting queue length of the cache queue is greater than the first rate threshold;

[0178] When the average waiting queue length change is greater than the fourth threshold, the waiting queue state is determined to be the second state; the second state indicates that the increase rate of the waiting queue length of the cache queue is greater than the second rate threshold.

[0179] In a feasible embodiment, in determining the traffic status of the buffer based on the data receiving rate, the processing unit 902 is specifically configured to:

[0180] Obtaining a first ratio of a data receiving rate to a bandwidth of a buffer for transmitting data;

[0181] Obtaining the total amount of data received and transmitted by the buffer within a first time period; the first time period is a preset time period before the moment when the nth request is received;

[0182] Obtaining a second ratio based on the total amount of data, the first time period, and the bandwidth;

[0183] Based on the first ratio and the second ratio, a flow state is determined.

[0184] In a feasible embodiment, in determining the flow state based on the first ratio and the second ratio, the processing unit 902 is specifically configured to:

[0185] When the first ratio is greater than (1+the second ratio), the traffic state is determined to be a third state; the third state indicates that the total amount of data received by the buffer in the first time period is greater than the sum of the total amount of data transmitted by the buffer in the first time period and the total amount of data predicted to be transmitted by the buffer in the second time period; the second time period is a preset time period after the moment when the nth request is received;

[0186] When the first ratio is less than (1-the second ratio), the traffic state is determined to be the fourth state; the fourth state indicates that the total amount of data received by the buffer in the first time period is less than the difference between the total amount of data transmitted by the buffer in the first time period and the total amount of data predicted to be received by the buffer in the second time period.

[0187] In a feasible embodiment, in determining the drop probability based on the waiting queue state and the traffic state, the processing unit 902 is specifically configured to:

[0188] When the waiting queue state is the first state and the traffic state is the fourth state, obtaining a drop probability based on an average waiting queue length and an average waiting queue length change;

[0189] When the waiting queue state is the first state and the traffic state is the third state, obtaining a drop probability based on an average waiting queue length, an average waiting queue length change, and a fourth threshold;

[0190] When the waiting queue state is the second state and the traffic state is the fourth state, obtaining a drop probability based on a fifth threshold and an average waiting queue length; the fifth threshold is greater than the first threshold and less than the second threshold;

[0191] When the waiting queue state is the second state and the traffic state is the third state, the discard probability is obtained based on the fourth threshold, the fifth threshold, the average waiting queue length and the average waiting queue length change; or, the discard probability is obtained based on the fifth threshold and the average waiting queue length.

[0192] In a feasible embodiment, when the waiting queue state is the second state and the traffic state is the fourth state, in obtaining the drop probability based on the fifth threshold and the average waiting queue length, the processing unit 902 is specifically configured to:

[0193] When the average waiting queue length is greater than the fifth threshold, the drop probability is determined to be 1;

[0194] When the average waiting queue length is less than or equal to the fifth threshold, the discard probability is obtained based on the average waiting queue length.

[0195] In a feasible embodiment, when the waiting queue state is the second state and the traffic state is the third state, in obtaining the drop probability based on the fourth threshold, the fifth threshold, the average waiting queue length, and the average waiting queue length change, the processing unit 902 is specifically configured to:

[0196] When the average waiting queue length is less than or equal to the fifth threshold, obtaining a drop probability based on the fourth threshold, the average waiting queue length, and the average waiting queue length change;

[0197] When the waiting queue state is the second state and the traffic state is the third state, in obtaining the drop probability based on the fifth threshold and the average waiting queue length, the processing unit 902 is specifically configured to:

[0198] When the average waiting queue length is greater than the fifth threshold, the discard probability is determined to be 1.

[0199] In a feasible embodiment, the processing unit 902 is further configured to:

[0200] When it is determined that the waiting queue state is the first state, the sixth threshold is added to the preset constant to obtain the fifth threshold; the sixth threshold is determined when the (n-1)th request is received;

[0201] When it is determined that the waiting queue state is the second state, the fifth threshold is obtained by subtracting a preset constant from the sixth threshold.

[0202] In a feasible embodiment, in determining the average waiting queue length and the average waiting queue length change when the nth request arrives based on the waiting queue length, the processing unit 902 is specifically configured to:

[0203] Get the average waiting queue length when the (n-1)th request arrives;

[0204] Determine the average waiting queue length based on the waiting queue length and the average waiting queue length when the (n-1)th request arrives;

[0205] Get the average waiting queue length change when the (n-1)th request arrives, and the waiting queue length when the (n-1)th request arrives;

[0206] Based on the waiting queue length when the (n-1)th request arrives, the waiting queue length, and the average waiting queue length change when the (n-1)th request arrives, the average waiting queue length change is obtained.

[0207] See Figure 10 , Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 10 As shown, electronic device 1000 includes a transceiver 1001, a processor 1002, and a memory 1003. These are connected via a bus 1004. Memory 1003 is used to store computer programs and data, and can transmit data stored in memory 1003 to processor 1002. Electronic device 1000 may be the aforementioned congestion control device 900. Specifically, transceiver 1001 may be the aforementioned acquisition unit 901, and processor 1002 may be the aforementioned processing unit 902.

[0208] When the electronic device 1000 is the congestion control device 900, the processor 1002 is configured to read the computer program in the memory 1003 and perform the following operations:

[0209] When the nth request is received, the waiting queue length of the cache queue of the network layer and the data receiving rate of the buffer of the network layer are obtained;

[0210] Congestion control is performed on the network layer based on the waiting queue length and data reception rate.

[0211] In a feasible embodiment, in terms of performing congestion control on the network layer based on the waiting queue length and the data receiving rate, the processor 1002 is specifically configured to perform the following operations:

[0212] Based on the waiting queue length, determine the average waiting queue length and the average waiting queue length change when the nth request arrives;

[0213] When the average waiting queue length is greater than a first threshold and less than a second threshold, determining a discard probability of the nth request based on a change in the average waiting queue length and a data receiving rate;

[0214] Based on the drop probability, determine whether to drop the nth request to perform congestion control on the network layer.

[0215] In a feasible embodiment, in determining the discard probability of the nth request based on the average waiting queue length change and the data receiving rate, the processor 1002 is specifically configured to perform the following operations:

[0216] Determining a waiting queue state of the cache queue based on a change in the average waiting queue length;

[0217] Determine the traffic status of the buffer based on the data receiving rate;

[0218] The drop probability is determined based on the waiting queue status and traffic status.

[0219] In a feasible embodiment, in determining the waiting queue state of the cache queue based on the average waiting queue length change, the processor 1002 is specifically configured to perform the following operations:

[0220] When the average waiting queue length change is less than the third threshold, determining that the waiting queue state is the first state; the first state indicates that the decreasing rate of the waiting queue length of the cache queue is greater than the first rate threshold;

[0221] When the average waiting queue length change is greater than the fourth threshold, the waiting queue state is determined to be the second state; the second state indicates that the increase rate of the waiting queue length of the cache queue is greater than the second rate threshold.

[0222] In a feasible embodiment, in determining the traffic status of the buffer based on the data receiving rate, the processor 1002 is specifically configured to perform the following operations:

[0223] Obtaining a first ratio of a data receiving rate to a bandwidth of a buffer for transmitting data;

[0224] Obtaining the total amount of data received and transmitted by the buffer within a first time period; the first time period is a preset time period before the moment when the nth request is received;

[0225] Obtaining a second ratio based on the total amount of data, the first time period, and the bandwidth;

[0226] Based on the first ratio and the second ratio, a flow state is determined.

[0227] In a feasible embodiment, in determining the flow state based on the first ratio and the second ratio, the processor 1002 is specifically configured to perform the following operations:

[0228] When the first ratio is greater than (1+the second ratio), the traffic state is determined to be a third state; the third state indicates that the total amount of data received by the buffer in the first time period is greater than the sum of the total amount of data transmitted by the buffer in the first time period and the total amount of data predicted to be transmitted by the buffer in the second time period; the second time period is a preset time period after the moment when the nth request is received;

[0229] When the first ratio is less than (1-the second ratio), the traffic state is determined to be the fourth state; the fourth state indicates that the total amount of data received by the buffer in the first time period is less than the difference between the total amount of data transmitted by the buffer in the first time period and the total amount of data predicted to be received by the buffer in the second time period.

[0230] In a feasible embodiment, in determining the drop probability based on the waiting queue state and the traffic state, the processor 1002 is specifically configured to perform the following operations:

[0231] When the waiting queue state is the first state and the traffic state is the fourth state, obtaining a drop probability based on an average waiting queue length and an average waiting queue length change;

[0232] When the waiting queue state is the first state and the traffic state is the third state, obtaining a drop probability based on an average waiting queue length, an average waiting queue length change, and a fourth threshold;

[0233] When the waiting queue state is the second state and the traffic state is the fourth state, obtaining a drop probability based on a fifth threshold and an average waiting queue length; the fifth threshold is greater than the first threshold and less than the second threshold;

[0234] When the waiting queue state is the second state and the traffic state is the third state, the discard probability is obtained based on the fourth threshold, the fifth threshold, the average waiting queue length and the average waiting queue length change; or, the discard probability is obtained based on the fifth threshold and the average waiting queue length.

[0235] In a feasible embodiment, when the waiting queue state is the second state and the traffic state is the fourth state, in obtaining the drop probability based on the fifth threshold and the average waiting queue length, the processor 1002 is specifically configured to perform the following operations:

[0236] When the average waiting queue length is greater than the fifth threshold, the drop probability is determined to be 1;

[0237] When the average waiting queue length is less than or equal to the fifth threshold, the discard probability is obtained based on the average waiting queue length.

[0238] In a feasible embodiment, when the waiting queue state is the second state and the traffic state is the third state, in obtaining the drop probability based on the fourth threshold, the fifth threshold, the average waiting queue length, and the average waiting queue length change, the processor 1002 is specifically configured to perform the following operations:

[0239] When the average waiting queue length is less than or equal to the fifth threshold, obtaining a drop probability based on the fourth threshold, the average waiting queue length, and the average waiting queue length change;

[0240] When the waiting queue state is the second state and the traffic state is the third state, in obtaining the drop probability based on the fifth threshold and the average waiting queue length, the processor 1002 is specifically configured to perform the following operations:

[0241] When the average waiting queue length is greater than the fifth threshold, the discard probability is determined to be 1.

[0242] In a feasible embodiment, the processor 1002 is further configured to perform the following operations:

[0243] When it is determined that the waiting queue state is the first state, the sixth threshold is added to the preset constant to obtain the fifth threshold; the sixth threshold is determined when the (n-1)th request is received;

[0244] When it is determined that the waiting queue state is the second state, the fifth threshold is obtained by subtracting a preset constant from the sixth threshold.

[0245] In a feasible embodiment, in determining the average waiting queue length and the average waiting queue length change when the nth request arrives based on the waiting queue length, the processor 1002 is specifically configured to perform the following operations:

[0246] Get the average waiting queue length when the (n-1)th request arrives;

[0247] Determine the average waiting queue length based on the waiting queue length and the average waiting queue length when the (n-1)th request arrives;

[0248] Get the average waiting queue length change when the (n-1)th request arrives, and the waiting queue length when the (n-1)th request arrives;

[0249] Based on the waiting queue length when the (n-1)th request arrives, the waiting queue length, and the average waiting queue length change when the (n-1)th request arrives, the average waiting queue length change is obtained.

[0250] An embodiment of the present application further provides a computer-readable storage medium storing a computer program, wherein the computer program is executed by a processor to implement part or all of the steps of any one of the congestion control methods described in the above method embodiments.

[0251] An embodiment of the present application also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute part or all of the steps of any one of the congestion control methods described in the above method embodiments.

[0252] An embodiment of the present application further provides a vehicle, comprising the above-mentioned congestion control device 900 .

[0253] It should be noted that for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all optional embodiments, and the actions and modules involved are not necessarily required for this application.

[0254] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0255] In the several embodiments provided in this application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as 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 mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.

[0256] The units described as separate components may or may not be physically separate, 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 these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0257] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or in the form of software program modules.

[0258] If the integrated unit is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a memory and includes a number of instructions for enabling 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 method described in each embodiment of the present application. The aforementioned memory includes various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0259] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program. The program can be stored in a computer-readable memory, and the memory can include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0260] The above is a detailed introduction to the embodiments of the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of the present application. At the same time, for those skilled in the art, according to the idea of the present application, there may be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A congestion control method, characterized in that: include: Upon receiving the nth request, obtaining a waiting queue length of a cache queue of the network layer and a data receiving rate of a buffer of the network layer; Congestion control is performed on the network layer based on the waiting queue length and the data receiving rate.

2. The method according to claim 1, characterized in that The performing congestion control on the network layer based on the waiting queue length and the data receiving rate includes: Based on the waiting queue length, determining the average waiting queue length and the average waiting queue length change when the nth request arrives; When the average waiting queue length is greater than a first threshold and less than a second threshold, determining a discard probability of the nth request based on a change in the average waiting queue length and the data receiving rate; Based on the discard probability, it is determined whether to discard the nth request, so as to perform the congestion control on the network layer.

3. The method according to claim 2, characterized in that The determining, based on the average waiting queue length change and the data receiving rate, a probability of discarding the nth request, includes: Determining a waiting queue state of the cache queue based on the average waiting queue length change; determining a flow state of the buffer zone based on the data receiving rate; The discard probability is determined based on the waiting queue state and the traffic state.

4. The method according to claim 3, characterized in that The determining the waiting queue state of the cache queue based on the average waiting queue length change includes: When the change in the average waiting queue length is less than a third threshold, determining that the waiting queue state is a first state; the first state indicates that a decreasing rate of the waiting queue length of the cache queue is greater than a first rate threshold; When the change in the average waiting queue length is greater than a fourth threshold, the waiting queue state is determined to be a second state; the second state indicates that an increase rate of the waiting queue length of the cache queue is greater than a second rate threshold.

5. The method according to claim 4, characterized in that The determining the flow state of the buffer zone based on the data receiving rate includes: Obtaining a first ratio of the data receiving rate to a bandwidth of the buffer for transmitting data; Obtaining the total amount of data received and transmitted by the buffer within a first time period; the first time period being a preset time period before the moment when the nth request is received; obtaining a second ratio based on the total amount of data, the first time period, and the bandwidth; The flow state is determined based on the first ratio and the second ratio.

6. The method according to claim 5, characterized in that The determining the flow state based on the first ratio and the second ratio includes: When the first ratio is greater than (1+the second ratio), determining that the traffic state is a third state; the third state indicates that the total amount of data received by the buffer in the first time period is greater than the sum of the total amount of data transmitted by the buffer in the first time period and the total amount of data predicted to be transmitted by the buffer in a second time period; the second time period is a preset time period after the moment when the nth request is received; When the first ratio is less than (1-the second ratio), the traffic state is determined to be the fourth state; the fourth state represents that the total amount of data received by the buffer in the first time period is less than the difference between the total amount of data transmitted by the buffer in the first time period and the total amount of data predicted to be received by the buffer in the second time period.

7. The method according to claim 6, characterized in that The determining the discard probability based on the waiting queue state and the traffic state includes: When the waiting queue state is the first state and the traffic state is the fourth state, obtaining the discard probability based on the average waiting queue length and the average waiting queue length change; When the waiting queue state is the first state and the traffic state is the third state, obtaining the discard probability based on the average waiting queue length, the average waiting queue length change, and the fourth threshold; When the waiting queue state is the second state and the traffic state is the fourth state, obtaining the drop probability based on a fifth threshold and the average waiting queue length; the fifth threshold is greater than the first threshold and less than the second threshold; When the waiting queue state is the second state and the traffic state is the third state, the discard probability is obtained based on the fourth threshold, the fifth threshold, the average waiting queue length and the change in the average waiting queue length; or, the discard probability is obtained based on the fifth threshold and the average waiting queue length.

8. The method according to claim 7, characterized in that When the waiting queue state is the second state and the traffic state is the fourth state, obtaining the discard probability based on a fifth threshold and the average waiting queue length includes: When the average waiting queue length is greater than the fifth threshold, determining the discard probability to be 1; When the average waiting queue length is less than or equal to the fifth threshold, the discard probability is obtained based on the average waiting queue length.

9. The method according to claim 7 or 8, characterized in that The step of obtaining the drop probability based on the fourth threshold, the fifth threshold, the average waiting queue length, and the average waiting queue length change when the waiting queue state is the second state and the traffic state is the third state includes: When the average waiting queue length is less than or equal to the fifth threshold, obtaining the discard probability based on the fourth threshold, the average waiting queue length, and the average waiting queue length change; The obtaining, when the waiting queue state is the second state and the traffic state is the third state, the discard probability based on the fifth threshold and the average waiting queue length includes: When the average waiting queue length is greater than the fifth threshold, the discard probability is determined to be 1.

10. The method according to any one of claims 7 to 9, characterized in that: The method further comprises: When it is determined that the waiting queue state is the first state, adding a preset constant to the sixth threshold to obtain the fifth threshold; the sixth threshold is determined when the (n-1)th request is received; When it is determined that the waiting queue state is the second state, the fifth threshold is obtained by subtracting the preset constant from the sixth threshold.

11. The method according to any one of claims 2 to 10, characterized in that: The determining, based on the waiting queue length, the average waiting queue length and the average waiting queue length change when the nth request arrives, includes: Get the average waiting queue length when the (n-1)th request arrives; Determine the average waiting queue length based on the waiting queue length and the average waiting queue length when the (n-1)th request arrives; Obtaining the average waiting queue length change when the (n-1)th request arrives, and the waiting queue length when the (n-1)th request arrives; The average waiting queue length change is obtained based on the waiting queue length when the (n-1)th request arrives, the waiting queue length, and the average waiting queue length change when the (n-1)th request arrives.

12. An electronic device, characterized in that: include: A processor and a memory, the processor is connected to the memory, the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the electronic device performs the method according to any one of claims 1 to 11.

13. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method according to any one of claims 1 to 11.

14. A vehicle, characterized in that: The vehicle includes the electronic device according to claim 12.