A bandwidth throttling method and device, electronic equipment and storage medium
By monitoring and calculating bandwidth threshold parameters through distributed nodes and sending adjustment messages to the control nodes, the problem of inefficient bandwidth coordination in distributed systems is solved, enabling dynamic and precise bandwidth allocation and ensuring system stability.
Patent Information
- Application Number
- CN202611283897.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-21
- Publication Date
- 2026-11-06
AI Technical Summary
Existing technologies cannot respond to sudden bursts of bandwidth traffic in a timely manner in distributed systems, nor can they identify and limit the excessive bandwidth consumption of specific processes within a node. This results in inefficient coordination of bandwidth resources between nodes and an inability to guarantee the stability of the outbound bandwidth of a single node.
Distributed nodes monitor the peak bandwidth and threshold parameters within the current time window, calculate the desired bandwidth threshold parameters, send adjustment messages to the management node, and then limit bandwidth after receiving the response from the management node, thereby achieving dynamic and fine-grained bandwidth allocation.
In a distributed system, nodes can adjust bandwidth threshold parameters in a timely manner, enabling dynamic and fine-grained allocation of bandwidth resources, reducing bandwidth coordination overhead, and ensuring stable system operation.
Smart Images

Figure CN123055674A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a bandwidth limiting method, apparatus, electronic device, and storage medium. Background Technology
[0002] With the rapid development of internet and cloud computing technologies, distributed systems have become the core architecture supporting large-scale online services (such as e-commerce, social networks, streaming media, and cloud computing platforms). In distributed systems, hundreds or thousands of nodes (e.g., servers) work collaboratively to provide services. Ensuring the stable and efficient operation of each node is the cornerstone of guaranteeing the service quality and reliability of the entire distributed system.
[0003] At the network level, node stability is closely related to the rational use of egress bandwidth. If the egress bandwidth of a single node is exhausted by one or a few application processes, other services on that node will become unresponsive, or even cause the node to crash, potentially leading to a cascading failure and endangering the entire system.
[0004] To address bandwidth overload issues, a "centralized decision-making-based cluster traffic scheduling and load balancing scheme" can be adopted. The core idea of this scheme is to optimize the load of the entire distributed system through a global coordinator. This scheme deploys a central controller (also known as a management node) in the distributed system, acting as the "brain" for the entire cluster's traffic management. Its operating mechanism is as follows: Status collection: Each worker node in the cluster (also known as a distributed node) reports its own load status to the central controller at fixed time intervals (e.g., every 5 or 10 seconds). This status data typically includes aggregate metrics such as CPU utilization, memory usage, disk I / O rate, and number of network connections.
[0005] Global Analysis and Decision-Making: After aggregating the status information of all nodes, the central controller performs global calculations and analysis using a preset load balancing algorithm (e.g., resource weight-based allocation). Its goal is to identify "hot" nodes whose current load exceeds a first preset threshold and "idle" nodes whose load falls below a second preset threshold.
[0006] Flow intervention: The central controller executes control strategies based on the analysis results. The main control methods are as follows: Issue rate limiting command: Directly send rate limiting command to nodes that are determined to be overloaded to reduce the rate at which new requests are received or processed.
[0007] Redirecting inbound traffic: Sending redirection instructions to the traffic inbound components of a distributed system (e.g., load balancers) to adjust the traffic distribution strategy, directing more subsequent new requests to the less loaded nodes in the system, thereby achieving load balancing at the request level.
[0008] This solution aims to prevent individual nodes from crashing due to excessive request pressure through macro-level traffic allocation. However, its core mechanism has the following problems, which prevent it from effectively guaranteeing the stability of the overall outbound bandwidth of a single node in the distributed system, and also prevents it from achieving agile coordination of bandwidth resources between nodes: 1. Untimely response: Relying on a central node for periodic decision-making results in a long control loop, making it impossible to respond to sudden bursts of bandwidth traffic in real time.
[0009] 2. Inaccurate control: Its control targets external request traffic, and it cannot identify and limit the excessive bandwidth consumption of specific processes within the node, resulting in the "bad neighbor" effect.
[0010] 3. Inefficient collaboration: The centralized architecture and generalized load metrics lack an effective mechanism for directly and dynamically allocating bandwidth, a specific resource, among nodes. Summary of the Invention
[0011] To overcome the problems existing in related technologies, this application provides a bandwidth limiting method, apparatus, electronic device, and storage medium.
[0012] According to a first aspect of the embodiments of this application, a bandwidth limiting method is provided, the method being applied to any distributed node in a distributed system, the distributed system further including a management node, the method comprising: Monitor the bandwidth used by the traffic received within the current time window; Based on the monitored bandwidth peak value within the current time window and the current bandwidth threshold parameter, determine whether the current bandwidth threshold parameter needs to be adjusted. When the judgment result is yes, the expected bandwidth threshold parameter is calculated based on the bandwidth peak and the current bandwidth threshold parameter, and a bandwidth adjustment message carrying the expected bandwidth threshold parameter is sent to the control node. The system receives a bandwidth adjustment response message from the control node, which carries the latest bandwidth threshold parameter. Based on the latest bandwidth threshold parameter, the system performs bandwidth rate limiting on the received traffic. The latest bandwidth threshold parameter is determined by the control node based on its remaining bandwidth and the desired bandwidth threshold parameter.
[0013] According to a second aspect of the embodiments of this application, a bandwidth limiting method is provided, the method being applied to a control node in a distributed system, the distributed system further comprising multiple distributed nodes, the method comprising: The system receives a bandwidth adjustment message from any distributed node, wherein the bandwidth adjustment message carries a desired bandwidth threshold parameter, and the bandwidth adjustment message is sent by the distributed node after determining that the current bandwidth threshold parameter needs to be adjusted based on the bandwidth peak value of the traffic received in the current time window and the current bandwidth threshold parameter. The desired bandwidth threshold parameter is calculated based on the bandwidth peak value and the current bandwidth threshold parameter. Based on its remaining bandwidth and the desired bandwidth threshold parameter, the latest bandwidth threshold parameter is determined, and the bandwidth corresponding to the latest bandwidth threshold parameter is allocated to the distributed node. Send a bandwidth adjustment response message carrying the latest bandwidth threshold parameters to the distributed node, so that the distributed node can limit the bandwidth of the received traffic according to the latest bandwidth threshold parameters.
[0014] According to a third aspect of the embodiments of this application, a bandwidth limiting device is provided, the device being applied to any distributed node in a distributed system, the distributed system further including a management node, the device comprising: The monitoring module is used to monitor the bandwidth occupied by the traffic received within the current time window; The judgment module is used to determine whether the current bandwidth threshold parameter needs to be adjusted based on the monitored bandwidth peak value within the current time window and the current bandwidth threshold parameter. The calculation and sending module is used to calculate the expected bandwidth threshold parameter based on the bandwidth peak value and the current bandwidth threshold parameter when the judgment result of the judgment module is yes, and send a bandwidth adjustment message carrying the expected bandwidth threshold parameter to the control node. The rate limiting module is used to receive a bandwidth adjustment response message sent by the control node, which carries the latest bandwidth threshold parameter, and to limit the bandwidth of the received traffic according to the latest bandwidth threshold parameter. The latest bandwidth threshold parameter is determined by the control node based on its own remaining bandwidth and the expected bandwidth threshold parameter.
[0015] According to a fourth aspect of the embodiments of this application, a bandwidth limiting device is provided, the device being applied to a control node in a distributed system, the distributed system further comprising multiple distributed nodes, the device comprising: The receiving module is used to receive a bandwidth adjustment message sent by any distributed node, wherein the bandwidth adjustment message carries a desired bandwidth threshold parameter, and the bandwidth adjustment message is sent by the distributed node after determining that the current bandwidth threshold parameter needs to be adjusted based on the bandwidth peak value of the bandwidth occupied by the traffic received in the current time window and the current bandwidth threshold parameter; The allocation module is used to determine the latest bandwidth threshold parameter based on its own remaining bandwidth and the expected bandwidth threshold parameter, and to allocate the bandwidth corresponding to the latest bandwidth threshold parameter to the distributed node. The sending module is used to send a bandwidth adjustment response message carrying the latest bandwidth threshold parameters to the distributed node, so that the distributed node can limit the bandwidth of the received traffic according to the latest bandwidth threshold parameters.
[0016] According to a fifth aspect of the present application, an electronic device is provided, characterized in that it includes a processor and a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions executable by the processor, the processor being prompted by the machine-executable instructions to implement the method steps of any of the above bandwidth limiting methods.
[0017] According to a sixth aspect of the present application, a computer-readable storage medium is provided, wherein a computer program is stored therein, and when the computer program is executed by a processor, it implements the steps of any of the above bandwidth limiting methods.
[0018] The technical solutions provided by the embodiments of this application may include the following beneficial effects: In this embodiment of the application, for any distributed node in the distributed system, the following operation process is performed: monitoring the bandwidth occupied by the traffic received within the current time window; determining whether the current bandwidth threshold parameter needs to be adjusted based on the monitored bandwidth peak value within the current time window and the current bandwidth threshold parameter; if the determination result is yes, calculating the desired bandwidth threshold parameter based on the bandwidth peak value and the current bandwidth threshold parameter, and sending a bandwidth adjustment message carrying the desired bandwidth threshold parameter to the management node in the distributed system; receiving a bandwidth adjustment response message carrying the latest bandwidth threshold parameter sent by the management node, and limiting the bandwidth of the received traffic based on the latest bandwidth threshold parameter, wherein the latest bandwidth threshold parameter is determined by the management node based on its own remaining bandwidth and the desired bandwidth threshold parameter.
[0019] In this way, distributed nodes in a distributed system can proactively report the bandwidth threshold parameters that need to be adjusted to the control node in a timely manner, so as to implement bandwidth rate limiting for traffic in a timely manner, thereby realizing dynamic and fine-grained allocation of bandwidth resources in a distributed system and effectively reducing bandwidth coordination overhead.
[0020] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description
[0021] The accompanying drawings, which are incorporated in and form part of this application, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0022] Figure 1 One of the flowcharts for a bandwidth limiting method provided in this application embodiment; Figure 2 This is a schematic diagram of the architecture of a distributed system provided in an embodiment of this application; Figure 3 A schematic diagram of the bandwidth overflow interval value and bandwidth release interval value provided in the embodiments of this application; Figure 4 A second schematic flowchart illustrating a bandwidth limiting method provided in an embodiment of this application; Figure 5 This is one of the structural schematic diagrams of a bandwidth limiting device provided in an embodiment of this application; Figure 6 This is a second schematic diagram of a bandwidth limiting device provided in an embodiment of this application; Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0023] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0024] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.
[0025] It should be understood that although the terms first, second, third, etc., may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the words “if” or “suppose” as used herein may be interpreted as “when…” or “when…”.
[0026] The embodiments of this application will now be described in detail.
[0027] This application provides a bandwidth limiting method, which is applied to any distributed node in a distributed system, which also includes a management node, such as... Figure 1 As shown, the method may include the following steps: S11. Monitor the bandwidth occupied by the traffic received within the current time window.
[0028] S12. Based on the monitored bandwidth peak value within the current time window and the current bandwidth threshold parameter, determine whether the current bandwidth threshold parameter needs to be adjusted; if the determination result is no, proceed to step S13; if the determination result is yes, proceed to step S14.
[0029] S13. End this process.
[0030] S14. Calculate the desired bandwidth threshold parameter based on the peak bandwidth and the current bandwidth threshold parameter, and send a bandwidth adjustment message carrying the desired bandwidth threshold parameter to the control node.
[0031] S15. Receive the bandwidth adjustment response message sent by the control node, which carries the latest bandwidth threshold parameters, and limit the bandwidth of the received traffic according to the latest bandwidth threshold parameters.
[0032] In this step, the latest bandwidth threshold parameter is determined by the control node based on its remaining bandwidth and the desired bandwidth threshold parameter.
[0033] Specifically, in step S12 above, the current bandwidth threshold parameters include the current bandwidth overflow threshold, the current bandwidth request threshold, and the current bandwidth return threshold.
[0034] In this situation, the distributed node can determine whether the current bandwidth threshold parameter needs to be adjusted in the following way: If the peak bandwidth is greater than the current bandwidth request threshold but less than the current bandwidth overflow threshold, then it is determined that the current bandwidth overflow threshold, the current bandwidth request threshold, and the current bandwidth return threshold need to be adjusted. If the peak bandwidth drops below the current bandwidth return threshold, then it is determined that the current bandwidth overflow threshold, the current bandwidth request threshold, and the current bandwidth return threshold need to be adjusted.
[0035] It should be noted that initially, the current bandwidth overflow threshold, the current bandwidth request threshold, and the current bandwidth return threshold are all allocated by the control node to each distributed node in the distributed system.
[0036] Specifically, in step S14 above, the expected bandwidth threshold parameters include the expected bandwidth overflow threshold, the expected bandwidth request threshold, and the expected bandwidth return threshold.
[0037] In this scenario, the distributed node can calculate the desired bandwidth threshold parameter in the following way: If the peak bandwidth is greater than the current bandwidth request threshold but less than the current bandwidth overflow threshold, calculate the difference between the peak bandwidth and the current bandwidth request threshold, add the difference to the current bandwidth overflow threshold to obtain the expected bandwidth overflow threshold, add the difference to the current bandwidth request threshold to obtain the expected bandwidth request threshold, and add the difference to the current bandwidth return threshold to obtain the expected bandwidth return threshold. If the peak bandwidth drops below the current bandwidth return threshold, calculate the difference between the current bandwidth return threshold and the peak bandwidth. Subtract the difference from the current bandwidth overflow threshold to obtain the expected bandwidth overflow threshold. Subtract the difference from the current bandwidth request threshold to obtain the expected bandwidth request threshold. Subtract the difference from the current bandwidth return threshold to obtain the expected bandwidth return threshold.
[0038] For example, such as Figure 2 As shown, the distributed system includes a management node (denoted as Admin) and n+1 distributed nodes (denoted as Node), namely Node0 to Noden. Assume that the distributed node is Node1(), and assume that Node1 detects a bandwidth peak (denoted as Flow_max) within a certain time window (denoted as Time_normal) as a, the current bandwidth overflow threshold (denoted as Full_line) as b, the current bandwidth request threshold (denoted as Request_line) as c, and the current bandwidth return threshold (denoted as Release_line) as d.
[0039] Assume a is greater than c and less than a. Then, Node1 first calculates the difference (ac) between the peak bandwidth (a) and the current bandwidth request threshold (c). It then adds the difference to the current bandwidth overflow threshold (b) to obtain the expected bandwidth overflow threshold (a-c+b). Node1 then adds the difference to the current bandwidth request threshold to obtain the expected bandwidth request threshold (a). Finally, it adds the difference to the current bandwidth return threshold to obtain the expected bandwidth return threshold (a-c+d).
[0040] In step S14 above, the distributed node can send a bandwidth adjustment message carrying the desired bandwidth threshold parameter to the control node in the following way: If the peak bandwidth is greater than the current bandwidth request threshold but less than the current bandwidth overflow threshold, send a bandwidth request message (which can be denoted as Requst_msg) to the control node, carrying the expected bandwidth overflow threshold, the expected bandwidth request threshold, and the expected bandwidth return threshold. If the peak bandwidth drops below the current bandwidth return threshold, a bandwidth return message (which can be denoted as Release_msg) is sent to the control node, carrying the expected bandwidth overflow threshold, the expected bandwidth request threshold, and the expected bandwidth return threshold.
[0041] Furthermore, in this embodiment of the application, the distributed node may also perform the following operations: First method: If the peak bandwidth detected in the current time window is greater than the current bandwidth overflow threshold, allow the received traffic to proceed and send a bandwidth overflow message (which can be denoted as Full_msg) to the control node. The bandwidth overflow message carries the difference between the peak bandwidth and the current bandwidth overflow threshold. If a borrowing message carrying its own identifier is received from the control node, or a borrowing message carrying a node chain with its own tail node is received from another distributed node, an operation to prevent traffic overflow is executed.
[0042] The second method: If bandwidth request messages and bandwidth overflow messages are sent consecutively within the current time window, the current bandwidth overflow interval value is increased according to the preset first threshold increase strategy. The current bandwidth overflow interval value (denoted as Full_interval) is the difference between the current bandwidth overflow threshold (denoted as Full_line) and the current bandwidth request threshold (denoted as Request_line). Figure 3 (as shown) The increased bandwidth overflow interval value is added to the current bandwidth overflow threshold to obtain the desired bandwidth overflow threshold; a bandwidth request message carrying the desired bandwidth overflow threshold, the current bandwidth request threshold, and the current bandwidth return threshold is sent to the control node. The system receives a bandwidth request response message from the control node, which carries the latest bandwidth overflow threshold, the latest bandwidth request threshold, and the latest bandwidth return threshold. Based on these thresholds, the system applies bandwidth rate limiting to the received traffic.
[0043] It should be noted that in the second operating procedure, the preset first threshold increase strategy can be set by the administrator according to actual network needs and pre-configured on the distributed node. For example, the preset first threshold increase strategy is to increase the threshold according to the set increase threshold, etc.
[0044] It should be further explained that the reason for implementing the second operation procedure is mainly to deal with the rapid increase in traffic within a single time window.
[0045] The third method: Within the current time window, after sending a bandwidth request message to the management node, and before receiving a bandwidth request response message from the management node within the current time window, no further bandwidth request messages will be sent.
[0046] The fourth operation: If the number of times bandwidth return messages and bandwidth request messages are sent alternately within the current time window reaches a set number, then the current bandwidth release interval value is increased according to the preset second threshold increase strategy. The current bandwidth release interval value (denoted as Release_interval) is the difference between the current bandwidth request threshold (denoted as Request_line) and the current bandwidth return threshold (Release_line). Figure 3 (as shown) The increased bandwidth release interval value is added to the current bandwidth return threshold to obtain the expected bandwidth return threshold; a bandwidth return message carrying the current bandwidth overflow threshold, the current bandwidth request threshold, and the expected bandwidth return threshold is sent to the control node. The system receives a bandwidth return response message from the control node, which carries the latest bandwidth overflow threshold, the latest bandwidth request threshold, and the latest bandwidth return threshold. Based on these thresholds, the system applies bandwidth rate limiting to the received traffic.
[0047] It should be noted that in the fourth operation procedure described above, the preset second threshold increase strategy can also be set by the administrator according to actual network needs and pre-configured on the distributed node. Here, the preset second threshold increase strategy can be the same as or different from the preset first threshold increase strategy.
[0048] It should be further explained that the reason for executing the fourth operation process is mainly to avoid sending messages frequently within a single time window, which would increase the processing pressure on the distributed node.
[0049] Fifth operation: If no message is sent within the current time window, the bandwidth release interval will be reduced according to the preset threshold reduction strategy. The increased bandwidth release interval value is added to the current bandwidth return threshold to obtain the expected bandwidth return threshold; a keep-alive message carrying the current bandwidth overflow threshold, the current bandwidth request threshold, and the expected bandwidth return threshold is sent to the management node. The system receives a keep-alive response message from the control node, which carries the latest bandwidth overflow threshold, the latest bandwidth request threshold, and the latest bandwidth return threshold. Based on these thresholds, the system applies bandwidth rate limiting to the received traffic.
[0050] It should be noted that in the fifth operation procedure, the preset threshold reduction strategy can be set by the administrator according to the actual network needs and pre-configured on the distributed node. For example, the preset threshold reduction strategy is to reduce the threshold according to the set reduction threshold, etc.
[0051] This application also provides a bandwidth limiting method, which is applied to a control node in a distributed system, the distributed system further including multiple distributed nodes, such as... Figure 4 As shown, the method may include the following steps: S41. Receive a bandwidth adjustment message sent by any distributed node.
[0052] In this step, the bandwidth adjustment message carries the expected bandwidth threshold parameter. The bandwidth adjustment message is sent by the distributed node after it determines that the current bandwidth threshold parameter needs to be adjusted based on the bandwidth peak value of the traffic received in the current time window and the current bandwidth threshold parameter. The expected bandwidth threshold parameter is calculated based on the bandwidth peak value and the current bandwidth threshold parameter. S42. Based on its own remaining bandwidth and the expected bandwidth threshold parameter, determine the latest bandwidth threshold parameter and allocate the bandwidth corresponding to the latest bandwidth threshold parameter to the distributed node.
[0053] S43. Send a bandwidth adjustment response message carrying the latest bandwidth threshold parameters to the distributed node, so that the distributed node can limit the bandwidth of the received traffic according to the latest bandwidth threshold parameters.
[0054] It should be noted that the expected bandwidth threshold parameters in this application embodiment include the expected bandwidth overflow threshold, the expected bandwidth request threshold, and the expected bandwidth return threshold.
[0055] In this scenario, in step S42 above, the control node can determine the latest bandwidth threshold parameter in the following way: If the bandwidth adjustment message is a bandwidth request message, then when the unallocated bandwidth value is greater than the expected bandwidth overflow threshold, the corresponding bandwidth is allocated to the distributed node according to the expected bandwidth overflow threshold, the expected bandwidth request threshold, and the expected bandwidth return threshold. The expected bandwidth overflow threshold, the expected bandwidth request threshold, and the expected bandwidth return threshold are then determined as the latest bandwidth overflow threshold, the latest bandwidth request threshold, and the expected bandwidth return threshold, respectively. Alternatively, when the unallocated bandwidth value is less than the expected bandwidth overflow threshold, the expected bandwidth overflow threshold is determined as the latest bandwidth overflow threshold. The current bandwidth overflow interval threshold is reduced according to a preset bandwidth reduction strategy. The expected bandwidth overflow threshold is subtracted from the reduced bandwidth overflow interval threshold to obtain the latest bandwidth request threshold. The difference between the latest bandwidth request threshold and the expected bandwidth request threshold and the expected bandwidth return threshold is subtracted to obtain the latest bandwidth return threshold. Here, the current bandwidth overflow interval threshold is the difference between the expected bandwidth overflow threshold and the expected bandwidth request threshold. If the bandwidth adjustment message is a bandwidth return message or a keep-alive message, then the corresponding bandwidth is allocated to the distributed node according to the expected bandwidth overflow threshold, the expected bandwidth request threshold, and the expected bandwidth return threshold, and the expected bandwidth overflow threshold, the expected bandwidth request threshold, and the expected bandwidth return threshold are determined as the latest bandwidth overflow threshold, the latest bandwidth request threshold, and the expected bandwidth return threshold, respectively. The bandwidth request message is generated when the distributed node calculates the difference between the peak bandwidth value and the current bandwidth request threshold, and then adds the difference to the current bandwidth overflow threshold to obtain the desired bandwidth overflow threshold; adds the difference to the current bandwidth request threshold to obtain the desired bandwidth request threshold; and finally adds the difference to the current bandwidth return threshold to obtain the desired bandwidth return threshold before sending the message. The bandwidth return message is sent by the distributed node after the bandwidth peak drops below the current bandwidth return threshold. The node calculates the difference between the current bandwidth return threshold and the bandwidth peak; subtracts the difference from the current bandwidth overflow threshold to obtain the expected bandwidth overflow threshold; subtracts the difference from the current bandwidth request threshold to obtain the expected bandwidth request threshold; and subtracts the difference from the current bandwidth return threshold to obtain the expected bandwidth return threshold before sending the message. The keep-alive message is sent by the distributed node when it detects that no messages have been sent within the current time window. According to the preset threshold reduction strategy, the bandwidth release interval value is reduced, and the increased bandwidth release interval value is added to the current bandwidth return threshold to obtain the desired bandwidth return threshold before being sent.
[0056] It should be noted that the configuration method of the preset threshold reduction strategy in the above determination process has been described when describing the bandwidth limiting method from the perspective of distributed nodes, and will not be elaborated here.
[0057] Furthermore, in this embodiment of the application, the control node may also perform the following operations: Receive the bandwidth overflow message sent by the distributed node, wherein the bandwidth overflow message carries the difference between the bandwidth peak and the current bandwidth overflow threshold, and the bandwidth overflow message is sent by the distributed node when it detects that the bandwidth peak in the current time window is greater than the current bandwidth overflow threshold; If there is still unallocated bandwidth exceeding the difference on itself, the difference will be used as virtual traffic for that distributed node and accumulated on itself. If the unallocated bandwidth value on itself is less than the difference, and there is no distributed node that has not sent a bandwidth request message within the current time window, then a second borrow message carrying the identifier of the distributed node is sent to that distributed node so that the distributed node performs the operation of preventing traffic overflow. If the unallocated bandwidth value on itself is less than the difference, and there is a first target distributed node that has not sent a bandwidth request message within the current time window, then the difference between the difference and the unallocated bandwidth value on itself is calculated. If the sum of the bandwidth overflow interval values of all first target distributed nodes is not less than the calculated difference, then based on the calculated difference and the preset borrowing strategy, the bandwidth corresponding to the calculated difference is borrowed from the bandwidth corresponding to the bandwidth overflow interval values of all first target distributed nodes. Alternatively, if the sum of the bandwidth overflow interval values of all first target distributed nodes is less than the calculated difference, a node chain is generated including all second target distributed nodes that have not sent bandwidth request messages or bandwidth overflow messages within the current time window and the node chain. The current bandwidth value to be borrowed and the second borrowing message of the node chain are sent to the first second target distributed node in the node chain. In this process, the bandwidth to be borrowed is the calculated difference, the tail node of the node chain is the distributed node, and the second borrowing message is used to instruct the first second target distributed node to borrow its remaining bandwidth to the distributed node when it determines that it is not the tail node. The calculated difference is subtracted from its own remaining bandwidth value to obtain the calculation result. The bandwidth to be borrowed carried in the second borrowing message is updated with the calculation result to obtain the third borrowing message. The third borrowing message is sent to the next distributed node in the node chain so that the next distributed node can perform the operation of preventing traffic overflow when it determines that it is the tail node. Alternatively, if the bandwidth to be borrowed carried in the third borrowing message is not 0 when it determines that it is not the tail node, the next distributed node is used as the first second target distributed node and the step of borrowing its own remaining bandwidth to the distributed node is started. If the bandwidth to be borrowed is 0, the process ends.
[0058] By executing the above operational procedures, when bandwidth overflow occurs, the control node can implement a three-level progressive coordination process: global idle bandwidth resource allocation → coordination of bandwidth resources reserved within distributed nodes → hierarchical bandwidth resource borrowing by nodes in a chain. This maximizes the potential of the distributed system. Ultimately, the unmet overflow traffic is identified as system-level overload, triggering the local bandwidth limiting mechanism, thus achieving graceful degradation and stable operation of the distributed system under high load.
[0059] As can be seen from the above technical solutions, in this embodiment of the application, for any distributed node in the distributed system, the following operation process is performed: monitoring the bandwidth occupied by the traffic received within the current time window; determining whether the current bandwidth threshold parameter needs to be adjusted based on the monitored bandwidth peak value within the current time window and the current bandwidth threshold parameter; when the determination result is yes, calculating the desired bandwidth threshold parameter based on the bandwidth peak value and the current bandwidth threshold parameter, and sending a bandwidth adjustment message carrying the desired bandwidth threshold parameter to the management node in the distributed system; receiving a bandwidth adjustment response message carrying the latest bandwidth threshold parameter sent by the management node, and limiting the bandwidth of the received traffic based on the latest bandwidth threshold parameter, wherein the latest bandwidth threshold parameter is determined by the management node based on its own remaining bandwidth and the desired bandwidth threshold parameter.
[0060] In this way, distributed nodes in a distributed system can proactively report the bandwidth threshold parameters that need to be adjusted to the control node in a timely manner, so as to implement bandwidth rate limiting for traffic in a timely manner, thereby realizing dynamic and fine-grained allocation of bandwidth resources in a distributed system and effectively reducing bandwidth coordination overhead.
[0061] Based on the same inventive concept, this application also provides a bandwidth limiting device, which is applied to any distributed node in a distributed system, and its structural schematic diagram is shown below. Figure 5 As shown, the distributed system also includes a management and control node, specifically including: Monitoring module 51 is used to monitor the bandwidth occupied by the traffic received within the current time window; The judgment module 52 is used to determine whether the current bandwidth threshold parameter needs to be adjusted based on the monitored bandwidth peak value within the current time window and the current bandwidth threshold parameter. The calculation and sending module 53 is used to calculate the expected bandwidth threshold parameter based on the bandwidth peak value and the current bandwidth threshold parameter when the judgment result of the judgment module 52 is yes, and send a bandwidth adjustment message carrying the expected bandwidth threshold parameter to the control node. The rate limiting module 54 is used to receive a bandwidth adjustment response message carrying the latest bandwidth threshold parameter sent by the control node, and to limit the bandwidth of the received traffic according to the latest bandwidth threshold parameter, wherein the latest bandwidth threshold parameter is determined by the control node based on its own remaining bandwidth and the expected bandwidth threshold parameter.
[0062] Preferably, the current bandwidth threshold parameters include the current bandwidth overflow threshold, the current bandwidth request threshold, and the current bandwidth return threshold; The expected bandwidth threshold parameters include the expected bandwidth overflow threshold, the expected bandwidth request threshold, and the expected bandwidth return threshold. The judgment module 52 is specifically used for: If the peak bandwidth is greater than the current bandwidth request threshold but less than the current bandwidth overflow threshold, then it is determined that the current bandwidth overflow threshold, the current bandwidth request threshold, and the current bandwidth return threshold need to be adjusted. If the bandwidth peak drops below the current bandwidth return threshold, it is determined that the current bandwidth overflow threshold, the current bandwidth request threshold, and the current bandwidth return threshold need to be adjusted. The calculation and transmission module 53 is specifically used for: If the peak bandwidth is greater than the current bandwidth request threshold and less than the current bandwidth overflow threshold, calculate the difference between the peak bandwidth and the current bandwidth request threshold, add the difference to the current bandwidth overflow threshold to obtain the expected bandwidth overflow threshold, add the difference to the current bandwidth request threshold to obtain the expected bandwidth request threshold, and add the difference to the current bandwidth return threshold to obtain the expected bandwidth return threshold. If the bandwidth peak drops below the current bandwidth return threshold, calculate the difference between the current bandwidth return threshold and the bandwidth peak, subtract the difference from the current bandwidth overflow threshold to obtain the desired bandwidth overflow threshold, subtract the difference from the current bandwidth request threshold to obtain the desired bandwidth request threshold, and subtract the difference from the current bandwidth return threshold to obtain the desired bandwidth return threshold. The speed limiting module 54 is specifically used for: If the bandwidth peak value is greater than the current bandwidth request threshold and less than the current bandwidth overflow threshold, a bandwidth request message carrying the expected bandwidth overflow threshold, the expected bandwidth request threshold, and the expected bandwidth return threshold is sent to the control node. If the bandwidth peak drops below the current bandwidth return threshold, a bandwidth return message carrying the expected bandwidth overflow threshold, the expected bandwidth request threshold, and the expected bandwidth return threshold is sent to the control node.
[0063] Preferably, the method further includes: Release sending module ( Figure 5 (not shown in the image), used to allow the received traffic to proceed if the detected bandwidth peak value within the current time window is greater than the current bandwidth overflow threshold, and to send a bandwidth overflow message to the control node, wherein the bandwidth overflow message carries the difference between the bandwidth peak value and the current bandwidth overflow threshold; First execution module ( Figure 5 (Not shown in the image) is used to perform a traffic overflow prevention operation if a borrowing message carrying its own identifier is received from the control node, or a borrowing message carrying a node chain with its own tail node is received from another distributed node.
[0064] Preferably, the method further includes: If bandwidth request messages and bandwidth overflow messages are sent consecutively within the current time window, the current bandwidth overflow interval value is increased according to the preset first threshold increase strategy, wherein the current bandwidth overflow interval value is the difference between the current bandwidth overflow threshold and the current bandwidth request threshold. The increased bandwidth overflow interval value is added to the current bandwidth overflow threshold to obtain the desired bandwidth overflow threshold; a bandwidth request message carrying the desired bandwidth overflow threshold, the current bandwidth request threshold, and the current bandwidth return threshold is sent to the control node. The system receives a bandwidth request response message from the control node, which carries the latest bandwidth overflow threshold, the latest bandwidth request threshold, and the latest bandwidth return threshold. Based on the latest bandwidth overflow threshold, the latest bandwidth request threshold, and the latest bandwidth return threshold, the system performs bandwidth rate limiting on the received traffic.
[0065] Preferably, the method further includes: Second execution module ( Figure 5 (Not shown in the image), is used to prevent the transmission of the bandwidth request message within the current time window after sending the bandwidth request message to the control node and before receiving a bandwidth request response message from the control node within the current time window.
[0066] Preferably, the method further includes: Third execution module ( Figure 5 (not shown in the image) If the number of times bandwidth return messages and bandwidth request messages are sent alternately within the current time window reaches a set number, the current bandwidth release interval value is increased according to the preset second threshold increase strategy, wherein the current bandwidth release interval value is the difference between the current bandwidth request threshold and the current bandwidth return threshold. The increased bandwidth release interval value is added to the current bandwidth return threshold to obtain the expected bandwidth return threshold; a bandwidth return message carrying the current bandwidth overflow threshold, the current bandwidth request threshold, and the expected bandwidth return threshold is sent to the control node. The system receives a bandwidth return response message from the control node, which carries the latest bandwidth overflow threshold, the latest bandwidth request threshold, and the latest bandwidth return threshold. Based on these thresholds, the system applies bandwidth rate limiting to the received traffic.
[0067] Preferably, the method further includes: Fourth Execution Module ( Figure 5 (not shown in the table) If no message is sent within the current time window, the bandwidth release interval value is reduced according to the preset threshold reduction strategy; The increased bandwidth release interval value is added to the current bandwidth return threshold to obtain the expected bandwidth return threshold; a keep-alive message carrying the current bandwidth overflow threshold, the current bandwidth request threshold, and the expected bandwidth return threshold is sent to the control node. The system receives a keep-alive response message from the control node, which carries the latest bandwidth overflow threshold, the latest bandwidth request threshold, and the latest bandwidth return threshold. Based on these thresholds, the system performs bandwidth rate limiting on the received traffic.
[0068] This application also provides a bandwidth limiting device, which is applied to a control node in a distributed system. The distributed system further includes multiple distributed nodes, and a schematic diagram of the control node is shown below. Figure 6 As shown, it specifically includes: The receiving module 61 is used to receive a bandwidth adjustment message sent by any distributed node, wherein the bandwidth adjustment message carries a desired bandwidth threshold parameter, and the bandwidth adjustment message is sent by the distributed node after determining that the current bandwidth threshold parameter needs to be adjusted based on the bandwidth peak value of the bandwidth occupied by the traffic received in the current time window and the current bandwidth threshold parameter; The allocation module 62 is used to determine the latest bandwidth threshold parameter based on its own remaining bandwidth and the expected bandwidth threshold parameter, and allocate the bandwidth corresponding to the latest bandwidth threshold parameter to the distributed node. The sending module 63 is used to send a bandwidth adjustment response message carrying the latest bandwidth threshold parameters to the distributed node, so that the distributed node can limit the bandwidth of the received traffic according to the latest bandwidth threshold parameters.
[0069] Preferably, the desired bandwidth threshold parameters include the desired bandwidth overflow threshold, the desired bandwidth request threshold, and the desired bandwidth return threshold; The allocation module 62 is specifically used for: If the bandwidth adjustment message is a bandwidth request message, then when the unallocated bandwidth value is greater than the expected bandwidth overflow threshold, the corresponding bandwidth is allocated to the distributed node according to the expected bandwidth overflow threshold, the expected bandwidth request threshold, and the expected bandwidth return threshold. The expected bandwidth overflow threshold, the expected bandwidth request threshold, and the expected bandwidth return threshold are then determined as the latest bandwidth overflow threshold, the latest bandwidth request threshold, and the expected bandwidth return threshold, respectively. Alternatively, when the unallocated bandwidth value is less than the expected bandwidth overflow threshold, the expected bandwidth overflow threshold is determined as the latest bandwidth overflow threshold. The current bandwidth overflow interval threshold is reduced according to a preset bandwidth reduction strategy. The expected bandwidth overflow threshold is subtracted from the reduced bandwidth overflow interval threshold to obtain the latest bandwidth request threshold. The difference between the latest bandwidth request threshold and the expected bandwidth request threshold and the expected bandwidth return threshold is subtracted to obtain the latest bandwidth return threshold. Here, the current bandwidth overflow interval threshold is the difference between the expected bandwidth overflow threshold and the expected bandwidth request threshold. If the bandwidth adjustment message is a bandwidth return message or a keep-alive message, then the corresponding bandwidth is allocated to the distributed node according to the expected bandwidth overflow threshold, the expected bandwidth request threshold, and the expected bandwidth return threshold, and the expected bandwidth overflow threshold, the expected bandwidth request threshold, and the expected bandwidth return threshold are determined as the latest bandwidth overflow threshold, the latest bandwidth request threshold, and the expected bandwidth return threshold, respectively. The bandwidth request message is sent by the distributed node when the peak bandwidth value is greater than the current bandwidth request threshold but less than the current bandwidth overflow threshold. The node calculates the difference between the peak bandwidth value and the current bandwidth request threshold; adds the difference to the current bandwidth overflow threshold to obtain the desired bandwidth overflow threshold; adds the difference to the current bandwidth request threshold to obtain the desired bandwidth request threshold; and adds the difference to the current bandwidth return threshold to obtain the desired bandwidth return threshold before sending the message. The bandwidth return message is sent by the distributed node after the bandwidth peak drops below the current bandwidth return threshold, calculating the difference between the current bandwidth return threshold and the bandwidth peak; subtracting the difference from the current bandwidth overflow threshold to obtain the desired bandwidth overflow threshold; subtracting the difference from the current bandwidth request threshold to obtain the desired bandwidth request threshold; and finally subtracting the difference from the current bandwidth return threshold to obtain the desired bandwidth return threshold. The keep-alive message is sent by the distributed node when it detects that no message has been sent within the current time window. The distributed node reduces the bandwidth release interval value according to a preset threshold reduction strategy, adds the increased bandwidth release interval value to the current bandwidth return threshold, and then sends the desired bandwidth return threshold.
[0070] Preferably, the method further includes: Bandwidth Coordination Module ( Figure 6 (not shown in the image) is used to receive a bandwidth overflow message sent by the distributed node, wherein the bandwidth overflow message carries the difference between the bandwidth peak value and the current bandwidth overflow threshold value, and the bandwidth overflow message is sent by the distributed node when it detects that the bandwidth peak value within the current time window is greater than the current bandwidth overflow threshold value; If there is still unallocated bandwidth on the node exceeding the difference, then the difference is used as the virtual traffic of the distributed node and accumulated on the node itself. If the unallocated bandwidth value on itself is less than the difference, and there is no distributed node that has not sent a bandwidth request message within the current time window, then a second borrow message carrying the identifier of the distributed node is sent to the distributed node so that the distributed node performs an operation to prevent traffic overflow. If the unallocated bandwidth value on itself is less than the difference, and there is a first target distributed node within the current time window that has not sent a bandwidth request message, then the difference between the difference and the unallocated bandwidth value on itself is calculated. If the sum of the bandwidth overflow interval values of all first target distributed nodes is not less than the calculated difference, based on the calculated difference and a preset borrowing strategy, the bandwidth corresponding to the calculated difference is borrowed from the bandwidth corresponding to the bandwidth overflow interval values of all first target distributed nodes for the distributed node. Alternatively, if the sum of the bandwidth overflow interval values of all first target distributed nodes is less than the calculated difference, a node chain is generated including all second target distributed nodes that have not sent bandwidth request messages or bandwidth overflow messages within the current time window and the distributed node. The current bandwidth value to be borrowed and the second borrowing message of the node chain are sent to the first second target distributed node in the node chain. In this process, the bandwidth to be borrowed is the calculated difference, the tail node of the node chain is the distributed node, and the second borrowing message is used to instruct the first second target distributed node to borrow its remaining bandwidth to the distributed node when it determines that it is not the tail node. The calculated difference is subtracted from its own remaining bandwidth value to obtain the calculation result. The bandwidth to be borrowed carried in the second borrowing message is updated to the calculation result to obtain the third borrowing message. The third borrowing message is sent to the next distributed node in the node chain so that the next distributed node can perform the operation of preventing traffic overflow when it determines that it is the tail node, or, if the bandwidth to be borrowed carried in the third borrowing message is not 0 when it determines that it is not the tail node, then the next distributed node is used as the first second target distributed node and the step of borrowing its own remaining bandwidth to the distributed node is started. If the bandwidth to be borrowed is 0, then the process ends.
[0071] As can be seen from the above technical solutions, in this embodiment of the application, for any distributed node in the distributed system, the following operation process is performed: monitoring the bandwidth occupied by the traffic received within the current time window; determining whether the current bandwidth threshold parameter needs to be adjusted based on the monitored bandwidth peak value within the current time window and the current bandwidth threshold parameter; when the determination result is yes, calculating the desired bandwidth threshold parameter based on the bandwidth peak value and the current bandwidth threshold parameter, and sending a bandwidth adjustment message carrying the desired bandwidth threshold parameter to the management node in the distributed system; receiving a bandwidth adjustment response message carrying the latest bandwidth threshold parameter sent by the management node, and limiting the bandwidth of the received traffic based on the latest bandwidth threshold parameter, wherein the latest bandwidth threshold parameter is determined by the management node based on its own remaining bandwidth and the desired bandwidth threshold parameter.
[0072] In this way, distributed nodes in a distributed system can proactively report the bandwidth threshold parameters that need to be adjusted to the control node in a timely manner, so as to implement bandwidth rate limiting for traffic in a timely manner, thereby realizing dynamic and fine-grained allocation of bandwidth resources in a distributed system and effectively reducing bandwidth coordination overhead.
[0073] This application also provides an electronic device, such as... Figure 7 As shown, it includes a processor 71 and a machine-readable storage medium 72, the machine-readable storage medium 72 storing machine-executable instructions that can be executed by the processor 71, the processor 71 being prompted by the machine-executable instructions to implement the steps of any of the above bandwidth limiting methods.
[0074] The aforementioned machine-readable storage medium may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the machine-readable storage medium may also be at least one storage device located remotely from the aforementioned processor.
[0075] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0076] In another embodiment provided in this application, a computer-readable storage medium is also provided, which stores a computer program that, when executed by a processor, implements the steps of any of the above-described bandwidth limiting methods.
[0077] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A bandwidth limiting method, characterized in that, The method is applied to any distributed node in a distributed system, which further includes a management node, and the method includes: Monitor the bandwidth used by the traffic received within the current time window; Based on the monitored bandwidth peak value within the current time window and the current bandwidth threshold parameter, determine whether the current bandwidth threshold parameter needs to be adjusted. When the judgment result is yes, the expected bandwidth threshold parameter is calculated based on the bandwidth peak and the current bandwidth threshold parameter, and a bandwidth adjustment message carrying the expected bandwidth threshold parameter is sent to the control node. The system receives a bandwidth adjustment response message from the control node, which carries the latest bandwidth threshold parameter. Based on the latest bandwidth threshold parameter, the system performs bandwidth rate limiting on the received traffic. The latest bandwidth threshold parameter is determined by the control node based on its remaining bandwidth and the desired bandwidth threshold parameter.
2. The method according to claim 1, characterized in that, The current bandwidth threshold parameters include the current bandwidth overflow threshold, the current bandwidth request threshold, and the current bandwidth return threshold. The expected bandwidth threshold parameters include the expected bandwidth overflow threshold, the expected bandwidth request threshold, and the expected bandwidth return threshold. Determine whether the current bandwidth threshold parameter needs to be adjusted using the following methods: If the peak bandwidth is greater than the current bandwidth request threshold but less than the current bandwidth overflow threshold, then it is determined that the current bandwidth overflow threshold, the current bandwidth request threshold, and the current bandwidth return threshold need to be adjusted. If the bandwidth peak drops below the current bandwidth return threshold, it is determined that the current bandwidth overflow threshold, the current bandwidth request threshold, and the current bandwidth return threshold need to be adjusted. Based on the peak bandwidth and the current bandwidth threshold parameter, the desired bandwidth threshold parameter is calculated, specifically including: If the peak bandwidth is greater than the current bandwidth request threshold and less than the current bandwidth overflow threshold, calculate the difference between the peak bandwidth and the current bandwidth request threshold, add the difference to the current bandwidth overflow threshold to obtain the expected bandwidth overflow threshold, add the difference to the current bandwidth request threshold to obtain the expected bandwidth request threshold, and add the difference to the current bandwidth return threshold to obtain the expected bandwidth return threshold. If the bandwidth peak drops below the current bandwidth return threshold, calculate the difference between the current bandwidth return threshold and the bandwidth peak, subtract the difference from the current bandwidth overflow threshold to obtain the desired bandwidth overflow threshold, subtract the difference from the current bandwidth request threshold to obtain the desired bandwidth request threshold, and subtract the difference from the current bandwidth return threshold to obtain the desired bandwidth return threshold. Sending a bandwidth adjustment message carrying the desired bandwidth threshold parameter to the control node, specifically including: If the bandwidth peak value is greater than the current bandwidth request threshold and less than the current bandwidth overflow threshold, a bandwidth request message carrying the expected bandwidth overflow threshold, the expected bandwidth request threshold, and the expected bandwidth return threshold is sent to the control node. If the bandwidth peak drops below the current bandwidth return threshold, a bandwidth return message carrying the expected bandwidth overflow threshold, the expected bandwidth request threshold, and the expected bandwidth return threshold is sent to the control node.
3. The method according to claim 1, characterized in that, The method further includes: If the detected bandwidth peak value within the current time window is greater than the current bandwidth overflow threshold, allow the received traffic to proceed, and send a bandwidth overflow message to the control node, wherein the bandwidth overflow message carries the difference between the bandwidth peak value and the current bandwidth overflow threshold. If a borrowing message carrying its own identifier is received from the control node, or a borrowing message carrying a node chain with its own tail node is received from another distributed node, an operation to prevent traffic overflow is executed.
4. The method according to claim 2, characterized in that, The method further includes: If bandwidth request messages and bandwidth overflow messages are sent consecutively within the current time window, the current bandwidth overflow interval value is increased according to the preset first threshold increase strategy, wherein the current bandwidth overflow interval value is the difference between the current bandwidth overflow threshold and the current bandwidth request threshold. The increased bandwidth overflow interval value is added to the current bandwidth overflow threshold to obtain the desired bandwidth overflow threshold; a bandwidth request message carrying the desired bandwidth overflow threshold, the current bandwidth request threshold, and the current bandwidth return threshold is sent to the control node. The system receives a bandwidth request response message from the control node, which carries the latest bandwidth overflow threshold, the latest bandwidth request threshold, and the latest bandwidth return threshold. Based on the latest bandwidth overflow threshold, the latest bandwidth request threshold, and the latest bandwidth return threshold, the system performs bandwidth rate limiting on the received traffic.
5. The method according to claim 2, characterized in that, The method further includes: Within the current time window, after sending the bandwidth request message to the control node, and before receiving a bandwidth request response message from the control node within the current time window, the bandwidth request message will not be sent again.
6. The method according to claim 2, characterized in that, The method further includes: If the number of times bandwidth return messages and bandwidth request messages are sent alternately within the current time window reaches a set number, the current bandwidth release interval value is increased according to the preset second threshold increase strategy, wherein the current bandwidth release interval value is the difference between the current bandwidth request threshold and the current bandwidth return threshold. The increased bandwidth release interval value is added to the current bandwidth return threshold to obtain the expected bandwidth return threshold; a bandwidth return message carrying the current bandwidth overflow threshold, the current bandwidth request threshold, and the expected bandwidth return threshold is sent to the control node. The system receives a bandwidth return response message from the control node, which carries the latest bandwidth overflow threshold, the latest bandwidth request threshold, and the latest bandwidth return threshold. Based on these thresholds, the system applies bandwidth rate limiting to the received traffic.
7. The method according to claim 1, characterized in that, The method further includes: If no message is sent within the current time window, the bandwidth release interval value is reduced according to the preset threshold reduction strategy. The increased bandwidth release interval value is added to the current bandwidth return threshold to obtain the expected bandwidth return threshold; a keep-alive message carrying the current bandwidth overflow threshold, the current bandwidth request threshold, and the expected bandwidth return threshold is sent to the control node. The system receives a keep-alive response message from the control node, which carries the latest bandwidth overflow threshold, the latest bandwidth request threshold, and the latest bandwidth return threshold. Based on these thresholds, the system performs bandwidth rate limiting on the received traffic.
8. A bandwidth limiting method, characterized in that, The method is applied to a control node in a distributed system, wherein the distributed system further includes multiple distributed nodes, and the method includes: The system receives a bandwidth adjustment message from any distributed node, wherein the bandwidth adjustment message carries a desired bandwidth threshold parameter, and the bandwidth adjustment message is sent by the distributed node after determining that the current bandwidth threshold parameter needs to be adjusted based on the bandwidth peak value of the traffic received in the current time window and the current bandwidth threshold parameter. The desired bandwidth threshold parameter is calculated based on the bandwidth peak value and the current bandwidth threshold parameter. Based on its remaining bandwidth and the desired bandwidth threshold parameter, the latest bandwidth threshold parameter is determined, and the bandwidth corresponding to the latest bandwidth threshold parameter is allocated to the distributed node. Send a bandwidth adjustment response message carrying the latest bandwidth threshold parameters to the distributed node, so that the distributed node can limit the bandwidth of the received traffic according to the latest bandwidth threshold parameters.
9. The method according to claim 8, characterized in that, The expected bandwidth threshold parameters include the expected bandwidth overflow threshold, the expected bandwidth request threshold, and the expected bandwidth return threshold; Based on its remaining bandwidth and the desired bandwidth threshold parameter, the latest bandwidth threshold parameter is determined, specifically including: If the bandwidth adjustment message is a bandwidth request message, then when the unallocated bandwidth value is greater than the expected bandwidth overflow threshold, the corresponding bandwidth is allocated to the distributed node according to the expected bandwidth overflow threshold, the expected bandwidth request threshold, and the expected bandwidth return threshold. The expected bandwidth overflow threshold, the expected bandwidth request threshold, and the expected bandwidth return threshold are then determined as the latest bandwidth overflow threshold, the latest bandwidth request threshold, and the expected bandwidth return threshold, respectively. Alternatively, when the unallocated bandwidth value is less than the expected bandwidth overflow threshold, the expected bandwidth overflow threshold is determined as the latest bandwidth overflow threshold. The current bandwidth overflow interval threshold is reduced according to a preset bandwidth reduction strategy. The expected bandwidth overflow threshold is subtracted from the reduced bandwidth overflow interval threshold to obtain the latest bandwidth request threshold. The difference between the latest bandwidth request threshold and the expected bandwidth request threshold and the expected bandwidth return threshold is subtracted to obtain the latest bandwidth return threshold. Here, the current bandwidth overflow interval threshold is the difference between the expected bandwidth overflow threshold and the expected bandwidth request threshold. If the bandwidth adjustment message is a bandwidth return message or a keep-alive message, then the corresponding bandwidth is allocated to the distributed node according to the expected bandwidth overflow threshold, the expected bandwidth request threshold, and the expected bandwidth return threshold, and the expected bandwidth overflow threshold, the expected bandwidth request threshold, and the expected bandwidth return threshold are determined as the latest bandwidth overflow threshold, the latest bandwidth request threshold, and the expected bandwidth return threshold, respectively. The bandwidth request message is sent by the distributed node when the peak bandwidth value is greater than the current bandwidth request threshold but less than the current bandwidth overflow threshold. The node calculates the difference between the peak bandwidth value and the current bandwidth request threshold; adds the difference to the current bandwidth overflow threshold to obtain the desired bandwidth overflow threshold; adds the difference to the current bandwidth request threshold to obtain the desired bandwidth request threshold; and adds the difference to the current bandwidth return threshold to obtain the desired bandwidth return threshold before sending the message. The bandwidth return message is sent by the distributed node after the bandwidth peak drops below the current bandwidth return threshold, calculating the difference between the current bandwidth return threshold and the bandwidth peak; subtracting the difference from the current bandwidth overflow threshold to obtain the desired bandwidth overflow threshold; subtracting the difference from the current bandwidth request threshold to obtain the desired bandwidth request threshold; and finally subtracting the difference from the current bandwidth return threshold to obtain the desired bandwidth return threshold. The keep-alive message is sent by the distributed node when it detects that no message has been sent within the current time window. The distributed node reduces the bandwidth release interval value according to a preset threshold reduction strategy, adds the increased bandwidth release interval value to the current bandwidth return threshold, and then sends the desired bandwidth return threshold.
10. The method according to claim 8, characterized in that, The method further includes: Receive a bandwidth overflow message sent by the distributed node, wherein the bandwidth overflow message carries the difference between the bandwidth peak and the current bandwidth overflow threshold, and the bandwidth overflow message is sent by the distributed node when it detects that the bandwidth peak within the current time window is greater than the current bandwidth overflow threshold; If there is still unallocated bandwidth on the node exceeding the difference, then the difference is used as the virtual traffic of the distributed node and accumulated on the node itself. If the unallocated bandwidth value on itself is less than the difference, and there is no distributed node that has not sent a bandwidth request message within the current time window, then a second borrow message carrying the identifier of the distributed node is sent to the distributed node so that the distributed node performs an operation to prevent traffic overflow. If the unallocated bandwidth value on itself is less than the difference, and there is a first target distributed node within the current time window that has not sent a bandwidth request message, then the difference between the difference and the unallocated bandwidth value on itself is calculated. If the sum of the bandwidth overflow interval values of all first target distributed nodes is not less than the calculated difference, based on the calculated difference and a preset borrowing strategy, the bandwidth corresponding to the calculated difference is borrowed from the bandwidth corresponding to the bandwidth overflow interval values of all first target distributed nodes for the distributed node. Alternatively, if the sum of the bandwidth overflow interval values of all first target distributed nodes is less than the calculated difference, a node chain is generated including all second target distributed nodes that have not sent bandwidth request messages or bandwidth overflow messages within the current time window and the distributed node. The current bandwidth value to be borrowed and the second borrowing message of the node chain are sent to the first second target distributed node in the node chain. In this process, the bandwidth to be borrowed is the calculated difference, the tail node of the node chain is the distributed node, and the second borrowing message is used to instruct the first second target distributed node to borrow its remaining bandwidth to the distributed node when it determines that it is not the tail node. The calculated difference is subtracted from its own remaining bandwidth value to obtain the calculation result. The bandwidth to be borrowed carried in the second borrowing message is updated to the calculation result to obtain the third borrowing message. The third borrowing message is sent to the next distributed node in the node chain so that the next distributed node can perform the operation of preventing traffic overflow when it determines that it is the tail node, or, if the bandwidth to be borrowed carried in the third borrowing message is not 0 when it determines that it is not the tail node, then the next distributed node is used as the first second target distributed node and the step of borrowing its own remaining bandwidth to the distributed node is started. If the bandwidth to be borrowed is 0, then the process ends.
11. A bandwidth limiting device, characterized in that, The device is applied to any distributed node in a distributed system, the distributed system further including a management node, and the device includes: The monitoring module is used to monitor the bandwidth occupied by the traffic received within the current time window; The judgment module is used to determine whether the current bandwidth threshold parameter needs to be adjusted based on the monitored bandwidth peak value within the current time window and the current bandwidth threshold parameter. The calculation and sending module is used to calculate the expected bandwidth threshold parameter based on the bandwidth peak value and the current bandwidth threshold parameter when the judgment result of the judgment module is yes, and send a bandwidth adjustment message carrying the expected bandwidth threshold parameter to the control node. The rate limiting module is used to receive a bandwidth adjustment response message sent by the control node, which carries the latest bandwidth threshold parameter, and to limit the bandwidth of the received traffic according to the latest bandwidth threshold parameter. The latest bandwidth threshold parameter is determined by the control node based on its own remaining bandwidth and the expected bandwidth threshold parameter.
12. A bandwidth limiting device, characterized in that, The device is applied to a control node in a distributed system, which further includes multiple distributed nodes. The device comprises: The receiving module is used to receive a bandwidth adjustment message sent by any distributed node, wherein the bandwidth adjustment message carries a desired bandwidth threshold parameter, and the bandwidth adjustment message is sent by the distributed node after determining that the current bandwidth threshold parameter needs to be adjusted based on the bandwidth peak value of the bandwidth occupied by the traffic received in the current time window and the current bandwidth threshold parameter; The allocation module is used to determine the latest bandwidth threshold parameter based on its own remaining bandwidth and the expected bandwidth threshold parameter, and to allocate the bandwidth corresponding to the latest bandwidth threshold parameter to the distributed node. The sending module is used to send a bandwidth adjustment response message carrying the latest bandwidth threshold parameters to the distributed node, so that the distributed node can limit the bandwidth of the received traffic according to the latest bandwidth threshold parameters.
13. An electronic device, characterized in that, The method includes a processor and a machine-readable storage medium storing machine-executable instructions that can be executed by the processor, the processor being prompted by the machine-executable instructions to perform the method steps of any one of claims 1-7 or any one of claims 8-10.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method steps of any one of claims 1-7 or any one of claims 8-10.
