An adaptive multi-dimensional flow rate limiting method, device, equipment and medium

Through the adaptive multi-dimensional traffic speed limiting method, the retention rate is used to adjust the speed limiting intensity, which solves the problems of service module overload and traffic oscillation after user traffic exceeds the limit, and achieves smooth adjustment of traffic and rapid recovery of service capabilities.

CN115914124BActive Publication Date: 2024-10-22BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211584498.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-09
Publication Date
2024-10-22
Estimated Expiration
2042-12-09

AI Technical Summary

Technical Problem

The existing technology causes service module overload and traffic oscillation after user traffic exceeds the limit, affecting user experience and failing to respond to requests in a timely manner.

Method used

Adopt an adaptive multi-dimensional traffic rate limiting method, and use the rate limiting module to limit the rate of requests of specified dimensions according to the retention rate, and adjust the retention rate within the preset time period to punish or restore the rate limiting intensity to avoid traffic fluctuations and Protection service module.

Benefits of technology

It effectively avoids traffic shock, protects the service module, ensures timely response to user requests, and gradually restores service capabilities after the speed limit ends.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115914124B_ABST
    Figure CN115914124B_ABST
Patent Text Reader

Abstract

The present disclosure provides an adaptive multi-dimensional traffic speed limiting method, device, equipment and medium, which relates to the field of artificial intelligence, especially to the fields of cloud computing, cloud storage and cloud database, and can be applied to intelligent cloud scenarios. The specific implementation scheme is: when the request volume of a specified dimension triggers the speed limit, the request of the specified dimension is speed-limited according to the retention rate, and the retention rate is the ratio between the number of requests that do not need to be delayed and the total number of requests currently to be processed; every first preset time, the retention rate is reduced by the retention rate penalty value; if the speed limit is not triggered again within the second preset time, the retention rate is increased by the recovery value every first preset time until the retention rate is restored to 100% or the speed limit is not triggered again within the third preset time, then the speed limit processing of the specified dimension is stopped. Smooth speed limiting can be achieved to avoid traffic oscillation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to the field of cloud computing, cloud storage and cloud database technology, and can be applied in intelligent cloud scenarios. Background Art

[0002] For systems with user traffic, in order to protect the service module, when the traffic received from a certain user exceeds a preset limit, the traffic of the user can be delayed to prevent the service module from being overloaded. Summary of the invention

[0003] The present invention provides an adaptive multi-dimensional flow rate limiting method, device, equipment and medium.

[0004] According to one aspect of the present disclosure, an adaptive multi-dimensional traffic speed limiting method is provided, comprising:

[0005] When the number of requests in a specified dimension triggers the speed limit, the requests in the specified dimension are speed-limited according to the retention rate, where the retention rate is the ratio between the number of requests that do not need to be delayed and the total number of requests currently to be processed;

[0006] Every first preset time period, reducing the retention rate by a retention rate penalty value;

[0007] If the speed limit is not triggered again within the second preset time period, the retention rate will be increased by the recovery value every first preset time period until the retention rate is restored to 100% or the speed limit is not triggered again within the third preset time period, then the speed limit processing for the specified dimension will be stopped; the first preset time period is less than the second preset time period, and the second preset time period is less than the third preset time period.

[0008] According to a second aspect of the present disclosure, there is provided an adaptive multi-dimensional flow rate limiting device, comprising:

[0009] A rate limiting module, for performing rate limiting processing on requests of a specified dimension according to a retention rate when the request volume of the specified dimension triggers the rate limiting, wherein the retention rate is the ratio between the request volume that does not need to be delayed and the total request volume that is currently to be processed;

[0010] A penalty module, configured to reduce the retention rate by a retention rate penalty value every first preset time period;

[0011] A recovery module is used to increase the retention rate by a recovery value every first preset time period until the retention rate is restored to 100% or the speed limit is not triggered again within a third preset time period if the speed limit is not triggered again within a second preset time period, thereby triggering the speed limit module to stop the speed limit processing for the specified dimension; the first preset time period is less than the second preset time period, and the second preset time period is less than the third preset time period.

