CN115297061A - Token bucket updating method and device, electronic equipment and storage medium - Google Patents

Token bucket updating method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115297061A
CN115297061A CN202210899897.0A CN202210899897A CN115297061A CN 115297061 A CN115297061 A CN 115297061A CN 202210899897 A CN202210899897 A CN 202210899897A CN 115297061 A CN115297061 A CN 115297061A
Authority
CN
China
Prior art keywords
token
configuration table
updating
preset
tokens
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.)
Pending
Application number
CN202210899897.0A
Other languages
Chinese (zh)
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.)
CITIC Aibank Corp Ltd
Original Assignee
CITIC Aibank Corp 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 CITIC Aibank Corp Ltd filed Critical CITIC Aibank Corp Ltd
Priority to CN202210899897.0A priority Critical patent/CN115297061A/en
Publication of CN115297061A publication Critical patent/CN115297061A/en
Pending legal-status Critical Current

Links

Images

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
    • 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/23Updating

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The disclosure provides a token bucket updating method, a token bucket updating device, an electronic device and a storage medium. The availability of the token is limited through a management mechanism of the token, the cache information is gathered through the real-time token, the use of the token is managed according to multiple dimensions, and the dependence on a database is reduced through a secondary cache mechanism. Therefore, the maximum excavation of the system capacity is realized, the token is dynamically and flexibly adjusted, and the flow control mechanism for efficiently managing the token in real time is cached. Therefore, the capacity expansion and contraction or quasi-real-time adjustment capability can be synchronously and dynamically realized according to the change of the background processing capability. In the scenes of transaction volume surge and flow surge, when the system has equivalent processing capacity, the dynamic capacity expansion can be carried out to avoid the waste of partial performance.

Description

