Token bucket updating method, device, electronic device and storage medium

By real-time management of the availability of token buckets and multi-dimensional caching mechanism, dynamically adjusting the number of tokens, solving the problem that the token bucket algorithm cannot effectively utilize the system's processing capabilities when traffic surges, and achieving efficient and stable operation of the system and dynamic flow control.

CN115297061BActive Publication Date: 2024-12-24CITIC AIBANK CORPORATION LIMITED
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210899897.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-28
Publication Date
2024-12-24
Estimated Expiration
2042-07-28

AI Technical Summary

Technical Problem

Existing token bucket algorithms cannot effectively utilize system processing capabilities when processing traffic surges, resulting in waste of performance and cannot dynamically adjust to deal with changes in transaction volume and processing capabilities.

Method used

By providing token bucket update methods and devices, the availability of tokens is managed in real time, using the multi-dimensional caching mechanism and secondary cache, dynamically adjusting the number of tokens, expanding and reducing dependence on the database according to changes in background processing capabilities.

Benefits of technology

It maximizes the utilization of system capabilities, avoids performance waste, and provides dynamic flow control capabilities in scenarios of surge in transaction volume and traffic, ensuring efficient and stable operation of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115297061B_ABST
    Figure CN115297061B_ABST
Patent Text Reader

Abstract

The present disclosure provides a token bucket update method, device, electronic device and storage medium. Through the token management mechanism, the availability of tokens is limited, and the cache information is summarized and cached through real-time tokens. The use of tokens is managed in multiple dimensions and the dependence on the database is reduced through the secondary cache mechanism. This realizes the maximum mining of system capabilities, dynamic and flexible adjustment of tokens, and a flow control mechanism for caching real-time and efficient management of tokens. Therefore, the ability to expand and shrink capacity or adjust in quasi-real time can be realized synchronously and dynamically according to the changes in the background processing capabilities. In the scenario of a surge in transaction volume and traffic, when the system has considerable processing power, it can dynamically expand capacity to avoid wasting some performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a token bucket updating method, device, electronic device and storage medium. Background Art

[0002] With the development of information technology, various application systems need a flow control capability when dealing with large concurrency and malicious access to protect the stable operation of application systems or the security of internal network access. When abnormal traffic or a sharp increase in transactions occurs, protecting the load capacity of key applications and services becomes a top priority.

[0003] At present, the flow control function is usually implemented based on the token bucket algorithm. The principle of the token bucket algorithm is that the system will put tokens into the bucket at a constant speed, and if a request needs to be processed, it needs to get a token from the bucket first. When there is no token in the bucket, the service is denied. This technology can only ensure that the flow is at a certain size, and cannot handle the scenario when the flow surges. Indirectly, when the flow surges, even if the system has considerable processing power, it cannot effectively use the system processing power, resulting in a waste of some performance. Summary of the invention

[0004] The present disclosure provides a token bucket updating method, device, electronic device and storage medium.

[0005] In a first aspect, the present disclosure provides a token bucket updating method, the method comprising:

[0006] In response to receiving a token adjustment request sent by a requesting end, obtaining an adjustment quantity of tokens in a token bucket from the token adjustment request;

[0007] Acquire a pre-stored token configuration table, wherein the token configuration table includes token information;

[0008] According to the token adjustment quantity, updating the token information in the preset token configuration table;

[0009] Based on the updated token configuration table, the token bucket is updated.

[0010] In some optional implementations, the token information includes each token identifier in the token bucket and corresponding token attribute information.

[0011] In some optional implementations, the token attribute information includes at least one of the following: an initialization state, an available state, a locked state, and a closed state.

[0012] In some optional implementations, the token adjustment request includes adding a first preset number of tokens; and

[0013] The updating of token information in a preset token configuration table according to the token adjustment quantity includes:

[0014] Add the first preset number of tokens whose token attribute status is the initialization status from the preset token configuration table.

[0015] In some optional implementations, the token adjustment request includes reducing a second preset number of tokens; and

[0016] The updating of token information in a preset token configuration table according to the token adjustment quantity includes:

[0017] Determine the second preset number of tokens whose token attribute status is in the available state from the preset token configuration table;

[0018] The token attribute state of the determined token is updated to a closed state.

[0019] In a second aspect, the present disclosure provides a token bucket updating device, the device comprising:

[0020] A first acquisition unit is configured to, in response to receiving a token adjustment request sent by a requesting end, acquire an adjustment quantity of tokens in a token bucket from the token adjustment request;

