WO2021114829A1 - 基于令牌桶的接口限流方法、装置、系统及可读存储介质 - Google Patents

基于令牌桶的接口限流方法、装置、系统及可读存储介质 Download PDF

Info

Publication number
WO2021114829A1
WO2021114829A1 PCT/CN2020/118251 CN2020118251W WO2021114829A1 WO 2021114829 A1 WO2021114829 A1 WO 2021114829A1 CN 2020118251 W CN2020118251 W CN 2020118251W WO 2021114829 A1 WO2021114829 A1 WO 2021114829A1
Authority
WO
WIPO (PCT)
Prior art keywords
interface
target adjustment
server
load
surplus
Prior art date
Application number
PCT/CN2020/118251
Other languages
English (en)
French (fr)
Inventor
郑钦锋
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2021114829A1 publication Critical patent/WO2021114829A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/215Flow control; Congestion control using token-bucket
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/12Avoiding congestion; Recovering from congestion
    • H04L47/125Avoiding congestion; Recovering from congestion by balancing the load, e.g. traffic engineering

Definitions

  • This application relates to the field of artificial intelligence technology, and in particular to a token bucket-based interface current limiting method, device, system, and computer-readable storage medium.
  • the interface current limiting method is generally adopted, and the principle is generally to make the request amount of the interface within the pressure range of the server.
  • the mainstream current limiting schemes include token buckets and leaky buckets.
  • the token bucket adds tokens to the bucket at a fixed rate. Whether the request is processed depends on whether the tokens in the bucket are sufficient. When the number of tokens is reduced When it is zero, new requests are rejected; while leaky buckets flow out requests at a constant fixed rate, and the rate of incoming requests is arbitrary. When the number of incoming requests accumulates to the leaky bucket capacity, new incoming requests are rejected.
  • the inventor found that the token bucket processes requests at a fixed rate. If the server's load is surplus at this time, then the server's resources will be wasted, and if a large number of requests accumulate at this time, because there are no extra tokens in the bucket, there will be Cause the request to be rejected. This makes that even if the server load is surplus, the request will still be rejected and discarded.
  • Leaky barrels have similar flaws. Of course, there are more than these two current limiting solutions. There are also solutions based on counters and redis (Remote Dictionary Server, key-value storage system), but they also have similar flaws. It can be seen that the existing current limiting solutions are not intelligent enough to perform flexible current limiting.
  • the main purpose of this application is to provide a token bucket-based interface current limiting method, device, system, and computer-readable storage medium, aiming to improve the flexibility of current limiting and realize intelligent current limiting.
  • this application provides an interface current limiting method based on a token bucket.
  • the token bucket-based interface current limiting method includes the following steps:
  • the number of access tokens configured with the target adjustment interface is updated.
  • the present application also provides an interface current limiting device based on a token bucket, and the interface current limiting device based on a token bucket includes:
  • a judging module configured to determine whether the load of the server is surplus based on the comprehensive load index value
  • the determining module is configured to determine the target adjustment interface corresponding to the server if there is a surplus, and determine the target adjustment value of the target adjustment interface;
  • the configuration module is configured to update the number of access tokens configured with the target adjustment interface based on the target adjustment value.
  • the present application also provides an interface current limiting system based on a token bucket.
  • the interface current limiting system based on a token bucket includes a processor, a memory, and a memory that is stored on the memory and can be
  • the token bucket-based interface current limiting program executed by the processor, wherein the token bucket-based interface current limiting program is executed by the processor to implement the above-mentioned token bucket-based interface current limiting method step:
  • the number of access tokens configured with the target adjustment interface is updated.
  • the present application also provides a computer-readable storage medium with a token bucket-based interface current limiting program stored on the computer-readable storage medium, wherein the token bucket-based interface current limiting program When the program is executed by the processor, the steps of implementing the interface current limiting method based on the token bucket as described above:
  • the number of access tokens configured with the target adjustment interface is updated.
  • This application provides an interface current limiting method based on a token bucket, which monitors the performance index of a server, and calculates the comprehensive load index value of the server based on the performance index; determines the server based on the comprehensive load index value If the load is surplus, determine the target adjustment interface corresponding to the server, and determine the target adjustment value of the target adjustment interface; based on the target adjustment value, update the number of access tokens configured with the target adjustment interface .
  • this application adjusts the number of access tokens on the target adjustment interface when determining the load surplus of the server, so as to adjust the target adjustment interface to process the number of access requests that rely on the access token for access, and realize the access request
  • the flexible current limiting improves the intelligence of current limiting.
  • FIG. 1 is a schematic diagram of the hardware structure of the token bucket-based interface current limiting system involved in the solution of the embodiment of the application;
  • FIG. 2 is a schematic flowchart of the first embodiment of the interface current limiting method based on the token bucket of this application;
  • Fig. 3 is a schematic diagram of functional modules of a first embodiment of a token bucket-based interface current limiting device according to the present application.
  • the token bucket-based interface current limiting method involved in the embodiments of the present application is mainly applied to the token bucket-based interface current limiting system.
  • the token bucket-based interface current limiting system may include PCs, portable computers, mobile terminals, etc. And processing function equipment.
  • FIG. 1 is a schematic diagram of the hardware structure of the token bucket-based interface current limiting system involved in the solution of the embodiment of the present application.
  • the interface current limiting system based on the token bucket may include a processor 1001 (for example, a CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005.
  • the communication bus 1002 is used to realize the connection and communication between these components;
  • the user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard);
  • the network interface 1004 may optionally include a standard wired interface, a wireless interface (Such as WI-FI interface);
  • the memory 1005 can be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory.
  • the memory 1005 may optionally be a storage device independent of the aforementioned processor 1001.
  • FIG. 1 does not constitute a limitation on the interface current limiting system based on the token bucket, and may include more or less components than shown in the figure, or a combination of certain components, Or different component arrangements.
  • the memory 1005 as a computer-readable storage medium in FIG. 1 may include an operating system, a network communication module, and an interface current limiting program based on a token bucket.
  • the network communication module is mainly used to connect to the server and perform data communication with the server; and the processor 1001 can call the token bucket-based interface current limiting program stored in the memory 1005, and execute the The interface current limiting method of the token bucket.
  • the embodiment of the present application provides an interface current limiting method based on a token bucket.
  • FIG. 2 is a schematic flowchart of the first embodiment of the interface current limiting method based on a token bucket according to the present application.
  • the interface current limiting method based on token bucket includes the following steps:
  • Step S10 monitoring the performance index of the server, and calculating the comprehensive load index value of the server based on the performance index;
  • Step S20 Determine whether the load of the server is surplus based on the comprehensive load index value
  • Step S30 if there is a surplus, determine the target adjustment interface corresponding to the server, and determine the target adjustment value of the target adjustment interface;
  • Step S40 based on the target adjustment value, update the number of access tokens configured with the target adjustment interface.
  • the interface current limiting method based on the token bucket of this embodiment is applied to the interface current limiting system based on the token bucket.
  • the interface current limiting system based on the token bucket is referred to as the current limiting system for short.
  • the current limiting in this embodiment In the process of processing big data calls, the system exposes multiple interfaces based on artificial intelligence technology. If the external system initiates an access request to the server based on the exposed interface, the current limiting system will limit the access request based on the token bucket technology. Avoid excessive access requests that exceed the pressure capacity of the server and cause the server system to crash.
  • the token bucket solution is used to perform interface limiting based on token buckets. Flow: Assuming that bucket A (corresponding to interface A) generates 5 tokens per second, that is, interface A can only process 5 access requests per second; bucket B (corresponding to interface B) generates 10 tokens per second, that is, B The interface can only process 10 access requests per second (assuming that the two interfaces A and B consume the same server resources), and the server is fully loaded at this time.
  • the call volume of interface B is reduced to 5 requests per second, that is, interface B currently only processes 5 access requests.
  • the load of the server is reduced due to less processing of 5 access requests, that is, the server is no longer Fully loaded, but if the call volume of the A interface rises to 10 requests per second during this period, but because the A bucket can only generate 5 tokens per second, it will inevitably cause the A interface to lack 5 tokens. Discard 5 access requests. It can be seen that the server resources at this time are not optimally utilized, and the access request cannot be processed in time.
  • the corresponding target adjustment interface is determined, and the corresponding target adjustment interface is determined.
  • the target adjustment interface adjusts the number of access tokens, so that the ability of the target adjustment interface to process access requests changes with the number of access tokens, realizes flexible current limiting of access requests, and improves the intelligence of current limiting.
  • step S10 the performance index of the server is monitored, and the comprehensive load index value of the server is calculated based on the performance index.
  • the current limiting system monitors the performance indicators of the server in real time or regularly, where the performance indicators include load parameters, such as cpu, io, and the number of threads.
  • the performance indicators include load parameters, such as cpu, io, and the number of threads.
  • load parameters such as cpu, io, and the number of threads.
  • they can be implemented through an open source framework, such as Pinpoint (distributed performance monitoring Tools) and Skywalking (distributed tracking system), etc., real-time or timing co-aggregate server performance indicators.
  • the comprehensive load index value of the server is calculated. Specifically, the determined performance index of the server is substituted into the preset load formula.
  • the preset load formula can be:
  • the preset load formula can be:
  • Step S20 Determine whether the load of the server is surplus based on the comprehensive load index value.
  • the calculated comprehensive load index value is compared with the comprehensive load index value when the server is fully loaded. If the calculated comprehensive load index value is less than the comprehensive load index value when the server is fully loaded, the server load surplus is determined , That is, the server has the ability to handle other things; if the calculated comprehensive load index value is equal to the comprehensive load index value when the server is fully loaded, it is determined that the server load has no surplus, that is, the server has no ability to handle other things.
  • the comprehensive load index value when the server is fully loaded can be measured in advance through simulation.
  • step S30 if there is a surplus, the target adjustment interface corresponding to the server is determined, and the target adjustment value of the target adjustment interface is determined.
  • the target adjustment interface corresponding to the server is determined, that is, which interface needs to be adjusted.
  • the server can correspond to Among all the interfaces, randomly determine the target adjustment interface.
  • the server determines the load surplus of the server, and then determine the target adjustment value of the target adjustment interface according to the load surplus, where the load surplus refers to the percentage of the load of the server when the current server is relatively full.
  • the server The comprehensive load index value at full load subtracts the calculated comprehensive load index value, and the difference obtained is divided by the comprehensive load index value when the server is fully loaded, which is the load surplus.
  • the target adjustment value of the target adjustment interface is determined according to the load surplus and the pre-built graph of the relationship between the load surplus and the adjustment value.
  • the relationship curve between load surplus and adjustment value refers to the change curve of the adjustment value of each interface under different load surplus of the server, which can be obtained through a large number of simulation tests in advance.
  • there are two A and B. Interface when the server is fully loaded, record the access processing volume of the A interface and the B interface, and use the single variable principle to keep the A interface or the B interface unchanged in order to reduce the load of the server, for example, reduce the load of the server by 5 percentage points At this time, record the access processing volume of A interface or B interface, and subtract the access processing volume of A interface or B interface recorded twice, you can get the server load surplus of 5% ,
  • the adjustment value of the A interface or the B interface based on this principle, sequentially record the adjustment value of the corresponding interface of the server under different load surpluses, and then a graph of the relationship between the load surplus and the adjustment value can be obtained.
  • the load surplus of the current server and the determined target adjustment interface can be used to find the corresponding target adjustment value in the graph of the relationship between the load surplus and the adjustment value.
  • step S30 includes:
  • Step a1 if there is a surplus, determine the load surplus of the server, and determine the adjustment value of each interface corresponding to the server based on the load surplus and a pre-built graph of the relationship between the load surplus and the adjustment value;
  • the load surplus of the server is determined, that is, the server is capable of handling other matters
  • the load surplus of the server is determined, and then the pre-built load surplus and the adjusted value graph are used to determine the server's corresponding load surplus.
  • the adjustment value of each interface if there are currently A and B interfaces, the load surplus of the server is 5%, then the adjustment value of the A interface is determined, such as 10, that is, every 5 percentage points of the server's comprehensive load index value, the A interface can be more Process 10 access requests; the adjusted value of B interface, such as 20, means that every 5 percentage points of the server's comprehensive load index value, B interface can process 20 more access requests, etc.
  • Step a2 Determine a target adjustment interface corresponding to the server and a target adjustment value of the target adjustment interface based on the adjustment value.
  • the target adjustment interface corresponding to the server is determined according to the determined adjustment value of each interface of the server. Specifically, the interface with the largest adjustment value can be used as the target adjustment interface corresponding to the server, and then the target adjustment value of the target adjustment interface is determined. , As in the above example, the adjustment value of the A interface is 10, and the adjustment value of the B interface is 20, then the B interface is determined as the target adjustment interface, and 20 is determined as the target adjustment value.
  • the adjustment range of each interface is determined first, and then the interface with the largest adjustment range is determined as the target adjustment interface, so that the server can process more access requests and improve processing effectiveness.
  • Step S40 based on the target adjustment value, update the number of access tokens configured with the target adjustment interface.
  • the number of access tokens of the configuration target adjustment interface is updated, that is, after the target adjustment value of the target adjustment interface is determined, the number of access tokens is adjusted on the target adjustment interface, such as The original number of access tokens for the A interface is 5, that is, A can only process 5 access requests per second.
  • the target adjustment value of the A interface is 10
  • the number of access tokens for the A interface is updated The configuration is 15 so that the A interface can handle 15 access requests per second.
  • This embodiment provides an interface current limiting method based on a token bucket, which monitors the performance index of a server, and calculates the comprehensive load index value of the server based on the performance index; and determines the comprehensive load index value based on the comprehensive load index value. Whether the load of the server is surplus; if it is surplus, determine the target adjustment interface corresponding to the server, and determine the target adjustment value of the target adjustment interface; based on the target adjustment value, update the access token configured with the target adjustment interface number.
  • this application adjusts the number of access tokens on the target adjustment interface when determining the load surplus of the server, so as to adjust the target adjustment interface to process the number of access requests that rely on the access token for access, and realize the access request
  • the flexible current limiting improves the intelligence of current limiting.
  • the second embodiment of the interface current limiting method based on the token bucket of this application is proposed.
  • step S30 includes:
  • Step a3 if there is a surplus, determine the interface type of each interface corresponding to the server, and determine the target adjustment interface corresponding to the server based on the interface type;
  • Step a4 Determine the load surplus of the server, and determine the target adjustment value of the target adjustment interface based on the load surplus and a pre-built graph of the relationship between the load surplus and the adjustment value.
  • the target adjustment interface corresponding to the server is determined by the interface type, where the interface type is used to characterize the importance of the interface, that is, when the server load surplus is determined, the server resources are prioritized for processing important interfaces, and the limit is increased.
  • the interface type is used to characterize the importance of the interface, that is, when the server load surplus is determined, the server resources are prioritized for processing important interfaces, and the limit is increased.
  • Step a3 If there is a surplus, determine the interface type of each interface corresponding to the server, and determine the target adjustment interface corresponding to the server based on the interface type.
  • the interface type of each interface corresponding to the server is determined.
  • the interface type includes business interface, security interface, etc., and business interface is used for business Function call, such as the call of credit business functions of financial institutions such as banks, etc.
  • the security interface is used for the call of security functions, such as the call of system log information.
  • the priority of the security interface is greater than the priority of the business interface. Therefore, the priority is to determine the security interface as the target adjustment interface. If the A interface is a security interface and the B interface is a business interface, then the A interface is determined as the target adjustment interface. .
  • Step a4 Determine the load surplus of the server, and determine the target adjustment value of the target adjustment interface based on the load surplus and a pre-built graph of the relationship between the load surplus and the adjustment value.
  • the target adjustment interface corresponding to the server is determined, the load surplus of the server is further determined, and then according to the load surplus, in the pre-built load surplus and the adjusted value graph, the target adjustment is found.
  • the specific process of the target adjustment value of the interface is similar to the foregoing embodiment, and will not be repeated here.
  • the interface when the server load surplus is determined, the interface is adjusted according to the interface type as the determination target, regardless of the load surplus or the adjustment value of the interface, so that the interface type with a higher priority can get a faster response.
  • the target adjustment interface corresponding to the server is determined by the interface type, that is, when the server load surplus is determined, the resources of the server are preferentially used for processing important interfaces, which improves the flexibility of current limiting and realizes intelligent current limiting.
  • step S30 includes:
  • Step a5 if there is a surplus, determine the amount of access requests for each interface corresponding to the server, and determine the target adjustment interface corresponding to the server based on the amount of access requests;
  • Step a6 Determine the load surplus of the server, and determine the target adjustment value of the target adjustment interface based on the load surplus and a pre-built graph of the relationship between the load surplus and the adjustment value.
  • the target adjustment interface corresponding to the server is determined by the access request volume of each interface corresponding to the server.
  • the access request volume refers to the number of access requests initiated by the external system based on the interface, that is, the volume of calls, that is, the server is determined.
  • Step a5 If there is a surplus, determine the access request amount of each interface corresponding to the server, and determine the target adjustment interface corresponding to the server based on the access request amount.
  • the access request volume of each interface corresponding to the server is determined, and then according to the access request volume, it is determined which interface has a higher call demand.
  • the number of access requests discarded by each interface due to insufficient access tokens can also be used to determine the target adjustment interface of the server. That is, the interface with the largest number of discarded access requests indicates that the call demand of the interface is large, then Determine the interface as the target adjustment interface.
  • Step a6 Determine the load surplus of the server, and determine the target adjustment value of the target adjustment interface based on the load surplus and a pre-built graph of the relationship between the load surplus and the adjustment value.
  • the target adjustment interface corresponding to the server is determined, the load surplus of the server is further determined, and then according to the load surplus, in the pre-built load surplus and the adjusted value graph, the target adjustment is found.
  • the specific process of the target adjustment value of the interface is similar to the foregoing embodiment, and will not be repeated here.
  • the interface with greater call demand is selected as the target adjustment interface, regardless of the load surplus or the adjustment value of the interface. , So that calls to the interface with greater demand can get faster response.
  • the target adjustment interface corresponding to the server is determined by the access request amount of each interface corresponding to the server, that is, when the server load surplus is determined, the server resources are preferentially used for the processing of invoking the interface with greater demand, and the limit is increased.
  • the flexibility of the flow realizes the intelligent current limitation.
  • step S30 includes:
  • Step a7 if there is a surplus, determine the target adjustment interface corresponding to the server, where the target adjustment interface includes at least a first target adjustment interface and a second target adjustment interface;
  • Step a8 Determine the load surplus of the server, and determine the first target adjustment interface and the second target adjustment interface based on the load surplus and a pre-built graph of the relationship between the load surplus and the adjustment value The adjustment ratio;
  • Step a9 Determine a first target adjustment value of the first target adjustment interface and a second target adjustment value of the second target adjustment interface based on the load surplus, the relationship graph, and the adjustment ratio .
  • the corresponding target adjustment value is determined according to the adjustment ratio of each target adjustment interface, so that each interface is evenly adjusted, which improves the flexibility of current limiting and realizes intelligent limiting. flow.
  • Step a7 If there is a surplus, determine the target adjustment interface corresponding to the server.
  • the target adjustment interface includes at least a first target adjustment interface and a second target adjustment interface.
  • the target adjustment interface corresponding to the server is determined.
  • the specific process please refer to the above-mentioned embodiment. The process of determining the target adjustment interface will not be repeated here. .
  • the target adjustment interface in this embodiment at least includes a first target adjustment interface and a second target adjustment interface, that is, there are multiple target adjustment interfaces.
  • Step a8 Determine the load surplus of the server, and determine the first target adjustment interface and the second target adjustment interface based on the load surplus and a pre-built graph of the relationship between the load surplus and the adjustment value The adjustment ratio.
  • the load surplus of the server is further determined, and then according to the load surplus, in the pre-built load surplus and the adjusted value graph, look up The first adjustment value of the first target adjustment interface, and the second adjustment value of the second target adjustment interface, and then the first adjustment value is divided by the second adjustment value to obtain the adjustment of the first target adjustment interface and the second target adjustment interface ratio.
  • each target adjustment interface is also determined in turn, and then the adjustment values of each target adjustment interface are compared to obtain the corresponding adjustment ratio.
  • Step a9 Determine a first target adjustment value of the first target adjustment interface and a second target adjustment value of the second target adjustment interface based on the load surplus, the relationship graph, and the adjustment ratio .
  • the pre-built graph of the relationship between the load surplus and the adjustment value and the adjustment ratio of each target adjustment interface determine the target adjustment value of each target adjustment interface.
  • the load surplus of the server is 5% as an example.
  • the adjustment value of A interface in the curve diagram is 10
  • the adjustment ratio of the A interface and the B interface is 1:2
  • the server resources are evenly used for the processing of each target adjustment interface, so that each target adjustment interface can get a faster response. .
  • the corresponding target adjustment value is determined according to the adjustment ratio of each target adjustment interface, so that each interface is evenly adjusted, which improves the flexibility of current limiting and realizes intelligent limiting. flow.
  • Step S10 includes:
  • Step b1 traversely determine the access processing volume of each interface corresponding to the server, and the load sensitivity of each interface;
  • Step b2 based on the access processing volume and the load sensitivity, sequentially calculate the load index of each of the interfaces, and calculate the comprehensive load index value of the server based on the load index.
  • the comprehensive load index value of the server is expressed by calculating the load index of each interface, so that the calculated comprehensive load index value is closely related to each interface, so that subsequent adjustments to the interface can be more accurate.
  • Step b1 traversely determine the access processing volume of each interface corresponding to the server and the load sensitivity of each interface.
  • traversal determines the access processing volume of each interface corresponding to the server, that is, the current call pressure of each interface, and determines the load sensitivity of each interface, where load sensitivity refers to the current interface processing access request .
  • Sensitivity to load parameters such as cpu, io, number of threads, etc., is specifically measured by the load change value of the load parameter caused by processing an access request, that is, the load value before the current interface processes the access request and the current interface processing
  • the load value after the access request is measured by the difference. For example, the difference between the cpu value before the current interface processes the access request and the cpu value after the current interface processes the access request is the load sensitivity of the current interface.
  • Step b2 based on the access processing volume and the load sensitivity, sequentially calculate the load index of each of the interfaces, and calculate the comprehensive load index value of the server based on the load index.
  • the load indicators of each interface are sequentially calculated, so that the load indicators of each interface are added together to obtain the comprehensive load indicator value of the server.
  • the specific calculation process includes:
  • Step b21 sequentially determining the load parameters corresponding to each of the interfaces, and determining the load value of the load parameters of each of the interfaces based on the access processing volume of each of the interfaces;
  • the load parameters corresponding to each interface are cpu, io, and the number of threads, indicating that when interface A is processing access requests, It will occupy the server's performance such as cpu, io, and the number of threads.
  • the load parameters corresponding to the B interface are cpu, io, indicating that the B interface will occupy the server's cpu and io performance when processing access requests.
  • the access processing volume of each interface determines the load value of the load parameter of each interface. For example, the CPU required for the A interface to process an access request is 5, if the access processing volume of the A interface is 10 at this time, the required cpu is 50, 50 is the load value of the cpu.
  • Step b22 Determine the weight value of the load parameter of each interface based on the load sensitivity of each interface
  • the weight value of the load parameter of each interface Based on the load sensitivity of each interface, determine the weight value of the load parameter of each interface. For example, if the load sensitivity of the current interface is 5 for cpu, 4 for io, and 1 for the number of threads, then determine the weight for the number of cpu, io, and threads. The value is 5:4:1.
  • Step b23 based on the load value and the weight value, sequentially calculate the load index of each of the interfaces.
  • Load index load value 1 * weight value 1 + load value 2 * weight value 2 + load value 3 * weight value 3...
  • the comprehensive load index value of the server is expressed by calculating the load index of each interface, so that the calculated comprehensive load index value is closely related to each interface, so that subsequent adjustments to the interface can be more accurate.
  • the embodiment of the present application also provides an interface current limiting device based on a token bucket.
  • FIG. 3 is a schematic diagram of the functional modules of the first embodiment of the interface current limiting device based on the token bucket of the present application.
  • the interface current limiting device based on a token bucket includes:
  • the calculation module 10 is used to monitor the performance index of the server, and calculate the comprehensive load index value of the server based on the performance index;
  • the judging module 20 is configured to determine whether the load of the server is surplus based on the comprehensive load index value
  • the determining module 30 is configured to determine the target adjustment interface corresponding to the server if there is a surplus, and determine the target adjustment value of the target adjustment interface;
  • the configuration module 40 is configured to update the number of access tokens for configuring the target adjustment interface based on the target adjustment value.
  • the determining module is further used for:
  • a target adjustment interface corresponding to the server and a target adjustment value of the target adjustment interface are determined.
  • the determining module is further used for:
  • the determining module is further used for:
  • the determining module is further used for:
  • the target adjustment interface includes at least a first target adjustment interface and a second target adjustment interface
  • a first target adjustment value of the first target adjustment interface and a second target adjustment value of the second target adjustment interface are determined.
  • calculation module is also used to:
  • the load index of each interface is sequentially calculated, and based on the load index, a comprehensive load index value of the server is calculated.
  • calculation module is also used to:
  • each module in the above-mentioned interface current-limiting device based on token bucket corresponds to each step in the above-mentioned embodiment of the above-mentioned interface current-limiting method based on token bucket, and its functions and implementation processes will not be repeated here.
  • the embodiment of the present application also provides a computer-readable storage medium.
  • the computer-readable storage medium of this application stores a token bucket-based interface current limiting program.
  • the computer-readable storage medium may be non-volatile or volatile.
  • the token bucket-based interface limit When the stream program is executed by the processor, the steps of the interface current limiting method based on the token bucket as described above are implemented.
  • the method implemented when the interface current limiting program based on the token bucket is executed can refer to the various embodiments of the interface current limiting method based on the token bucket of this application, which will not be repeated here.
  • the technical solution of this application essentially or the part that contributes to the existing technology can be embodied in the form of a software product, and the computer software product is stored in a storage medium (such as ROM/RAM) as described above. , Magnetic disks, optical disks), including several instructions to make a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) execute the method described in each embodiment of the present application.
  • a terminal device which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Debugging And Monitoring (AREA)
  • Multi Processors (AREA)

