Flow control method, apparatus and device

By determining the traffic allocation level based on queue depth and authorization surplus at the data source end, the problem of traffic bursts caused by source end authorization state oscillation in distributed network communication systems is solved, adaptive traffic control is achieved, and the destination end cache usage is reduced.

CN121418360BActive Publication Date: 2026-07-07GETONG INTELLIGENT TECHNOLOGY (SHANGHAI) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GETONG INTELLIGENT TECHNOLOGY (SHANGHAI) CO LTD
Filing Date
2025-12-26
Publication Date
2026-07-07

Smart Images

  • Figure CN121418360B_ABST
    Figure CN121418360B_ABST
Patent Text Reader

Abstract

The application provides a flow control method, device and equipment. The application determines whether a queue reaches a target authorization condition according to a current queue depth of the queue and a current authorization surplus of the queue; in response to the queue reaching the target authorization condition, determines a rate level corresponding to the queue according to a difference between the current queue depth and the current authorization surplus; the rate level and the difference are positively correlated, and the higher the rate level, the more flow is requested to be allocated; sends an authorization request corresponding to the queue to a destination of a network communication distributed system; the authorization request carries the rate level of the queue; in response to receiving authorization information returned by the destination according to the rate level, controls data in the queue to be sent to the destination according to the authorization information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of network communication technology, and in particular to a flow control method, apparatus and device. Background Technology

[0002] A distributed network communication system refers to a system in which multiple independent nodes (computers, servers, terminal devices, etc.) connected by a network work together to complete complex tasks based on a unified communication protocol and coordination rules. In a distributed network communication system, the core objective of path flow control is to optimize network resource utilization, avoid link congestion, ensure low latency for critical services, and achieve manageable and controllable traffic (such as policy-based scheduling, rate limiting, and traffic distribution). Essentially, it involves sensing network conditions and executing scheduling strategies to perform fine-grained management of data transmission path selection, traffic allocation, and rate limiting between nodes.

[0003] Current path flow control in distributed network communication systems typically employs an authorization mechanism. The data source allocates queues to data packets based on their destination and priority, storing the packets in the corresponding queues. Each queue then generates a send request to the destination. The destination, based on its processing capacity and a predetermined scheduling strategy, authorizes the data packets to be allocated to each queue. After receiving authorization, each queue sends the corresponding number of data packets to the destination, according to the authorized limit. While current flow control methods can achieve congestion control on average, they microscopically transform smooth input traffic into bursty traffic, leading to increased buffer usage at the destination. Summary of the Invention

[0004] This application provides a flow control method, apparatus, and device to solve the above-mentioned problems.

[0005] In a first aspect, embodiments of this disclosure provide a flow control method for the data source end of a network communication distributed system; the flow control method includes:

[0006] Based on the current queue depth and the current authorization surplus of the queue, determine whether the queue has met the target authorization conditions;

[0007] In response to the queue reaching the target authorization condition, a rate level corresponding to the queue is determined based on the difference between the current queue depth and the current authorization surplus; wherein the rate level is positively correlated with the difference, and the higher the rate level, the more traffic is requested to be allocated;

[0008] Send an authorization request corresponding to the queue to the destination of the network communication distributed system; the authorization request carries the rate level of the queue;

[0009] In response to receiving authorization information returned by the destination based on the rate level, the data in the queue is sent to the destination based on the authorization information.

[0010] Optionally, determining whether the queue has met the target authorization condition based on the current queue depth and the current authorization surplus of the queue includes:

[0011] The current queue depth is compared with the first value, and the current authorized surplus is compared with the second value; if the current queue depth is greater than the first value and the current authorized surplus is less than or equal to the second value, it is determined that the queue has reached the target authorization condition.

[0012] Optionally, determining the rate level corresponding to the queue based on the difference between the current queue depth and the current authorized surplus includes: determining the difference range to which the difference belongs; wherein different difference ranges correspond to different rate levels; and determining the rate level corresponding to the difference range to which the difference belongs as the rate level corresponding to the queue.

[0013] Optionally, determining the rate level corresponding to the queue based on the difference between the current queue depth and the current authorized surplus includes: sequentially comparing the difference with the threshold value corresponding to each rate level in descending order of rate level, until the difference is greater than the threshold value of the currently compared rate level for the first time, and then determining the currently compared rate level as the rate level corresponding to the queue.

[0014] Optionally, the method further includes: updating the current queue depth of the queue in response to storing new data in the queue, and / or updating the authorized surplus according to the authorized information based on the authorized information in response to receiving authorization information returned by the destination based on the rate level.

[0015] Optionally, the method further includes: in response to the queue not meeting the target authorization condition, sending an authorization request to the destination, and carrying an identifier indicating that the target authorization condition has not been met in the authorization request; the identifier indicating that the target authorization condition has not been met is used by the destination to authorize the queue at the lowest possible rate.

[0016] Secondly, embodiments of this disclosure also provide a flow control method for the destination end of a network communication distributed system; the flow control method includes:

[0017] The system receives an authorization request from the data source and determines a rate adjustment factor corresponding to the queue based on the rate level carried in the authorization request. The rate level and the difference are positively correlated; the higher the rate level, the more traffic is requested to be allocated. The difference is the difference between the current queue depth and the current authorization surplus of the queue.

[0018] Based on the rate adjustment factor and the baseline shaping value corresponding to the queue, the target shaping value of the queue is determined;

[0019] Based on the target integer value, authorization information is sent to the data source.

[0020] Optionally, determining the target shaping value of the queue based on the rate adjustment factor and the baseline shaping value corresponding to the queue includes: determining the baseline shaping value corresponding to the queue; the baseline shaping value includes: a shaping value pre-configured for the queue, or the port rate of the port used to receive data sent from the data source; adjusting the baseline shaping value based on the rate adjustment factor to obtain the target shaping value of the queue; wherein the target shaping value of the queue is positively correlated with the rate level of the queue.

[0021] Optionally, sending authorization information to the data source based on the target integer value includes: generating the authorization information based on the target integer value and a preset queue scheduling rule;

[0022] Send the authorization information to the data source.

[0023] Thirdly, embodiments of this disclosure also provide a flow control device for the data source end of a network communication distributed system; the device includes:

[0024] The judgment module is used to determine whether the queue has met the target authorization conditions based on the current queue depth and the current authorization surplus of the queue.

[0025] A determination module is used to determine the rate level corresponding to the queue in response to the queue reaching the target authorization condition, based on the difference between the current queue depth and the current authorization surplus; wherein the rate level is positively correlated with the difference, and the higher the rate level, the more traffic is requested to be allocated;

[0026] The sending module is used to send an authorization request corresponding to the queue to the destination of the network communication distributed system; the authorization request carries the rate level of the queue;

