CN114615202B - Flow access control method and device - Google Patents

Flow access control method and device Download PDF

Info

Publication number
CN114615202B
CN114615202B CN202210237256.9A CN202210237256A CN114615202B CN 114615202 B CN114615202 B CN 114615202B CN 202210237256 A CN202210237256 A CN 202210237256A CN 114615202 B CN114615202 B CN 114615202B
Authority
CN
China
Prior art keywords
key
value
access
redis
database
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN202210237256.9A
Other languages
Chinese (zh)
Other versions
CN114615202A (en
Inventor
农倩倩
单亚冰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Bank of China Ltd
Original Assignee
Bank of China Ltd
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 Bank of China Ltd filed Critical Bank of China Ltd
Priority to CN202210237256.9A priority Critical patent/CN114615202B/en
Publication of CN114615202A publication Critical patent/CN114615202A/en
Application granted granted Critical
Publication of CN114615202B publication Critical patent/CN114615202B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/20Traffic policing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a flow access control method and a flow access control device, which can be used in the financial field, wherein the method comprises the following steps: receiving a flow access request, wherein the flow access request comprises a plurality of key words; if the access times corresponding to the key words do not exceed the preset access threshold value, adding 1 to the value corresponding to each key word in the database by using the redis key value; creating access record key and expiration time parameters corresponding to each key in a rediskey database; and updating the value corresponding to each key in the database by using the redis key value according to the key of the access record and the expiration time parameter. The invention can perform flow access control, reduce transaction response time, avoid the condition that access quantity is suddenly increased and reduced, and realize stable flow control.

Description

Flow access control method and device
Technical Field
The invention relates to the field of finance, in particular to a flow access control method and a flow access control device. It should be noted that the flow access control method and apparatus of the present invention may be used in the financial field, and may be used in any field other than the financial field, and the application field of the flow access control method and apparatus of the present invention is not limited.
Background
This section is intended to provide a background or context to the embodiments of the invention that are recited in the claims. The description herein is not admitted to be prior art by inclusion in this section.
When the application system sends information to the mobile phone number of an unauthenticated client, the harassment of junk information to the client caused by the attack of the system is prevented, and the risk of short message bombing is prevented. One of the measures we take is to limit the frequency of sending short messages and limit the total amount of information sent over a period of time. For example, the system uses a limit of 2 transmissions per minute, 15 transmissions per hour, and 60 transmissions per day.
Every time a user has a transaction, a stream of data is inserted into the mysql database. Every time a transaction is newly started, counting and inquiring how many transactions exist in the last minute/last hour/last day, and respectively judging whether the number of the transactions is exceeded, and if so, reporting an error of 'transaction too frequent'.
In the prior art, the system has different flow control limits for different transaction platforms, different business transaction channels and different interfaces. For each client visit, the system compares the number of transactions obtained in the statistics visit schedule of minutes, hours and one day for a plurality of general dimensions, as shown in fig. 1 and 2. This approach, while improving the differentiated configuration of flow control, has the following problems:
1) The higher the differentiated configuration, the higher the limit dimension, the higher the statistical cost and the long time. For example, the four-dimensional minute, hour, day limits provided in current systems require statistics of at least 4*3 transactions from a database, a large amount of statistics, and transaction response time. And as the limit maintenance increases, the amount of statistics doubles, the response time also gets longer, and the code complexity becomes higher.
2) The statistics time is long, the statistics aging of the minute level is affected, and the statistics distortion of the minute level is distorted.
3) In order to facilitate the management of the data volume of the flow list, a mechanism of early morning zero-point daily clearing is adopted at present, so that malicious bombing access is performed in a clearing period, the access volume is suddenly increased and dropped, and stable control of the flow cannot be achieved.
Thus, there is a need for a flow access control scheme that overcomes the above-described problems.
Disclosure of Invention
The embodiment of the invention provides a flow access control method, which is used for carrying out flow access control, reducing transaction response time, avoiding the condition that access quantity is suddenly increased and decreased, and realizing stable flow control, and comprises the following steps:
Receiving a flow access request, wherein the flow access request comprises a plurality of key words;
If the access times corresponding to the key words do not exceed the preset access threshold value, adding 1 to the value corresponding to each key word in the database by using the redis key value;
Creating access record key and expiration time parameters corresponding to each key in a rediskey database;
And updating the value corresponding to each key in the database by using the redis key value according to the key of the access record and the expiration time parameter.
The embodiment of the invention provides a flow access control device, which is used for carrying out flow access control, reducing transaction response time, avoiding the condition that the access quantity is suddenly increased and decreased, and realizing stable flow control, and comprises the following components:
The request receiving module is used for receiving a flow access request, wherein the flow access request comprises a plurality of key words;
The key value processing module is used for adding 1 to the value corresponding to each key of the database by using the redis key value if the access times corresponding to the key of the plurality of keys do not exceed the preset access threshold;
The parameter creation module is used for creating access record key words and expiration time parameters corresponding to each key word in the redis key value database;
And the key value updating module is used for updating the value corresponding to each key in the database by the redis key value according to the key of the access record and the expiration time parameter.
The embodiment of the invention also provides a computer device which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor realizes the flow access control method when executing the computer program.
The embodiment of the invention also provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program realizes the flow access control method when being executed by a processor.
The embodiment of the invention also provides a computer program product, which comprises a computer program, and the computer program realizes the flow access control method when being executed by a processor.
The embodiment of the invention receives a flow access request, wherein the flow access request comprises a plurality of key words; if the access times corresponding to the key words do not exceed the preset access threshold value, adding 1 to the value corresponding to each key word in the database by using the redis key value; creating access record key and expiration time parameters corresponding to each key in a rediskey database; and updating the value corresponding to each key in the database by using the redis key value according to the key of the access record and the expiration time parameter. The embodiment of the invention creates the access record key and the expiration time parameter corresponding to each key by using the redis key value, and further updates the value corresponding to each key in the database according to the access record key and the expiration time parameter, thereby reducing the transaction response time, avoiding the condition of steep increase and decrease of the access quantity and realizing stable flow control.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art. In the drawings:
FIGS. 1-2 are schematic diagrams of conventional flow access control;
FIG. 3 is a schematic diagram of a method for controlling flow access in an embodiment of the present invention;
FIGS. 4-5 are flow charts of flow access control in an embodiment of the present invention;
FIG. 6 is a block diagram of a flow access control device according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of a computer device according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the embodiments of the present invention will be described in further detail with reference to the accompanying drawings. The exemplary embodiments of the present invention and their descriptions herein are for the purpose of explaining the present invention, but are not to be construed as limiting the invention.
In order to perform flow access control, reduce transaction response time, avoid situations of abrupt increase and decrease of access amount, and implement flow stability control, an embodiment of the present invention provides a flow access control method, as shown in fig. 3, where the method may include:
step 301, receiving a traffic access request, wherein the traffic access request comprises a plurality of key words;
step 302, if the access times corresponding to the plurality of key words do not exceed the preset access threshold, adding 1 to the value corresponding to each key word in the database by using the redis key value;
Step 303, creating access record key and expiration time parameters corresponding to each key in the redis key database;
And 304, updating the value corresponding to each key in the database by using the redis key value according to the key of the access record and the expiration time parameter.
As can be seen from fig. 3, the embodiment of the present invention receives a traffic access request, where the traffic access request includes a plurality of key words; if the access times corresponding to the key words do not exceed the preset access threshold value, adding 1 to the value corresponding to each key word in the database by using the redis key value; creating access record key and expiration time parameters corresponding to each key in a rediskey database; and updating the value corresponding to each key in the database by using the redis key value according to the key of the access record and the expiration time parameter. The embodiment of the invention creates the access record key and the expiration time parameter corresponding to each key by using the redis key value, and further updates the value corresponding to each key in the database according to the access record key and the expiration time parameter, thereby reducing the transaction response time, avoiding the condition of steep increase and decrease of the access quantity and realizing stable flow control.
In an embodiment, a traffic access request is received, the traffic access request comprising a plurality of key words; if the access times corresponding to the key words do not exceed the preset access threshold value, adding 1 to the value corresponding to each key word in the database by using the redis key value; creating access record key and expiration time parameters corresponding to each key in a rediskey database; and updating the value corresponding to each key in the database by using the redis key value according to the key of the access record and the expiration time parameter.
In one embodiment, the value comprises: presetting access times in a minute;
Adding 1 to the value corresponding to each key of the key in the database by using the redis key value comprises the following steps: adding 1 to access times in preset minutes corresponding to each key of the key database according to the redis key value;
The expiration time parameter includes: presetting for a minute;
Updating the value corresponding to each key in the database by the redis key value according to the key of the access record and the expiration time parameter, wherein the updating comprises the following steps: and after the preset minutes, subtracting 1 from the access times in the preset minutes corresponding to each key of the database by using the redis key value.
In one embodiment, the value comprises: presetting access times in an hour;
Adding 1 to the value corresponding to each key of the key in the database by using the redis key value comprises the following steps: adding 1 to access times in preset hours corresponding to each key of the key database according to the redis key value;
The expiration time parameter includes: presetting for hours;
Updating the value corresponding to each key in the database by the redis key value according to the key of the access record and the expiration time parameter, wherein the updating comprises the following steps: and after the preset hours pass, subtracting 1 from the access times of each keyword key in the database in the preset hours.
In one embodiment, the value comprises: the number of access times in a preset number of days;
Adding 1 to the value corresponding to each key of the key in the database by using the redis key value comprises the following steps: adding 1 to the access times of the redis key value in the preset days corresponding to each key in the database;
the expiration time parameter includes: a preset number of days;
Updating the value corresponding to each key in the database by the redis key value according to the key of the access record and the expiration time parameter, wherein the updating comprises the following steps: and after the preset days pass, subtracting 1 from the access times of the redis key value in the preset days corresponding to each key of the keywords in the database.
A specific embodiment is given below to illustrate a specific application of the flow access control in the embodiment of the present invention. As shown in fig. 4-5, a complex scenario of multidimensional, multi-time window control is provided through a key value expiration mechanism and a notification mechanism of redis.
1) And setting a key value of redis to realize statistics of flow control of different dimensions and dimension combinations. For example: for different mobile phone numbers, different platforms and different service channels, key-value values of flow statistics of different service interfaces in different time windows are set as follows: ([ minutes, hours, 24 hours ] refers to the statistical dimension of the corresponding key values, the number of accesses per minute is common to the number of accesses per minute, the number of accesses per hour is common to the number of accesses per hour, and the number of accesses per 24 hours is common to the number of accesses per hour)
Cell phone number-platform name-business channel-service interface: [ min, hr, 24 hr ];
handset number-platform name: [ min, hr, 24 hr ];
cell phone number-business channel: [ min, hr, 24 hr ];
Cell phone number-service interface: [ min, hr, 24 hr ].
When the transaction exists each time, the key value and the upper limit of the limit rule are compared, and if the limit is exceeded, the error is directly reported; when smaller than, the value of the corresponding key is +1:
cell phone number-platform name-business channel-service interface: [ min+1, hr+1, 24 hr+1 ];
Handset number-platform name: [ min+1, hr+1, 24 hr+1 ];
Cell phone number-business channel: [ min+1, hr+1, 24 hr+1 ];
cell phone number-service interface: [ min+1, hr+1, 24 hr+1 ].
2) When access is possible, it is necessary to create a key value of an access record and set an expiration time in addition to the access amount +1 to the above-described corresponding key value. The first corresponding key and expiration time above are as follows, and the other 3 key values generate access record key values that are similar.
The expiration time of the mobile phone number, the platform name, the service channel, the service interface and the m-uuid is 60s;
Handset number-platform name-business channel-service interface-h-uuid expiration time 3600s;
handset number-platform name-business channel-service interface-d-uuid expiration time 86400s.
3) The time window is automatically smoothed and automatically pruned for outdated access data.
When the expiration time of the mobile phone number-platform name-business channel-service interface-m-uuid to 60s, notifying to call up the service, for [ mobile phone number-platform name-business channel-service interface: the count of the minute level of [ minute, hour, 24 hours ] ] is decremented by one, then key-value is as follows [ handset number-platform name-business channel-service interface: [ min-1, hr, 24 hr ];
When the expiration time of the mobile phone number-platform name-business channel-service interface-h-uuid to 3600s, notifying to call up the service, for [ mobile phone number-platform name-business channel-service interface: the count at the hour level of [ min, hr, 24 hr ] ] is decremented by one, then key-value is as follows [ cell phone number-platform name-business channel-service interface: [ min, hr-1, 24 hr ];
When the expiration time of the mobile phone number-platform name-business channel-service interface-d-uuid to 86400s, the notification of the call-up service is made to [ mobile phone number-platform name-business channel-service interface: the 24-hour count of [ min, hr, 24 hr ] ] is decremented by one, then key-value is as follows [ phone number-platform name-business channel-service interface: [ min, hr, 24 hr-1 ].
According to the embodiment of the invention, different key values are generated aiming at different dimensions, and [ minutes, hours and 24 hours ] are taken as values, when new transaction exists, each value of list is added with 1, [ minutes+1, hours+1, 24 hours+1 ] in a current limiting range, and the value result of the key is updated. For each key value of the traffic statistics dimension, three key values are generated per transaction as a running water. Flow statistics key corresponding to a flow record key, wherein uuid is uuid corresponding to each transaction: the key-m-uuid sets the expiration time to be 60s; the key-h-uuid sets the expiration time to 3600s; the key-d-uuid sets the expiration time to 86400s. Accesses that are not within the time window are pruned in the traffic statistics. And (3) setting a notification mechanism for expiration of a key value of redis, if the key is [ key-m-uuid ] is expired, calling up a service, subtracting one from the value of the [ key ] in the minute level, namely [ minutes-1, hours, 24 hours ], and updating the value of the [ key ]. If the key is [ key-h-uuid ] is expired, the service is invoked, the value of the [ key ] is updated by subtracting one from the value of the [ key ] in the hour level, namely [ minutes, hours-1, 24 hours ]. If the key is [ key-d-uuid ] is expired, the service is invoked, the value of [ key ] is updated by subtracting one from the value of [ key ] at 24 hours, namely [ min-1, hour, 24 hours-1 ]. The two redis libraries cooperate with each other as shown in Table 1.
TABLE 1
The embodiment of the invention utilizes the modes of redis1 and redis2 to record the total number of accesses and access running water respectively, and utilizes the expiration mechanism and notification mechanism of redis, and can automatically update and delete the statistics data which are expired relative to the time window in redis1 through the access running water. The design of the key value of Redis can facilitate the increase of the current limiting control rule of any dimension. Has the following advantages: the flow control of the new dimension can be flexibly increased, the time window can be flexibly set, only the expiration time is required to be modified, the time window is smoothly moved, and the conditions of abrupt increase and abrupt decrease can not exist. The invention uses the key of redis to set overtime mechanism and notification mechanism to control the time window smoothly, avoiding the condition of abrupt increase and decrease of flow. When the user accesses, the transaction number is increased by 1, so that the statistical calculation of transaction flow is not needed, and the transaction response is fast. Even if a statistical dimension is newly added, only one key value of redis is needed to be added, complex mysql query strip primary combination is not needed, the code multiplexing degree is high, and the complexity is low. The public mechanism can be multiplexed, the acquisition of the statistical key value can be performed, and the comparison and judgment can be performed. Other parts only need to use the timeout mechanism and notification mechanism of redis to support.
Based on the same inventive concept, the embodiment of the invention also provides a flow access control device, as described in the following embodiment. Since the principles of solving the problems are similar to those of the flow access control method, the implementation of the flow access control device can be referred to as the implementation of the method, and the repetition is omitted.
Fig. 6 is a structural diagram of a flow access control device according to an embodiment of the present invention, and as shown in fig. 6, the flow access control device includes:
a request receiving module 601, configured to receive a traffic access request, where the traffic access request includes a plurality of key words;
the key value processing module 602 is configured to add 1 to a value corresponding to each key of the redis key value in the database if the access times corresponding to the plurality of keys do not exceed a preset access threshold;
a parameter creation module 603, configured to create an access record key and an expiration time parameter corresponding to each key in the redis key database;
And a key value updating module 604, configured to update a value corresponding to each key in the database by using the redis key value according to the access record key and the expiration time parameter.
In one embodiment, the value comprises: presetting access times in a minute;
The key value processing module 602 is further configured to: adding 1 to access times in preset minutes corresponding to each key of the key database according to the redis key value;
The expiration time parameter includes: presetting for a minute;
the key value update module 604 is further configured to: and after the preset minutes, subtracting 1 from the access times in the preset minutes corresponding to each key of the database by using the redis key value.
In one embodiment, the value comprises: presetting access times in an hour;
the key value processing module 602 is further configured to: adding 1 to access times in preset hours corresponding to each key of the key database according to the redis key value;
The expiration time parameter includes: presetting for hours;
The key value update module 604 is further configured to: and after the preset hours pass, subtracting 1 from the access times of each keyword key in the database in the preset hours.
In one embodiment, the value comprises: the number of access times in a preset number of days;
the key value processing module 602 is further configured to: adding 1 to the access times of the redis key value in the preset days corresponding to each key in the database;
the expiration time parameter includes: a preset number of days;
The key value update module 604 is further configured to: and after the preset days pass, subtracting 1 from the access times of the redis key value in the preset days corresponding to each key of the keywords in the database.
Based on the foregoing inventive concept, as shown in fig. 7, an embodiment of the present invention further provides a computer device 700, including a memory 710, a processor 720, and a computer program 730 stored in the memory 710 and executable on the processor 720, where the processor 720 implements the above-mentioned flow access control method when executing the computer program 730.
Based on the foregoing inventive concept, an embodiment of the present invention also provides a computer-readable storage medium storing a computer program which when executed by a processor implements the above-described flow access control method.
The embodiment of the invention also provides a computer program product, which comprises a computer program, and the computer program realizes the flow access control method when being executed by a processor.
The embodiment of the invention receives a flow access request, wherein the flow access request comprises a plurality of key words; if the access times corresponding to the key words do not exceed the preset access threshold value, adding 1 to the value corresponding to each key word in the database by using the redis key value; creating access record key and expiration time parameters corresponding to each key in a rediskey database; and updating the value corresponding to each key in the database by using the redis key value according to the key of the access record and the expiration time parameter. The embodiment of the invention creates the access record key and the expiration time parameter corresponding to each key by using the redis key value, and further updates the value corresponding to each key in the database according to the access record key and the expiration time parameter, thereby reducing the transaction response time, avoiding the condition of steep increase and decrease of the access quantity and realizing stable flow control.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The foregoing description of the embodiments has been provided for the purpose of illustrating the general principles of the invention, and is not meant to limit the scope of the invention, but to limit the invention to the particular embodiments, and any modifications, equivalents, improvements, etc. that fall within the spirit and principles of the invention are intended to be included within the scope of the invention.

Claims (10)

1. A method for controlling traffic access, comprising:
Receiving a flow access request, wherein the flow access request comprises a plurality of key words;
If the access times corresponding to the key words do not exceed the preset access threshold value, adding 1 to the value corresponding to each key word in the database by using the redis key value;
Creating access record key and expiration time parameters corresponding to each key in a rediskey database;
updating the value corresponding to each key in the database by using the redis key value according to the key of the access record and the expiration time parameter;
The method comprises the steps of adopting two redis libraries to cooperate with each other, wherein the first redis library is used for storing the sum of flow access statistics, adding one transaction, adding 1 to the statistics, and the second redis library is used for storing access pipelining and setting expiration time; and adopting automatic smoothing control of a time window, and automatically deleting the expired access data.
2. The flow access control method of claim 1, wherein the value comprises: presetting access times in a minute;
Adding 1 to the value corresponding to each key of the key in the database by using the redis key value comprises the following steps: adding 1 to access times in preset minutes corresponding to each key of the key database according to the redis key value;
The expiration time parameter includes: presetting for a minute;
Updating the value corresponding to each key in the database by the redis key value according to the key of the access record and the expiration time parameter, wherein the updating comprises the following steps: and after the preset minutes, subtracting 1 from the access times in the preset minutes corresponding to each key of the database by using the redis key value.
3. The flow access control method of claim 1, wherein the value comprises: presetting access times in an hour;
Adding 1 to the value corresponding to each key of the key in the database by using the redis key value comprises the following steps: adding 1 to access times in preset hours corresponding to each key of the key database according to the redis key value;
The expiration time parameter includes: presetting for hours;
Updating the value corresponding to each key in the database by the redis key value according to the key of the access record and the expiration time parameter, wherein the updating comprises the following steps: and after the preset hours pass, subtracting 1 from the access times of each keyword key in the database in the preset hours.
4. The flow access control method of claim 1, wherein the value comprises: the number of access times in a preset number of days;
Adding 1 to the value corresponding to each key of the key in the database by using the redis key value comprises the following steps: adding 1 to the access times of the redis key value in the preset days corresponding to each key in the database;
the expiration time parameter includes: a preset number of days;
Updating the value corresponding to each key in the database by the redis key value according to the key of the access record and the expiration time parameter, wherein the updating comprises the following steps: and after the preset days pass, subtracting 1 from the access times of the redis key value in the preset days corresponding to each key of the keywords in the database.
5. A flow access control device, comprising:
The request receiving module is used for receiving a flow access request, wherein the flow access request comprises a plurality of key words;
The key value processing module is used for adding 1 to the value corresponding to each key of the database by using the redis key value if the access times corresponding to the key of the plurality of keys do not exceed the preset access threshold;
The parameter creation module is used for creating access record key words and expiration time parameters corresponding to each key word in the redis key value database;
The key value updating module is used for updating the value corresponding to each key of the rediskey value database according to the key of the access record and the expiration time parameter; the method comprises the steps of adopting two redis libraries to cooperate with each other, wherein the first redis library is used for storing the sum of flow access statistics, adding one transaction, adding 1 to the statistics, and the second redis library is used for storing access pipelining and setting expiration time; and adopting automatic smoothing control of a time window, and automatically deleting the expired access data.
6. The flow access control device of claim 5, wherein the value comprises: presetting access times in a minute;
The key value processing module is further configured to: adding 1 to access times in preset minutes corresponding to each key of the key database according to the redis key value;
The expiration time parameter includes: presetting for a minute;
The key value update module is further configured to: and after the preset minutes, subtracting 1 from the access times in the preset minutes corresponding to each key of the database by using the redis key value.
7. The flow access control device of claim 5, wherein the value comprises: presetting access times in an hour;
the key value processing module is further configured to: adding 1 to access times in preset hours corresponding to each key of the key database according to the redis key value;
The expiration time parameter includes: presetting for hours;
The key value update module is further configured to: and after the preset hours pass, subtracting 1 from the access times of each keyword key in the database in the preset hours.
8. The flow access control device of claim 5, wherein the value comprises: the number of access times in a preset number of days;
The key value processing module is further configured to: adding 1 to the access times of the redis key value in the preset days corresponding to each key in the database;
the expiration time parameter includes: a preset number of days;
the key value update module is further configured to: and after the preset days pass, subtracting 1 from the access times of the redis key value in the preset days corresponding to each key of the keywords in the database.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method of any of claims 1 to 4 when executing the computer program.
10. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program which, when executed by a processor, implements the method of any of claims 1 to 4.
CN202210237256.9A 2022-03-10 2022-03-10 Flow access control method and device Active CN114615202B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210237256.9A CN114615202B (en) 2022-03-10 2022-03-10 Flow access control method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210237256.9A CN114615202B (en) 2022-03-10 2022-03-10 Flow access control method and device

Publications (2)

Publication Number Publication Date
CN114615202A CN114615202A (en) 2022-06-10
CN114615202B true CN114615202B (en) 2024-06-21

Family

ID=81862649

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210237256.9A Active CN114615202B (en) 2022-03-10 2022-03-10 Flow access control method and device

Country Status (1)

Country Link
CN (1) CN114615202B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102780603A (en) * 2011-05-11 2012-11-14 阿里巴巴集团控股有限公司 Web traffic control method and device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100393069C (en) * 2004-12-29 2008-06-04 中兴通讯股份有限公司 Method of differentiating multiple services for anti IP data stream in multicast to impact communication system
CN113965519B (en) * 2021-09-06 2024-01-26 阿里巴巴(中国)有限公司 Flow control and cluster resource guarantee method, equipment and storage medium

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102780603A (en) * 2011-05-11 2012-11-14 阿里巴巴集团控股有限公司 Web traffic control method and device

Also Published As

Publication number Publication date
CN114615202A (en) 2022-06-10

Similar Documents

Publication Publication Date Title
CN100520760C (en) Apparatus and method for handling electronic mail
US20070088641A1 (en) Methods, systems, and computer program products for managing services accounts through electronic budget adjustments based on defined rules
CN1308811A (en) Tariff management apparatus and methods for communications terminals using smart cards
CN111010426A (en) Message pushing method and device
US6442569B1 (en) Apparatus and method for data transfer between databases
CN111585913B (en) Service flow limiting method based on recovery token and storage medium
US20140092737A1 (en) Traffic control method and traffic control apparatus
CN110933698A (en) Monitoring management method, device and equipment for Internet of things card
CN115277577A (en) Data processing method, data processing device, computer equipment and computer readable storage medium
US7844038B2 (en) Systems, methods and apparatus for tracking on-call activity
CN101951623A (en) User behavior statistical method and device based on user events
CN114615202B (en) Flow access control method and device
EP3945420A1 (en) Method and apparatus for data processing, server and storage medium
CN110191097A (en) Detection method, system, equipment and the storage medium of login page safety
EP2348676B1 (en) Method for accessing magnanimity data of intelligent network service database and system and device thereof
CN112800066A (en) Index management method, related device and storage medium
CN116360981A (en) Resource management method and device
CN111026748B (en) Data compression method, device and system for network access frequency management and control
US20120202456A1 (en) Method and system for optimising the efficiency with which telecommunication network resources are used
CN112000390A (en) User information management method and device, electronic equipment and storage medium
CN116132528B (en) Flight management message pushing method and device and electronic equipment
CN113886078B (en) Method and device for realizing quota unified management based on dynamic threshold mechanism, electronic equipment and computer readable storage medium
CN115002216B (en) Downloading method, downloading device, terminal equipment and readable storage medium
CN112350887B (en) APM probe sampling rate determining method, computer equipment and storage medium
CN109104293B (en) Method and device for managing converged communication system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant