A flow control method, apparatus, electronic device, and computer-readable medium

By receiving flow control requests, determining the flow control query account, and generating tokens based on performance data obtained from a preset flow control list, the problem that existing flow control mechanisms cannot achieve fine-grained global flow control at the account level is solved. This enables more accurate flow control and dynamic adjustment, and improves the transaction processing capabilities of the corporate deposit component.

CN119094455BActive Publication Date: 2025-10-31CHINA CONSTRUCTION BANK +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411271958.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-11
Publication Date
2025-10-31
Estimated Expiration
2044-09-11

AI Technical Summary

Technical Problem

Existing flow control mechanisms cannot achieve finer-grained global flow control at the account level, resulting in poor accuracy in flow control. Especially when the database capabilities are insufficient after the core public system is localized, high-concurrency operations may cause database lock timeouts, making it impossible to achieve precise flow control.

Method used

By receiving flow control requests, determining the flow control query account, obtaining the performance data of each account based on the preset flow control list, generating a token and refreshing it to the cache, executing the token acquisition process, retrying the process in response to failure, calling the corporate deposit component to execute the transaction and release the token, and realizing dynamic adjustment of flow control.

Benefits of technology

It enables more granular service-differentiated traffic control, improves the accuracy and smoothness of traffic control, supports dynamic adjustment, adapts to the service differences of different accounts, and enhances the transaction processing capabilities of the corporate deposit component.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119094455B_ABST
    Figure CN119094455B_ABST
Patent Text Reader

Abstract

This application discloses a flow control method, apparatus, electronic device, and computer-readable medium, relating to the field of computer technology. One specific embodiment includes receiving a flow control request and determining a flow control query account; determining a flow control account based on the flow control query account and a preset flow control list; in response to the flow control account not existing in the cache, retrieving performance data for each account from the preset flow control list; generating a token based on the performance data, refreshing the token to the cache, and executing a token acquisition process; in response to token acquisition failure and the transaction identifier corresponding to an offline transaction, executing a token acquisition retry process; and in response to successful token acquisition, invoking a corporate deposit component to execute the corresponding transaction and releasing the token. The token enables dynamic adjustment of flow, while the flow control account enables finer-grained differentiated flow control for the same service, improving the accuracy of flow control.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a flow control method, apparatus, electronic device, and computer-readable medium. Background Technology

[0002] After localization, the database capabilities of the corporate core system still lag behind those of commercial databases. High-concurrency operations on the same account may lead to database lock (row lock) timeouts, requiring access to core system components for concurrency reduction control. Furthermore, the performance of the same transfer service varies significantly depending on the product or service type subscribed to by the corporate current account; for example, the transfer service performance of a regular current account is three times that of an account subscribed to a three-tier real-time pool. The existing flow control mechanism is single-machine and only applies to outbound or inbound URIs or client-side concurrency control. It cannot achieve finer-grained, account-level global flow control, resulting in poor accuracy in traffic control. Summary of the Invention

[0003] In view of this, embodiments of this application provide a flow control method, apparatus, electronic device, and computer-readable medium, which can solve the problem that existing flow control mechanisms cannot achieve more granular account-level global flow control and have poor flow control accuracy.

[0004] To achieve the above objectives, according to one aspect of the embodiments of this application, a flow control method is provided, comprising: receiving a flow control request and determining a flow control query account; determining a flow control account based on the flow control query account and a preset flow control list; in response to the flow control account not existing in the cache, obtaining performance data of each account from the preset flow control list; generating a token based on the performance data, refreshing the token to the cache, executing a token acquisition process; in response to the token acquisition failure and the transaction identifier corresponding to an offline transaction, executing a token acquisition retry process; and in response to the token acquisition success, invoking a corporate deposit component to execute the corresponding transaction and releasing the token.

[0005] Optionally, determining the flow control query account includes: obtaining the payment account and extracting the first preset number of digits of the payment account as the flow control query account.

[0006] Optionally, determining the flow control account includes: in response to the flow control query account being in a preset flow control list, querying the account corresponding to the flow control query account from the preset flow control list; and determining the flow control account based on the account.

[0007] Optionally, based on the account, the flow control account is determined, including: determining the type of the account; if the type includes a main account, then the account with the type of main account is determined as the flow control account; if the type does not include a main account, then the account with the type of sub-account is determined as the flow control account.

[0008] Optionally, the corporate deposit component is invoked to execute the corresponding transaction, including: invoking the corporate deposit component to execute the corresponding transaction after increasing the concurrency, and reducing the concurrency after the corresponding transaction is completed.

[0009] Optionally, a token acquisition retry process is executed, including: retrying to acquire the token at preset intervals and for a preset number of times; if the token is still not acquired, a transaction restricted information is returned; if the token is acquired successfully in the retry, the token acquisition is determined to be successful.

[0010] In addition, this application also provides a flow control device, including: a receiving unit configured to receive a flow control request and determine a flow control query account; a flow control account determination unit configured to determine a flow control account based on the flow control query account and a preset flow control list; an acquisition unit configured to, in response to the flow control account not existing in the cache, acquire performance data of each account from the preset flow control list; an execution unit configured to, based on the performance data, generate a token, refresh the token to the cache, execute a token acquisition process, and in response to token acquisition failure and the transaction identifier corresponding to an offline transaction, execute a token acquisition retry process; and a token release unit configured to, in response to successful token acquisition, call a corporate deposit component to execute the corresponding transaction and release the token.

[0011] Optionally, the receiving unit is further configured to: obtain the payment account and extract the first preset number of digits of the payment account as the flow control query account.

[0012] Optionally, the flow control account determination unit is further configured to: in response to the flow control query account being in a preset flow control list, query the account corresponding to the flow control query account from the preset flow control list; and determine the flow control account based on the account.

[0013] Optionally, the flow control account determination unit is further configured to: determine the type of the account; in response to the type being configured as a primary account, determine the account with the type of primary account as the flow control account; in response to the type not being configured as a primary account, determine the account with the type of sub-account as the flow control account.

[0014] Optionally, the token release unit is further configured to: increase the concurrency level, then call the corporate deposit component to execute the corresponding transaction, and after the corresponding transaction is completed, reduce the concurrency level.

[0015] Optionally, the execution unit is further configured to: retry acquiring the token at preset intervals and for a preset number of times; if the token is still not acquired, return transaction restricted information; if the token is successfully acquired during the retry, then the token acquisition is confirmed to be successful.

[0016] In addition, this application also provides a flow control electronic device, including: one or more processors; and a storage device for storing one or more programs, which, when executed by one or more processors, cause the one or more processors to implement the flow control method as described above.

[0017] In addition, this application also provides a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the flow control method as described above.

[0018] To achieve the above objectives, according to another aspect of the embodiments of this application, a computer program product is provided.

[0019] A computer program product according to an embodiment of this application includes a computer program that, when executed by a processor, implements the flow control method provided in an embodiment of this application.

[0020] One embodiment of the above invention has the following advantages or beneficial effects: This application determines the flow control query account by receiving a flow control request; determines the flow control account based on the flow control query account and a preset flow control list; in response to the flow control account not existing in the cache, it obtains the performance data of each account from the preset flow control list; based on the performance data, it generates a token, refreshes the token to the cache, and executes the token acquisition process; in response to the token acquisition failure and the transaction identifier corresponding to an offline transaction, it executes the token acquisition retry process; in response to the successful token acquisition, it calls the corporate deposit component to execute the corresponding transaction and releases the token. The token enables dynamic adjustment of traffic, and the flow control account enables finer-grained differentiated traffic control for the same service, improving the accuracy of traffic control.

[0021] The further effects of the aforementioned unconventional alternative methods will be explained below in conjunction with specific implementation methods. Attached Figure Description

[0022] The accompanying drawings are provided to better understand this application and do not constitute an undue limitation thereof. Wherein:

[0023] Figure 1 This is a schematic diagram of the main flow of a flow control method according to an embodiment of this application;

[0024] Figure 2 This is a schematic diagram of the main flow of a flow control method according to an embodiment of this application;

[0025] Figure 3 This is a schematic flowchart of a flow control method according to an embodiment of this application;

[0026] Figure 4 This is a schematic diagram of the main units of a flow control device according to an embodiment of this application;

[0027] Figure 5 This is an exemplary system architecture diagram to which embodiments of this application can be applied;

[0028] Figure 6 This is a schematic diagram of the structure of a computer system suitable for implementing terminal devices or servers in the embodiments of this application. Detailed Implementation

[0029] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of this application, including various details to aid understanding. These embodiments should be considered merely exemplary. Therefore, those skilled in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this application. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description. It should be noted that the acquisition, transmission, storage, use, and processing of data in the technical solutions of this application comply with relevant national laws and regulations. It should also be noted that certain software, components, models, and other existing industry solutions may be mentioned in the embodiments of this application. These should be considered exemplary, intended only to illustrate the feasibility of implementing the technical solutions of this application, and do not imply that the applicant has already used or necessarily used such solutions. The collection, analysis, use, transmission, and storage of user personal information involved in the technical solutions of this application all comply with relevant laws and regulations, are used for legal and reasonable purposes, are not shared, disclosed, or sold outside of these legal uses, and are subject to supervision and management by regulatory authorities. Necessary measures should be taken to prevent unauthorized access to user personal information data, ensure that personnel authorized to access such data comply with relevant laws and regulations, and safeguard user personal information security. Once this user personal information data is no longer needed, risks should be minimized by restricting or even prohibiting data collection and / or deleting the data.

[0030] When used, including in certain relevant applications, data is deidentified to protect user privacy, for example by removing specific identifiers, controlling the amount or specificity of stored data, controlling how data is stored, and / or other methods.

[0031] Figure 1 This is a schematic diagram of the main flow of a flow control method according to an embodiment of this application, as shown below. Figure 1 As shown, the flow control method mainly includes the following steps S101-S105.

[0032] Step S101: Receive a flow control request and determine the flow control query account.

[0033] In this embodiment, the execution entity of the flow control method (e.g., a server) can receive flow control requests via a wired or wireless connection. After receiving the flow control request, the execution entity can determine the flow control query account in the request by using the payment account corresponding to the transaction code carried in the flow control request.

[0034] Specifically, determining the flow control query account includes: obtaining the payment account and extracting the first preset number of digits of the payment account as the flow control query account.

[0035] For example, the first 20 digits of the payment / receipt account can be used as the flow control query account to determine the flow control account. This allows for accurate flow control based on the identified flow control account.

[0036] Step S102: Determine the flow control account based on the flow control query account and the preset flow control list.

[0037] The preset flow control list table can store key-value pairs of flow control query accounts and flow control accounts. The executing entity can search the preset flow control list table for a corresponding key-value pair based on the flow control query account corresponding to the flow control request. If a pair is found, the corresponding flow control account is determined based on the corresponding key-value pair.

[0038] The flow control query account is used to retrieve flow control accounts, which are used for flow control during corporate deposit transactions.

[0039] Step S103: In response to the fact that the flow control account does not exist in the cache, retrieve the performance data of each account from the preset flow control list table.

[0040] The cache stores key-value pairs of various flow control accounts and tokens. After obtaining a flow control account, the executing entity can match the obtained account with the key-value pairs in the cache. If no matching key-value pair is found, it indicates that the flow control account does not exist in the cache. In this case, the cache needs to be initialized. Specifically, this can be done by retrieving the performance data of each account from a pre-defined flow control list. For example, the performance data for each account can include its performance level and performance. An account's performance level refers to its overall evaluation on the target platform, including aspects such as security level, activity level, and interactivity. Different platforms may have different rating systems and standards. A higher performance level means greater influence and activity on the platform, resulting in more exposure and recommendation opportunities.

[0041] Step S104: Based on performance data, generate a token, refresh the token to the cache, execute the token acquisition process, and in response to token acquisition failure and the transaction identifier corresponding to an offline transaction, execute the token acquisition retry process.