[0027] The control module is configured to, in response to receiving authorization information returned by the destination based on the rate level, send the data in the queue to the destination based on the authorization information.

[0028] Fourthly, embodiments of this disclosure also provide another flow control method for the destination end of a distributed network communication system; the apparatus includes:

[0029] The receiving module is used to receive authorization requests sent by the data source, and determine the rate adjustment factor corresponding to the queue based on the rate level carried in the authorization request; the rate level and the difference are positively correlated, the higher the rate level, the more traffic is requested to be allocated; the difference is the difference between the current queue depth and the current authorization surplus of the queue.

[0030] The adjustment module is used to determine the target shaping value of the queue based on the rate adjustment factor and the baseline shaping value corresponding to the queue.

[0031] The sending module is used to send authorization information to the data source based on the target integer value.

[0032] Fifthly, embodiments of this disclosure also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the method described in the first aspect, or any one of the first aspects, or the second aspect, or any one of the second aspects.

[0033] In a sixth aspect, embodiments of this disclosure also provide a computer device, the device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, performs the steps of the method described in the first aspect, or any one of the first aspects, or the second aspect, or any one of the second aspects.

[0034] The technical solutions provided in the embodiments of this specification may include the following beneficial effects:

[0035] The flow control method provided in this disclosure determines whether a queue has met the target authorization condition at the data source end based on the current queue depth and the current authorization surplus of each queue. If the queue meets the target authorization condition, the flow allocation level corresponding to the queue is determined based on the difference between the current queue depth and the current authorization surplus. This flow allocation level and the difference are positively correlated; that is, a larger difference means there is relatively more data in the queue but relatively less data authorized for transmission. Therefore, higher flow is required to transmit the data in the queue, thus a higher flow allocation level can be determined for the queue. Conversely, a smaller difference means there is relatively less data in the queue but relatively more data authorized for transmission. Therefore, less flow is required to transmit the data in the queue, thus a relatively lower flow allocation level can be determined for the queue. The determined flow allocation level is then sent to the destination end, enabling the destination end to authorize transmission to the queue according to the determined flow allocation level. This achieves adaptive flow control, resolves the micro-burst problem of flow caused by oscillations in the authorization request state at the source end, and reduces the buffer usage at the destination end.

[0036] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this specification. Attached Figure Description

[0037] Figure 1 This is a flowchart illustrating a flow control method according to an embodiment of this application.

[0038] Figure 2 This is a flowchart illustrating a specific example of a flow control method according to an embodiment of this application.

[0039] Figure 3 This is a flowchart illustrating another flow control method according to an embodiment of this application.

[0040] Figure 4 This is a flowchart illustrating a specific example of another flow control method according to an embodiment of this application.

[0041] Figure 5 This is a schematic diagram of the structure of a flow control device according to an embodiment of this application.

[0042] Figure 6 This is a schematic diagram of the structure of another flow control device shown in one embodiment of this application.

[0043] Figure 7 This is a schematic diagram of a computer device shown in one embodiment of this application. Detailed Implementation

[0044] The exemplary embodiments will now be described in detail. When the description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this specification; they are merely exemplary embodiments of apparatuses and methods consistent with some aspects of this specification.

[0045] It should be understood that the terms "first," "second," "third," etc., may be used in this specification to describe various information or structural modules for the purpose of more clearly describing the solution. These terms should not be construed as indicating or implying relative importance or implicitly specifying the number, order, or position of the indicated technical features. Therefore, a feature specified with "first," "second," "third," etc., may explicitly or implicitly include one or more of that feature. In the description of this specification, unless otherwise stated, "multiple" means two or more; "if" can be interpreted as "when," "when," or "in response to a determination." In this specification, "and / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship.

[0046] In related technologies, when a distributed network communication system uses an authorization mechanism to control path traffic, the data source classifies data packets according to their destination and priority (e.g., payment requests have high priority, log reporting has low priority). Each category corresponds to an independent sending queue. After a data packet is generated, it is placed into the corresponding queue according to its category, waiting to be sent. When a queue has data packets waiting to be sent, the source sends an "authorization request" to the destination on behalf of that queue. After receiving authorization requests from various source queues, the destination assesses how much data it can receive based on its current processing capacity (e.g., CPU load, memory usage, number of requests being processed, remaining buffer size, etc.). Then, based on the evaluation results, and according to the scheduling strategy (such as priority scheduling strategy, weighted fair queue scheduling strategy, round-robin strategy, etc.), it is determined how to allocate its limited receiving quota to each requesting source queue, and a receiving quota allocation strategy is determined; then, according to the receiving quota allocation strategy, the number of data packets allowed to be sent for each queue is calculated, and a corresponding "GrantResponse" is returned to the source to inform the queue how much data it can send this time.

[0047] After receiving authorization, the source end retrieves no more than the authorized number of data packets from the head of the queue and then sends them to the destination end. After sending, if there is still data remaining in the queue, the source end will initiate another authorization request and repeat the above process.

[0048] However, in the above process, the source end exists in two states: requesting authorization and not requesting authorization. When there is data to be sent in the queue, the source end switches to the requesting authorization state and initiates an authorization request to the destination end. When there is no data to be sent in the queue, the source end is in the not requesting authorization state, in which the source end does not initiate an authorization request to the destination end. Since there are only two states, when the inflow rate of the source end is less than the authorization allocation rate of the destination end, the source end queue receives too many authorizations while in the requesting authorization state, causing it to exit the requesting authorization state and jump to the not requesting authorization state. While in the not requesting authorization state, the authorizations gradually consume, and the source end queue jumps back to the requesting authorization state. The source end oscillates continuously between the requesting authorization state and the not requesting authorization state, causing the sent data to switch between maximum and zero rates for periods of time. Although this can achieve congestion control on average, microscopically it transforms smooth input traffic into bursty traffic, leading to increased buffer usage at the destination end.

[0049] Based on this, the present disclosure provides a flow control method that solves the problem of micro-bursts in traffic caused by oscillations in the authorization request state at the source end when the inbound rate at the data source end is less than the authorization allocation rate at the destination end in a distributed network communication system, thereby reducing the cache usage at the destination end.

[0050] The embodiments described in this specification will now be described in detail.

[0051] like Figure 1 As shown, Figure 1 This is a flowchart illustrating an exemplary flow control method in Embodiment 1 of this disclosure, used at the data source end of a distributed network communication system; the flow control method includes the following steps:

[0052] S101: Determine whether the queue has met the target authorization conditions based on the current queue depth and the current authorization surplus of the queue;

[0053] S102: When the queue reaches the target authorization condition, determine the traffic allocation level corresponding to the queue based on the difference between the current queue depth and the current authorization surplus; wherein, the traffic allocation level is positively correlated with the difference; and the higher the traffic allocation level, the more traffic is requested to be allocated;