[0012] According to a third aspect of the present disclosure, there is provided an electronic device, including:

[0013] at least one processor; and

[0014] a memory communicatively connected to the at least one processor; wherein,

[0015] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method described in the first aspect.

[0016] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to execute the method described in the first aspect.

[0017] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein the computer program implements the method described in the first aspect when executed by a processor.

[0018] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0020] Figure 1 It is a flow chart of an adaptive multi-dimensional flow rate limiting method provided by an embodiment of the present disclosure;

[0021] Figure 2 is an exemplary schematic diagram of traffic delay processing provided by an embodiment of the present disclosure;

[0022] Figure 3 is an exemplary schematic diagram of a flow rate limiting effect of an adaptive multi-dimensional flow rate limiting method according to an embodiment of the present disclosure;

[0023] Figure 4It is a schematic diagram of the structure of an adaptive multi-dimensional flow rate limiting device provided by an embodiment of the present disclosure;

[0024] Figure 5 It is a block diagram of an electronic device used to implement an adaptive multi-dimensional traffic speed limiting method according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0025] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0026] Currently, when the traffic of a certain user exceeds a certain limit, all the traffic of the user can be delayed for a period of time before processing. After the delayed time is reached, the speed limit will most likely be triggered again. This will cause traffic fluctuations, which will put the service module at risk of overloading and make it impossible for the user's request to be responded to in a timely manner, affecting the user experience.

[0027] In order to better limit the flow rate, the embodiment of the present disclosure provides an adaptive multi-dimensional flow rate limiting method, which can be executed by a rate limiter, wherein the rate limiter can be deployed in a server to limit the flow rate of users accessing the server. Or in a distributed service cluster, the rate limiter can be connected to multiple service modules providing the same service to limit the flow rate of users accessing the service.

[0028] like Figure 1 As shown, the method includes:

[0029] S101. When the request volume of a specified dimension triggers a speed limit, the request volume of the specified dimension is speed-limited according to a retention rate, where the retention rate is the ratio between the request volume that does not need to be delayed and the total request volume currently to be processed.

[0030] The specified dimension may be a user dimension, a user's query per second (QPS) dimension, and / or a user's access bandwidth dimension, etc., which is not limited in the embodiments of the present disclosure. The condition for triggering the speed limit by the request volume of the specified dimension may be set based on the actual processing capacity of the service module.

[0031] As an example, if the reserved rate (reservedRate) is 70%, then it is necessary to directly process 70% of the requests in the specified dimension and delay the processing of the remaining 30% of the requests.

[0032] The delay duration can be a random value between the preset minimum delay value and the maximum delay value, such as Figure 2 As shown, Figure 2 The horizontal axis shown represents time. When the request volume of the specified dimension triggers the speed limit, see the upward arrow, some requests are processed directly without delay; see the three arc arrows to the right, the remaining requests are delayed, and the delay duration is a random value within the delay gap (delayGap) between the minimum delay value (delayMin) and the maximum delay value (delayMax). Figure 2 The three curved arrows in the figure are used to indicate that the delay time of each request can be different. In actual implementation, it is not limited to Figure 2 The three curved arrows indicate the three delay time lengths.

[0033] It should be noted that the request amount in the embodiment of the present disclosure refers to the number of requests that need to be speed-limited, or the amount of resources requested by the requests that need to be speed-limited, and the request amount may also be referred to as traffic.

[0034] S102: every first preset time period, reduce the retention rate by a retention rate penalty value.

[0035] The first preset duration may be in milliseconds. The initial value of the reserved rate and the initial value of the reserved rate penalty (reservedRatePunish) are pre-set values.