Token bucket updating method and device, electronic equipment and storage medium
Technical Field
The disclosure relates to the technical field of computers, and in particular relates to a token bucket updating method and device, an electronic device and a storage medium.
Background
With the development of information-based services, when various application systems handle large concurrent and malicious accesses, a traffic limitation capability is required to protect the security of stable operation of the application systems or access to internal networks of mechanisms. Protecting the load capacity of critical applications and services becomes an imperative when abnormal traffic occurs or transactions surge.
At present, the flow control function is usually implemented based on a token bucket algorithm. The principle of token bucket algorithm is that the system will put tokens into the bucket at a constant rate, and if a request needs to be processed, it will need to first get a token from the bucket, and if no token is available in the bucket, it will refuse service. The technology can only ensure that the flow is in a certain size, and cannot process scenes when the flow is increased suddenly, so that when the flow is increased suddenly, even if the system has considerable processing capacity, the processing capacity of the system cannot be effectively used, and partial performance is wasted.
Disclosure of Invention
The disclosure provides a token bucket updating method, a token bucket updating device, an electronic device and a storage medium.
In a first aspect, the present disclosure provides a token bucket updating method, including:
responding to a received token adjusting request sent by a request end, and acquiring a token adjusting quantity aiming at a token bucket from the token adjusting request;
obtaining a pre-stored token configuration table, wherein the token configuration table comprises token information;
updating token information in a preset token configuration table according to the token adjustment quantity;
and updating the token bucket based on the updated token configuration table.
In some optional embodiments, the token information includes token identifications and corresponding token attribute information in the token bucket.
In some optional embodiments, the token attribute information comprises at least one of: an initialization state, an available state, a locked state, and a closed state.
In some alternative embodiments, the token adjustment request comprises increasing a first preset number of tokens; and
the updating token information in a preset token configuration table according to the token adjustment quantity includes:
and adding tokens of which the first preset number and the token attribute state are initialization states from a preset token configuration table.
In some optional embodiments, the token adjustment request comprises a reduction of a second preset number of tokens; and
the updating token information in a preset token configuration table according to the token adjustment quantity comprises:
determining tokens of which the second preset number and the token attribute states are available states from a preset token configuration table;
and updating the token attribute state of the determined token to the closed state.
In a second aspect, the present disclosure provides a token bucket updating apparatus, comprising:
the first obtaining unit is configured to respond to the received token adjusting request sent by a request end, and obtain a token adjusting quantity aiming at the token bucket from the token adjusting request;
a second obtaining unit configured to obtain a pre-stored token configuration table, the token configuration table including token information;
the first updating unit is configured to update the token information in a preset token configuration table according to the token adjustment quantity;
a second updating unit configured to update the token bucket based on the updated token configuration table.
In some alternative embodiments, the token adjustment request comprises increasing a first preset number of tokens; and
the first updating unit is further configured to:
and adding tokens of which the first preset number and the token attribute state are initialization states from a preset token configuration table.
In some optional embodiments, the token adjustment request comprises a reduction of a second preset number of tokens; and
the first updating unit is further configured to:
determining tokens of which the second preset number and the token attribute states are available states from a preset token configuration table;
and updating the token attribute state of the determined token to the closed state.
In a third aspect, the present disclosure provides an electronic device, comprising: one or more processors; a storage device, on which one or more programs are stored, which, when executed by the one or more processors, cause the one or more processors to implement the method as described in any implementation manner of the first aspect.
In a fourth aspect, the present disclosure provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by one or more processors, implements the method as described in any of the implementations of the first aspect.
The disclosure provides a token bucket updating method, a token bucket updating device, an electronic device and a storage medium. The availability of the token is limited through a management mechanism of the token, the caching information is gathered through the real-time token, the use of the token is managed according to multiple dimensions, and the dependence on a database is reduced through a secondary caching mechanism. Therefore, the maximum excavation of the system capacity is realized, the token is dynamically and flexibly adjusted, and the flow control mechanism for efficiently managing the token in real time is cached. Therefore, the capacity expansion and contraction or quasi-real-time adjustment capability can be synchronously and dynamically realized according to the change of the background processing capability. In the scenes of transaction volume surge and flow surge, when the system has equivalent processing capacity, the dynamic capacity expansion can be carried out to avoid the waste of partial performance.
Drawings
Other features, objects and advantages of the disclosure will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram in which one embodiment of the present disclosure may be applied;
FIG. 2 is a flow diagram for one embodiment of a token bucket update method according to the present disclosure;
FIG. 3 is a business scenario diagram of one embodiment of a token bucket update method according to the present disclosure;
FIG. 4 is a schematic block diagram illustrating one embodiment of a token bucket updating apparatus according to the present disclosure;
FIG. 5 is a schematic block diagram of a computer system suitable for use in implementing the electronic device of the present disclosure.
Detailed Description
The present disclosure is described in further detail below with reference to the figures and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that, in the present disclosure, the embodiments and the features of the embodiments may be combined with each other without conflict. The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 illustrates an exemplary system architecture 100 to which embodiments of the token bucket updating method or token bucket updating apparatus of the present disclosure may be applied.
As shown in fig. 1, system architecture 100 may include terminal device 101, network 102, and server 103. Network 102 is the medium used to provide communication links between terminal equipment 101 and server 103. Network 102 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
A user may use terminal device 101 to interact with server 103 over network 102 to receive or send messages and the like. Various communication client applications, such as a token bucket management application, a background operation and maintenance application, a web browser application, and the like, may be installed on the terminal device 101.
The terminal apparatus 101 may be hardware or software. When the terminal device 101 is hardware, it may be various electronic devices having a display screen and supporting text input, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like. When the terminal apparatus 101 is software, it can be installed in the electronic apparatuses listed above. It may be implemented as multiple software or software modules (e.g., to provide token bucket update services) or as a single software or software module. And is not particularly limited herein.
The server 103 may be a server that provides various services, such as a background server that provides a token bucket update service according to a token adjustment request sent by the terminal device 101. The background server can analyze and process the received token adjustment request and feed back the processing result to the terminal equipment.
In some cases, the token bucket update method provided by the present disclosure may be performed by both the terminal device 101 and the server 103, e.g., "obtaining an adjusted number of tokens for the token bucket" step may be performed by the terminal device 101, and the remaining steps may be performed by the server 103. The present disclosure is not limited thereto. Accordingly, token bucket updating means may also be provided in the terminal device 101 and the server 103, respectively.
In some cases, the token bucket updating method provided by the present disclosure may be executed by the server 103, and accordingly, the token bucket updating apparatus may also be disposed in the server 103, and in this case, the system architecture 100 may also not include the terminal device 101.
In some cases, the token bucket updating method provided by the present disclosure may be executed by the terminal device 101, and accordingly, the token bucket updating apparatus may also be disposed in the terminal device 101, and in this case, the system architecture 100 may not include the server 103.
The server 103 may be hardware or software. When the server 103 is hardware, it may be implemented as a distributed server cluster composed of a plurality of servers, or may be implemented as a single server. When server 103 is software, it may be implemented as multiple software or software modules (e.g., to provide token bucket update services), or as a single software or software module. And is not particularly limited herein.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to fig. 2, a flow 200 of one embodiment of a token bucket update method according to the present disclosure is illustrated. The token bucket updating method comprises the following steps:
step 201, in response to receiving a token adjustment request sent by a request end, obtaining a token adjustment amount for a token bucket from the token adjustment request.
In this embodiment, a user may send a token adjustment request through an operation and maintenance platform of a request end, an execution subject (for example, the server 103 shown in fig. 1) of token bucket update receives the token adjustment request sent by the request end, and may obtain a token adjustment amount for a token bucket from the token adjustment request.
Here, the token may correspond to a certificate of transaction processing. Only if the token is held, the transaction processing can be performed. If the transaction does not hold a token, the transaction will be flow controlled. The token bucket may be a managed pool of tokens generated by configuration (flow control requirements), providing database-level pooling capabilities for token borrowing, enrollment, concurrency management, release, real-time scaling of tokens.
In one scenario, when the background processing capability changes, the transaction concurrent processing capability changes accordingly, and a user may send a token adjustment request through an operation and maintenance platform of a request end. When the background processing capacity is reduced, namely the transaction concurrent processing capacity is reduced, the user can send a request for reducing the number of tokens through the operation and maintenance platform of the request end. When the background processing capacity is increased, namely the transaction concurrent processing capacity is increased, the user can send a request for increasing the number of tokens through the operation and maintenance platform of the request end.
Step 202, a pre-stored token configuration table is obtained.
Here, the token configuration table may include token information. The token configuration table may be used to track the state of all tokens.
The token information may include token identifications and corresponding token attribute information for each token in the token bucket. The token attribute information may include at least one of: an initialization state, an available state, a locked state, and a closed state. Wherein the initialization state may be used to characterize the token as being in the creation state. The lock status may be used to characterize the token as being in a transactionally held state. The available state may be used to characterize the token as being in a released state. The off state may be used to characterize the token as being in a deactivated state.
And step 203, updating the token information in the preset token configuration table according to the token adjustment quantity.
In this embodiment, the executing entity may update the token information in the token configuration table according to the token adjustment amount obtained in step 201.
In one implementation, the token adjustment request may include increasing the first preset number of tokens. Step 203 may further comprise: and adding tokens with a first preset number and the token attribute state as the initialization state from a preset token configuration table.
For example, when the token adjustment request is to add 20 tokens, the execution body adds 20 tokens in the initialization state in the preset token configuration table.
In yet another implementation, the token adjustment request may include a reduction of the second preset number of tokens. Step 203 may further comprise: and determining tokens of which the second preset number and the token attribute state are available states from a preset token configuration table. And updating the token attribute state of the determined token to the closed state.
For example, when the token adjustment request is to reduce 20 tokens, the execution entity determines 20 tokens in available states in the preset token configuration table. And updating the determined token to be in a closed state.
And step 204, updating the tokens in the token bucket based on the updated token configuration table.
In this embodiment, the executing agent may update the number of tokens in the token bucket based on the token configuration table updated in step 203.
For example, when 20 pieces of token information are added to the updated token configuration table. The execution body may add 20 tokens in the token bucket based on the updated token configuration table.
For example, when the updated token configuration table changes the token attribute information of 20 tokens from the available state to the disabled state. The execution body may close 20 tokens in the token bucket based on the updated token configuration table.
In one implementation, two levels of storage are also possible: redis data caching mechanism and database token bucket hierarchy management token mechanism. Specifically, the Redis data caching mechanism may cache in real-time token information: according to the service condition of the token and the transaction flow limiting dimension, multi-dimensional summary calculation is carried out on the service condition of the token in real time, the complexity of a database is reduced depending on a distributed redis architecture, and real-time and rapid processing of concurrent control flow is improved.
In addition, a synchronization mechanism can be provided between the two hierarchies, namely, the data of the two hierarchies are updated synchronously. For example, token information in the Redis data cache may be queried first, and after the token information is determined to be successful, the token configuration table of the token bucket hierarchy of the database may be updated, so as to implement localized storage (persistence).
In yet another implementation, a token handling invalidation mechanism may also be provided: when the token cannot be acquired, the processing scheme is solidified into the processing flow of token management as the whole solution, and developers using the method are hard required to provide a processing plan, so that the processing integrity of the system is effectively improved.
The disclosure provides a token bucket updating method, a token bucket updating device, an electronic device and a storage medium. The availability of the token is limited through a management mechanism of the token, the cache information is gathered through the real-time token, the use of the token is managed according to multiple dimensions, and the dependence on a database is reduced through a secondary cache mechanism. Therefore, the maximum excavation of the system capacity is realized, the token is dynamically and flexibly adjusted, and the flow control mechanism for efficiently managing the token in real time is cached. Therefore, the capacity expansion and contraction or quasi-real-time adjustment capability can be synchronously and dynamically realized according to the change of the background processing capability. In the scenes of transaction volume surge and flow surge, when the system has equivalent processing capacity, the dynamic capacity expansion can be carried out to avoid the waste of partial performance.
Referring to fig. 3, a traffic scenario diagram of an embodiment of a token bucket updating method of the present disclosure is shown. The token bucket updating method comprises the steps of flow control parameter setting, token bucket (token pool) creation, token management information cache loading, token dynamic expansion capacity, token linear adjustment, token acquisition, token release and unacquired token compensation mechanisms.
Above, with reference to fig. 2 to fig. 3, the present disclosure provides a token bucket updating method, which obtains beneficial effects including but not limited to:
1. the high availability of token management is ensured, system resources are not wasted like a token bucket, the performance of the system is maximized, a full-flow processing capacity framework is provided, and an abnormal flow processing flow must be realized when a token cannot be acquired.
2. And (3) real-time dynamic capacity expansion, linear adjustment of online flow and token number, and adoption of a cluster mode (redis and sql cluster) to guarantee synchronous management of the redis and sql data.
With further reference to fig. 4, as an implementation of the methods shown in the above-mentioned figures, the present disclosure provides an embodiment of a token bucket updating apparatus, which corresponds to the method embodiment shown in fig. 2, and which may be applied in various electronic devices.
As shown in fig. 4, the token bucket updating apparatus 400 of the present embodiment includes a first obtaining unit 401, a second obtaining unit 402, a first updating unit 403, and a second updating unit 404. The first obtaining unit 401 may be configured to obtain, in response to receiving a token adjustment request sent by a requesting end, a token adjustment amount for the token bucket from the token adjustment request. The second obtaining unit 402 may be configured to obtain a pre-stored token configuration table, which includes token information. The first updating unit 403 may be configured to update the token information in the preset token configuration table according to the token adjustment amount. The second updating unit 404 may be configured to update the token bucket based on the updated token configuration table.
In this embodiment, specific processes of the first obtaining unit 401, the second obtaining unit 402, the first updating unit 403, and the second updating unit 404 of the token bucket updating apparatus 400 and technical effects thereof may refer to related descriptions of step 201, step 202, step 203, and step 204 in the corresponding embodiment of fig. 2, which are not described herein again.
In some optional embodiments, the token adjustment request comprises increasing a first preset number of tokens; and the first updating unit 403 may be further configured to: and adding tokens with a first preset number and the token attribute state as the initialization state from a preset token configuration table.
In some alternative embodiments, the token adjustment request comprises a reduction of a second preset number of tokens; and the first updating unit 403 may be further configured to: determining tokens of which the second preset number and the token attribute states are available states from a preset token configuration table; and updating the token attribute state of the determined token to the closed state.
It should be noted that details of implementation and technical effects of each unit in the token bucket updating apparatus provided in the present disclosure may refer to descriptions of other embodiments in the present disclosure, and are not described herein again.
Referring now to FIG. 5, a block diagram of a computer system 500 suitable for use in implementing the electronic device of the present disclosure is shown. The electronic device shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of use of the present disclosure.
As shown in fig. 5, the computer system 500 includes a Central Processing Unit (CPU) 501 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 502 or a program loaded from a storage section 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data necessary for the operation of the system 500 are also stored. The CPU 501, ROM 502, and RAM 503 are connected to each other via a bus 504. An Input/Output (I/O) interface 506 is also connected to the bus 504.
The following components are connected to the I/O interface 506: an input section 506 including a touch screen, a tablet, a keyboard, a mouse, or the like; an output section 507 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; a storage portion 508 including a hard disk and the like; and a communication section 509 including a Network interface card such as a LAN (Local Area Network) card, a modem, or the like. The communication section 509 performs communication processing via a network such as the internet.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer-readable medium, the computer program comprising program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 509. The above-described functions defined in the method of the present disclosure are performed when the computer program is executed by a Central Processing Unit (CPU) 501. It should be noted that the computer readable medium in the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer-readable signal medium may include a propagated data signal with computer-readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, smalltalk, C + +, python, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in this disclosure may be implemented by software or hardware. The described units may also be provided in a processor, which may be described as: a processor includes a first obtaining unit, a second obtaining unit, a first updating unit, and a second updating unit. The names of the units do not form a limitation on the units themselves in some cases, for example, the first obtaining unit may also be described as "a unit that obtains the token adjustment amount for the token bucket from the token adjustment request in response to receiving the token adjustment request sent by the requesting end".
As another aspect, the present disclosure also provides a computer-readable medium, which may be contained in the apparatus described in the above embodiments; or may be present separately and not assembled into the device. The computer readable medium carries one or more programs which, when executed by the apparatus, cause the apparatus to: responding to a received token adjustment request sent by a request end, and acquiring a token adjustment quantity aiming at a token bucket from the token adjustment request; acquiring a pre-stored token configuration table, wherein the token configuration table comprises token information; updating token information in a preset token configuration table according to the token adjustment quantity; and updating the token bucket based on the updated token configuration table.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention in the present disclosure is not limited to the specific combination of the above-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is possible without departing from the inventive concept as defined above. For example, the above features and the technical features disclosed in the present disclosure (but not limited to) having similar functions are replaced with each other to form the technical solution.