Abstract

本申请涉及人工智能技术领域,提供一种基于令牌桶的接口限流方法、装置、系统及可读存储介质,所述方法包括以下步骤:监测服务器的性能指标,并基于所述性能指标,计算所述服务器的综合负载指标值;基于所述综合负载指标值,确定所述服务器的负载是否盈余;若盈余,则确定所述服务器对应的目标调整接口,并确定所述目标调整接口的目标调整值;基于所述目标调整值,更新配置所述目标调整接口的访问令牌数。

Description

基于令牌桶的接口限流方法、装置、系统及可读存储介质
本申请要求2020年6月9日申请的,申请号为202010520643.4,名称为“基于令牌桶的接口限流方法、装置、系统及可读存储介质”的中国专利申请的优先权,在此将其全文引入作为参考。
技术领域
本申请涉及人工智能技术领域,尤其涉及一种基于令牌桶的接口限流方法、装置、系统及计算机可读存储介质。
背景技术
在人工智能技术领域,大数据、大流量、高并发、分布式以及微服务都是当下的热点技术,数据量级的增加,必然导致软件系统架构的升级,让服务间的调用更加错综复杂,而服务间调用请求的积压很有可能导致服务雪崩,最终崩掉整个系统。
为解决上述技术问题,现有技术中一般采用接口限流的方式,其原理大体是使接口的请求量在服务器的承压范围之内。目前主流的限流方案有令牌桶和漏桶两种,其中,令牌桶是按照固定速率往桶中添加令牌,请求是否被处理需要看桶中令牌是否足够,当令牌数减为零时,则拒绝新的请求;而漏桶则是按照常量固定速率流出请求,流入请求速率任意,当流入的请求数累积到漏桶容量时,则新流入的请求被拒绝。
然而,发明人发现,令牌桶是按固定速率处理请求,如果此时服务器的负载盈余,那么就是浪费服务器的资源,而且若此时大量请求堆积过来,由于桶中没有多余令牌,还会造成请求拒绝。这使得,即使服务器的负载有盈余,请求依然会被拒绝、丢弃。漏桶也有类似的缺陷。当然,限流方案不止这两种,还有诸如基于计数器,redis(Remote Dictionary Server,key-value存储系统)的方案,但是它们也有着类似的缺陷。可见,现有限流方案智能性不足,无法进行灵活限流。
技术解决方案
本申请的主要目的在于提供一种基于令牌桶的接口限流方法、装置、系统及计算机可读存储介质,旨在提高限流的灵活性,实现智能限流。
为实现上述目的,本申请提供一种基于令牌桶的接口限流方法,所述基于令牌桶的接口限流方法包括以下步骤:
监测服务器的性能指标,并基于所述性能指标,计算所述服务器的综合负载指标值;
基于所述综合负载指标值,确定所述服务器的负载是否盈余;
若盈余,则确定所述服务器对应的目标调整接口,并确定所述目标调整接口的目标调整值;
基于所述目标调整值,更新配置所述目标调整接口的访问令牌数。
此外,为实现上述目的,本申请还提供一种基于令牌桶的接口限流装置,所述基于令牌桶的接口限流装置包括:
计算模块,用于监测服务器的性能指标,并基于所述性能指标,计算所述服务器的综合负载指标值;
判断模块,用于基于所述综合负载指标值,确定所述服务器的负载是否盈余;
确定模块,用于若盈余,则确定所述服务器对应的目标调整接口,并确定所述目标调整接口的目标调整值;
配置模块,用于基于所述目标调整值,更新配置所述目标调整接口的访问令牌数。
此外,为实现上述目的,本申请还提供一种基于令牌桶的接口限流系统,所述基于令牌桶的接口限流系统包括处理器、存储器、以及存储在所述存储器上并可被所述处理器执行的基于令牌桶的接口限流程序,其中所述基于令牌桶的接口限流程序被所述处理器执行时,实现如上述的基于令牌桶的接口限流方法的步骤:
监测服务器的性能指标,并基于所述性能指标,计算所述服务器的综合负载指标值;
基于所述综合负载指标值,确定所述服务器的负载是否盈余;
若盈余,则确定所述服务器对应的目标调整接口,并确定所述目标调整接口的目标调整值;
基于所述目标调整值,更新配置所述目标调整接口的访问令牌数。
此外,为实现上述目的,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有基于令牌桶的接口限流程序,其中所述基于令牌桶的接口限流程序被处理器执行时,实现如上述的基于令牌桶的接口限流方法的步骤:
监测服务器的性能指标,并基于所述性能指标,计算所述服务器的综合负载指标值;
基于所述综合负载指标值,确定所述服务器的负载是否盈余;
若盈余,则确定所述服务器对应的目标调整接口,并确定所述目标调整接口的目标调整值;
基于所述目标调整值,更新配置所述目标调整接口的访问令牌数。
本申请提供一种基于令牌桶的接口限流方法,监测服务器的性能指标,并基于所述性能指标,计算所述服务器的综合负载指标值;基于所述综合负载指标值,确定所述服务器的负载是否盈余;若盈余,则确定所述服务器对应的目标调整接口,并确定所述目标调整接口的目标调整值;基于所述目标调整值,更新配置所述目标调整接口的访问令牌数。本申请通过监测服务器的性能指标,在确定服务器的负载盈余时,对目标调整接口进行访问令牌数的调整,从而调整目标调整接口处理依赖访问令牌进行访问的访问请求数,实现对访问请求的灵活限流,提高限流的智能性。
附图说明
图1为本申请实施例方案中涉及的基于令牌桶的接口限流系统的硬件结构示意图;
图2为本申请基于令牌桶的接口限流方法第一实施例的流程示意图;
图3为本申请基于令牌桶的接口限流装置第一实施例的功能模块示意图。
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
本申请的实施方式
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
本申请实施例涉及的基于令牌桶的接口限流方法主要应用于基于令牌桶的接口限流系统,该基于令牌桶的接口限流系统可以包括PC、便携计算机、移动终端等具有显示和处理功能的设备。
参照图1,图1为本申请实施例方案中涉及的基于令牌桶的接口限流系统的硬件结构示意图。本申请实施例中,基于令牌桶的接口限流系统可以包括处理器1001(例如CPU),通信总线1002,用户接口1003,网络接口1004,存储器1005。其中,通信总线1002用于实现这些组件之间的连接通信;用户接口1003可以包括显示屏(Display)、输入单元比如键盘(Keyboard);网络接口1004可选的可以包括标准的有线接口、无线接口(如WI-FI接口);存储器1005可以是高速RAM存储器,也可以是稳定的存储器(non-volatile memory),例如磁盘存储器,存储器1005可选的还可以是独立于前述处理器1001的存储装置。
本领域技术人员可以理解,图1中示出的硬件结构并不构成对基于令牌桶的接口限流系统的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。
继续参照图1,图1中作为一种计算机可读存储介质的存储器1005可以包括操作系统、网络通信模块以及基于令牌桶的接口限流程序。
在图1中,网络通信模块主要用于连接服务器,与服务器进行数据通信;而处理器1001可以调用存储器1005中存储的基于令牌桶的接口限流程序,并执行本申请实施例提供的基于令牌桶的接口限流方法。
本申请实施例提供了一种基于令牌桶的接口限流方法。
参照图2,图2为本申请基于令牌桶的接口限流方法第一实施例的流程示意图。
本实施例中,所述基于令牌桶的接口限流方法包括以下步骤:
步骤S10,监测服务器的性能指标,并基于所述性能指标,计算所述服务器的综合负载指标值;
步骤S20,基于所述综合负载指标值,确定所述服务器的负载是否盈余;
步骤S30,若盈余,则确定所述服务器对应的目标调整接口,并确定所述目标调整接口的目标调整值;
步骤S40,基于所述目标调整值,更新配置所述目标调整接口的访问令牌数。
本实施例的基于令牌桶的接口限流方法应用于基于令牌桶的接口限流系统,为描述方便,基于令牌桶的接口限流系统以限流系统简称,本实施例的限流系统在处理大数据调用的过程中,基于人工智能技术,对外暴露多个接口,外部系统若基于暴露的接口向服务器发起访问请求,限流系统则基于令牌桶技术对访问请求进行限流,避免访问请求过多,超过服务器的承压能力,引起服务器系统崩溃。
虽然现有技术有多种限流方案,但是都不尽如意,比如服务器上只有一个应用,该应用暴露出A、B两个接口,采用令牌桶的方案来进行基于令牌桶的接口限流:假设A桶(对应于A接口)每秒生成5个令牌,即A接口每秒只能处理5个访问请求;B桶(对应于B接口)每秒生成10个令牌,即B接口每秒只能处理10个访问请求,(假设A、B两个接口消耗服务器资源相等),此时服务器满负载。
若一段时间后,B接口的调用量降低至每秒5个请求,也即B接口当前只处理5个访问请求,此时,服务器的负载由于少处理5个访问请求而降低,即服务器不再满载,但若这段时间A接口的调用量上升到每秒10个请求,但是由于A桶每秒只能生成5个令牌,那么必然会造成A接口这边会因为缺少5个令牌而丢弃掉5个访问请求。可见,此时的服务器资源并没有得到最优化利用,访问请求也不能得到及时处理。
本实施例在现有令牌桶技术的基础上,通过监测服务器的性能指标,在确定服务器的负载盈余时,也即服务器还有资源可以处理其他事项时,确定对应的目标调整接口,并对目标调整接口进行访问令牌数的调整,使得目标调整接口处理访问请求的能力随访问令牌数改变,实现对访问请求的灵活限流,提高限流的智能性。
以下将对各个步骤进行详细的说明:
步骤S10,监测服务器的性能指标,并基于所述性能指标,计算所述服务器的综合负载指标值。
在本实施例中,限流系统实时或者定时监测服务器的性能指标,其中,性能指标包括负载参数,如cpu,io,线程数量等,具体的,可通过开源框架,如Pinpoint(分布式性能监控工具)和Skywalking(分布式追踪系统)等,实时或者定时共聚服务器的性能指标。此外,还可以事先编写相应的agent(代理)脚本去监控服务器的性能指标,限流系统只需接收agent上报的服务器的性能指标即可。
然后,根据确定的服务器的性能指标,计算服务器的综合负载指标值,具体的,将确定的服务器的性能指标代入预设负载公式中。
其中,预设负载公式可为:
综合负载指标值=负载参数1*权重值1+负载参数2*权重值2+负载参数3*权重值3......
以性能指标包括cpu,io,线程数量等负载参数为例,预设负载公式可为:
综合负载指标值=cpu负载数据*50%+io负载数据*40%+线程数据*10%
因此,在具体实施时,只需将监测得到的负载参数代入预设负载公式中,即可计算得到服务器的综合负载指标值。
步骤S20,基于所述综合负载指标值,确定所述服务器的负载是否盈余。
在本实施例中,将计算得到的综合负载指标值与服务器满载时的综合负载指标值进行比较,若计算得到的综合负载指标值小于服务器满载时的综合负载指标值,则确定服务器的负载盈余,即服务器还有能力处理其他事项;若计算得到的综合负载指标值等于服务器满载时的综合负载指标值,则确定服务器的负载没有盈余,即服务器没有能力再处理其他事项。
可以理解的,服务器满载时的综合负载指标值可事先通过模拟测得。
步骤S30,若盈余,则确定所述服务器对应的目标调整接口,并确定所述目标调整接口的目标调整值。
在本实施例中,若确定服务器的负载盈余,也即服务器有能力处理其他事项,则确定服务器对应的目标调整接口,也即确定需要对哪个接口进行调整,本实施例中,可从服务器对应的所有接口中,随机确定目标调整接口。
接着,确定服务器的负载盈余量,再根据负载盈余量确定目标调整接口的目标调整值,其中,负载盈余量指的是当前服务器相对满载时的服务器下降的负载百分比,在具体实施时,将服务器满载时的综合负载指标值减去计算得到的综合负载指标值,得到的差值除以服务器满载时的综合负载指标值,即为负载盈余量。最后,根据负载盈余量和预构建的负载盈余量与调整值的关系曲线图,确定目标调整接口的目标调整值。
其中,负载盈余量与调整值的关系曲线图指的是服务器在不同负载盈余量下,各接口的调整值的变化曲线图,具体可事先通过大量模拟测试得到,如当前有A和B两个接口,在服务器满载时,记录A接口和B接口的访问处理量,通过单一变量原则,依次保持A接口或者B接口不变,降低服务器的负载,如降低5个百分点,也即服务器的负载盈余量为5%,此时,再记录A接口或者B接口的访问处理量,将两次记录的A接口或者B接口的访问处理量进行相减,即可得到服务器的负载盈余量为5%时,A接口或者B接口的调整值,基于此原理,依次记录在不同负载盈余量下,服务器对应的接口的调整值,即可得到负载盈余量与调整值的关系曲线图。
因此,可通过当前服务器的负载盈余量,以及确定的目标调整接口,在负载盈余量与调整值的关系曲线图中,查找到对应的目标调整值。
进一步地,在一实施例中,步骤S30 包括:
步骤a1,若盈余,则确定所述服务器的负载盈余量,并基于所述负载盈余量和预构建的负载盈余量与调整值的关系曲线图,确定所述服务器对应的各接口的调整值;
在一实施例中,若确定服务器的负载盈余,也即服务器有能力处理其他事项,则确定服务器的负载盈余量,再通过预构建的负载盈余量与调整值的关系曲线图,确定服务器对应的各接口的调整值,如当前有A和B接口,服务器的负载盈余量为5%,则确定A接口的调整值,如10,即服务器综合负载指标值每下降5个百分点,A接口可以多处理10个访问请求;B接口的调整值,如20,即服务器综合负载指标值每下降5个百分点B接口可以多处理20个访问请求等。
步骤a2,基于所述调整值,确定所述服务器对应的目标调整接口,以及所述目标调整接口的目标调整值。
在一实施例中,根据确定的服务器各接口的调整值,确定服务器对应的目标调整接口,具体的,可以调整值最大的接口作为服务器对应的目标调整接口,再确定目标调整接口的目标调整值,如上述例子,A接口的调整值为10,B接口的调整值为20 ,则将B接口确定为目标调整接口,将20确定为目标调整值。
也即,在一实施例中,在确定服务器有盈余量时,先确定各接口的调整幅度,然后将调整幅度最大的接口确定为目标调整接口,使得服务器可以处理更多的访问请求,提高处理效率。
步骤S40,基于所述目标调整值,更新配置所述目标调整接口的访问令牌数。
在本实施例中,基于目标调整值,更新配置目标调整接口的访问令牌数,也即,在确定了目标调整接口的目标调整值之后,对目标调整接口进行访问令牌数的调整,如A接口原来的访问令牌数是5个,也即A每秒只能处理5个访问请求,在服务器负载盈余时,A接口的目标调整值为10,则将A接口的访问令牌数更新配置为15个,使得A接口每秒可以处理15个访问请求。
本实施例提供一种基于令牌桶的接口限流方法,监测服务器的性能指标,并基于所述性能指标,计算所述服务器的综合负载指标值;基于所述综合负载指标值,确定所述服务器的负载是否盈余;若盈余,则确定所述服务器对应的目标调整接口,并确定所述目标调整接口的目标调整值;基于所述目标调整值,更新配置所述目标调整接口的访问令牌数。本申请通过监测服务器的性能指标,在确定服务器的负载盈余时,对目标调整接口进行访问令牌数的调整,从而调整目标调整接口处理依赖访问令牌进行访问的访问请求数,实现对访问请求的灵活限流,提高限流的智能性。
进一步地,基于第一实施例提出本申请基于令牌桶的接口限流方法的第二实施例。
基于令牌桶的接口限流方法的第二实施例与基于令牌桶的接口限流方法的第一实施例的区别在于,步骤S30包括:
步骤a3,若盈余,则确定所述服务器对应的各接口的接口类型,并基于所述接口类型,确定所述服务器对应的目标调整接口;
步骤a4,确定所述服务器的负载盈余量,并基于所述负载盈余量和预构建的负载盈余量与调整值的关系曲线图,确定所述目标调整接口的目标调整值。
本实施例通过接口类型来确定服务器对应的目标调整接口,其中接口类型用于表征接口的重要程度,也即在确定服务器负载盈余时,优先将服务器的资源用于重要接口的处理上,提高限流的灵活性,实现智能限流。
以下将对各个步骤进行详细说明:
步骤a3,若盈余,则确定所述服务器对应的各接口的接口类型,并基于所述接口类型,确定所述服务器对应的目标调整接口。
在本实施例中,若确定服务器的负载盈余,也即服务器有能力处理其他事项,则确定服务器对应的各接口的接口类型,其中,接口类型包括业务接口,安全接口等,业务接口用于业务功能的调用,如银行等金融机构的信贷业务功能的调用等,安全接口用于安全功能的调用,如系统日志信息的调用等。
然后,根据接口类型,确定服务器对应的目标调整接口。在本实施例中,安全接口的优先级大于业务接口的优先级,因此,优先确定安全接口为目标调整接口,如A接口为安全接口,B接口为业务接口,则确定A接口为目标调整接口。
步骤a4,确定所述服务器的负载盈余量,并基于所述负载盈余量和预构建的负载盈余量与调整值的关系曲线图,确定所述目标调整接口的目标调整值。
在本实施例中,在确定好服务器对应的目标调整接口之后,进一步确定服务器的负载盈余量,再根据负载盈余量,在预构建的负载盈余量与调整值的关系曲线图中,查找目标调整接口的目标调整值,具体过程与上述实施例类似,在此不再赘述。
也即,本实施例在确定服务器负载盈余时,根据接口类型为确定目标调整接口,而不用管负载盈余量或者接口的调整值,使得优先级较高的接口类型可以得到较快响应。
本实施例通过接口类型来确定服务器对应的目标调整接口,也即在确定服务器负载盈余时,优先将服务器的资源用于重要接口的处理上,提高限流的灵活性,实现智能限流。
进一步地,基于第一、第二实施例提出本申请基于令牌桶的接口限流方法的第三实施例。
基于令牌桶的接口限流方法的第三实施例与基于令牌桶的接口限流方法的第一、第二实施例的区别在于,步骤S30包括:
步骤a5,若盈余,则确定所述服务器对应的各接口的访问请求量,并基于所述访问请求量,确定所述服务器对应的目标调整接口;
步骤a6,确定所述服务器的负载盈余量,并基于所述负载盈余量和预构建的负载盈余量与调整值的关系曲线图,确定所述目标调整接口的目标调整值。
本实施例通过服务器对应的各接口的访问请求量来确定服务器对应的目标调整接口,其中,访问请求量指的是外部系统基于接口发起的访问请求数,也即调用量,也即在确定服务器负载盈余时,优先将服务器的资源用于调用需求较大的接口的处理上,提高限流的灵活性,实现智能限流。
以下将对各个步骤进行详细说明:
步骤a5,若盈余,则确定所述服务器对应的各接口的访问请求量,并基于所述访问请求量,确定所述服务器对应的目标调整接口。
在本实施例中,若确定服务器的负载盈余,也即服务器有能力处理其他事项,则确定服务器对应的各接口的访问请求量,再根据访问请求量,确定哪个接口的调用需求较大。
在具体实施过程中,还可以各接口因访问令牌数不足而丢弃的访问请求数来确定服务器的目标调整接口,也即,丢弃的访问请求数最多的接口说明该接口的调用需求大,则将该接口确定为目标调整接口。
步骤a6,确定所述服务器的负载盈余量,并基于所述负载盈余量和预构建的负载盈余量与调整值的关系曲线图,确定所述目标调整接口的目标调整值。
在本实施例中,在确定好服务器对应的目标调整接口之后,进一步确定服务器的负载盈余量,再根据负载盈余量,在预构建的负载盈余量与调整值的关系曲线图中,查找目标调整接口的目标调整值,具体过程与上述实施例类似,在此不再赘述。
也即,本实施例在确定服务器负载盈余时,根据各接口的访问请求量,也即调用需求,从中选择调用需求较大的接口作为目标调整接口,而不用管负载盈余量或者接口的调整值,使得调用需求较大的接口可以得到较快响应。
本实施例通过服务器对应的各接口的访问请求量来确定服务器对应的目标调整接口,也即在确定服务器负载盈余时,优先将服务器的资源用于调用需求较大的接口的处理上,提高限流的灵活性,实现智能限流。
进一步地,基于第一、第二、第三实施例提出本申请基于令牌桶的接口限流方法的第四实施例。
基于令牌桶的接口限流方法的第四实施例与基于令牌桶的接口限流方法的第一、第二、第三实施例的区别在于,步骤S30包括:
步骤a7,若盈余,则确定所述服务器对应的目标调整接口,所述目标调整接口至少包括第一目标调整接口和第二目标调整接口;
步骤a8,确定所述服务器的负载盈余量,并基于所述负载盈余量和预构建的负载盈余量与调整值的关系曲线图,确定所述第一目标调整接口与所述第二目标调整接口的调整比值;
步骤a9,基于所述负载盈余量、所述关系曲线图和所述调整比值,确定所述第一目标调整接口的第一目标调整值,以及所述第二目标调整接口的第二目标调整值。
本实施例若确定服务器对应的目标调整接口有多个,则根据各目标调整接口的调整比值来确定对应的目标调整值,使得各接口得到均匀的调整,提高限流的灵活性,实现智能限流。
以下将对各个步骤进行详细说明:
步骤a7,若盈余,则确定所述服务器对应的目标调整接口,所述目标调整接口至少包括第一目标调整接口和第二目标调整接口。
在本实施例中,若确定服务器的负载盈余,也即服务器有能力处理其他事项,则确定服务器对应的目标调整接口,具体过程可参见上述实施例,在此不再赘述目标调整接口的确定过程。
需要说明的是,本实施例的目标调整接口至少包括第一目标调整接口和第二目标调整接口,也即目标调整接口有多个的情况。
步骤a8,确定所述服务器的负载盈余量,并基于所述负载盈余量和预构建的负载盈余量与调整值的关系曲线图,确定所述第一目标调整接口与所述第二目标调整接口的调整比值。
在本实施例中,在确定服务器对应的目标调整接口有多个后,进一步确定服务器的负载盈余量,再根据负载盈余量,在预构建的负载盈余量与调整值的关系曲线图中,查找第一目标调整接口的第一调整值,以及第二目标调整接口的第二调整值,然后将第一调整值除以第二调整值,得到第一目标调整接口与第二目标调整接口的调整比值。
可以理解的,若目标调整接口有三个或以上,则也依次确定各目标调整接口的调整值,再将各目标调整接口的调整值进行比较,得到对应的调整比值。
步骤a9,基于所述负载盈余量、所述关系曲线图和所述调整比值,确定所述第一目标调整接口的第一目标调整值,以及所述第二目标调整接口的第二目标调整值。
在本实施例中,基于服务器的负载盈余量。预构建的负载盈余量与调整值的关系曲线图和各目标调整接口的调整比值,确定各目标调整接口的目标调整值。
以A接口和B接口都为目标调整接口,服务器的负载盈余量为5%为例,假设在只有A接口的情况下,A接口在曲线关系图中的调整值为10,在只有B接口的情况下,B接口在曲线关系图中的调整值为20,则A接口与B接口的调整比值为1:2,则A接口最终的目标调整值为10*1/2=5,B接口最终的目标调整值为20*1/2=10。
也即,本实施例在确定服务器负载盈余,且目标调整接口有多个的情况下,将服务器的资源均匀的用于各目标调整接口的处理上,使得各目标调整接口都能得到较快响应。
本实施例若确定服务器对应的目标调整接口有多个,则根据各目标调整接口的调整比值来确定对应的目标调整值,使得各接口得到均匀的调整,提高限流的灵活性,实现智能限流。
进一步地,基于第一、第二、第三、第四实施例提出本申请基于令牌桶的接口限流方法的第五实施例。
基于令牌桶的接口限流方法的第五实施例与基于令牌桶的接口限流方法的第一、第二、第三、第四实施例的区别在于,所述性能指标包括负载指标,步骤S10包括:
步骤b1,遍历确定所述服务器对应的各接口的访问处理量,以及各所述接口的负载敏感度;
步骤b2,基于所述访问处理量和所述负载敏感度,依次计算各所述接口的负载指标,并基于所述负载指标,计算所述服务器的综合负载指标值。
本实施例通过计算各接口的负载指标来表示服务器的综合负载指标值,使得计算得到的综合负载指标值与各接口密切相关,以便后续对接口进行调整时,能更加准确。
以下将对各个步骤进行详细说明:
步骤b1,遍历确定所述服务器对应的各接口的访问处理量,以及各所述接口的负载敏感度。
在本实施例中,遍历确定服务器对应的各接口的访问处理量,也即当前各接口的调用压力,并确定各接口的负载敏感度,其中,负载敏感度指的是当前接口处理访问请求时,对负载参数,如cpu,io,线程数量等的敏感程度,具体以处理一个访问请求所引起的负载参数的负载变化值来衡量,即以当前接口处理访问请求前的负载值与当前接口处理访问请求后的负载值的差值来衡量,如当前接口处理访问请求前的cpu值与当前接口处理访问请求后的cpu值的差值,即为当前接口的负载敏感度。
步骤b2,基于所述访问处理量和所述负载敏感度,依次计算各所述接口的负载指标,并基于所述负载指标,计算所述服务器的综合负载指标值。
在本实施例中,基于各接口的访问处理量和负载敏感程度,依次计算各接口的负载指标,从而将各接口的负载指标相加,得到服务器的综合负载指标值。
具体的计算过程包括:
步骤b21,依次确定各所述接口对应的负载参数,并基于各所述接口的访问处理量,确定各所述接口的负载参数的负载值;
依次确定各接口对应的负载参数,也即确定各接口在处理访问请求时需要占用服务器的哪些性能,如A接口对应的负载参数为cpu,io,线程数量,说明A接口在处理访问请求时,会占用服务器的cpu、io和线程数量等性能,B接口对应的负载参数为cpu,io,说明B接口在处理访问请求时,会占用服务器的cpu和io等性能。
然后,根据各接口的访问处理量,确定各接口的负载参数的负载值,如A接口处理一个访问请求所需cpu为5,若此时A接口的访问处理量为10,则所需cpu为50,50即为cpu的负载值。
步骤b22,基于各所述接口的负载敏感度,确定各所述接口的负载参数的权重值;
基于各接口的负载敏感度,确定各接口的负载参数的权重值,如当前接口的负载敏感度分别为cpu为5,io为4,线程数量为1,则确定cpu,io和线程数量的权重值为5:4:1。
步骤b23,基于所述负载值和所述权重值,依次计算各所述接口的负载指标。
将负载参数的负载值和权重值,代入预设接口负载公式中,其中预设接口负载公式可为:
负载指标=负载值1*权重值1+负载值2*权重值2+负载值3*权重值3......
以当前接口的负载参数具体为cpu=20,io=33,线程数量=1为例,当前接口的负载指标=20*5+33*4+1*1=233。
最后,将各接口的负载指标相加,即可得到服务器的综合负载指标值。
本实施例通过计算各接口的负载指标来表示服务器的综合负载指标值,使得计算得到的综合负载指标值与各接口密切相关,以便后续对接口进行调整时,能更加准确。
此外,本申请实施例还提供一种基于令牌桶的接口限流装置。
参照图3,图3为本申请基于令牌桶的接口限流装置第一实施例的功能模块示意图。
本实施例中,所述基于令牌桶的接口限流装置包括:
计算模块10,用于监测服务器的性能指标,并基于所述性能指标,计算所述服务器的综合负载指标值;
判断模块20,用于基于所述综合负载指标值,确定所述服务器的负载是否盈余;
确定模块30,用于若盈余,则确定所述服务器对应的目标调整接口,并确定所述目标调整接口的目标调整值;
配置模块40,用于基于所述目标调整值,更新配置所述目标调整接口的访问令牌数。
可选地,所述确定模块还用于:
若盈余,则确定所述服务器的负载盈余量,并基于所述负载盈余量和预构建的负载盈余量与调整值的关系曲线图,确定所述服务器对应的各接口的调整值;
基于所述调整值,确定所述服务器对应的目标调整接口,以及所述目标调整接口的目标调整值。
可选地,所述确定模块还用于:
若盈余,则确定所述服务器对应的各接口的接口类型,并基于所述接口类型,确定所述服务器对应的目标调整接口;
确定所述服务器的负载盈余量,并基于所述负载盈余量和预构建的负载盈余量与调整值的关系曲线图,确定所述目标调整接口的目标调整值。
可选地,所述确定模块还用于:
若盈余,则确定所述服务器对应的各接口的访问请求量,并基于所述访问请求量,确定所述服务器对应的目标调整接口;
确定所述服务器的负载盈余量,并基于所述负载盈余量和预构建的负载盈余量与调整值的关系曲线图,确定所述目标调整接口的目标调整值。
可选地,所述确定模块还用于:
若盈余,则确定所述服务器对应的目标调整接口,所述目标调整接口至少包括第一目标调整接口和第二目标调整接口;
确定所述服务器的负载盈余量,并基于所述负载盈余量和预构建的负载盈余量与调整值的关系曲线图,确定所述第一目标调整接口与所述第二目标调整接口的调整比值;
基于所述负载盈余量、所述关系曲线图和所述调整比值,确定所述第一目标调整接口的第一目标调整值,以及所述第二目标调整接口的第二目标调整值。
可选地,所述计算模块还用于:
遍历确定所述服务器对应的各接口的访问处理量,以及各所述接口的负载敏感度;
基于所述访问处理量和所述负载敏感度,依次计算各所述接口的负载指标,并基于所述负载指标,计算所述服务器的综合负载指标值。
可选地,所述计算模块还用于:
依次确定各所述接口对应的负载参数,并基于各所述接口的访问处理量,确定各所述接口的负载参数的负载值;
基于各所述接口的负载敏感度,确定各所述接口的负载参数的权重值;
基于所述负载值和所述权重值,依次计算各所述接口的负载指标。
其中,上述基于令牌桶的接口限流装置中各个模块与上述基于令牌桶的接口限流方法实施例中各步骤相对应,其功能和实现过程在此处不再一一赘述。
此外,本申请实施例还提供一种计算机可读存储介质。
本申请计算机可读存储介质上存储有基于令牌桶的接口限流程序,所述计算机可读存储介质可以是非易失性,也可以是易失性,其中所述基于令牌桶的接口限流程序被处理器执行时,实现如上述的基于令牌桶的接口限流方法的步骤。
其中,基于令牌桶的接口限流程序被执行时所实现的方法可参照本申请基于令牌桶的接口限流方法的各个实施例,此处不再赘述。
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者系统不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者系统所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者系统中还存在另外的相同要素。
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本申请各个实施例所述的方法。
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。