[0036] As an example, the first preset duration can be 500ms, the initial value of the retention rate can be 70%, and the retention rate penalty value can be 5%. Then the retention rate starts from 70% and decreases by 5% every 500ms. That is to say, within 500ms after the speed limit is triggered, the speed limit is processed for the request of the specified dimension according to the retention rate of 70%, and the speed limit is processed for the request of the specified dimension according to the retention rate of 65% in the next 500ms, and then the speed limit is processed for the request of the specified dimension according to the retention rate of 5% in the next 500ms, and so on.

[0037] S103. If the speed limit is not triggered again within the second preset time period, the retention rate is increased by the recovery value every first preset time period until the retention rate is restored to 100% or the speed limit is not triggered again within the third preset time period, then the speed limit processing for the specified dimension is stopped.

[0038] The first preset time length is shorter than the second preset time length, and the second preset time length is shorter than the third preset time length.

[0039] The first preset time length and the second preset time length may both be in the order of seconds. For example, the first preset time length may be 3 seconds, and the second preset time length may be 60 seconds.

[0040] It is understandable that since new requests will continue to be received and delayed requests still need to be processed after reaching the delay time, the speed limiter needs to determine in real time whether the request volume of the specified dimension triggers the speed limit again. It should be noted that each time the speed limit is determined, the total request volume of the currently received new requests and the current requests that have reached the delay time must be considered for judgment. If the current total request volume meets the speed limit condition, the speed limit is triggered.

[0041] Among them, the rate limiter can be implemented in the form of a token bucket.

[0042] If the speed limit is not triggered again for 3 seconds, the retention rate can be gradually increased to gradually cancel the speed limit. The recovery value is less than the retention rate penalty value. For example, the recovery value (recoverRate) can be 1%, that is, based on the current retention rate, the retention rate is increased by 1% every 500ms.

[0043] By adopting this method, when the request volume of a specified dimension triggers the speed limit, the request volume of the specified dimension can be speed-limited according to the retention rate, that is, a portion of the requests are processed normally according to the retention rate, and the other portion of the requests are processed with a delay, and the proportion of the requests processed normally can be reduced at intervals of the first preset time, which can avoid the instantaneous speed limit being too strong. And if the limit is not triggered again within the second preset time, the retention rate can be gradually increased to smoothly resume the processing of the request volume of the specified dimension. In this way, the traffic oscillation caused by excessive speed limit can be avoided, and the speed limit can be smoothly adjusted, so that the normal service capacity can be restored as soon as possible while protecting the service module.

[0044] In some embodiments of the present disclosure, the condition for the request volume of the specified dimension to trigger the speed limit is: the request volume parameter of the specified dimension reaches the speed limit threshold, and the request volume parameter is used to characterize the request volume of the specified dimension.

[0045] For example, if the specified dimension is the user dimension, the request quantity parameter may be QPS; if the specified dimension is the cache space dimension requested by the user, the request quantity parameter may be the cache space size requested by the user; for another example, if the specified dimension is the user's access bandwidth dimension, the request quantity parameter may be the user's access bandwidth. Of course, the specified dimension may also be set based on actual needs, and is not limited to the three dimensions listed above.

[0046] When the request volume of a specified dimension triggers the rate limit, the rate limit threshold may be increased by a preset threshold before the rate limit processing is performed on the requests of the specified dimension according to the retention rate.

[0047] The initial value of the speed limit threshold may be smaller than the maximum processing capacity of the service module. Taking the request volume parameter as QPS as an example, assuming that the maximum QPS that the service module can support for a single user is 2000, the speed limit threshold may be set to 1500.

[0048] In addition, after the speed limit threshold is increased by the preset threshold, it cannot exceed the maximum processing capacity of the service module. For example, the speed limit threshold can be increased from 1500 to 2000.

[0049] Furthermore, after the speed limit processing for the specified dimension is stopped, the speed limit threshold may be restored to the initial value of the speed limit threshold, that is, in the above example, the speed limit threshold may be restored to 1500 again.