[0021] A second acquisition unit is configured to acquire a pre-stored token configuration table, wherein the token configuration table includes token information;

[0022] A first updating unit is configured to update the token information in a preset token configuration table according to the token adjustment quantity;

[0023] The second updating unit is configured to update the token bucket based on the updated token configuration table.

[0024] In some optional implementations, the token adjustment request includes adding a first preset number of tokens; and

[0025] The first updating unit is further configured to:

[0026] Add the first preset number of tokens whose token attribute status is the initialization status from the preset token configuration table.

[0027] In some optional implementations, the token adjustment request includes reducing a second preset number of tokens; and

[0028] The first updating unit is further configured to:

[0029] Determine the second preset number of tokens whose token attribute status is in the available state from the preset token configuration table;

[0030] The token attribute state of the determined token is updated to a closed state.

[0031] 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, and when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any implementation manner in the first aspect.

[0032] 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 described in any implementation manner in the first aspect.

[0033] The present disclosure provides a token bucket update method, device, electronic device and storage medium. Through the token management mechanism, the availability of tokens is limited, and the cache information is summarized and cached through real-time tokens. The use of tokens is managed in multiple dimensions and the dependence on the database is reduced through the secondary cache mechanism. This realizes the maximum mining of system capabilities, dynamic and flexible adjustment of tokens, and a flow control mechanism for caching real-time and efficient management of tokens. Therefore, the ability to expand and shrink capacity or adjust in quasi-real time can be realized synchronously and dynamically according to the changes in the background processing capabilities. In the scenario of a surge in transaction volume and traffic, when the system has considerable processing power, it can dynamically expand capacity to avoid wasting some performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Other features, objects and advantages of the present disclosure will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:

[0035] Figure 1 is an exemplary system architecture diagram in which an embodiment of the present disclosure may be applied;

[0036] Figure 2 is a flow chart of an embodiment of a token bucket updating method according to the present disclosure;

[0037] Figure 3 It is a business scenario diagram according to an embodiment of the token bucket update method disclosed in the present invention;

[0038] Figure 4 is a structural schematic diagram of an embodiment of a token bucket updating device according to the present disclosure;

[0039] Figure 5 It is a schematic diagram of the structure of a computer system suitable for implementing the electronic device of the present disclosure. DETAILED DESCRIPTION

[0040] The present disclosure is further described in detail below in conjunction with the accompanying drawings and embodiments. It is understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It is also necessary to explain that, for ease of description, only the parts related to the relevant invention are shown in the accompanying drawings.

[0041] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present disclosure may be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0042] Figure 1 An exemplary system architecture 100 is shown to which an embodiment of a token bucket updating method or a token bucket updating apparatus of the present disclosure can be applied.

[0043] like Figure 1 As shown, system architecture 100 may include terminal device 101, network 102 and server 103. Network 102 is used to provide a medium for a communication link between terminal device 101 and server 103. Network 102 may include various connection types, such as wired, wireless communication links or optical fiber cables.

[0044] The user can use the terminal device 101 to interact with the server 103 through the network 102 to receive or send messages, etc. Various communication client applications can be installed on the terminal device 101, such as token bucket management applications, background operation and maintenance applications, web browser applications, etc.

[0045] The terminal device 101 can be hardware or software. When the terminal device 101 is hardware, it can be various electronic devices with a display screen and supporting text input, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, etc. When the terminal device 101 is software, it can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules (for example, to provide token bucket update services), or it can be implemented as a single software or software module. No specific limitation is made here.

[0046] The server 103 may be a server providing various services, such as a background server providing a token bucket update service according to a token adjustment request sent by the terminal device 101. The background server may analyze and process the received token adjustment request, and feed back the processing result to the terminal device.

[0047] In some cases, the token bucket update method provided by the present disclosure can be performed jointly by the terminal device 101 and the server 103. For example, the step of "obtaining the number of tokens adjusted in the token bucket" can be performed by the terminal device 101, and the remaining steps can be performed by the server 103. The present disclosure does not limit this. Accordingly, the token bucket update device can also be respectively set in the terminal device 101 and the server 103.

[0048] In some cases, the token bucket updating method provided in the present disclosure may be executed by the server 103 , and accordingly, the token bucket updating device may also be disposed in the server 103 . In this case, the system architecture 100 may not include the terminal device 101 .

