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.
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
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...
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com