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

Distributed current limiting method based on redis, computer equipment and storage medium

A current limiting method and distributed technology, applied in the field of traffic management, which can solve the problem that multiple gateway servers cannot share current limiting traffic.

Pending Publication Date: 2021-06-08
欧冶云商股份有限公司
View PDF4 Cites 2 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

The traditional flow limitation method is limited in the memory of a single machine, and multiple gateway servers cannot share the flow limit flow. With the increasing number of open gateways, how to realize multi-machine distributed flow limitation poses a challenge to the current technology. Higher requirements

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 method based on redis, computer equipment and storage medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment

[0027] The present invention provides a redis-based distributed current limiting method, which adopts and improves the token bucket algorithm, which is currently the most commonly used one in network traffic shaping (Traffic Shaping) and rate limiting (RateLimiting) algorithm. Typically, the token bucket algorithm is used to control the amount of data sent to the network and to allow bursts of data to be sent. The principle of the invention is that the system will put tokens into the bucket at a constant speed, and if the request needs to be processed, it needs to obtain a token from the bucket first, and when there is no token available in the bucket, the service will be refused.

[0028] The concrete steps of a kind of redis-based distributed current limiting method include the following contents:

[0029] Step 1. Set the current limit interval to interval (example: 1 second), the number of tokens that need to be placed in the token bucket intervalTokens (example: 1000) in ...

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 relates to a distributed current limiting method based on redis, computer equipment and a storage medium. The method comprises the following steps: setting current limiting interval time, the number of tokens needing to be put into a token bucket in each interval time, the number of tokens consumed by a user in each request and the maximum capacity of the token bucket; judging whether a traffic limiting condition identifier identifying the user http request exists in redis or not, if not, placing the maximum number of tokens in a token bucket, and setting the token placing time as request time, if yes, judging whether the interval between the current request time and the last token placing time of the current identifier information exceeds the traffic limiting interval time, and if not, sending the traffic limiting condition identifier to the user http request; if the number does not exceed the reset number of the placed tokens, resetting the time for placing the tokens as the request time; acquiring the token from the token bucket, and acquiring a successful execution request; and obtaining a failure rejection request. According to the invention, the limitation problem that an existing flow limiting mode can only act on one machine is solved, and a plurality of machines share the flow limiting limit.

Description

technical field [0001] The invention relates to the technical field of traffic management, in particular to a redis-based distributed current limiting method, computer equipment and storage media. Background technique [0002] With the development of computer technology, more and more technologies are applied in the financial field or IT technology and other fields, but due to the security and real-time requirements of various industries, higher requirements are also put forward for technology. Among them, in terms of data traffic management, in order to prevent the system from being paralyzed due to excessive access to a certain server or an application, flow limiting is often used to protect the server or application background. Current limiting is a means for a service or application to protect itself. It guarantees its own load by limiting or rejecting the traffic of the caller. The traditional flow limitation method is limited in the memory of a single machine, and mul...

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): H04L12/819H04L29/08H04L47/21
CPCH04L47/215H04L67/02
Inventor 吕峰辉高晓国杜余波刘晶
Owner 欧冶云商股份有限公司
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