[0042] Account performance data can be encrypted using Fernet token generation to generate tokens, thus enhancing security. Fernet is a lightweight, secure message format designed specifically for API tokens. It does not require storage in a database, thereby reducing disk I / O and improving performance.

[0043] In addition, account performance data can also be generated into tokens in the form of JWT (JSON Web Tokens), which is suitable for scenarios where account performance data needs to be transferred between multiple systems.

[0044] In this embodiment of the application, the transaction identifier may be, for example, a transaction code.

[0045] Specifically, the token acquisition retry process includes: retrying to acquire the token at preset intervals and for a preset number of times; if the token is still not acquired, a transaction restriction message is returned; if the token is successfully acquired during the retry, the token acquisition is confirmed to be successful.

[0046] For example, the interval is preset to a certain duration, such as 200ms, and the number of attempts is preset to a certain number, such as 3 attempts, before retrying to obtain the token.

[0047] In this embodiment, when the flow control account is not in the cache, a token is generated based on the performance data of each account in the preset flow control list and refreshed into the cache to initialize the cache. Since the flow control account is in the preset flow control list, the initialized cache contains key-value pairs of flow control accounts and tokens. That is, the initialized cache contains the flow control account determined based on the flow control query account and the preset flow control list. At this time, the token acquisition process corresponding to the flow control account is executed, and if the token acquisition fails and the transaction identifier corresponds to an offline transaction, the token acquisition retry process is executed to ensure the smooth operation of flow control. By generating a token based on the performance data of each account in the preset flow control list and refreshing it into the cache to initialize the cache, accurate flow control based on the flow control account can be achieved, ensuring the smoothness and accuracy of flow control execution.

[0048] In step S105, in response to successful token acquisition, the corporate deposit component is invoked to execute the corresponding transaction and release the token.

[0049] Specifically, calling the corporate deposit component to execute the corresponding transaction includes: increasing the number of concurrent transactions before calling the corporate deposit component to execute the corresponding transaction, and then reducing the number of concurrent transactions after the transaction is completed.

[0050] Increasing the concurrency level when calling the corporate deposit component to execute a transaction sets a lock for the corporate deposit component. After the transaction is completed, decreasing the concurrency level releases the lock for the corporate deposit component. This can improve the transaction processing capacity and efficiency of the corporate deposit component and avoid interference.

[0051] This embodiment receives a flow control request and determines the flow control query account; based on the flow control query account and a preset flow control list, it determines the flow control account; if the flow control account does not exist in the cache, it retrieves the performance data of each account from the preset flow control list; based on the performance data, it generates a token, refreshes the token to the cache, and executes the token acquisition process; if the token acquisition fails and the transaction identifier corresponds to an offline transaction, it executes the token acquisition retry process; if the token acquisition succeeds, it calls the corporate deposit component to execute the corresponding transaction and releases the token. The token enables dynamic adjustment of traffic, and the flow control account enables finer-grained differentiated traffic control for the same service, improving the accuracy of traffic control.

[0052] Figure 2 This is a schematic diagram of the main flow of a flow control method according to an embodiment of this application, as shown below. Figure 2 As shown, the flow control method mainly includes the following steps S201-S206.

[0053] Step S201: Receive the flow control request and determine the flow control query account.

[0054] Step S202: In response to the flow control query account being in the preset flow control list, query the account corresponding to the flow control query account from the preset flow control list.

[0055] The preset flow control list can be a flow control whitelist. The preset flow control list stores key-value pairs between the flow control accounts that require flow control and the flow control query accounts.

[0056] Step S203: Determine the flow control account based on the account.

[0057] The system queries the preset flow control list to see if a corresponding flow control account exists. If so, the flow control account found is identified as the flow control account corresponding to the flow control query account for the flow control request.

[0058] Specifically, based on the account, the flow control account is determined, including: determining the type of the account; if the type includes a main account, then the account with the type of main account is determined as the flow control account; if the type does not include a main account, then the account with the type of sub-account is determined as the flow control account.