[0050] By adopting the disclosed embodiment, when starting to limit the speed, the speed limit threshold is increased by the preset threshold, which can avoid frequently triggering new speed limits during the speed limit processing process, can increase the speed of the service module in processing traffic, and improve the ability to cope with sudden traffic. It not only protects the service module in the face of high traffic, but also enables the service module to gradually process traffic according to the maximum processing capacity within the allowed range, and can recover to the state of no speed limit more quickly. After stopping the speed limit, the speed limit threshold can also be restored to the initial value to avoid overloading the service module.

[0051] In some embodiments of the present disclosure, a processing method after the speed limit is triggered again in the speed limit stage is also provided. Specifically, after the speed limit processing is performed on the request of the specified dimension according to the retention rate, the method further includes:

[0052] If the speed limit is triggered again within the fourth preset time, or the speed limit is triggered again in the process of increasing the retention rate by the recovery value every first preset time, the retention rate is reduced according to the first preset ratio, and the recovery value is reduced by the second preset ratio. The first preset ratio is greater than the retention rate penalty value, and the fourth preset time is between the first preset time and the second preset time. As an example, the fourth preset time may be 1 second.

[0053] That is to say, there are two scenarios in which speed limit penalties are required in the embodiments of the present disclosure.

[0054] Scenario 1 is: after determining that the request volume of a specified dimension needs to be speed-limited, the request volume of the specified dimension triggers speed limiting again within a fourth preset time period.

[0055] Scenario 2 is: if the speed limit is not triggered again within the second preset time period, but in the process of increasing the retention rate by the recovery value every first preset time period, the request volume of the specified dimension triggers the speed limit again.

[0056] The penalty measures corresponding to the above two scenarios are to reduce the retention rate according to the first preset ratio and reduce the recovery value according to the second preset ratio.

[0057] For example, the retention rate may be reduced by 20% from the current value, and the recovery value may be reduced by 0.4% from the current value, or both the current retention rate and the current recovery value may be halved.

[0058] In this way, when the speed limit is triggered again, it means that a lot of traffic has arrived in a short period of time. By increasing the speed limit, we can avoid frequent triggering of the speed limit and causing traffic fluctuations. By reducing the retention rate, the number of requests that are delayed can be increased, reducing the current processing pressure of the service module, and by reducing the recovery value, the subsequent retention rate can be increased more slowly, that is, the speed limit can be released more smoothly. Under the premise of protecting the service module, the service module can gradually process the delayed requests and achieve the effect of smooth speed limit.

[0059] It should be noted that after the request of the specified dimension is limited according to the retention rate, the method further includes: if the speed limit is triggered again within the fifth preset time, ignoring the re-triggered speed limit, and the fifth preset time is less than the fourth preset time. As an example, the fifth preset time may be 500ms.

[0060] That is, if the time interval between two speed limit triggerings is less than the fifth preset time length, the most recently triggered speed limit is ignored, that is, the penalty measures introduced in the above embodiment are not executed, which can prevent excessive speed limit due to traffic jitter.

[0061] It should also be noted that the minimum value of the reserved rate in the embodiments of the present disclosure is the reserved rate lower limit value (reservedRateMin). In any of the above embodiments, if the reduced reserved rate is less than or equal to the reserved rate lower limit value, the reserved rate is adjusted to the reserved rate lower limit value and the reserved rate is no longer reduced. This can avoid excessive speed limit, thereby avoiding the situation where the user's request is not responded to for a long time.

[0062] As an example, the initial value of the lower limit of the retention rate may be 20%.

[0063] In some embodiments of the present disclosure, after rate limiting the requests of the specified dimension according to the retention rate, the method further includes:

[0064] If the speed limit is triggered again within the fourth preset time period, or if the speed limit is triggered again during the process of increasing the retention rate by the restoration value every first preset time period, the lower limit value of the retention rate will be reduced by the third preset proportion.

[0065] That is to say, in the two scenarios where speed limit penalty is required in the above embodiments, the penalty measure also includes reducing the lower limit value of the retention rate by a third preset ratio.