Claims (20)

  1. 一种基于令牌桶的接口限流方法,所述基于令牌桶的接口限流方法包括以下步骤:
    监测服务器的性能指标,并基于所述性能指标,计算所述服务器的综合负载指标值;
    基于所述综合负载指标值,确定所述服务器的负载是否盈余;
    若盈余,则确定所述服务器对应的目标调整接口,并确定所述目标调整接口的目标调整值;
    基于所述目标调整值,更新配置所述目标调整接口的访问令牌数。
  2. 如权利要求1所述的基于令牌桶的接口限流方法,其中,所述若盈余,则确定所述服务器对应的目标调整接口,并确定所述目标调整接口的目标调整值的步骤包括:
    若盈余,则确定所述服务器的负载盈余量,并基于所述负载盈余量和预构建的负载盈余量与调整值的关系曲线图,确定所述服务器对应的各接口的调整值;
    基于所述调整值,确定所述服务器对应的目标调整接口,以及所述目标调整接口的目标调整值。
  3. 如权利要求1所述的基于令牌桶的接口限流方法,其中,所述若盈余,则确定所述服务器对应的目标调整接口,并确定所述目标调整接口的目标调整值的步骤包括:
    若盈余,则确定所述服务器对应的各接口的接口类型,并基于所述接口类型,确定所述服务器对应的目标调整接口;
    确定所述服务器的负载盈余量,并基于所述负载盈余量和预构建的负载盈余量与调整值的关系曲线图,确定所述目标调整接口的目标调整值。
  4. 如权利要求1所述的基于令牌桶的接口限流方法,其中,所述若盈余,则确定所述服务器对应的目标调整接口,并确定所述目标调整接口的目标调整值的步骤包括:
    若盈余,则确定所述服务器对应的各接口的访问请求量,并基于所述访问请求量,确定所述服务器对应的目标调整接口;
    确定所述服务器的负载盈余量,并基于所述负载盈余量和预构建的负载盈余量与调整值的关系曲线图,确定所述目标调整接口的目标调整值。
  5. 如权利要求1所述的基于令牌桶的接口限流方法,其中,所述若盈余,则确定所述服务器对应的目标调整接口,并确定所述目标调整接口的目标调整值的步骤包括:
    若盈余,则确定所述服务器对应的目标调整接口,所述目标调整接口至少包括第一目标调整接口和第二目标调整接口;
    确定所述服务器的负载盈余量,并基于所述负载盈余量和预构建的负载盈余量与调整值的关系曲线图,确定所述第一目标调整接口与所述第二目标调整接口的调整比值;
    基于所述负载盈余量、所述关系曲线图和所述调整比值,确定所述第一目标调整接口的第一目标调整值,以及所述第二目标调整接口的第二目标调整值。
  6. 如权利要求1至5任一项所述的基于令牌桶的接口限流方法,其中,所述性能指标包括负载指标,所述监测服务器的性能指标,并基于所述性能指标,计算所述服务器的综合负载指标值的步骤包括:
    遍历确定所述服务器对应的各接口的访问处理量,以及各所述接口的负载敏感度;
    基于所述访问处理量和所述负载敏感度,依次计算各所述接口的负载指标,并基于所述负载指标,计算所述服务器的综合负载指标值。
  7. 如权利要求6所述的基于令牌桶的接口限流方法,其中,所述基于所述访问处理量和所述负载敏感度,依次计算各所述接口的负载指标的步骤包括:
    依次确定各所述接口对应的负载参数,并基于各所述接口的访问处理量,确定各所述接口的负载参数的负载值;
    基于各所述接口的负载敏感度,确定各所述接口的负载参数的权重值;
    基于所述负载值和所述权重值,依次计算各所述接口的负载指标。
  8. 一种基于令牌桶的接口限流装置,所述基于令牌桶的接口限流装置包括:
    计算模块,用于监测服务器的性能指标,并基于所述性能指标,计算所述服务器的综合负载指标值;
    判断模块,用于基于所述综合负载指标值,确定所述服务器的负载是否盈余;
    确定模块,用于若盈余,则确定所述服务器对应的目标调整接口,并确定所述目标调整接口的目标调整值;
    配置模块,用于基于所述目标调整值,更新配置所述目标调整接口的访问令牌数。
  9. 一种基于令牌桶的接口限流系统,其中,所述基于令牌桶的接口限流系统包括处理器、存储器、以及存储在所述存储器上并可被所述处理器执行的基于令牌桶的接口限流程序,其中所述基于令牌桶的接口限流程序被所述处理器执行时,实现一种接口限流方法的步骤:
    监测服务器的性能指标,并基于所述性能指标,计算所述服务器的综合负载指标值;
    基于所述综合负载指标值,确定所述服务器的负载是否盈余;
    若盈余,则确定所述服务器对应的目标调整接口,并确定所述目标调整接口的目标调整值;
    基于所述目标调整值,更新配置所述目标调整接口的访问令牌数。
  10. 如权利要求9所述的基于令牌桶的接口限流系统,其中,所述处理器执行的所述若盈余,则确定所述服务器对应的目标调整接口,并确定所述目标调整接口的目标调整值的步骤包括:
    若盈余,则确定所述服务器的负载盈余量,并基于所述负载盈余量和预构建的负载盈余量与调整值的关系曲线图,确定所述服务器对应的各接口的调整值;
    基于所述调整值,确定所述服务器对应的目标调整接口,以及所述目标调整接口的目标调整值。
  11. 如权利要求9所述的基于令牌桶的接口限流系统,其中,所述处理器执行的所述若盈余,则确定所述服务器对应的目标调整接口,并确定所述目标调整接口的目标调整值的步骤包括:
    若盈余,则确定所述服务器对应的各接口的接口类型,并基于所述接口类型,确定所述服务器对应的目标调整接口;
    确定所述服务器的负载盈余量,并基于所述负载盈余量和预构建的负载盈余量与调整值的关系曲线图,确定所述目标调整接口的目标调整值。
  12. 如权利要求9所述的基于令牌桶的接口限流系统,其中,所述处理器执行的所述若盈余,则确定所述服务器对应的目标调整接口,并确定所述目标调整接口的目标调整值的步骤包括:
    若盈余,则确定所述服务器对应的各接口的访问请求量,并基于所述访问请求量,确定所述服务器对应的目标调整接口;
    确定所述服务器的负载盈余量,并基于所述负载盈余量和预构建的负载盈余量与调整值的关系曲线图,确定所述目标调整接口的目标调整值。
  13. 如权利要求9所述的基于令牌桶的接口限流系统,其中,所述处理器执行的所述若盈余,则确定所述服务器对应的目标调整接口,并确定所述目标调整接口的目标调整值的步骤包括:
    若盈余,则确定所述服务器对应的目标调整接口,所述目标调整接口至少包括第一目标调整接口和第二目标调整接口;
    确定所述服务器的负载盈余量,并基于所述负载盈余量和预构建的负载盈余量与调整值的关系曲线图,确定所述第一目标调整接口与所述第二目标调整接口的调整比值;
    基于所述负载盈余量、所述关系曲线图和所述调整比值,确定所述第一目标调整接口的第一目标调整值,以及所述第二目标调整接口的第二目标调整值。
  14. 如权利要求9至13任一项所述的基于令牌桶的接口限流系统,其中,所述性能指标包括负载指标,所述处理器执行的所述监测服务器的性能指标,并基于所述性能指标,计算所述服务器的综合负载指标值的步骤包括:
    遍历确定所述服务器对应的各接口的访问处理量,以及各所述接口的负载敏感度;
    基于所述访问处理量和所述负载敏感度,依次计算各所述接口的负载指标,并基于所述负载指标,计算所述服务器的综合负载指标值。
  15. 一种计算机可读存储介质,其中,所述计算机可读存储介质上存储有基于令牌桶的接口限流程序,其中所述基于令牌桶的接口限流程序被处理器执行时,实现接口限流方法的步骤:
    监测服务器的性能指标,并基于所述性能指标,计算所述服务器的综合负载指标值;
    基于所述综合负载指标值,确定所述服务器的负载是否盈余;
    若盈余,则确定所述服务器对应的目标调整接口,并确定所述目标调整接口的目标调整值;
    基于所述目标调整值,更新配置所述目标调整接口的访问令牌数。
  16. 如权利要求15所述的计算机可读存储介质,其中,所述若盈余,则确定所述服务器对应的目标调整接口,并确定所述目标调整接口的目标调整值的步骤包括:
    若盈余,则确定所述服务器的负载盈余量,并基于所述负载盈余量和预构建的负载盈余量与调整值的关系曲线图,确定所述服务器对应的各接口的调整值;
    基于所述调整值,确定所述服务器对应的目标调整接口,以及所述目标调整接口的目标调整值。
  17. 如权利要求15所述的计算机可读存储介质,其中,所述若盈余,则确定所述服务器对应的目标调整接口,并确定所述目标调整接口的目标调整值的步骤包括:
    若盈余,则确定所述服务器对应的各接口的接口类型,并基于所述接口类型,确定所述服务器对应的目标调整接口;
    确定所述服务器的负载盈余量,并基于所述负载盈余量和预构建的负载盈余量与调整值的关系曲线图,确定所述目标调整接口的目标调整值。
  18. 如权利要求15所述的计算机可读存储介质,其中,所述若盈余,则确定所述服务器对应的目标调整接口,并确定所述目标调整接口的目标调整值的步骤包括:
    若盈余,则确定所述服务器对应的各接口的访问请求量,并基于所述访问请求量,确定所述服务器对应的目标调整接口;
    确定所述服务器的负载盈余量,并基于所述负载盈余量和预构建的负载盈余量与调整值的关系曲线图,确定所述目标调整接口的目标调整值。
  19. 如权利要求15所述的计算机可读存储介质,其中,所述若盈余,则确定所述服务器对应的目标调整接口,并确定所述目标调整接口的目标调整值的步骤包括:
    若盈余,则确定所述服务器对应的目标调整接口,所述目标调整接口至少包括第一目标调整接口和第二目标调整接口;
    确定所述服务器的负载盈余量,并基于所述负载盈余量和预构建的负载盈余量与调整值的关系曲线图,确定所述第一目标调整接口与所述第二目标调整接口的调整比值;
    基于所述负载盈余量、所述关系曲线图和所述调整比值,确定所述第一目标调整接口的第一目标调整值,以及所述第二目标调整接口的第二目标调整值。
  20. 如权利要求15至19任一项所述的计算机可读存储介质,其中,所述性能指标包括负载指标,所述监测服务器的性能指标,并基于所述性能指标,计算所述服务器的综合负载指标值的步骤包括:
    遍历确定所述服务器对应的各接口的访问处理量,以及各所述接口的负载敏感度;
    基于所述访问处理量和所述负载敏感度,依次计算各所述接口的负载指标,并基于所述负载指标,计算所述服务器的综合负载指标值。