[0059] In the flow control query, if a primary account exists among the accounts returned from the preset flow control list, it will be used as the flow control account. If no primary account exists, the returned account (which may correspond to a sub-account) can be used as the flow control account. This is to achieve compatibility with linked payment scenarios.

[0060] Step S204: In response to the fact that the flow control account does not exist in the cache, retrieve the performance data of each account from the preset flow control list table.

[0061] If the obtained flow control account is not in the cache, then perform cache initialization and retrieve the security level, activity level, interactivity and other performance data of each account from the preset flow control list table.

[0062] Step S205: Based on performance data, generate a token, refresh the token to the cache, execute the token acquisition process, and in response to token acquisition failure and the transaction identifier corresponding to an offline transaction, execute the token acquisition retry process.

[0063] The performance data is encrypted to generate a token. The generated token is then associated with each flow control account in the preset flow control list and updated in the cache. A token acquisition process is then executed. In response to a token acquisition failure and a transaction identifier corresponding to an offline transaction, a token acquisition retry process is executed.

[0064] In step S206, in response to successful token acquisition, the corporate deposit component is invoked to execute the corresponding transaction and release the token.

[0065] After successfully acquiring the token based on the updated cache, the corporate deposit component is invoked to execute the corresponding transaction and release the token. Flow control is then completed.

[0066] Figure 3 This is a schematic diagram of the main flow of a flow control method according to an embodiment of this application. In the scenario of corporate deposit transaction processing, the database capabilities of the domestically produced corporate core system are somewhat inferior to those of the commercial version. High-concurrency operations on the same account may lead to database lock (row lock) timeout issues, requiring access to core system components for concurrency reduction control. Furthermore, the performance of the same transfer service varies greatly depending on the products or service types subscribed to by the corporate current account; for example, the performance of a transfer service for a regular current account is three times that of a subscribed three-level real-time pool account. To reduce business impact while fully utilizing the service capabilities of the corporate core system, access to core components needs to be subject to global, differentiated, and precise concurrency control based on the product subscribed to by the account.

[0067] like Figure 3As shown, when a flow control request is received, the executing entity can determine whether the flow control switch is turned on. If not, flow control is not executed, the original logic is maintained, the corporate deposit component is called to execute the corresponding transaction, and the process ends. If the request is received, the transaction code corresponding to the flow control request is determined, and it is determined whether the corresponding transaction is in the transaction code blacklist. If it is, flow control is not executed, the original logic is maintained, the corporate deposit component is called to execute the corresponding transaction, and the process ends. If the corresponding transaction is not in the transaction code blacklist, the first 20 digits of the payment account (this is just an example and not a specific limitation) are used as the flow control query account for querying in the flow control whitelist. The system determines whether the account used for flow control queries is in the flow control whitelist (i.e., the preset flow control whitelist in this application). If it is not in the flow control whitelist, flow control is not executed, the original logic is maintained, the corporate deposit component is called to execute the corresponding transaction, and the process ends. If the account used for flow control queries is in the flow control whitelist, the flow control account corresponding to the account used for flow control queries is retrieved from the flow control whitelist. Specifically, the flow control account can be determined based on the account returned by the query. For example, if the account returned by the query from the flow control whitelist based on the account used for flow control queries includes a primary account, then the returned primary account is used as the flow control account. If the returned account does not include a primary account but includes a sub-account, then the returned sub-account is used as the flow control account. After identifying the flow control account, the execution entity can check if the account is in the cache. If not, it initializes the cache based on the account performance level in the flow control whitelist table. Specifically, it retrieves the performance level and performance of each account from the whitelist, generates a token, refreshes it to the cache, and attempts to acquire the token. If acquiring the token fails, it checks if the transaction is restricted and if it's an online transaction. If both are restricted and online, it returns "Transaction Restricted." If restricted but not online, it calls the flow control package at 200ms intervals, sleeps, and attempts three times. If the token is still not acquired, it returns "Transaction Restricted." If the token is successfully acquired, it calls the corporate deposit component and increases the concurrency to execute the transfer transaction. After the transfer transaction is executed, it reduces the concurrency of the corporate deposit component, releases the token, and terminates the process. If the flow control account is in the cache, determine whether the transaction is restricted and whether it is an online transaction. If it is both restricted and online, return "Transaction Restricted". If it is restricted but not online, call the flow control package every 200ms, sleep, and try 3 times. If the token corresponding to the flow control account is still not obtained, return "Transaction Restricted". If the token corresponding to the flow control account is successfully obtained, call the corporate deposit component and increase the concurrency to execute the transfer transaction. After the transfer transaction is executed, decrease the concurrency of the corporate deposit component, release the token, and end.