[0066] For example, the third preset ratio may be 5%, and assuming that the current lower limit of the retention rate is 20%, the lower limit of the retention rate may be reduced to 15%. Furthermore, in the subsequent process of reducing the retention rate by the retention rate penalty value every first preset time, the minimum retention rate may be reduced to 15%, and if the above two scenarios occur again, when the retention rate is reduced again according to the first preset ratio, the minimum retention rate may also be reduced to 15%.

[0067] By using this method, when the speed limit is repeatedly triggered, it indicates that there is a continuous high traffic situation. By lowering the lower limit of the retention rate, the subsequent speed limit can be made stronger, preventing the service module from being overloaded and improving the protection capability of the service module.

[0068] Based on the above embodiment, after stopping the speed limit processing for the specified dimension, it is necessary to adjust the retention rate to the initial value of the retention rate, adjust the recovery value to the initial value of the recovery value, and adjust the lower limit of the retention rate to the initial value of the lower limit of the retention rate.

[0069] It should be noted that the initial value of the retention rate, the initial value of the recovery value, and the initial value of the lower limit of the retention rate are all preset values.

[0070] After stopping the speed limit processing for the specified dimension, it means that the processing of the burst traffic has been successfully completed. Then, the parameters adjusted in the above speed limit process can be restored to the initial values, so that the next time the speed limit processing is performed on the specified dimension, the initial values ​​of each parameter can be used for smooth speed limit to avoid excessive or insufficient speed limit.

[0071] like Figure 3 As shown, Figure 3 is an exemplary schematic diagram of a flow rate limiting effect of an adaptive multi-dimensional flow rate limiting method according to an embodiment of the present disclosure, Figure 3 The horizontal axis is time, and the vertical axis is the query rate per second.

[0072] At the 17th second, the user traffic suddenly increased, triggering the speed limit on the user traffic. The traffic surge at around the 17th second was at the millisecond level. Figure 3 The horizontal axis of is in seconds, so Figure 3 The effect of a large increase in flow is not shown.

[0073] After a sudden increase in traffic, see Figure 3 After limiting the speed of user traffic, the speed limit was gradually reduced until it was stopped. 30 seconds ago, there was another sudden increase in traffic, which triggered the speed limit. Figure 3It can be seen that after each peak, the speed will be limited according to the retention rate instead of directly limiting all traffic. After each trough, user traffic increases slowly and does not instantly return to the state before the speed limit, thus avoiding the problem of traffic fluctuations.

[0074] Based on the same concept, the embodiment of the present disclosure provides an adaptive multi-dimensional flow rate limiting device, such as Figure 4 As shown, including:

[0075] The rate limiting module 401 is used to perform rate limiting processing on the requests of the specified dimension according to the retention rate when the request volume of the specified dimension triggers the rate limiting. The retention rate is the ratio between the request volume that does not need to be delayed and the total request volume currently to be processed.

[0076] The penalty module 402 is configured to reduce the retention rate by a retention rate penalty value every first preset time period.

[0077] The recovery module 403 is used to increase the retention rate by the recovery value every first preset time period until the retention rate is restored to 100% or the speed limit is not triggered again within a third preset time period if the speed limit is not triggered again within the second preset time period, then the speed limit module 401 is triggered to stop the speed limit processing for the specified dimension; the first preset time period is less than the second preset time period, and the second preset time period is less than the third preset time period.

[0078] Optionally, the speed limiting module 401 is further used for:

[0079] If the speed limit is triggered again within the fourth preset time period, or if the speed limit is triggered again while increasing the retention rate by the recovery value every the first preset time period, the retention rate will be reduced by the first preset ratio, and the recovery value will be reduced by the second preset ratio.

[0080] The first preset ratio is greater than the retention rate penalty value, and the fourth preset duration is between the first preset duration and the second preset duration.

[0081] Optionally, the minimum value of the retention rate is the retention rate lower limit.