PCT/CN2020/118251 2020-06-09 2020-09-28 基于令牌桶的接口限流方法、装置、系统及可读存储介质 WO2021114829A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010520643.4A CN111817974B (zh) 2020-06-09 2020-06-09 基于令牌桶的接口限流方法、装置、系统及可读存储介质
CN202010520643.4 2020-06-09

Publications (1)

Publication Number Publication Date
WO2021114829A1 true WO2021114829A1 (zh) 2021-06-17

Family

ID=72844850

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/118251 WO2021114829A1 (zh) 2020-06-09 2020-09-28 基于令牌桶的接口限流方法、装置、系统及可读存储介质

Country Status (2)

Country Link
CN (1) CN111817974B (zh)
WO (1) WO2021114829A1 (zh)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113992596A (zh) * 2021-10-18 2022-01-28 北京沃东天骏信息技术有限公司 一种接口限流方法、装置、设备、系统和存储介质
CN114024908A (zh) * 2021-11-03 2022-02-08 蚂蚁胜信(上海)信息技术有限公司 实时自适应限流方法、限流服务系统和限流器
CN115277577A (zh) * 2022-09-28 2022-11-01 平安银行股份有限公司 数据处理方法、装置、计算机设备和计算机可读存储介质
CN115314441A (zh) * 2022-08-02 2022-11-08 支付宝实验室(新加坡)有限公司 分布式集群的限流方法、装置和电子设备
CN115442432A (zh) * 2022-09-06 2022-12-06 上海浦东发展银行股份有限公司 一种控制方法、装置、设备及存储介质
CN117061526A (zh) * 2023-10-12 2023-11-14 人力资源和社会保障部人事考试中心 一种基于全局与局部业务访问控制的访问高峰防拥塞方法
CN115442432B (zh) * 2022-09-06 2024-06-07 上海浦东发展银行股份有限公司 一种控制方法、装置、设备及存储介质

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112600760B (zh) * 2020-12-08 2022-06-14 厦门服云信息科技有限公司 一种应用层流量限速方法、终端设备及存储介质
CN113067875B (zh) * 2021-03-24 2023-06-02 厦门立林科技有限公司 基于微服务网关动态流控的访问方法和装置以及设备
CN114844835B (zh) * 2022-07-04 2022-09-20 眉山环天智慧科技有限公司 一种自适应动态限流方法、设备

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106201722A (zh) * 2016-07-12 2016-12-07 乐视控股(北京)有限公司 服务器的负载调整方法及系统
CN106603695A (zh) * 2016-12-28 2017-04-26 北京奇艺世纪科技有限公司 一种每秒查询率的调整方法及装置
US20170272371A1 (en) * 2016-03-21 2017-09-21 Alibaba Group Holding Limited Flow control in connection with an access request
CN107483351A (zh) * 2017-07-13 2017-12-15 中国银联股份有限公司 一种限流方法及装置
CN107547433A (zh) * 2017-07-03 2018-01-05 阿里巴巴集团控股有限公司 基于令牌漏桶进行限流的方法、装置和设备
CN108073465A (zh) * 2017-12-29 2018-05-25 中国平安人寿保险股份有限公司 动态限流方法、Nginx服务器、存储介质及装置
CN109842565A (zh) * 2018-12-15 2019-06-04 平安科技(深圳)有限公司 接口限流方法、装置、电子设备及存储介质
CN110099009A (zh) * 2018-01-31 2019-08-06 北京易真学思教育科技有限公司 基于接口响应时间趋势的动态限流方法及计算机可读介质

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120127864A1 (en) * 2010-11-22 2012-05-24 Avaya Inc. Performing policing operations in packet time
CN109861920A (zh) * 2019-01-16 2019-06-07 深圳市融汇通金科技有限公司 一种弹性限流的方法及装置

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170272371A1 (en) * 2016-03-21 2017-09-21 Alibaba Group Holding Limited Flow control in connection with an access request
CN106201722A (zh) * 2016-07-12 2016-12-07 乐视控股(北京)有限公司 服务器的负载调整方法及系统
CN106603695A (zh) * 2016-12-28 2017-04-26 北京奇艺世纪科技有限公司 一种每秒查询率的调整方法及装置
CN107547433A (zh) * 2017-07-03 2018-01-05 阿里巴巴集团控股有限公司 基于令牌漏桶进行限流的方法、装置和设备
CN107483351A (zh) * 2017-07-13 2017-12-15 中国银联股份有限公司 一种限流方法及装置
CN108073465A (zh) * 2017-12-29 2018-05-25 中国平安人寿保险股份有限公司 动态限流方法、Nginx服务器、存储介质及装置
CN110099009A (zh) * 2018-01-31 2019-08-06 北京易真学思教育科技有限公司 基于接口响应时间趋势的动态限流方法及计算机可读介质
CN109842565A (zh) * 2018-12-15 2019-06-04 平安科技(深圳)有限公司 接口限流方法、装置、电子设备及存储介质

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113992596A (zh) * 2021-10-18 2022-01-28 北京沃东天骏信息技术有限公司 一种接口限流方法、装置、设备、系统和存储介质
CN114024908A (zh) * 2021-11-03 2022-02-08 蚂蚁胜信(上海)信息技术有限公司 实时自适应限流方法、限流服务系统和限流器
CN115314441A (zh) * 2022-08-02 2022-11-08 支付宝实验室(新加坡)有限公司 分布式集群的限流方法、装置和电子设备
CN115442432A (zh) * 2022-09-06 2022-12-06 上海浦东发展银行股份有限公司 一种控制方法、装置、设备及存储介质
CN115442432B (zh) * 2022-09-06 2024-06-07 上海浦东发展银行股份有限公司 一种控制方法、装置、设备及存储介质
CN115277577A (zh) * 2022-09-28 2022-11-01 平安银行股份有限公司 数据处理方法、装置、计算机设备和计算机可读存储介质
CN115277577B (zh) * 2022-09-28 2023-04-28 平安银行股份有限公司 数据处理方法、装置、计算机设备和计算机可读存储介质
CN117061526A (zh) * 2023-10-12 2023-11-14 人力资源和社会保障部人事考试中心 一种基于全局与局部业务访问控制的访问高峰防拥塞方法
CN117061526B (zh) * 2023-10-12 2023-12-12 人力资源和社会保障部人事考试中心 一种基于全局与局部业务访问控制的访问高峰防拥塞方法