Claims (10)

1. A token bucket update method, comprising:
responding to a received token adjustment request sent by a request end, and acquiring a token adjustment quantity aiming at a token bucket from the token adjustment request;
obtaining a pre-stored token configuration table, wherein the token configuration table comprises token information;
updating token information in a preset token configuration table according to the token adjustment quantity;
and updating the token bucket based on the updated token configuration table.
2. The method of claim 1, wherein the token information comprises token identifications and corresponding token attribute information for each token in a token bucket.
3. The method of claim 2, wherein the token attribute information comprises at least one of: an initialization state, an available state, a locked state, and a closed state.
4. The method of claim 3, wherein the token adjustment request comprises incrementing a first preset number of tokens; and
the updating token information in a preset token configuration table according to the token adjustment quantity comprises:
and adding tokens of which the first preset number and the token attribute state are initialization states from a preset token configuration table.
5. The method of claim 3, wherein the token adjustment request comprises a reduction of a second preset number of tokens; and
the updating token information in a preset token configuration table according to the token adjustment quantity comprises:
determining tokens of which the second preset number and the token attribute states are available states from a preset token configuration table;
and updating the token attribute state of the determined token to the closed state.
6. A token bucket updating apparatus, comprising:
the first obtaining unit is configured to respond to the received token adjusting request sent by a request end, and obtain a token adjusting quantity aiming at the token bucket from the token adjusting request;
a second obtaining unit configured to obtain a pre-stored token configuration table, the token configuration table including token information;
the first updating unit is configured to update the token information in a preset token configuration table according to the token adjustment quantity;
a second updating unit configured to update the token bucket based on the updated token configuration table.
7. The apparatus of claim 6, wherein the token adjustment request comprises incrementing a first preset number of tokens; and
the first updating unit is further configured to:
and adding tokens of which the first preset number and the token attribute state are initialization states from a preset token configuration table.
8. The apparatus of claim 6, wherein the token adjustment request comprises a reduction of a second preset number of tokens; and
the first updating unit is further configured to:
determining tokens of which the second preset number and the token attribute states are available states from a preset token configuration table;
and updating the token attribute state of the determined token to the closed state.
9. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method recited in any of claims 1-5.
10. A computer-readable medium, on which a computer program is stored, wherein the program, when executed by a processor, implements the method of any one of claims 1-5.
CN202210899897.0A 2022-07-28 2022-07-28 Token bucket updating method and device, electronic equipment and storage medium Pending CN115297061A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210899897.0A CN115297061A (en) 2022-07-28 2022-07-28 Token bucket updating method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210899897.0A CN115297061A (en) 2022-07-28 2022-07-28 Token bucket updating method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115297061A true CN115297061A (en) 2022-11-04