[0054] S103: Send the traffic allocation level to the destination of the network communication distributed system;

[0055] S104: In response to receiving authorization information returned by the destination based on the rate level, send the data in the queue to the destination based on the authorization information.

[0056] The flow control method provided in this disclosure determines whether a queue has met the target authorization condition at the data source end based on the current queue depth and the current authorization surplus of each queue. If the queue meets the target authorization condition, the flow allocation level corresponding to the queue is determined based on the difference between the current queue depth and the current authorization surplus. This flow allocation level and the difference are positively correlated; that is, a larger difference means there is relatively more data in the queue but relatively less data authorized for transmission. Therefore, higher flow is required to transmit the data in the queue, thus a higher flow allocation level can be determined for the queue. Conversely, a smaller difference means there is relatively less data in the queue but relatively more data authorized for transmission. Therefore, less flow is required to transmit the data in the queue, thus a relatively lower flow allocation level can be determined for the queue. The determined flow allocation level is then sent to the destination end, enabling the destination end to authorize transmission to the queue according to the determined flow allocation level. This achieves adaptive flow control, resolves the micro-burst problem of flow caused by oscillations in the authorization request state at the source end, and reduces the buffer usage at the destination end.

[0057] The following provides a detailed explanation of S101 to S104.

[0058] Regarding the above S101:

[0059] In practice, the data source may have pre-defined data classification rules, pre-defined mapping relationship between sending destination and priority, clear queues corresponding to different destinations, and maintain queues corresponding to destinations according to different priorities as judgment criteria.

[0060] For example, if there are multiple destinations corresponding to the data source, then for each destination, a queue corresponding to each destination can be maintained based on the priority information of its data.

[0061] When the data source needs to send data to the destination, it will determine the corresponding queue for the data based on the destination and priority, and store the data in the corresponding queue in the form of data packets.

[0062] In addition, in this embodiment of the disclosure, the data source also records the current queue depth of each queue; this queue depth is used to describe the amount of data currently stored in the queue, such as the number of data packets, or the storage occupancy of recorded data, the size of the data itself (i.e., bytes), the number of records, the size of data blocks, traffic, etc. Specific embodiments of this disclosure are not limited.

[0063] When data in the queue is sent to the destination, the data is deleted from the queue, and the corresponding data volume is deducted from the queue depth. When new data is saved in the queue to wait for sending to the destination, the corresponding data volume is accumulated to the queue depth.

[0064] Furthermore, in this embodiment, the data source also records the current authorization surplus of each queue. The authorization surplus, for example, represents the current surplus amount of data that the destination end can authorize the source end to send. When data in a queue is sent to the destination end, the corresponding amount is deducted from the authorization surplus of that queue; when a new authorization is obtained from the destination end, the new authorization is accumulated into the authorization surplus.

[0065] Typically, the units for measuring authorized surplus and queue depth are consistent; in one possible case, the unit for both is bytes; 1 byte = 1 authorized surplus = 1 queue depth; in another possible implementation, the unit for both can also be the number of data packets; 1 authorized surplus = 1 queue depth = 1 data packet. Specifically, it can be determined according to actual needs, and this disclosure does not limit it.

[0066] The source end can respond to the target event being triggered by determining whether the queue has met the target authorization conditions based on the current queue depth and the current authorization surplus of the queue.

[0067] Here, the target event may include at least one of the following: when new data is stored in the queue, when the current queue depth is updated, when a new authorization is received from the destination, or when a preset time period is reached. Specific target events can be set according to actual needs, and this disclosure does not limit the scope of the event.

[0068] When determining whether a queue has met the target authorization condition based on its current queue depth and current authorization surplus, the following methods can be used, for example:

[0069] The current queue depth is compared with the first value, and the current authorized surplus is compared with the second value;

[0070] If the current queue depth is greater than the first value and the current authorization surplus is less than or equal to the second value, it is determined that the queue has reached the target authorization condition.

[0071] In practice, since different queues store data with different priorities, and for queues with higher priority data, the data stored in them needs to be sent to the destination with a higher priority to ensure the timeliness of the data. Therefore, a first value with a smaller value and / or a second value with a larger value can be set for them. That is, for queues with higher priority data, it is necessary to ensure that new authorization requests are made in advance when there is less data storage and a large authorization surplus, so that the data in the queue can be sent to the destination with less waiting time.

[0072] For queues corresponding to lower priority data, since the timeliness of the data is weaker, a larger first value and / or a smaller second value can be set for them. That is, for queues corresponding to lower priority data, a new authorization request is only made when there is a large amount of data stored in them and a small authorization surplus. This avoids lower priority data occupying the data channel and affecting the sending of higher priority data.

[0073] In addition, the same first value can be set for different queues, and / or the same second value can be set for different queues, and data transmission can be controlled through the authorization allocation mechanism of the destination.

[0074] Furthermore, the first value corresponding to the same queue is usually greater than or equal to its corresponding second value. That is, when the amount of data currently stored in a queue is greater than or equal to the current authorized surplus, it means that the current authorized surplus is insufficient to send all the data stored in the queue to the destination, and the source requests a new authorization from the destination.

[0075] For example, suppose the first and second values ​​are both set to 0.

[0076] In other words, if the current queue depth is greater than 0 (meaning there is unsent data stored in the queue) and the current authorization surplus is equal to 0 (since the second value is 0, the current authorization surplus will not be less than 0), then to send the data in the queue to the destination, a new authorization needs to be requested. Therefore, in this case, it is determined that the queue has met the target authorization conditions.

[0077] If the current queue depth is 0 (meaning there is no unsent data in the queue), then since no data needs to be sent to the destination, there is no need to request new authorization surplus from the destination, regardless of the current authorized surplus value. Therefore, in this state, it is determined that the queue has not met the target authorization condition.

[0078] If the current queue depth is greater than 0 (meaning there is unsent data in the queue) and the current authorization surplus is greater than 0, then the data in the queue needs to be sent to the destination without needing to request a new authorization. Therefore, in this case, it is determined that the queue has not met the target authorization conditions.

[0079] In one embodiment of this disclosure, if the queue does not meet the target authorization conditions, an authorization request may not be sent to the destination.

[0080] Furthermore, since the events in which data is stored in the queue are unpredictable, in another embodiment of this disclosure, an authorization request may be sent to the destination if it is determined that the queue has not met the target authorization conditions.

[0081] At this point, the identifier indicating that the target authorization condition has not been met can be included in the authorization request;

[0082] The identifier indicating that the target authorization condition has not been met is used by the destination end to authorize the queue based on the lowest possible rate.