Also Published As

Publication number Publication date
CN111817974A (zh) 2020-10-23
CN111817974B (zh) 2022-11-15

Similar Documents

Publication Publication Date Title
WO2021114829A1 (zh) 基于令牌桶的接口限流方法、装置、系统及可读存储介质
US10523507B2 (en) Method and system for tuning performance of microservices-based applications
CN110545246B (zh) 一种基于令牌桶的限流方法、装置和计算机可读介质
CN108776934B (zh) 分布式数据计算方法、装置、计算机设备及可读存储介质
US10700994B2 (en) Multi-tenant throttling approaches
US10432551B1 (en) Network request throttling
CN112650576B (zh) 资源调度方法、装置、设备、存储介质及计算机程序产品
US10536322B2 (en) Resource management for services
US10712958B2 (en) Elastic storage volume type selection and optimization engine for public cloud environments
US9774662B2 (en) Managing transactional data for high use databases
CN107070709B (zh) 一种基于底层numa感知的nfv实现方法
CN111311286B (zh) 一种智能客服数据处理方法、装置及计算设备、存储介质
CN108874324B (zh) 一种访问请求处理方法、装置、设备及可读存储介质
CN112445857A (zh) 一种基于数据库的资源配额管理方法和装置
CN110247856A (zh) 服务器资源释放方法和装置
CN109191287A (zh) 一种区块链智能合约的分片方法、装置及电子设备
WO2020134364A1 (zh) 一种虚拟机迁移方法、云计算管理平台和存储介质
CN107943854A (zh) 征信业务查询方法、装置及计算机可读存储介质
CN112181948A (zh) 数据库操作语句的处理方法、装置、电子设备和介质
CN109582649A (zh) 一种元数据存储方法、装置、设备及可读存储介质
US20230283655A1 (en) Data download method and apparatus, electronic device, and readable storage medium
WO2020000724A1 (zh) 云平台主机间通信负载的处理方法、电子装置及介质
EP4357916A1 (en) Job processing method and apparatus, computer device, and storage medium
CN110119364B (zh) 一种输入/输出批量提交的方法和系统
US11550692B2 (en) Integrated event processing and policy enforcement

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20898811

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20898811

Country of ref document: EP

Kind code of ref document: A1