Family

ID=83823444

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210899897.0A Pending CN115297061A (en) 2022-07-28 2022-07-28 Token bucket updating method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115297061A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140137236A1 (en) * 2012-07-17 2014-05-15 Netapp, Inc. Method and system for transferring replicated information from source storage to destination storage
US9639398B1 (en) * 2015-03-31 2017-05-02 Amazon Technologies, Inc. Burst throttling with sequential operation detection
US20170180254A1 (en) * 2012-03-26 2017-06-22 Amazon Technologies, Inc. Adaptive throttling for shared resources
CN107896197A (en) * 2017-10-23 2018-04-10 深圳市楠菲微电子有限公司 Method and apparatus, the storage medium of forwarding rate are measured in communication equipment
US20200265422A1 (en) * 2019-02-18 2020-08-20 Visa International Service Association System, Method, and Computer Program Product for Updating and Processing Payment Device Transaction Tokens
CN112368729A (en) * 2018-07-03 2021-02-12 维萨国际服务协会 Token state synchronization
US20220038460A1 (en) * 2018-09-20 2022-02-03 Visa International Service Association Systems and methods for refreshing token data

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170180254A1 (en) * 2012-03-26 2017-06-22 Amazon Technologies, Inc. Adaptive throttling for shared resources
US20140137236A1 (en) * 2012-07-17 2014-05-15 Netapp, Inc. Method and system for transferring replicated information from source storage to destination storage
US9639398B1 (en) * 2015-03-31 2017-05-02 Amazon Technologies, Inc. Burst throttling with sequential operation detection
CN107896197A (en) * 2017-10-23 2018-04-10 深圳市楠菲微电子有限公司 Method and apparatus, the storage medium of forwarding rate are measured in communication equipment
CN112368729A (en) * 2018-07-03 2021-02-12 维萨国际服务协会 Token state synchronization
US20220038460A1 (en) * 2018-09-20 2022-02-03 Visa International Service Association Systems and methods for refreshing token data
US20200265422A1 (en) * 2019-02-18 2020-08-20 Visa International Service Association System, Method, and Computer Program Product for Updating and Processing Payment Device Transaction Tokens