[0068] Example of a flow control method in this application embodiment:

[0069] (1) If the flow control switch is not turned on, the flow control will not be followed and the original logic will be maintained; otherwise, proceed to the next step.

[0070] (2) By default, all transactions are subject to flow control. If the transaction code is in the transaction code blacklist, flow control will not be applied and the original logic will remain unchanged. Otherwise, proceed to the next step.

[0071] (3) Determine whether the flow control query account is in the flow control whitelist. If not, flow control is not required. If it exists, determine the flow control account based on the returned account (i.e., the account found in the flow control whitelist database through the flow control query account, which can be a sub-account or a main account). That is, if the top-level account (i.e. the main account) in the returned account is not empty, the top-level account is used as the flow control account; otherwise, the customer account (i.e. the sub-account) is used as the flow control account, thus adapting to the linked payment scenario.

[0072] (4) Determine if the flow control account exists in the cache. If it does not exist, retrieve the performance level and performance corresponding to the account from the flow control account whitelist table, generate a token and refresh it to the cache.

[0073] (5) Obtain token. If obtaining token fails, determine whether it is an online transaction. If it is an online transaction, return "Transaction Restricted". If it is not an online transaction, try 3 times at 200ms intervals. If the token is still not obtained, return "Transaction Restricted". If obtaining token is successful, execute the transfer transaction and then release the token.

[0074] This application's embodiments utilize a pre-set token cached by a third party to achieve precise global control and support dynamic adjustments; it uses payment and collection accounts as the flow control key to achieve more granular differentiated control over the same service. Account-level flow control is implemented, allowing for dynamic adjustments to the flow control strategy after service startup.

[0075] Figure 4 This is a schematic diagram of the main units of a flow control device according to an embodiment of this application. Figure 4 As shown, the flow control device 400 includes a receiving unit 401, a flow control account determination unit 402, an acquisition unit 403, an execution unit 404, and a token release unit 405.

[0076] The receiving unit 401 is configured to receive flow control requests and determine the flow control query account.

[0077] The flow control account determination unit 402 determines the flow control account based on the flow control query account and the preset flow control list.

[0078] The acquisition unit 403 is configured to retrieve the performance data of each account from the preset flow control list table in response to the flow control account not existing in the cache.

[0079] Execution unit 404 is configured to generate a token based on performance data, refresh the token to a cache, execute a token acquisition process, and execute a token acquisition retry process in response to a token acquisition failure and a transaction identifier corresponding to an offline transaction.

[0080] The token release unit 405 is configured to, in response to successful token acquisition, invoke the corporate deposit component to execute the corresponding transaction and release the token.

[0081] In some embodiments, the receiving unit 401 is further configured to: obtain the payment account and extract the first preset number of digits of the payment account as the flow control query account.

[0082] In some embodiments, the flow control account determination unit 402 is further configured to: in response to the flow control query account being in a preset flow control list, query the account corresponding to the flow control query account from the preset flow control list; and determine the flow control account based on the account.

[0083] In some embodiments, the flow control account determination unit 402 is further configured to: determine the type of the account; in response to the type being configured as a primary account, determine the account with the type as a primary account as a flow control account; in response to the type not being configured as a primary account, determine the account with the type as a sub-account as a flow control account.

[0084] In some embodiments, the token release unit 405 is further configured to: increase the number of concurrent transactions, then call the corporate deposit component to execute the corresponding transaction, and after the corresponding transaction is completed, reduce the number of concurrent transactions.