[0083] For example, as shown in the following example, an identifier indicating that the target authorization condition has not been met can be set to "off"; this identifier can be included in the authorization request and sent to the destination. Upon receiving this identifier, the destination will authorize the queue based on the lowest possible rate.

[0084] Regarding S102 above:

[0085] In practice, if the queue is determined to meet the authorization application conditions based on the above steps, the rate level corresponding to the queue needs to be determined based on the difference between the current queue depth and the current authorization surplus.

[0086] The difference between the current queue depth and the current authorized surplus is used to represent the number of new authorized numbers that need to be requested from the destination before all the data currently stored in the queue can be sent to the destination.

[0087] The larger the difference, the more authorization needs to be requested from the destination to meet the data transmission requirements in the queue; the smaller the difference, the less authorization needs to be requested from the destination to meet the data transmission requirements in the queue.

[0088] Furthermore, in this embodiment of the disclosure, the rate level corresponding to the queue is determined based on the difference between the current queue depth and the current authorized surplus.

[0089] The larger the difference, the higher the rate level, and the more traffic is allocated to the destination. The smaller the difference, the lower the rate level, and the less traffic is allocated to the destination.

[0090] Specifically, this disclosure also provides a method for determining the rate level corresponding to the queue based on the difference between the current queue depth and the current authorized surplus, including:

[0091] Determine the range to which the difference belongs; wherein different difference ranges correspond to different rate levels;

[0092] The rate level corresponding to the range of differences to which the difference belongs is determined as the rate level corresponding to the queue.

[0093] In practice, different difference ranges can be set for multiple rate levels, with higher rate levels having larger maximum and minimum values ​​for the corresponding difference range.

[0094] For example, suppose that the difference ranges corresponding to multiple rate levels are continuous difference ranges, that is, between two adjacent rate levels, the minimum value corresponding to the difference range of the higher rate level and the maximum value corresponding to the difference range of the lower rate level are the same.

[0095] When determining the difference range between the current queue depth and the current authorized surplus from the difference ranges corresponding to multiple rate levels, for example, the minimum value of the rate interval corresponding to each rate level can be used as the threshold value of each rate level, and the difference can be compared with the threshold value of each rate level in turn until the difference is less than the threshold value of the i-th rate level for the first time. Then, it is determined that the difference belongs to the difference range corresponding to the (i-1)-th rate level.

[0096] Then, the (i-1)th rate level is taken as the rate level corresponding to the queue.