[0049] In some cases, the token bucket updating method provided in 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 . In this case, the system architecture 100 may not include the server 103 .

[0050] It should be noted that the server 103 can be hardware or software. When the server 103 is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or it can be implemented as a single server. When the server 103 is software, it can be implemented as multiple software or software modules (for example, for providing token bucket update service), or it can be implemented as a single software or software module. No specific limitation is made here.

[0051] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0052] Continue to refer Figure 2 , which shows a process 200 of an embodiment of a token bucket updating method according to the present disclosure. The token bucket updating method comprises the following steps:

[0053] Step 201: in response to receiving a token adjustment request sent by a requesting end, obtaining an adjustment quantity of tokens in a token bucket from the token adjustment request.

[0054] In this embodiment, the user can send a token adjustment request through the operation and maintenance platform of the requesting end, and the execution subject of the token bucket update (for example Figure 1 The server 103 shown receives the token adjustment request sent by the requesting end and can obtain the token adjustment quantity in the token bucket from the token adjustment request.

[0055] Here, the token can be equivalent to the certificate for transaction processing. Only when the transaction holds the token can the transaction be processed. If the transaction does not hold the token, the transaction will be subject to flow control. The token bucket can be a management pool of tokens generated according to the configuration (flow control requirements), providing database-level pooling capabilities for token borrowing, registration, concurrent management, release, and real-time expansion and contraction of tokens.

[0056] In a scenario, when the background processing capacity changes, the transaction concurrent processing capacity changes accordingly, and the user can send a token adjustment request through the operation and maintenance platform of the requesting end. When the background processing capacity decreases, that is, the transaction concurrent processing capacity decreases, the user can send a request to reduce the number of tokens through the operation and maintenance platform of the requesting end. When the background processing capacity increases, that is, the transaction concurrent processing capacity increases, the user can send a request to increase the number of tokens through the operation and maintenance platform of the requesting end.

[0057] Step 202: Obtain a pre-stored token configuration table.

[0058] Here, the token configuration table may include token information. The token configuration table may be used to track the status of all tokens.

[0059] The token information may include each token identifier in the token bucket and the corresponding token attribute information. The token attribute information may include at least one of the following: an initialization state, an available state, a locked state, and a closed state. Among them, the initialization state can be used to represent that the token is in a creation state. The locked state can be used to represent that the token is in a transaction holding state. The available state can be used to represent that the token is in a released state. The closed state can be used to represent that the token is in a deactivated state.

[0060] Step 203: Update the token information in the preset token configuration table according to the token adjustment quantity.

[0061] In this embodiment, the execution entity may adjust the number of tokens obtained in step 201 and update the token information in the token configuration table.

[0062] In one implementation, the token adjustment request may include adding a first preset number of tokens. Step 203 may further include: adding a first preset number of tokens whose token attribute states are in an initialization state from a preset token configuration table.

[0063] For example, when the token adjustment request is to add 20 tokens, the execution entity adds 20 tokens in the initialization state to the preset token configuration table.

[0064] In another implementation, the token adjustment request may include reducing a second preset number of tokens. Step 203 may further include: determining a second preset number of tokens whose token attribute status is an available state from a preset token configuration table, and updating the token attribute status of the determined tokens to a closed state.

[0065] For example, when the token adjustment request is to reduce 20 tokens, the execution subject determines 20 tokens in the preset token configuration table that are in the available state, and then updates the determined tokens to the closed state.

[0066] Step 204: Update the tokens in the token bucket based on the updated token configuration table.

[0067] In this embodiment, the execution entity may update the number of tokens in the token bucket based on the token configuration table updated in step 203 .

[0068] For example, when 20 token information is added to the updated token configuration table, the execution subject may add 20 tokens to the token bucket based on the updated token configuration table.

[0069] For example, when the token attribute information of 20 tokens is changed from an available state to a disabled state in the updated token configuration table, the execution subject may close the 20 tokens in the token bucket based on the updated token configuration table.

[0070] In one implementation, two levels of storage are available: Redis data cache mechanism and database token bucket level management token mechanism. Specifically, the Redis data cache mechanism can cache token information in real time: based on the usage of tokens and the transaction flow limit dimension, the usage of tokens is summarized and calculated in multiple dimensions in real time, relying on the distributed Redis architecture, reducing database complexity and improving the real-time and fast processing of concurrent control traffic.

[0071] In addition, there can be a synchronization mechanism between the above two levels, that is, the data of the two levels are updated synchronously. For example, you can first query the token information in the Redis data cache, and after confirming success, update the token configuration table at the database token bucket level to achieve local storage (persistence).

[0072] In another implementation, a token processing invalidation mechanism can also be set up: when the token cannot be obtained, a processing plan should be implemented and solidified into the token management process as an overall solution. Developers who use this method are required to provide a processing plan, which effectively improves the system processing integrity.

[0073] The present disclosure provides a token bucket update method, device, electronic device and storage medium. Through the token management mechanism, the availability of tokens is limited, and the cache information is summarized and cached through real-time tokens. The use of tokens is managed in multiple dimensions and the dependence on the database is reduced through the secondary cache mechanism. This realizes the maximum mining of system capabilities, dynamic and flexible adjustment of tokens, and a flow control mechanism for caching real-time and efficient management of tokens. Therefore, the ability to expand and shrink capacity or adjust in quasi-real time can be realized synchronously and dynamically according to the changes in the background processing capabilities. In the scenario of a surge in transaction volume and traffic, when the system has considerable processing power, it can dynamically expand capacity to avoid wasting some performance.

[0074] Please refer to Figure 3 , showing a business scenario diagram of an embodiment of the token bucket update method disclosed in the present invention. The token bucket update method includes flow control parameter setting, token bucket (token pool) creation, token management information cache loading, token dynamic expansion and contraction, token linear adjustment, token acquisition, token release and unacquired token compensation mechanism.

[0075] Above, combined Figures 2 to 3 The present disclosure provides a token bucket update method, which has the following beneficial effects, including but not limited to:

[0076] 1. Ensure high availability of token management, do not waste system resources like token buckets, ensure maximum system performance, provide a full-process processing capability framework, and implement abnormal traffic processing when tokens cannot be obtained.

[0077] 2. Real-time dynamic expansion and contraction, linear adjustment of online traffic and number of tokens, and the use of cluster mode (redis and sql cluster) to ensure synchronous management of redis and sql data.

[0078] Further references Figure 4 As an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of a token bucket update device. Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0079] like Figure 4As shown, the token bucket updating device 400 of this embodiment includes a first acquisition unit 401, a second acquisition unit 402, a first update unit 403 and a second update unit 404. Among them, the first acquisition unit 401 can be configured to obtain the token adjustment quantity for the token bucket from the token adjustment request in response to receiving the token adjustment request sent by the request end. The second acquisition unit 402 can be configured to obtain a pre-stored token configuration table, and the token configuration table includes token information. The first update unit 403 can be configured to update the token information in the preset token configuration table according to the token adjustment quantity. The second update unit 404 can be configured to update the token bucket based on the updated token configuration table.

