Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Distributed current limiting implementation method and system based on sliding window algorithm

A sliding window, distributed technology, applied in transmission systems, electrical components, etc., can solve problems such as the total amount of front and rear traffic exceeding, and achieve the effect of avoiding invalid occupation, protecting the security of upstream services, and realizing traffic.

Pending Publication Date: 2022-03-15
SHANDONG LANGCHAO YUNTOU INFORMATION TECH CO LTD
View PDF5 Cites 4 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

How to ensure accurate distributed current limiting for cloud-native gateway services in high-availability and multi-instance business scenarios has become a basic problem for cloud-native gateways; common current limiting solutions include frequency limiting and current limiting based on the leaky bucket algorithm, Total current limit based on token bucket, but the above solutions will cause different problems
The current limiting strategy based on the leaky bucket algorithm needs to be locked every time it is updated in a distributed architecture to ensure the flow control strategy of the leaky bucket algorithm; the current limiting strategy based on the token bucket will cause the token bucket to reset the token The total amount of traffic before and after the action exceeds the set current limiting times per unit time; therefore, a distributed current limiting implementation method and system based on a sliding window algorithm is invented to solve the above problems

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Distributed current limiting implementation method and system based on sliding window algorithm
  • Distributed current limiting implementation method and system based on sliding window algorithm
  • Distributed current limiting implementation method and system based on sliding window algorithm

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0061] A method for implementing distributed current limiting based on a sliding window algorithm, the specific steps of the method are as follows:

[0062] S1 uses Redis to select the storage of current-limited data;

[0063] S2 selects the ZSet data type in Redis as the technical resource for sliding window current limiting;

[0064] S3 sets the unique identifier in Redis as the key of ZSet;

[0065] S4 uses the resource recovery mechanism of Redis to set the survival time for each API's current-limited resource pool;

[0066] Based on the sliding window algorithm, S5 sets the requested Key to the millisecond-level timestamp at the moment of request entry + the value corresponding to the self-incrementing Key in Redis;

[0067] S6 sets rules to count and limit API traffic;

[0068] First, select the type of current-limited data storage. Redis (Remote Dictionary Server), that is, remote dictionary service, is an open-source log-type and Key-Value database written in ANSI C l...

Embodiment 2

[0100] A distributed current limiting implementation system based on a sliding window algorithm, the system specifically includes a storage type selection module, a resource selection module, an identification setting module, a time setting module, a value setting module and a rule setting module:

[0101]Storage selection module: Use Redis to select the storage of current-limited data;

[0102] Resource selection module: select the ZSet data type in Redis as the technical resource for sliding window current limiting;

[0103] Identity setting module: set the unique identity in Redis as the key of ZSet;

[0104] Time setting module: use Redis's resource recovery mechanism to set the survival time for each API's current-limited resource pool;

[0105] Value setting module: Based on the sliding window algorithm, set the requested Key to the millisecond-level timestamp at the time of request entry + the value corresponding to the self-incrementing Key in Redis;

[0106] Rule se...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a distributed current limiting implementation method and system based on a sliding window algorithm, and belongs to the field of cloud native. The method comprises the following specific steps: S1, carrying out model selection on storage of the current limiting data by utilizing Redis; s2, selecting a ZSet data type in Redis as a technical resource for sliding window flow limiting; s3, setting a unique identifier in the Redis as a key of the ZSet; s4, setting survival time for the current limiting resource pool of each API by using a resource recovery mechanism of Redis; s5, on the basis of a sliding window algorithm, setting the requested Key as a value value corresponding to the millisecond-level timestamp of the request entering moment + the self-increasing Key in the Redis; s6, setting a rule to count and limit the flow of the API; according to the method, the Redis cluster deployed in the cluster is used as a main implementation component of the current limiting function, so that the cloud source biochemistry of the gateway current limiting service and the high adaptability to the cluster environment are ensured, and the basic requirements of the current large environment on the service ecology are met.

Description

technical field [0001] The invention discloses a distributed current limiting implementation method and system based on a sliding window algorithm, and relates to the technical field of cloud native technology. Background technique [0002] With the continuous development of cloud native technology, container technology represented by Kubernetes is becoming a new interface for cloud computing. How to ensure accurate distributed current limiting for cloud-native gateway services in high-availability and multi-instance business scenarios has become a basic problem for cloud-native gateways; common current limiting solutions include frequency limiting and current limiting based on the leaky bucket algorithm, Total traffic limit based on token bucket, but the above solutions will cause different problems. The current limiting strategy based on the leaky bucket algorithm needs to be locked every time it is updated in a distributed architecture to ensure the flow control strategy...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): H04L47/22H04L47/24H04L47/28H04L47/32H04L67/1042
CPCH04L47/225H04L47/24H04L47/286H04L47/32H04L67/1044
Inventor 盖泉贺张东海孙兴艳
Owner SHANDONG LANGCHAO YUNTOU INFORMATION TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products