[0097] Specifically, assume there are n speed levels, and the difference intervals corresponding to the n speed levels are respectively: [0, k1), [k1, k2), [k2, k3), ..., [k n-1 (,+∞).

[0098] The difference is represented as: diff-vslue.

[0099] Compare diff-vslue with 0; if diff-vslue is greater than 0, then continue to compare diff-vslue with k1.

[0100] If diff-vslue is greater than k1, then continue to compare diff-vslue and k1;

[0101] If diff-vslue is greater than k2, then continue to compare diff-vslue with k3;

[0102] ...

[0103] If diff-vslue is greater than k i-1 Then continue with diff-vslue and k i Perform a comparison;

[0104] If diff-vslue is less than k i If so, then it is determined that diff-vslue belongs to the (i-1)th difference interval, which is the difference interval corresponding to the (i-1)th rate level.

[0105] At this point, the (i-1)th rate level is taken as the rate level corresponding to the queue.

[0106] Furthermore, in another embodiment of this disclosure, when determining the difference range to which the difference between the current queue depth and the current authorized surplus belongs from the difference ranges corresponding to multiple rate levels, for example, the minimum value of the rate interval corresponding to each rate level can be used as the threshold value of each rate level in descending order of rate level. The difference is then compared with the threshold value of each rate level in turn until the difference is greater than or equal to the threshold value of the i-th rate level for the first time. In this case, the difference is determined to belong to the difference range corresponding to the i-th rate level.

[0107] Specifically, assume there are n speed levels, and the difference intervals corresponding to the n speed levels are respectively: [0, k1), [k1, k2), [k2, k3), ..., [k n-1 (,+∞).

[0108] The difference is represented as: diff-vslue.

[0109] diff-vslue and k n-1 Perform a comparison; if diff-vslue is less than or equal to k n-1 Then continue with diff-vslue and k n-2 Perform a comparison;

[0110] If diff-vslue is less than or equal to k n-2 Then continue with diff-vslue and k n-3 Perform a comparison;

[0111] ...

[0112] If diff-vslue is less than or equal to k i+1 Then continue with diff-vslue and k i Perform a comparison;

[0113] If diff-vslue is greater than k i If so, then it is determined that diff-vslue belongs to the i-th difference interval, which is the difference interval corresponding to the i-th rate level.

[0114] At this point, the i-th rate level is taken as the rate level corresponding to the queue.

[0115] Furthermore, in another embodiment of this disclosure, assuming there are n rate levels, the difference intervals corresponding to the n rate levels can also be set as: (0,k1], (k1,k2], (k2,k3], ..., (k n-1 ,+∞).

[0116] The comparison relationship between the difference and each threshold value is different from the above comparison relationship. Specifically, as long as the difference range to which the difference belongs can be determined by comparing the difference with the threshold value, this disclosure embodiment does not limit it.

[0117] This disclosure also provides a specific method for determining the rate level corresponding to the queue based on the difference between the current queue depth and the current authorized surplus. In this method, instead of setting a value range, a threshold value is directly set for each traffic level, and the threshold value corresponding to different traffic levels is positively correlated with the level of traffic.

[0118] In other words, the higher the traffic level, the higher the threshold value; the lower the traffic level, the lower the threshold value.

[0119] When determining the rate level corresponding to a queue based on the difference, for example:

[0120] According to the order of each rate level from high to low, the difference is compared with the threshold value corresponding to each rate level in turn until the difference is greater than the threshold value of the current rate level for the first time. Then, the current rate level is determined as the rate level corresponding to the queue.

[0121] For example, suppose there are n rate levels, and the threshold values ​​corresponding to the n rate levels from low to high are k1, k2, ..., kn respectively;

[0122] The difference between the current queue depth and the current authorized surplus is represented as: diff-vslue.

[0123] First, compare diff-vslue with kn; if diff-vslue is greater than kn, then the nth rate level is taken as the rate level corresponding to the queue.

[0124] If diff-vslue is less than or equal to kn, then diff-vslue is compared with k(n-1); if diff-vslue is greater than k(n-1), then the (n-1)th rate level is taken as the corresponding rate level.

[0125] If diff-vslue is less than or equal to k(n-1), then diff-vslue and k(n-2) are compared; if diff-vslue is greater than k(n-2), then the (n-2)th rate level is taken as the corresponding rate level.

[0126] If diff-vslue is less than or equal to k(n-2), then diff-vslue and k(n-3) are compared; if diff-vslue is greater than k(n-3), then the (n-3)th rate level is taken as the corresponding rate level.

[0127] ...

[0128] The above comparison process stops when the difference first exceeds the threshold of the current comparison rate level, and the current comparison rate level is taken as the rate level of the queue.

[0129] Regarding the above S103:

[0130] After obtaining the rate level corresponding to the queue using the above method, an authorization request corresponding to the queue is sent to the destination based on the rate level. For example, the rate level can be included in the authorization request during transmission.

[0131] Regarding S104 above:

[0132] Upon receiving an authorization request, the destination device parses the request, retrieves the rate level from it, and then performs the specific authorization process according to the rate level for each queue. The detailed authorization process is described below and will not be repeated here.

[0133] After generating authorization information, the destination sends it to the data source. This authorization information includes details about the queue, such as the number of authorizations (e.g., number of tokens, number of data packets). Upon receiving the authorization information, the data source sends the data in the queue to the destination based on that information.

[0134] Furthermore, in another embodiment of this disclosure, in response to receiving authorization information returned by the destination based on the rate level, the authorization surplus is updated based on the authorization information.

[0135] In a distributed network communication system, authorization surplus can be, for example, token surplus. Authorization surplus directly corresponds to the number of unused tokens in the token bucket, and the number of tokens can be one-to-one with the number of bytes (e.g., 1 token = 1 byte).

[0136] Token surplus (tokens) = min(current token count, burst integer parameter)

[0137] For example, token surplus can be carried in the authorization information sent from the destination to the data source.

[0138] The calculation of the current token count depends on the token bucket generation rules:

[0139] Current token count = min(last remaining token count + CIR × ΔT / 8, Bc + Be) - tokens consumed this time

[0140] ΔT: The time interval between two token verifications (e.g., 10ms);

[0141] Token generation rate: determined by CIR, i.e. the number of new tokens generated per unit time;

[0142] Tokens consumed this time: The number of data packets actually forwarded by the queue in bytes.

[0143] In addition, authorization surplus can also be data packet surplus. After acquiring the token count, since there is a one-to-one correspondence between tokens and bytes, the number of tokens corresponding to each data packet can be determined based on the number of bytes contained in each data packet. Then, based on the aforementioned token count and the number of tokens corresponding to each data packet, the data packet surplus is calculated.

[0144] The above process is used to complete flow control during data transmission.

[0145] This disclosure also provides a specific example of flow control, in which the flow level has 5 levels from low to high, including step0, step1, step2, step3, and on. See also Figure 2 As shown, it specifically includes the following steps:

[0146] S201: Get the current queue depth que_len and the current authorized surplus que_credit of the queue.

[0147] S202: Determine if the queue depth que_len is equal to 0 and the queue credit surplus que_credit is greater than 0. If the condition is met, jump to S203; if the condition is not met, jump to S204.

[0148] S203: Set the traffic level to off, i.e., req_staus=off, meaning the target authorization conditions have not been met. Here, "off" is the identifier indicating that the target authorization conditions have not been met.

[0149] S204: Calculate the difference between the current queue depth and the current authorized surplus: diff_value = que_len – que_credit.

[0150] S205: If the difference value (diff_value) is greater than the threshold value configured for step0, set the traffic level to step0: req_status=step0. Then jump to 206.

[0151] S206: If the difference value (diff_value) is greater than the threshold value configured for step1, set the traffic level to step1: req_status = step1. Then jump to 207.

[0152] S207: If the difference value (diff_value) is greater than the threshold value configured for step2, set the traffic level to step2: req_status = step2. Then jump to 208.

[0153] S208: If the difference value (diff_value) is greater than the threshold value configured for step3, set the traffic level to step3: req_status = step3. Then jump to 209.

[0154] S209: If the difference value diff_value is greater than the threshold value configured for on, set the traffic level to on, indicating that authorization is requested with the maximum traffic: req_status = on.

[0155] S210: Include req_status in the authorization request and send it to the destination.

[0156] In the above process: S205~S209 are executed continuously. After each step, the traffic level is updated and the final traffic level is carried in the authorization request and sent to the destination. If the judgment result of any step in S206~S209 is negative, the continuous execution process is stopped, and the current value of req_status is sent to the destination as the traffic level of the queue.

[0157] Here, typically, a small value, such as 0, is set for step0. Therefore, provided the target authorization conditions are met, there will usually be no situation where S206 fails to determine the value, meaning the difference value (diff_value) will not be less than or equal to the threshold value configured for step0.

[0158] If there is a special case where diff_value is less than or equal to step0, then req_staus=off, as determined in 201, will be sent to the destination.

[0159] Using the above process, the data source completes the authorization request process.

[0160] Then, the data source controls the sending of data in the queue based on the target integer value carried in the authorization information returned by the destination.

[0161] like Figure 3 As shown, Figure 3 This is a flowchart illustrating another flow control method exemplarily shown in Embodiment 1 of this disclosure, used at the destination end of a network communication distributed system.

[0162] In this embodiment of the disclosure, the data source and the destination are relative identities; for any node in the network communication distributed system, when the node sends data to other nodes, the node is the data source; the other nodes that receive the data are the destination; when the node receives data sent by other nodes, the node is the destination, and the other nodes that send data to the node are the data source.

[0163] See Figure 3 As shown, the flow control method provided in this embodiment includes the following steps:

[0164] S301: Receive an authorization request sent by the data source, and determine the rate adjustment factor corresponding to the queue based on the rate level carried in the authorization request; the rate level and the difference are positively correlated, and the higher the rate level, the more traffic is requested to be allocated; the difference is the difference between the current queue depth and the current authorization surplus of the queue.

[0165] S302: Determine the target shaping value of the queue based on the rate adjustment factor and the baseline shaping value corresponding to the queue;

[0166] S303: Send authorization information to the data source based on the target integer value.

[0167] The flow control method provided in this disclosure involves sending an authorization request from the data source to the destination, carrying the rate level corresponding to the queue, and determining the rate adjustment factor corresponding to the queue based on the rate level. Then, based on the rate adjustment factor and the baseline shaping value corresponding to the queue, a target shaping value for the queue is determined, and authorization information is sent to the data source based on the target shaping value and preset scheduling rules. The rate level in the authorization request is determined by the data source based on the difference between the current queue depth and the current authorization surplus. In other words, the flow level requested by the data source is adaptively determined based on the queue's needs. Therefore, the target shaping value determined based on the flow level is also adaptively determined based on the queue's needs. Thus, it is possible to authorize the queue to send traffic based on the flow allocation level determined for the queue, thereby achieving adaptive flow control, solving the micro-burst problem of traffic caused by oscillations in the authorization request state at the source, and reducing the buffer usage at the destination.

[0168] The following provides a detailed explanation of S301 to S303.

[0169] Regarding S301 above: In this embodiment of the disclosure, in specific implementation, after receiving the authorization request sent by the data source, the destination end will parse the authorization request to obtain the queue rate level.

[0170] The higher the rate level, the higher the rate at which data in the queue needs to be sent; conversely, the lower the rate level, the lower the rate at which data in the queue needs to be sent.

[0171] Therefore, the baseline shaping value determined for the queue at the destination needs to be adjusted according to the rate level to meet the aforementioned queue speed requirements.

[0172] Therefore, in this embodiment of the disclosure, after receiving the authorization request, the rate adjustment factor corresponding to the queue is determined based on the rate level corresponding to the queue carried in the authorization request.

[0173] The rate adjustment factor is used to adjust the sizing value of the queue to obtain the target sizing value for the queue.

[0174] Regarding S302 and S303 above:

[0175] In various embodiments of this disclosure, when determining the target shaping value of the queue based on the rate adjustment factor and the baseline shaping value corresponding to the queue, the following methods may be used, for example:

[0176] Determine a baseline shaping value corresponding to the queue; the baseline shaping value includes: a shaping value pre-configured for the queue, or the port rate of the port used to receive data sent from the data source.

[0177] Based on the rate adjustment factor, the baseline shaping value is adjusted to obtain the target shaping value of the queue;

[0178] The target integer value of the queue is positively correlated with the rate level of the queue.

[0179] Specifically, for example, in response to receiving an authorization request for the queue from the data source, it is determined whether the queue has been pre-configured with an integer value; if the queue has been pre-configured with an integer value, the pre-configured integer value will be used as the base integer value for the queue. If the queue has not been pre-configured with an integer value, the port speed will be used as the base integer value for the queue.

[0180] Then, using a determined rate adjustment factor, the baseline shaping value is adjusted to obtain the target shaping value of the queue.

[0181] During the authorization process, the destination will generate a target integer value for the queue based on the queue's rate level. This target integer value includes a rate integer value and a burst integer value.

[0182] The rate shaping values ​​include: Committed Information Rate (CIR) and Peak Information Rate (PIR). The Committed Information Rate defines the long-term average rate ceiling to ensure basic service transmission needs; the Peak Information Rate defines the short-term maximum rate ceiling to allow for traffic bursts.

[0183] Burst shaping values ​​include: committed burst size (Bc) and excess burst size (Be), which are used in conjunction with the rate parameter (rate shaping value) to define the maximum amount of burst data allowed within the rate limit. Essentially, they are a buffer supplement to the rate constraint.

[0184] The target integer value is used to limit the number of authorizations received by the queue per unit of time.

[0185] After obtaining the target integer value, the destination end will generate authorization information based on the target integer value and the preset queue scheduling rules, and send the authorization information to the data source end.

[0186] When the destination generates authorization information based on the target integer value and the preset queue scheduling rules, and sends the authorization information to the data source, it first reshapes the queue according to the target integer value.

[0187] Specifically, when generating authorization information, the destination first generates a token bucket based on the target integer value.

[0188] The parameters of the token bucket include: token generation rate, total token bucket capacity, and peak token consumption rate.

[0189] The token generation rate is controlled by the commitment information generation rate (CIR) in the target integer value, which continuously generates tokens according to the byte rate corresponding to the commitment token generation rate (CIR).

[0190] The total capacity of the token bucket, which is also the maximum number of tokens that the token bucket can store, = committed burst size (Bc) + excess burst size (Be).

[0191] The peak token consumption rate, also known as the peak information rate (PIR), limits the number of tokens consumed by the queue per second, ensuring that the data transmission rate does not exceed the peak information rate (PIR).

[0192] Following the token bucket, the destination end uses the token bucket to generate authorization information to control data transmission to the queue, and then sends this authorization information to the data source end. This allows the data source end to send the data in the queue to the destination end based on the received authorization information.

[0193] Specifically, the destination uses a loop logic of "token generation → token verification → data transmission → status update" to achieve closed-loop control of the queue transmission rate.

[0194] Step 1: Tokens are generated periodically (continuously replenished):

[0195] The destination adds tokens to the token bucket at fixed time intervals (e.g., 10ms), according to the following rules:

[0196] New tokens = token generation rate × time interval;

[0197] The number of tokens in the token bucket will not exceed the total capacity of the token bucket (Bc+Be), and any excess tokens will be discarded.

[0198] Step 2: Token verification before dequeuing data:

[0199] Data packets in the queue must first pass the token bucket verification before they can be allowed to be sent. The verification logic has three cases:

[0200] ①: If the data packet size is less than or equal to the remaining tokens, the verification passes, the corresponding number of tokens are consumed, and the data packet is allowed to be dequeued and sent.

[0201] ②: If the data packet size is greater than the remaining token and the queue cache is not full, the verification fails. The data packet is temporarily stored in the queue and will be verified again after the token is generated.

[0202] ③: If the data packet size is greater than the remaining tokens and the queue cache is full, the verification fails, triggering the discard policy to prevent queue overflow.

[0203] Step 3: Data transmission and rate control:

[0204] Normal rate (≤CIR): Token generation rate ≥ token consumption rate, tokens are continuously in surplus, queue data packets can be sent at a constant rate, meeting the long-term transmission needs of the business.

[0205] Burst rate (CIR < rate ≤ PIR): When a queue needs to send a large amount of data in a short period of time, it needs to consume the excess tokens (Be part) in the bucket to achieve burst transmission; however, the consumption rate will not exceed PIR to avoid breaking the peak constraint.

[0206] Rate Exceeded (>PIR): Even if there are enough tokens, the system will limit the rate at which tokens are consumed. Packets that exceed the PIR will be buffered until the token consumption rate falls back below the PIR.

[0207] Step 4: Token Bucket Status Update:

[0208] Each time a data packet is sent in the queue (i.e., after the destination receives the data sent by the data source), the token balance in the token bucket is updated.

[0209] By repeating steps 1 through 4, the data stored in the queue is sent to the destination using the token bucket.

[0210] After the queue is shaped, the destination will schedule the queues with the shaped tokens according to the preset scheduling rules. During the scheduling process, authorization information corresponding to the queue will be generated based on the scheduling rules and the shaped tokens, and the authorization information will be sent to the data source.

[0211] The authorization information includes details about the data sent by the authorization queue, such as the number of tokens or data packets.

[0212] After receiving the authorization information, the data source sends the data in the control queue to the destination according to the authorization information.

[0213] Specifically, see Figure 4 As shown, this disclosure provides a specific example of flow control at the destination, including:

[0214] S401: Get the queue's rate status (req_status).

[0215] S402: Determine whether an integer value has been pre-configured for the queue. If an integer value has been pre-configured for the queue, jump to S403; if an integer value has not been pre-configured for the queue, jump to S404.

[0216] S403: The base integer value of the queue is the integer value configured for the queue. Jump to S405.

[0217] S404: Queue base integer value base_rate = port rate, jump to S405.

[0218] Depending on the specific value of the rate level req_status, select to perform any one of the following steps 405-410:

[0219] S405: When the rate level req_status is on:

[0220] The target integer value is the base integer value, base_rate, which means transmitting the data in the queue at the maximum rate.

[0221] S406: When the rate level req_status is step3:

[0222] The target integer value for the queue is = base_rate / step3_ratio; where Step3_ratio is the rate adjustment factor for step3.

[0223] S407: When the rate level req_status is step2:

[0224] The target integer value for the queue is = base_rate / step2_ratio; where Step2_ratio is the rate adjustment factor for step2.

[0225] S408: When the rate level req_status is step1:

[0226] The target integer value of the queue is = base_rate / step1_ratio; where Step1_ratio is the rate adjustment factor for step1.

[0227] S409: When the rate level req_status is step0:

[0228] The target integer value of the queue is = base_rate / step0_ratio; where Step0_ratio is the rate adjustment factor for step0.

[0229] S410: When the rate level req_status is off:

[0230] The target reshaping value for the queue is base_rate / step0_ratio, which means reshaping the queue at the lowest possible rate.

[0231] S411: Reshape the queue according to the calculated target integer value and generate an integer token for the queue;

[0232] S412: Schedule queues with integer tokens according to preset scheduling rules.

[0233] The process described above completes the scheduling of the queue.

[0234] Corresponding to the embodiments of the foregoing methods, this specification also provides embodiments of the apparatus and the terminal to which it is applied.

[0235] The embodiments of the document processing apparatus described in this specification can be applied to computer devices, such as servers or terminal devices. The apparatus embodiments can be implemented through software, hardware, or a combination of both. Taking software implementation as an example, as a logically defined apparatus, it is formed by the processor in which it processes the file, reading the corresponding computer program instructions from non-volatile memory into memory for execution. From a hardware perspective, such as... Figure 5 The diagram shown is a hardware structure diagram of a computer device containing the file processing apparatus as described in this specification, except... Figure 5 In addition to the processor 510, memory 530, network interface 520, and non-volatile memory 540 shown, the server or electronic device where the device 531 is located in the embodiment may also include other hardware depending on the actual function of the computer device, which will not be described in detail here.

[0236] Accordingly, see Figure 6 As shown, this specification also provides a flow control device, which includes a processor; a memory for storing processor-executable instructions; wherein the processor is configured to:

[0237] The judgment module 61 is used to determine whether the queue has reached the target authorization condition based on the current queue depth and the current authorization surplus of the queue.

[0238] The determination module 62 is used to determine the rate level corresponding to the queue in response to the queue reaching the target authorization condition, based on the difference between the current queue depth and the current authorization surplus; wherein the rate level is positively correlated with the difference, and the higher the rate level, the more traffic is requested to be allocated;

[0239] Sending module 63 is used to send an authorization request corresponding to the queue to the destination of the network communication distributed system; the authorization request carries the rate level of the queue;

[0240] The control module 64 is configured to, in response to receiving authorization information returned by the destination based on the rate level, send the data in the queue to the destination based on the authorization information.

[0241] Optionally, the judgment module 61, when determining whether the queue has met the target authorization condition based on the current queue depth and the current authorization surplus of the queue, is used to:

[0242] The current queue depth is compared with the first value, and the current authorized surplus is compared with the second value;

[0243] If the current queue depth is greater than the first value and the current authorization surplus is less than or equal to the second value, it is determined that the queue has reached the target authorization condition.

[0244] Optionally, the determining module 62, when determining the rate level corresponding to the queue based on the difference between the current queue depth and the current authorized surplus, is used to:

[0245] Determine the range to which the difference belongs; wherein different difference ranges correspond to different rate levels;

[0246] The rate level corresponding to the range of differences to which the difference belongs is determined as the rate level corresponding to the queue.

[0247] Optionally, the determining module 62, when determining the rate level corresponding to the queue based on the difference between the current queue depth and the current authorized surplus, is used to:

[0248] According to the order of each rate level from high to low, the difference is compared with the threshold value corresponding to each rate level in turn until the difference is greater than the threshold value of the current rate level for the first time. Then, the current rate level is determined as the rate level corresponding to the queue.

[0249] Optionally, it also includes: an update module, configured to: update the current queue depth of the queue in response to storing new data in the queue, and / or in response to sending the data stored in the queue to the destination;

[0250] And / or,

[0251] In response to receiving authorization information returned by the destination based on the rate level, the authorization surplus is updated based on the authorization information.

[0252] Optionally, the sending module 63 is further configured to: in response to the queue not meeting the target authorization condition, send an authorization request to the destination, and carry the identifier of not meeting the target authorization condition in the authorization request;

[0253] The identifier indicating that the target authorization condition has not been met is used by the destination end to authorize the queue based on the lowest possible rate.

[0254] Accordingly, see Figure 7 As shown, this specification also provides another flow control device, which includes a processor; a memory for storing processor-executable instructions; wherein the processor is configured to:

[0255] The receiving module 71 is used to receive an authorization request sent by the data source, and determine a rate adjustment factor corresponding to the queue based on the rate level carried in the authorization request; the rate level and the difference are positively correlated, the higher the rate level, the more traffic is requested to be allocated; the difference is the difference between the current queue depth and the current authorization surplus of the queue.

[0256] The adjustment module 72 is used to determine the target shaping value of the queue based on the rate adjustment factor and the baseline shaping value corresponding to the queue;

[0257] The sending module 73 is used to send authorization information to the data source based on the target integer value.

[0258] Optionally, the adjustment module 72, when determining the target shaping value of the queue based on the rate adjustment factor and the baseline shaping value corresponding to the queue, is used to:

[0259] Determine a baseline shaping value corresponding to the queue; the baseline shaping value includes: a shaping value pre-configured for the queue, or the port rate of the port used to receive data sent from the data source.

[0260] Based on the rate adjustment factor, the baseline shaping value is adjusted to obtain the target shaping value of the queue;

[0261] The target integer value of the queue is positively correlated with the rate level of the queue.

[0262] Optionally, when sending authorization information to the data source based on the target integer value, the sending module 73 is configured to: generate the authorization information based on the target integer value and a preset queue scheduling rule; and send the authorization information to the data source.

[0263] The specific implementation process of the functions and roles of each module in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.

[0264] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of the solution in this specification according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0265] The foregoing has described exemplary embodiments of this specification. It should be understood that in some cases, the modules described in this specification may be divided in a manner different from that in the embodiments, and the described actions or steps may be performed in a different order than that in the embodiments, while still achieving the desired result. Furthermore, the processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0266] Other embodiments of this specification will readily occur to those skilled in the art upon consideration of the specification and practice of the invention claimed herein. This specification is intended to cover any variations, uses, or adaptations that follow the general principles of this specification and include common knowledge or customary techniques in the art not illustrated herein.