[0080] In this embodiment, the specific processing of the first acquisition unit 401, the second acquisition unit 402, the first update unit 403 and the second update unit 404 of the token bucket update device 400 and the technical effects thereof can be referred to respectively. Figure 2 The relevant descriptions of step 201, step 202, step 203 and step 204 in the corresponding embodiment are not repeated here.

[0081] In some optional implementations, the token adjustment request includes adding a first preset number of tokens; and the first update unit 403 may be further configured to: add a first preset number of tokens whose token attribute states are in an initialized state from a preset token configuration table.

[0082] In some optional embodiments, the token adjustment request includes reducing a second preset number of tokens; and the first update unit 403 can be further configured to: determine a second preset number of tokens with a token attribute status of an available state from a preset token configuration table; and update the token attribute status of the determined token to a closed state.

[0083] It should be noted that the implementation details and technical effects of each unit in the token bucket updating device provided in the present disclosure can be referred to the description of other embodiments in the present disclosure, and will not be repeated here.

[0084] Reference below Figure 5 , which shows a schematic diagram of the structure of a computer system 500 suitable for implementing the electronic device of the present disclosure. Figure 5 The electronic device shown is only an example and should not bring any limitation to the function and scope of use of the present disclosure.

[0085] like Figure 5As shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 502 or the program loaded from the storage part 508 to the random access memory (RAM) 503. Various programs and data required for the operation of the system 500 are also stored in the RAM 503. The CPU 501, the ROM 502 and the RAM 503 are connected to each other through a bus 504. An input / output (I / O) interface 506 is also connected to the bus 504.

[0086] The following components are connected to the I / O interface 506: an input section 506 including a touch screen, a handwriting tablet, a keyboard, or a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet.