Similar Documents

Publication Publication Date Title
CN108920222B (en) Business processing method and device based on rule engine
CN110287264A (en) Batch data update method, device and the system of distributed data base
CN111126948A (en) Processing method and device for approval process
CN111666293A (en) Database access method and device
CN110909022A (en) Data query method and device
CN112948498A (en) Method and device for generating global identification of distributed system
US8069313B2 (en) Method and system for managing cache invalidation
CN114996337A (en) Multi-cluster database management system and method
CN113282589A (en) Data acquisition method and device
CN115545639B (en) Financial business processing method, device, electronic equipment and storage medium
CN112559560A (en) Metadata reading method and device, metadata updating method and device, and storage device
CN113722007B (en) Configuration method, device and system of VPN branch equipment
CN115297061A (en) Token bucket updating method and device, electronic equipment and storage medium
CN110858199A (en) Document data distributed computing method and device
CN111008202A (en) Distributed transaction processing method and framework
CN114780361A (en) Log generation method, device, computer system and readable storage medium
CN114528140A (en) Method and device for service degradation
CN113760927A (en) Data processing method and device, electronic equipment and computer readable medium
CN113760928A (en) Cache data updating system and method
CN109120692B (en) Method and apparatus for processing requests
CN111125112A (en) Data processing method and device, electronic equipment and computer readable storage medium
CN112783904B (en) Method and device for updating index data
CN112214500A (en) Data comparison method and device, electronic equipment and storage medium
CN110262756B (en) Method and device for caching data
CN114268558B (en) Method, device, equipment and medium for generating monitoring graph

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