[0085] In some embodiments, the execution unit 404 is further configured to: retry acquiring the token at preset intervals and attempt a preset number of times; if the token is still not acquired, return transaction restricted information; if the token is successfully acquired during the retry, then the token acquisition is determined to be successful.

[0086] It should be noted that the flow control method and flow control device in this application are related in terms of specific implementation, so repeated content will not be described again.

[0087] Figure 5 An exemplary system architecture 500 is shown that can be applied to the flow control method or flow control device of the present application embodiments.

[0088] like Figure 5As shown, system architecture 500 may include terminal devices 501, 502, and 503, a network 504, and a server 505. Network 504 serves as the medium for providing communication links between terminal devices 501, 502, and 503 and server 505. Network 504 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.

[0089] Users can use terminal devices 501, 502, and 503 to interact with server 505 via network 504 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 501, 502, and 503, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social media platform software, etc. (for example only).

[0090] Terminal devices 501, 502, and 503 can be various electronic devices with a flow control processing screen and support web browsing, including but not limited to smartphones, tablets, laptops, and desktop computers.

[0091] Server 505 can be a server providing various services, such as a backend management server supporting traffic control requests submitted by users using terminal devices 501, 502, and 503 (for example only). The backend management server can receive traffic control requests, determine the traffic control query account; determine the traffic control account based on the query account and a preset traffic control list; if the traffic control account does not exist in the cache, it retrieves performance data for each account from the preset traffic control list; based on the performance data, it generates a token, refreshes the token to the cache, and executes the token acquisition process; if token acquisition fails and the transaction identifier corresponds to an offline transaction, it executes a token acquisition retry process; if token acquisition succeeds, it calls the corporate deposit component to execute the corresponding transaction and releases the token. The token enables dynamic adjustment of traffic, and the traffic control account enables finer-grained differentiated traffic control for the same service, improving the accuracy of traffic control.

[0092] It should be noted that the flow control method provided in this application embodiment is generally executed by server 505, and correspondingly, the flow control device is generally set in server 505.

[0093] It should be understood that Figure 5 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0094] The following is for reference. Figure 6 It shows a schematic diagram of the structure of a computer system 600 suitable for implementing a terminal device according to the embodiments of this application. Figure 6The terminal device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0095] like Figure 6 As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 602 or programs loaded from storage section 608 into random access memory (RAM) 603. The RAM 603 also stores various programs and data required for the operation of the computer system 600. The CPU 601, ROM 602, and RAM 603 are interconnected via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0096] The following components are connected to I / O interface 605: an input section 606 including a keyboard, mouse, etc.; an output section 607 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to I / O interface 605 as needed. A removable medium 611, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 610 as needed so that computer programs read from it can be installed into storage section 608 as needed.

[0097] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 609, and / or installed from removable medium 611. When the computer program is executed by central processing unit (CPU) 601, it performs the functions defined above in the system of this application.

[0098] It should be noted that the computer-readable medium shown in this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. Computer-readable storage media can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0099] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0100] The units described in the embodiments of this application can be implemented in software or hardware. The described units can also be housed in a processor; for example, a processor may be described as including a receiving unit, a flow control account determination unit, an acquisition unit, an execution unit, and a token release unit. The names of these units do not necessarily limit the specific unit itself.

[0101] In another aspect, this application also provides a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist independently and not assembled into the device. The computer-readable medium carries one or more programs that, when executed by the device, cause the device to receive a flow control request, determine a flow control query account; determine a flow control account based on the flow control query account and a preset flow control list; in response to the flow control account not existing in the cache, obtain performance data for each account from the preset flow control list; generate a token based on the performance data, refresh the token to the cache, execute a token acquisition process; in response to token acquisition failure and the transaction identifier corresponding to an offline transaction, execute a token acquisition retry process; in response to successful token acquisition, call the corporate deposit component to execute the corresponding transaction, and release the token.

[0102] The computer program product of this application includes a computer program that, when executed by a processor, implements the flow control method in the embodiments of this application.

[0103] According to the technical solution of the embodiments of this application, dynamic traffic adjustment is supported through tokens, and more granular differentiated traffic control for the same service is achieved through flow control accounts, thereby improving the accuracy of traffic control.