Claims

1. A flow control method, characterized in that, Used as the data source in distributed network communication systems; The flow control method includes: Based on the current queue depth and the current authorization surplus of the queue, determine whether the queue has met the target authorization conditions; In response to the queue reaching the target authorization condition, a rate level corresponding to the queue is determined based on the difference between the current queue depth and the current authorization surplus; wherein the rate level and the difference are positively correlated, and the higher the rate level, the more traffic is requested to be allocated; the rate level is used to determine a rate adjustment factor, which is used to adjust the baseline integer value corresponding to the current queue to obtain a target integer value; the target integer value is used to generate authorization information; Send an authorization request corresponding to the queue to the destination of the network communication distributed system; the authorization request carries the rate level of the queue; In response to receiving the authorization information returned by the destination based on the rate level, the data in the queue is sent to the destination based on the authorization information; It also includes: in response to the queue not meeting the target authorization condition, sending an authorization request to the destination, and carrying the identifier of the failure to meet the target authorization condition in the authorization request; The identifier indicating that the target authorization condition has not been met is used by the destination to authorize the queue based on the lowest rate. The step of determining whether the queue has met the target authorization condition based on the current queue depth and the current authorization surplus of the queue includes: The current queue depth is compared with the first value, and the current authorized surplus is compared with the second value; If the current queue depth is greater than the first value and the current authorization surplus is less than or equal to the second value, it is determined that the queue has reached the target authorization condition. The step of determining the rate level corresponding to the queue based on the difference between the current queue depth and the current authorized surplus includes: According to the order of each rate level from high to low, the difference is compared with the threshold value corresponding to each rate level in turn until the difference is greater than the threshold value of the current rate level for the first time. Then, the current rate level is determined as the rate level corresponding to the queue.