[0087] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 509. When the computer program is executed by the central processing unit (CPU) 501, the above functions defined in the method of the present disclosure are executed. It should be noted that the computer-readable medium described in the present disclosure can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection with one or more conductors, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device, or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in combination with an instruction execution system, device, or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0088] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, Python, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving 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 may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0089] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0090] The units described in the present disclosure may be implemented in software or hardware. The units described may also be provided in a processor, for example, may be described as: a processor including a first acquisition unit, a second acquisition unit, a first update unit, and a second update unit. The names of these units do not, in certain cases, constitute limitations on the units themselves, for example, the first acquisition unit may also be described as "a unit for obtaining, in response to receiving a token adjustment request sent by a requesting end, a token adjustment request for the number of tokens in a token bucket from the token adjustment request".

[0091] As another aspect, the present disclosure also provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by the device, the device: in response to receiving a token adjustment request sent by the requesting end, obtains the token adjustment quantity for the token bucket from the token adjustment request; obtains a pre-stored token configuration table, the token configuration table includes token information; updates the token information in the preset token configuration table according to the token adjustment quantity; and updates the token bucket based on the updated token configuration table.

[0092] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present disclosure is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above invention concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other.

Claims

1. A token bucket updating method, comprising: In response to receiving a token adjustment request sent by the requesting end, obtaining the token adjustment quantity for the token bucket from the token adjustment request, wherein the token is a certificate for transaction processing and is used to control the flow of transactions. When the background processing capacity changes, the transaction concurrent processing capacity changes accordingly. The user can send a token adjustment request through the operation and maintenance platform of the requesting end. The requesting end is installed with a background operation and maintenance application. The token bucket is a management pool of tokens generated according to flow control requirements; Obtaining a pre-stored token configuration table, wherein the token configuration table includes token information, wherein the token configuration table is used to track the status of all tokens; According to the token adjustment quantity, updating the token information in the preset token configuration table; Based on the updated token configuration table, the token bucket is updated.

2. The method according to claim 1, wherein: The token information includes each token identifier in the token bucket and corresponding token attribute information.

3. The method according to claim 2, wherein: The token attribute information includes at least one of the following: an initialization state, an available state, a locked state, and a closed state.

4. The method according to claim 3, wherein: The token adjustment request includes adding a first preset number of tokens; and The updating of token information in a preset token configuration table according to the token adjustment quantity includes: Add the first preset number of tokens whose token attribute status is the initialization status from the preset token configuration table.

5. The method according to claim 3, wherein: The token adjustment request includes reducing a second preset number of tokens; and The updating of token information in a preset token configuration table according to the token adjustment quantity includes: Determine the second preset number of tokens whose token attribute status is in the available state from the preset token configuration table; The token attribute state of the determined token is updated to a closed state.

6. A token bucket updating device, comprising: A first acquisition unit is configured to, in response to receiving a token adjustment request sent by a requesting end, acquire the token adjustment quantity for the token bucket from the token adjustment request, wherein the token is a certificate for transaction processing and is used to control the flow of transactions. When the background processing capacity changes, the transaction concurrent processing capacity changes accordingly. The user can send the token adjustment request through the operation and maintenance platform of the requesting end, and the background operation and maintenance application is installed on the requesting end. The token bucket is a management pool of tokens generated according to the flow control requirements; A second acquisition unit is configured to acquire a pre-stored token configuration table, wherein the token configuration table includes token information, wherein the token configuration table is used to track the status of all tokens; A first updating unit is configured to update the token information in a preset token configuration table according to the token adjustment quantity; The second updating unit is configured to update the token bucket based on the updated token configuration table.

7. The device according to claim 6, wherein: The token adjustment request includes adding a first preset number of tokens; and The first updating unit is further configured to: Add the first preset number of tokens whose token attribute status is the initialization status from the preset token configuration table.

8. The device according to claim 6, wherein: The token adjustment request includes reducing a second preset number of tokens; and The first updating unit is further configured to: Determine the second preset number of tokens whose token attribute status is in the available state from the preset token configuration table; The token attribute state of the determined token is updated to a closed state.

9. An electronic device, comprising: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors are enabled to implement the method according to any one of claims 1 to 5.

10. A computer readable medium having a computer program stored thereon, wherein: When the program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Method and device for measuring forwarding rate in communication device and memory medium

    CN107896197A

  • Token state synchronization

    CN112368729A