[0104] The specific embodiments described above do not constitute a limitation on the scope of protection of this application. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A flow control method, characterized in that, include: Receive flow control requests and determine the flow control query account; Based on the flow control query account and the preset flow control list, the flow control account is determined; In response to the fact that the flow control account does not exist in the cache, the performance data of each account is obtained from the preset flow control list table; Based on the performance data, a token is generated, the token is refreshed to the cache, and a token acquisition process is executed. In response to a token acquisition failure and the transaction identifier corresponding to an offline transaction, a token acquisition retry process is executed. Upon successful token acquisition, the corporate deposit component is invoked to execute the corresponding transaction and release the token.

2. The method according to claim 1, characterized in that, The process of determining the flow control query account includes: Obtain the payment and receipt account, and extract the first preset number of digits of the payment and receipt account as the flow control query account.

3. The method according to claim 1, characterized in that, The determination of the flow control account includes: In response to the flow control query account being in a preset flow control list, the system queries the preset flow control list for the account corresponding to the flow control query account. Based on the account, the flow control account is determined.

4. The method according to claim 3, characterized in that, The process of determining the flow control account based on the account includes: Determine the type of the account; if the type includes a main account, then the account with the type of main account is determined as a flow control account. If the type does not include a primary account, then accounts of type sub-account are identified as flow control accounts.

5. The method according to claim 1, characterized in that, The invocation of the corporate deposit component to execute the corresponding transaction includes: After increasing the concurrency level, the corporate deposit component is invoked to execute the corresponding transaction. Once the corresponding transaction is completed, the concurrency level is reduced.

6. The method according to claim 1, characterized in that, The execution token acquisition retry process includes: The system attempts to acquire the token a preset number of times over a preset time interval. If the token is still not acquired, a transaction restriction message is returned. If the token is successfully acquired during the retry, the token acquisition is considered successful.

7. A flow control device, characterized in that, include: The receiving unit is configured to receive flow control requests and determine the flow control query account. The flow control account determination unit determines the flow control account based on the flow control query account and the preset flow control list; The acquisition unit is configured to retrieve the performance data of each account from the preset flow control list in response to the flow control account not existing in the cache. The execution unit is configured to generate a token based on the performance data, refresh the token to the cache, execute a token acquisition process, and execute a token acquisition retry process in response to a token acquisition failure and a transaction identifier corresponding to an offline transaction. The token release unit is configured to, in response to successful token acquisition, invoke the corporate deposit component to execute the corresponding transaction and release the token.

8. The apparatus according to claim 7, characterized in that, The receiving unit is further configured to: Obtain the payment and receipt account, and extract the first preset number of digits of the payment and receipt account as the flow control query account.

9. The apparatus according to claim 7, characterized in that, The flow control account determination unit is further configured to: In response to the flow control query account being in a preset flow control list, the system queries the preset flow control list for the account corresponding to the flow control query account. Based on the account, the flow control account is determined.

10. The apparatus according to claim 9, characterized in that, The flow control account determination unit is further configured to: The type of the account is determined, and in response to the type being configured as a primary account, the account with the type of primary account is identified as a flow control account; If the type is not configured as a primary account, then the account of type sub-account will be identified as a flow control account.

11. The apparatus according to claim 7, characterized in that, The token release unit is further configured to: After increasing the concurrency level, the corporate deposit component is invoked to execute the corresponding transaction. Once the corresponding transaction is completed, the concurrency level is reduced.

12. The apparatus according to claim 7, characterized in that, The execution unit is further configured to: The system attempts to acquire the token a preset number of times over a preset time interval. If the token is still not acquired, a transaction restriction message is returned. If the token is successfully acquired during the retry, the token acquisition is considered successful.

13. A flow control electronic device, characterized in that, include: One or more processors; 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 implement the method as described in any one of claims 1-6.

14. A computer-readable medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-6.

15. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Token-based system flow control method and device, electronic equipment and storage medium

    CN109412967A

  • Business processing method, system and device and storage medium

    CN112350978A