2. The flow control method according to claim 1, characterized in that, Based on the difference between the current queue depth and the current authorized surplus, the rate level corresponding to the queue is determined, including: Determine the range to which the difference belongs; wherein different difference ranges correspond to different rate levels; The rate level corresponding to the range of differences to which the difference belongs is determined as the rate level corresponding to the queue.

3. The flow control method according to claim 1, characterized in that, The method further includes: In response to storing new data in the queue, and / or in response to sending the data stored in the queue to the destination, the current queue depth of the queue is updated. And / or, In response to receiving authorization information returned by the destination based on the rate level, the authorization surplus is updated based on the authorization information.

4. A flow control method, characterized in that, Used as the destination in a distributed network communication system; The flow control method includes: The system receives an authorization request from a data source and determines a rate adjustment factor corresponding to the queue based on the rate level carried in the authorization request. The rate level and the difference are positively correlated; the higher the rate level, the more traffic is requested to be allocated. The difference is the difference between the current queue depth and the current authorization surplus of the queue. The authorization request is generated based on the traffic control method according to any one of claims 1-3. Based on the rate adjustment factor and the baseline shaping value corresponding to the queue, the target shaping value of the queue is determined; Based on the target integer value, authorization information is sent to the data source.

5. The flow control method according to claim 4, characterized in that, Determining the target shaping value of the queue based on the rate adjustment factor and the baseline shaping value corresponding to the queue includes: Determine a baseline shaping value corresponding to the queue; the baseline shaping value includes: a shaping value pre-configured for the queue, or the port rate of the port used to receive data sent from the data source. Based on the rate adjustment factor, the baseline shaping value is adjusted to obtain the target shaping value of the queue; The target integer value of the queue is positively correlated with the rate level of the queue.