[0082] Optionally, the speed limiting module 401 is further used for:

[0083] If the speed limit is triggered again within the fourth preset time period, or if the speed limit is triggered again during the process of increasing the retention rate by the restoration value every first preset time period, the lower limit value of the retention rate is reduced by the third preset proportion.

[0084] Optionally, the speed limiting module 401 is further used for:

[0085] If the speed limit is triggered again within the fifth preset time period, the re-triggered speed limit is ignored, and the fifth preset time period is less than the fourth preset time period.

[0086] Optionally, the recovery module 403 is further used to:

[0087] The retention rate is adjusted to the initial value of the retention rate, the recovery value is adjusted to the initial value of the recovery value, and the retention rate floor value is adjusted to the initial value of the retention rate floor value.

[0088] Optionally, the condition for triggering the speed limit on the request volume of the specified dimension is that the request volume parameter of the specified dimension reaches the speed limit threshold, and the request volume parameter is used to characterize the request volume of the specified dimension;

[0089] The rate limiting module 401 is further configured to increase the rate limiting threshold by a preset threshold before performing rate limiting processing on requests of a specified dimension according to the retention rate.

[0090] The recovery module 403 is further used to restore the speed limit threshold to the initial value of the speed limit threshold after stopping the speed limit processing for the specified dimension.

[0091] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0092] It should be noted that the request in this embodiment is not a request for a specific user and cannot reflect the personal information of a specific user.

[0093] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0094] Figure 5 A schematic block diagram of an example electronic device 500 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0095] like Figure 5As shown, the device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 502 or a computer program loaded from a storage unit 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the device 500 can also be stored. The computing unit 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0096] A number of components in the device 500 are connected to the I / O interface 505, including: an input unit 506, such as a keyboard, a mouse, etc.; an output unit 507, such as various types of displays, speakers, etc.; a storage unit 508, such as a disk, an optical disk, etc.; and a communication unit 509, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 509 allows the device 500 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0097] The computing unit 501 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 501 performs the various methods and processes described above, such as an adaptive multi-dimensional traffic speed limiting method. For example, in some embodiments, an adaptive multi-dimensional traffic speed limiting method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 508. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 500 via the ROM 502 and / or the communication unit 509. When the computer program is loaded into the RAM 503 and executed by the computing unit 501, one or more steps of an adaptive multi-dimensional traffic speed limiting method described above may be executed. Alternatively, in other embodiments, the computing unit 501 may be configured to execute an adaptive multi-dimensional traffic speed limiting method in any other appropriate manner (for example, by means of firmware).

[0098] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0099] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0100] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0101] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0102] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0103] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.

[0104] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0105] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. An adaptive multi-dimensional traffic speed limiting method, comprising: When the number of requests in a specified dimension triggers the speed limit, the requests in the specified dimension are speed-limited according to the retention rate, where the retention rate is the ratio between the number of requests that do not need to be delayed and the total number of requests currently to be processed; Every first preset time period, reducing the retention rate by a retention rate penalty value; If the speed limit is not triggered again within the second preset time period, the retention rate will be increased by the recovery value every first preset time period until the retention rate is restored to 100% or the speed limit is not triggered again within the third preset time period, then the speed limit processing for the specified dimension will be stopped; the first preset time period is less than the second preset time period, and the second preset time period is less than the third preset time period.

2. The method according to claim 1, after the request of the specified dimension is rate-limited according to the retention rate, the method further comprises: If the speed limit is triggered again within the fourth preset time period, or if the speed limit is triggered again during the process of increasing the retention rate by the recovery value every the first preset time period, the retention rate is reduced according to the first preset ratio, and the recovery value is reduced by the second preset ratio; The first preset ratio is greater than the retention rate penalty value, and the fourth preset duration is between the first preset duration and the second preset duration.

3. The method according to claim 2, wherein: The minimum value of the retention rate is the lower limit of the retention rate.

