Method and device for limiting speed of cloud network data traffic
By configuring random discarding and priority discarding threshold parameters in the cloud network, and adjusting the data traffic forwarding strategy using the token bucket mechanism, the problems of instability and low efficiency caused by the excessive bandwidth of user traffic in the cloud network are solved, and efficient and stable data transmission is achieved.
Patent Information
- Application Number
- CN202510534678.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-25
- Publication Date
- 2025-06-27
AI Technical Summary
In a cloud network environment, when the user traffic exceeds the bandwidth, data transmission is unstable and the transmission efficiency is low, resulting in the critical service traffic being disconnected due to serious packet loss.
By configuring the random drop start threshold parameters and priority drop threshold parameters, the token bucket mechanism is used to compare the number of tokens with these threshold parameters, and the forwarding behavior and policies of data traffic are adjusted to ensure that high priority traffic and traffic that requires specific QoS guarantees are forwarded quickly and in real time and in non-blocking.
It effectively improves the quality of user QoS services, improves the efficiency and stability of data transmission, and avoids problems such as lag, delay or data loss due to network congestion or insufficient resources.
Smart Images

Figure CN120223640A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical fields of cloud computing and network communication, and particularly relates to a method and device for limiting the data traffic rate in a cloud network. Background Art
[0002] With the rapid development of cloud computing technology, the data traffic in the cloud network is increasing day by day. How to ensure the high-performance and low-latency transmission of key business data packets of key users in the cloud network has become an urgent problem to be solved.
[0003] In a cloud network environment, when a user's over-bandwidth packet is forwarded, it usually depends on the CAR (Commit Access Rate) traffic supervision of cloud network devices, and packets exceeding the bandwidth are dropped without discrimination. For some key business traffic, protocol disconnections, tcp (transmission control protocol) link disconnections, RDP (Remote Desktop Protocol) remote link disconnections, etc. occur due to serious packet loss. Summary of the Invention
[0004] In view of this, the present invention provides a method and device for limiting the data traffic rate in a cloud network to solve the problems of unstable data transmission and low transmission efficiency in the scenario where the user traffic exceeds the bandwidth.
[0005] In a first aspect, the present invention provides a method for limiting the data traffic rate in a cloud network, the method comprising:
[0006] Configuring a random discard start threshold parameter and a priority discard threshold parameter; the random discard start threshold parameter is greater than the priority discard threshold parameter;
[0007] Obtaining the number of tokens in a single-bucket single-rate CAR token bucket, and when the cloud network data traffic reaches the single-bucket single-rate CAR token bucket, comparing the number of tokens with the random discard start threshold parameter and the priority discard threshold parameter respectively, and limiting the cloud network data traffic based on the comparison result.
[0008] The method for limiting the data traffic rate in a cloud network provided in this embodiment adjusts the forwarding behavior and forwarding strategy through the comparison results of the number of tokens with the random discard start threshold parameter and the priority discard threshold parameter by configuring the random discard start threshold parameter and the priority discard threshold parameter, ensuring that high-priority traffic of key services or traffic that requires specific QoS (Quality of Service) guarantee is forwarded quickly, in real time, and without blocking. In the scenario where the user traffic exceeds the bandwidth, the QoS service quality of the user can be effectively improved, and the efficiency and stability of data transmission are improved.
[0009] In an alternative embodiment, when cloud network data traffic arrives at the token bucket, the number of tokens is compared with the random discard start threshold parameter and the priority discard threshold parameter respectively, and the cloud network data traffic is rate-limited based on the comparison results, including:
[0010] If the number of tokens is greater than the random discard start threshold parameter, the cloud network data traffic is output;
[0011] Or, if the number of tokens is less than the random discard start threshold parameter and the number of tokens is greater than the priority discard threshold parameter, the priority of the cloud network data traffic is obtained, and the low-priority cloud network data traffic is packet-dropped according to the discard probability, and the high-priority cloud network data traffic is output;
[0012] Or, if the number of tokens is less than the priority discard threshold parameter, the low-priority cloud network data traffic is discarded, and it is judged whether the number of tokens meets the high-priority cloud network data traffic, and the high-priority cloud network data traffic is output based on the judgment result.
[0013] A method for rate-limiting cloud network data traffic provided by this embodiment adjusts the forwarding behavior and forwarding strategy through the relationship between the number of tokens and the random discard start threshold parameter and the priority discard threshold parameter, ensuring that high-priority traffic of key services or traffic that requires specific QoS guarantees can be forwarded quickly, in real-time, and without blocking. The low-priority cloud network data traffic adopts the random early discard strategy, which can effectively trigger the sliding window speed regulation mechanism of TCP itself, effectively prevent TCP from disconnecting due to a large number of packet drops, and ensure the stability of data transmission.
[0014] In an alternative embodiment, if the number of tokens is greater than the random discard start threshold parameter, outputting the cloud network data traffic includes:
[0015] If the number of tokens is greater than the random discard start threshold parameter, the number of tokens occupied by the cloud network data traffic is obtained, the number of tokens is subtracted from the number of tokens occupied by the cloud network data traffic, and the cloud network data traffic is output.
[0016] A method for rate-limiting cloud network data traffic provided by this embodiment can clearly understand the remaining amount of token resources in the current cloud network by subtracting the number of tokens occupied by the cloud network data traffic from the number of tokens, monitor the network load situation in real-time to avoid network congestion, and ensure the stable operation of the network. Moreover, by calculating the token difference and preferentially allocating token resources for key services, the service quality of key services can be guaranteed, and problems such as freezing, delay, or data loss due to network congestion or resource shortage can be avoided.
[0017] In an alternative embodiment, if the number of tokens is less than the random discard start threshold parameter and the number of tokens is greater than the priority discard threshold parameter, then obtain the priority of the cloud network data traffic, perform packet discarding processing on the low-priority cloud network data traffic according to the discard probability, and output the high-priority cloud network data traffic, including:
[0018] If the number of tokens is less than the random discard start threshold parameter and the number of tokens is greater than the priority discard threshold parameter, then select a random value within the parameter interval corresponding to the random discard start threshold parameter and the priority discard threshold parameter;
[0019] Compare the number of tokens with the random value. If the number of tokens is less than the random value, then discard the low-priority cloud network data traffic and output the high-priority cloud network data traffic.
[0020] A method for rate limiting cloud network data traffic provided in this embodiment compares the number of tokens with the random value, and performs packet discarding processing on the low-priority cloud network data traffic according to different discard probabilities, ensuring the normal output of the high-priority cloud network data traffic and achieving effective rate limiting of the cloud network data traffic.
[0021] In an alternative embodiment, if the number of tokens is less than the random discard start threshold parameter and the number of tokens is greater than the priority discard threshold parameter, then obtain the priority of the cloud network data traffic, perform packet discarding processing on the low-priority cloud network data traffic according to the discard probability, and output the high-priority cloud network data traffic, further including:
[0022] If the number of tokens corresponding to the low-priority cloud network data traffic is greater than or equal to the random value, then output the cloud network data traffic.
[0023] In an alternative embodiment, if the number of tokens is less than the priority discard threshold parameter, then discard the low-priority cloud network data traffic, and determine whether the number of tokens meets the requirements of the high-priority cloud network data traffic, and output the high-priority cloud network data traffic based on the determination result, including:
[0024] If the number of tokens is less than the priority discard threshold parameter, then obtain the number of tokens occupied by the high-priority cloud network data traffic;
[0025] Compare the number of tokens with the number of occupied tokens. If the number of tokens is greater than the number of occupied tokens, then output the high-priority cloud network data traffic and discard the low-priority cloud network data traffic.
[0026] A method for limiting the cloud network data traffic provided in this embodiment compares the number of tokens with the number of tokens occupied by the high-priority cloud network data traffic, and then outputs the high-priority cloud network data traffic according to the comparison result, and discards all the low-priority cloud network data traffic, realizing the effective allocation of tokens, and ensuring that the high-priority traffic of key services or the traffic that requires specific QoS guarantee can be forwarded quickly, in real time and without blockage.
[0027] In a second aspect, the present invention provides an apparatus for limiting the cloud network data traffic, and the apparatus includes:
[0028] A configuration module, configured to configure a random discard start threshold parameter and a priority discard threshold parameter; the random discard start threshold parameter is greater than the priority discard threshold parameter;
[0029] A rate limiting module, configured to obtain the number of tokens in a single-bucket single-rate CAR token bucket, and when the cloud network data traffic arrives at the single-bucket single-rate CAR token bucket, compare the number of tokens with the random discard start threshold parameter and the priority discard threshold parameter respectively, and limit the cloud network data traffic based on the comparison result.
[0030] In a third aspect, the present invention provides a computer device, including: a memory and a processor, which are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to execute the method for limiting the cloud network data traffic according to the first aspect or any corresponding embodiment thereof.
[0031] In a fourth aspect, the present invention provides a computer-readable storage medium, on which computer instructions are stored, and the computer instructions are used to cause a computer to execute the method for limiting the cloud network data traffic according to the first aspect or any corresponding embodiment thereof.
[0032] In a fifth aspect, the present invention provides a computer program product, including computer instructions, and the computer instructions are used to cause a computer to execute the method for limiting the cloud network data traffic according to the first aspect or any corresponding embodiment thereof. Description of the Drawings
[0033] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required to be used in the description of the specific embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0034] Figure 1It is a schematic flowchart of a method for limiting cloud network data traffic speed according to an embodiment of the present invention;
[0035] Figure 2 It is a schematic flowchart of another method for limiting cloud network data traffic speed according to an embodiment of the present invention;
[0036] Figure 3 It is a schematic flowchart of the thresh_car speed limit algorithm according to an embodiment of the present invention;
[0037] Figure 4 It is a schematic diagram of a single-bucket single-rate CAR token bucket according to an embodiment of the present invention;
[0038] Figure 5 It is a structural block diagram of a device for limiting cloud network data traffic speed according to an embodiment of the present invention;
[0039] Figure 6 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. Specific embodiments
[0040] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Apparently, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0041] The embodiments of the present invention provide a method for limiting cloud network data traffic speed. It should be noted that for the method for limiting cloud network data traffic speed provided by the embodiments of the present invention, the execution subject may be a device for limiting cloud network data traffic speed. The device for limiting cloud network data traffic speed can be implemented as part or all of an electronic device through software, hardware, or a combination of software and hardware. Among them, the electronic device may be a server or a terminal. Among them, the server in the embodiments of the present application may be a single server or a server cluster composed of multiple servers. The terminal in the embodiments of the present application may be other intelligent hardware devices such as a smart phone, a personal computer, a tablet computer, a wearable device, and a smart robot. In the following method embodiments, the execution subject being an electronic device is taken as an example for description.
[0042] The embodiments of the present invention provide a method for limiting cloud network data traffic speed, which improves the efficiency and stability of cloud network data traffic transmission by configuring thresholds and differentiating and processing different protocol priorities.
[0043] According to an embodiment of the present invention, there is provided an embodiment of a method for limiting the data traffic speed of a cloud network. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here.
[0044] In this embodiment, a method for limiting the data traffic speed of a cloud network is provided, which can be used in the above-mentioned electronic device. Figure 1 It is a flowchart of a method for limiting the data traffic speed of a cloud network according to an embodiment of the present invention, as Figure 1 shown, the process includes the following steps:
[0045] Step S101, configure the random discard start threshold parameter and the priority discard threshold parameter; the random discard start threshold parameter is greater than the priority discard threshold parameter.
[0046] Specifically, there are two threshold parameters in the single-bucket single-rate CAR token bucket, namely the random discard start threshold parameter Thresh_RD and the priority discard threshold parameter Thresh_P, Thresh_RD > Thresh_P. Among them, when the tokens in the single-bucket single-rate CAR token bucket are lower than Thresh_RD, the low-priority cloud network data traffic starts to be discarded with a certain probability, and the lower the token water level, the greater the discard probability; when the tokens in the single-bucket single-rate CAR token bucket are lower than Thresh_P, the low-priority cloud network data traffic is discarded 100%, and only the high-priority cloud network data traffic is allowed to pass.
[0047] Among them, CAR is a traffic policing technology, mainly used to police the traffic rate entering or leaving the network.
[0048] Step S102, obtain the number of tokens in the single-bucket single-rate CAR token bucket. When the cloud network data traffic arrives at the single-bucket single-rate CAR token bucket, compare the number of tokens with the random discard start threshold parameter and the priority discard threshold parameter respectively, and limit the cloud network data traffic based on the comparison result.
[0049] Specifically, tokens are generated according to the Committed Information Rate (CIR for short), and the tokens are put into the single-bucket single-rate CAR token bucket. Then, the traffic rate limiting algorithm thresh_car is used to limit the cloud network data traffic, where the structure of thresh_car is as follows:
[0050]
[0051] Among them, in the above Table 1, CBS (Committed Burst Size) is the amount of data that can be transmitted exceeding the CIR within a short period of time committed to the customer, and the CIR is the rate of guaranteed bandwidth that can be transmitted to the customer committed to the customer.
[0052] A method for limiting the cloud network data traffic provided by this embodiment adjusts the forwarding behavior and forwarding policy through the comparison results of the token quantity with the random discard start threshold parameter and the priority discard threshold parameter by configuring the random discard start threshold parameter and the priority discard threshold parameter, ensuring that the high-priority traffic of critical services or the traffic that requires specific QoS (Quality of Service) guarantee is forwarded quickly, in real time, and without blocking. In the scenario where the user traffic exceeds the bandwidth, it can effectively improve the user QoS service quality and improve the efficiency and stability of data transmission.
[0053] In this embodiment, a method for limiting the cloud network data traffic is provided, which can be used in the above-mentioned electronic device. Figure 2 It is a flowchart of a method for limiting the cloud network data traffic according to an embodiment of the present invention, as Figure 2 shown, and this process includes the following steps:
[0054] Step S201, configure the random discard start threshold parameter and the priority discard threshold parameter; the random discard start threshold parameter is greater than the priority discard threshold parameter. For details, please refer to Figure 1 Step S101 of the shown embodiment, which will not be elaborated here.
[0055] Step S202, obtain the token quantity in the single-bucket single-rate CAR token bucket. When the cloud network data traffic reaches the single-bucket single-rate CAR token bucket, compare the token quantity with the random discard start threshold parameter and the priority discard threshold parameter respectively, and limit the cloud network data traffic based on the comparison results.
[0056] Specifically, as Figure 3 shown, the above step S202 includes:
[0057] Step S2021, if the token quantity is greater than the random discard start threshold parameter, output the cloud network data traffic.
[0058] Specifically, if the token quantity is greater than the random discard start threshold parameter, obtain the number of tokens occupied by the cloud network data traffic, subtract the number of tokens occupied by the cloud network data traffic from the token quantity, and output the cloud network data traffic.
[0059] Further, as Figure 4As shown, when the number of TOKENs (i.e., the number of tokens) in the single-bucket single-rate CAR token bucket is greater than Thresh_RD, all cloud network data traffic passes through normally, and the number of TOKENs is subtracted by the number of tokens PKT_TOKEN required by the packet.
[0060] Step S2022, or, if the number of tokens is less than the random discard start threshold parameter and the number of tokens is greater than the priority discard threshold parameter, obtain the priority of the cloud network data traffic, perform packet discarding processing on the low-priority cloud network data traffic according to the discard probability, and output the high-priority cloud network data traffic.
[0061] Specifically, as Figure 4 shown, when the TOKEN water level (i.e., the number of tokens) in the single-bucket single-rate CAR token bucket is between Thresh_RD and Thresh_P, the high-priority cloud network data traffic passes through normally, and the low-priority cloud network data traffic is processed for packet discarding according to different discard probabilities according to the height of the TOKEN water level.
[0062] In some optional implementation manners, the above step S2022 includes:
[0063] Step a1, if the number of tokens is less than the random discard start threshold parameter and the number of tokens is greater than the priority discard threshold parameter, select a random value within the parameter interval corresponding to the random discard start threshold parameter and the priority discard threshold parameter.
[0064] Specifically, select a random value random within the parameter interval [Thresh_P, Thresh_RD].
[0065] Step a2, compare the number of tokens with the random value. If the number of tokens is less than the random value, discard the low-priority cloud network data traffic and output the high-priority cloud network data traffic.
[0066] Specifically, if the number of tokens corresponding to the low-priority cloud network data traffic is greater than or equal to the random value, output the cloud network data traffic.
[0067] Furthermore, if TOKEN < random, the low-priority cloud network data traffic is discarded, otherwise it passes through. The closer the TOKEN water level is to Thresh_RD, the smaller the packet discard probability, and the closer the TOKEN water level is to Thresh_P, the greater the packet discard probability.
[0068] Step S2023, or, if the number of tokens is less than the priority discard threshold parameter, discard the low-priority cloud network data traffic, and determine whether the number of tokens meets the high-priority cloud network data traffic, and output the high-priority cloud network data traffic based on the determination result.
[0069] In some alternative embodiments, the above step S2023 includes:
[0070] Step b1, if the number of tokens is less than the priority discard threshold parameter, obtain the number of occupied tokens of the cloud network data traffic with high priority.
[0071] Step b2, compare the number of tokens with the number of occupied tokens. If the number of tokens is greater than the number of occupied tokens, output the cloud network data traffic with high priority and discard the cloud network data traffic with low priority.
[0072] Specifically, as Figure 4 shown, when the TOKEN water level in the single-bucket single-rate CAR token bucket is lower than Thresh_P, all the cloud network data traffic with low priority is discarded. At this time, for the cloud network data traffic with high priority, it is determined whether to pass according to whether the TOKEN in the token bucket meets the passing condition of the cloud network data traffic with high priority.
[0073] A method for limiting the speed of cloud network data traffic provided in this embodiment adjusts the forwarding behavior and forwarding strategy through the relationship between the number of tokens, the random discard start threshold parameter, and the priority discard threshold parameter, ensuring that high-priority traffic of key services or traffic that requires specific QoS guarantees can be forwarded quickly, in real time, and without blocking. The cloud network data traffic with low priority adopts the random early discard strategy, which can effectively trigger the sliding window speed regulation mechanism of tcp itself, effectively prevent tcp from disconnecting due to a large number of packet losses. The high-priority protocol packets do not exceed CIR (1M bit). When the total traffic exceeds 3 times CIR, the write packets are not lost, and the tcp connection of the 100M large packet in the FTP (File Transfer Protocol) transmission can remain uninterrupted.
[0074] In this embodiment, a device for limiting the speed of cloud network data traffic is also provided. This device is used to implement the above embodiment and preferred implementation manners, and those that have been described will not be repeated here. As used below, the term "module" can be a combination of software and / or hardware that can achieve a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.
[0075] This embodiment provides a device for limiting the speed of cloud network data traffic, as Figure 5 shown, including:
[0076] A configuration module 501, configured to configure a random discard start threshold parameter and a priority discard threshold parameter; the random discard start threshold parameter is greater than the priority discard threshold parameter;
[0077] The speed limit module 502 is used to obtain the number of tokens in the single-bucket single-rate CAR token bucket. When the cloud network data traffic reaches the single-bucket single-rate CAR token bucket, the number of tokens is compared with the random discard start threshold parameter and the priority discard threshold parameter respectively, and the cloud network data traffic is speed-limited based on the comparison results.
[0078] In some alternative embodiments, the speed limit module 502 includes:
[0079] The first judgment unit is used to output the cloud network data traffic if the number of tokens is greater than the random discard start threshold parameter;
[0080] The second judgment unit is used to, if the number of tokens is less than the random discard start threshold parameter and the number of tokens is greater than the priority discard threshold parameter, obtain the priority of the cloud network data traffic, perform packet discarding processing on the cloud network data traffic with low priority according to the discard probability, and output the cloud network data traffic with high priority;
[0081] The third judgment unit is used to, if the number of tokens is less than the priority discard threshold parameter, discard the cloud network data traffic with low priority, and judge whether the number of tokens meets the cloud network data traffic with high priority, and output the cloud network data traffic with high priority based on the judgment result.
[0082] In some alternative embodiments, the first judgment unit is specifically used to, if the number of tokens is greater than the random discard start threshold parameter, obtain the number of occupied tokens of the cloud network data traffic, subtract the number of occupied tokens of the cloud network data traffic from the number of tokens, and output the cloud network data traffic.
[0083] In some alternative embodiments, the second judgment unit includes:
[0084] The selection subunit is used to select a random value within the parameter interval corresponding to the random discard start threshold parameter and the priority discard threshold parameter if the number of tokens is less than the random discard start threshold parameter and the number of tokens is greater than the priority discard threshold parameter;
[0085] The first discard subunit is used to compare the number of tokens with the random value, and if the number of tokens is less than the random value, discard the cloud network data traffic with low priority and output the cloud network data traffic with high priority.
[0086] In some alternative embodiments, the second judgment unit further includes:
[0087] The output subunit is used to output the cloud network data traffic if the number of tokens corresponding to the cloud network data traffic with low priority is greater than or equal to the random value.
[0088] In some alternative embodiments, the third judgment unit includes:
[0089] An obtaining subunit, configured to obtain the number of occupied tokens of high-priority cloud network data traffic if the number of tokens is less than a priority discard threshold parameter;
[0090] A second discard subunit, configured to compare the number of tokens with the number of occupied tokens, and if the number of tokens is greater than the number of occupied tokens, output high-priority cloud network data traffic and discard low-priority cloud network data traffic.
[0091] The further function descriptions of the above-mentioned various modules and units are the same as those in the corresponding foregoing embodiments, and will not be elaborated herein.
[0092] The device for limiting the speed of cloud network data traffic in this embodiment is presented in the form of functional units. Here, the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and a memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.
[0093] An embodiment of the present invention further provides a computer device having the above-mentioned Figure 5 device for limiting the speed of cloud network data traffic as shown.
[0094] Please refer to Figure 6 , Figure 6 which is a schematic structural diagram of a computer device provided by an optional embodiment of the present invention. As shown in Figure 6 , the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including a high-speed interface and a low-speed interface. Each component communicates with each other using different buses and can be installed on a common motherboard or installed in other ways as needed. The processor can process instructions executed within the computer device, including instructions stored in the memory or on the memory to display graphical information of a GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a set of blade servers, or a multi-processor system). Figure 6 In
[0095] The processor 10 may be a central processing unit, a network processor, or a combination thereof. Among them, the processor 10 may further include a hardware chip. The above-mentioned hardware chip may be an application-specific integrated circuit, a programmable logic device, or a combination thereof. The above-mentioned programmable logic device may be a complex programmable logic device, a field programmable gate array, a generic array logic, or any combination thereof.
[0096] Among them, the memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiments.
[0097] The memory 20 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system and application programs required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may further include a non-transitory memory, such as at least one disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some alternative embodiments, the memory 20 may optionally include a memory remotely provided with respect to the processor 10, and these remote memories may be connected to the computer device through a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.
[0098] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk, or a solid-state drive; the memory 20 may further include a combination of the above types of memories.
[0099] The computer device further includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30, and the output device 40 may be connected through a bus or other means. Figure 6 Taking connection through a bus as an example.
[0100] The input device 30 can receive input digital or character information, and generate key signal inputs related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a trackpad, a touchpad, a pointing stick, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (for example, an LED), and a tactile feedback device (for example, a vibration motor), etc. The above-mentioned display device includes, but is not limited to, a liquid crystal display, a light-emitting diode, a display, and a plasma display. In some alternative embodiments, the display device may be a touch screen.
[0101] Embodiments of the present invention also provide a computer-readable storage medium. The method according to the embodiments of the present invention can be implemented in hardware, firmware, or be implemented as computer code that can be recorded on a storage medium, or be implemented as computer code that is originally stored in a remote storage medium or a non-transitory machine-readable storage medium and downloaded through a network and will be stored in a local storage medium, so that the method described herein can be stored as such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk, or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by the computer, the processor, or the hardware, the method shown in the above embodiments is implemented.
[0102] A part of the present invention can be applied as a computer program product, for example, computer program instructions. When executed by a computer, through the operation of the computer, the methods and / or technical solutions according to the present invention can be called or provided. Those skilled in the art should be able to understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executes the instructions, or the computer compiles the instructions and then executes the corresponding compiled program, or the computer reads and executes the instructions, or the computer reads and installs the instructions and then executes the corresponding installed program. Herein, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to the computer.
[0103] Although the embodiments of the present invention are described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A method for limiting the speed of cloud network data traffic, characterized in that: The method comprises: Configure a random discard start threshold parameter and a priority discard threshold parameter; the random discard start threshold parameter is greater than the priority discard threshold parameter; Obtain the number of tokens in the single-bucket single-rate CAR token bucket. When the cloud network data traffic reaches the single-bucket single-rate CAR token bucket, compare the number of tokens with the random discard start threshold parameter and the priority discard threshold parameter, respectively, and limit the cloud network data traffic based on the comparison result.
2. The method according to claim 1, characterized in that When the cloud network data traffic reaches the token bucket, the number of tokens is compared with the random discard start threshold parameter and the priority discard threshold parameter, and the cloud network data traffic is speed-limited based on the comparison result, including: If the number of tokens is greater than the random discard start threshold parameter, outputting the cloud network data traffic; Alternatively, if the number of tokens is less than the random discard start threshold parameter, and the number of tokens is greater than the priority discard threshold parameter, the priority of the cloud network data traffic is obtained, low-priority cloud network data traffic is subjected to packet discard processing according to the discard probability, and high-priority cloud network data traffic is output; Alternatively, if the number of tokens is less than the priority discard threshold parameter, the low-priority cloud network data traffic is discarded, and it is determined whether the number of tokens meets the high-priority cloud network data traffic, and the high-priority cloud network data traffic is output based on the determination result.
3. The method according to claim 2, characterized in that If the number of tokens is greater than the random discard start threshold parameter, outputting the cloud network data traffic includes: If the number of tokens is greater than the random discard start threshold parameter, the number of occupied tokens of the cloud network data traffic is obtained, the number of occupied tokens of the cloud network data traffic is subtracted from the number of tokens, and the cloud network data traffic is output.
4. The method according to claim 2, characterized in that: If the number of tokens is less than the random discard start threshold parameter, and the number of tokens is greater than the priority discard threshold parameter, the priority of the cloud network data traffic is obtained, low-priority cloud network data traffic is subjected to packet loss processing according to the discard probability, and high-priority cloud network data traffic is output, including: If the number of tokens is less than the random discard start threshold parameter, and the number of tokens is greater than the priority discard threshold parameter, a random value is selected within the parameter interval corresponding to the random discard start threshold parameter and the priority discard threshold parameter; The number of tokens is compared with the random value. If the number of tokens is less than the random value, the low-priority cloud network data traffic is discarded and the high-priority cloud network data traffic is output.
5. The method according to claim 4, characterized in that If the number of tokens is less than the random discard start threshold parameter, and the number of tokens is greater than the priority discard threshold parameter, the priority of the cloud network data traffic is obtained, low-priority cloud network data traffic is subjected to packet loss processing according to the discard probability, and high-priority cloud network data traffic is output, further comprising: If the number of tokens corresponding to the low-priority cloud network data traffic is greater than or equal to the random value, the cloud network data traffic is output.
6. The method according to claim 2, characterized in that If the number of tokens is less than the priority discard threshold parameter, discarding low-priority cloud network data traffic, and determining whether the number of tokens meets the high-priority cloud network data traffic, and outputting high-priority cloud network data traffic based on the determination result, including: If the number of tokens is less than the priority discard threshold parameter, the number of occupied tokens of the high-priority cloud network data traffic is obtained; The number of tokens is compared with the number of occupied tokens. If the number of tokens is greater than the number of occupied tokens, the high-priority cloud network data traffic is output and the low-priority cloud network data traffic is discarded.
7. A device for limiting the speed of cloud network data traffic, characterized in that: The device comprises: A configuration module, used to configure a random discard start threshold parameter and a priority discard threshold parameter; the random discard start threshold parameter is greater than the priority discard threshold parameter; The speed limiting module is used to obtain the number of tokens in the single-bucket single-rate CAR token bucket. When the cloud network data traffic reaches the single-bucket single-rate CAR token bucket, the number of tokens is compared with the random discard start threshold parameter and the priority discard threshold parameter respectively, and the cloud network data traffic is speed-limited based on the comparison result.
8. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method for limiting the speed of cloud network data traffic according to any one of claims 1 to 6 by executing the computer instructions.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method for limiting the speed of cloud network data traffic according to any one of claims 1 to 6.
10. A computer program product, characterized in that The method comprises computer instructions for causing a computer to execute the method for limiting the speed of cloud network data traffic according to any one of claims 1 to 6.
Citation Information
Cited By
Token distribution method and device based on traffic prediction, equipment and storage medium
CN120835037A