6. The method according to claim 4 or 5, characterized in that, The step of sending authorization information to the data source based on the target integer value includes: The authorization information is generated based on the target integer value and the preset queue scheduling rules. Send the authorization information to the data source.

7. A flow control device, characterized in that, For a data source in a distributed network communication system; the device includes: The judgment module is used to determine whether the queue has met the target authorization conditions based on the current queue depth and the current authorization surplus of the queue. A determination module is configured to, in response to the queue reaching the target authorization condition, determine the rate level corresponding to the queue based on the difference between the current queue depth and the current authorization surplus; wherein the rate level and the difference are positively correlated, and the higher the rate level, the more traffic is requested to be allocated; the rate level is used to determine a rate adjustment factor, which is used to adjust the baseline integer value corresponding to the current queue to obtain a target integer value; the target integer value is used to generate authorization information; The sending module is used to send an authorization request corresponding to the queue to the destination of the network communication distributed system; the authorization request carries the rate level of the queue; The control module is configured to, in response to receiving the authorization information returned by the destination terminal according to the rate level, send the data in the queue to the destination terminal according to the authorization information; The sending module is further configured to: in response to the queue not meeting the target authorization condition, send an authorization request to the destination, and carry the identifier of not meeting the target authorization condition in the authorization request; The identifier indicating that the target authorization condition has not been met is used by the destination to authorize the queue based on the lowest rate. The judgment module is specifically used to compare the current queue depth with the first value, and to compare the current authorized surplus with the second value; If the current queue depth is greater than the first value and the current authorization surplus is less than or equal to the second value, it is determined that the queue has reached the target authorization condition. The determining module, when determining the rate level corresponding to the queue based on the difference between the current queue depth and the current authorized surplus, is used to: The step of determining the rate level corresponding to the queue based on the difference between the current queue depth and the current authorized surplus includes: According to the order of each rate level from high to low, the difference is compared with the threshold value corresponding to each rate level in turn until the difference is greater than the threshold value of the current rate level for the first time. Then, the current rate level is determined as the rate level corresponding to the queue.

8. A flow control device, characterized in that, For a destination in a distributed network communication system; the device includes: A receiving module is configured to receive an authorization request sent by a data source, and determine a rate adjustment factor corresponding to the queue based on the rate level carried in the authorization request; the rate level and the difference are positively correlated, and the higher the rate level, the more traffic is requested to be allocated; the difference is the difference between the current queue depth and the current authorization surplus of the queue; the authorization request is generated based on the traffic control method according to any one of claims 1-3. The adjustment module is used to determine the target shaping value of the queue based on the rate adjustment factor and the baseline shaping value corresponding to the queue. The sending module is used to send authorization information to the data source based on the target integer value.

9. A computer device, characterized in that, The device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being executed by the processor to perform the method as described in any one of claims 1 to 6.