4. The method according to claim 3, after the request of the specified dimension is rate-limited according to the retention rate, the method further comprises: If the speed limit is triggered again within the fourth preset time period, or if the speed limit is triggered again during the process of increasing the retention rate by the restoration value every first preset time period, the lower limit value of the retention rate is reduced by a third preset proportion.

5. The method according to claim 2, after the request of the specified dimension is rate-limited according to the retention rate, the method further comprises: If the speed limit is triggered again within a fifth preset time period, the retriggered speed limit is ignored, and the fifth preset time period is less than the fourth preset time period.

6. The method according to claim 4, after stopping the speed limit processing for the specified dimension, the method further comprises: The retention rate is adjusted to the initial value of the retention rate, the recovery value is adjusted to the initial value of the recovery value, and the retention rate lower limit value is adjusted to the initial value of the retention rate lower limit value.

7. The method according to claim 1, wherein: The condition for triggering the speed limit on the request volume of the specified dimension is that the request volume parameter of the specified dimension reaches the speed limit threshold, and the request volume parameter is used to characterize the request volume of the specified dimension; Before the rate limiting processing is performed on the request of the specified dimension according to the retention rate, the method further includes: Increasing the speed limit threshold by a preset threshold; After stopping the speed limit processing on the specified dimension, the method further includes: The speed limit threshold is restored to the initial value of the speed limit threshold.

8. An adaptive multi-dimensional flow rate limiting device, comprising: A rate limiting module, for performing rate limiting processing on requests of a specified dimension according to a retention rate when the rate limiting is triggered by the number of requests of the specified dimension, wherein the retention rate is the ratio between the number of requests that do not need to be processed delayed and the total number of requests currently to be processed; A penalty module, configured to reduce the retention rate by a retention rate penalty value every first preset time period; A recovery module is used to increase the retention rate by a recovery value every first preset time period until the retention rate is restored to 100% or the speed limit is not triggered again within a third preset time period if the speed limit is not triggered again within a second preset time period, thereby triggering the speed limit module to stop the speed limit processing for the specified dimension; the first preset time period is less than the second preset time period, and the second preset time period is less than the third preset time period.

9. The device according to claim 8, wherein the speed limiting module is further used for: If the speed limit is triggered again within the fourth preset time period, or if the speed limit is triggered again during the process of increasing the retention rate by the recovery value every the first preset time period, the retention rate is reduced according to the first preset ratio, and the recovery value is reduced by the second preset ratio; in, The first preset ratio is greater than the retention rate penalty value, and the fourth preset duration is between the first preset duration and the second preset duration.

10. The device according to claim 9, wherein: The minimum value of the retention rate is the lower limit of the retention rate.

11. The device according to claim 10, wherein the speed limiting module is further used for: If the speed limit is triggered again within the fourth preset time period, or if the speed limit is triggered again during the process of increasing the retention rate by the restoration value every first preset time period, the lower limit value of the retention rate is reduced by a third preset proportion.

12. The device according to claim 9, wherein the speed limiting module is further configured to: If the speed limit is triggered again within a fifth preset time period, the retriggered speed limit is ignored, and the fifth preset time period is less than the fourth preset time period.

13. The device according to claim 11, wherein the recovery module is further configured to: The retention rate is adjusted to the initial value of the retention rate, the recovery value is adjusted to the initial value of the recovery value, and the retention rate lower limit value is adjusted to the initial value of the retention rate lower limit value.

14. The device according to claim 8, wherein: The condition for triggering the speed limit on the request volume of the specified dimension is that the request volume parameter of the specified dimension reaches the speed limit threshold, and the request volume parameter is used to characterize the request volume of the specified dimension; The rate limiting module is further configured to increase the rate limiting threshold by a preset threshold before performing rate limiting processing on the request of the specified dimension according to the retention rate; The recovery module is further configured to restore the speed limit threshold to the initial value of the speed limit threshold after stopping the speed limit processing on the specified dimension.

15. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 7.

16. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-7.

17. A computer program product, comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 7.