Flow control method and device, equipment, program semantics and storage medium

By dynamically obtaining the usage information and current limit configuration files of the database connection pool, accurate current limiting of different types of transaction requests is achieved, and the problem of the inability to distinguish transaction types in the existing technology has been solved, improving user experience and promoting the development of the financial technology field.

CN119544620APending Publication Date: 2025-02-28INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411726887.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-28
Publication Date
2025-02-28

Smart Images

  • Figure CN119544620A_ABST
    Figure CN119544620A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a flow control method and device, equipment, program semantics and a storage medium, and relates to the field of financial science and technology, and the method comprises the steps: obtaining the use information of a connection pool of a database at the current moment when at least one transaction request sent by a first user through each distributed node server is received; for each transaction request, determining whether the current transaction request needs to be subjected to current limiting according to the use information, a predetermined current limiting configuration file of each transaction type and the current transaction type of the current transaction request; when the current transaction request needs to be subjected to current limiting, obtaining a current limiting parameter of the current transaction request according to the current limiting configuration file and the use information of the current transaction request; and performing current limiting operation on the current transaction request according to the current limiting parameter of the current transaction request. The method provided by the invention not only can ensure that the requests of some key services are not limited randomly, but also can perform accurate and efficient flow limiting operation on the requests needing flow limiting.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of financial technology, and in particular, to a flow control method, apparatus, device, program semantics and storage medium. Background Art

[0002] In the financial industry, banking systems or other financial data platforms usually need to process a large number of transaction requests initiated by enterprise mobile applications. The intranet architecture of the enterprise mobile master group is that multiple mobile application (APP) servers are connected to a database, and the database provides data services to the APP server through a connection pool. The banking system distributes requests to the APP server through a load balancer, and the APP server then requests the database to return to the mobile client. However, when the requests generated by each APP server exceed the capacity of the banking system, it may cause system performance to decline, response time to increase, or even system crash. By implementing current limiting on the requests to the APP server, this situation can be prevented from happening, ensuring that the system can still run stably under high load.

[0003] The current limiting method currently used is to return error information to all users (APP servers) indiscriminately, and perform indiscriminate global limiting through current limiting parameters. However, in actual applications, especially in bank transactions, the business importance or business requirements of different types of transactions are different, and current limiting cannot be performed indiscriminately. This indiscriminate current limiting method cannot distinguish different transactions, resulting in a poor experience for important customers within the bank. For example, when there are a large number of important transaction requests, a large number of concurrent requests appear in certain nodes of the server in a short period of time, and the server side is likely to experience unavailable database connections, reducing the user experience. Summary of the invention

[0004] The embodiments of the present invention provide a flow control method, apparatus, device, program semantics and storage medium, which can dynamically determine the flow limiting strategy according to different types of transactions, which can not only ensure that requests for some key businesses are not arbitrarily limited, but also avoid the waste of resources, improve the user experience, and promote the development and progress of the financial technology field.

[0005] In a first aspect, an embodiment of the present invention provides a flow control method, including:

[0006] When receiving at least one transaction request sent by the first user through each distributed node server, obtaining usage information of the connection pool of the database at the current moment;

[0007] For each transaction request, determining whether it is necessary to limit the flow of the current transaction request according to the usage information, the predetermined flow limiting configuration files of each transaction type, and the current transaction type of the current transaction request;

[0008] When it is necessary to limit the flow of the current transaction request, obtaining the flow limiting parameters of the current transaction request according to the flow limiting configuration file of the current transaction request and the usage information;

[0009] Perform a current limiting operation on the current transaction request according to the current limiting parameters of the current transaction request.

[0010] In a second aspect, an embodiment of the present invention provides a flow control device, the device comprising:

[0011] An information acquisition module, configured to acquire usage information of a connection pool of a database at a current moment when receiving at least one transaction request sent by a first user through each distributed node server;

[0012] A current limiting triggering module is used to determine, for each transaction request, whether it is necessary to limit the current transaction request according to the usage information, the predetermined current limiting configuration files of each transaction type and the current transaction type of the current transaction request;

[0013] A parameter determination module, configured to obtain a current limiting parameter of the current transaction request according to a current limiting configuration file of the current transaction request and the usage information when current limiting is required for the current transaction request;

[0014] The current limiting control module is used to perform a current limiting operation on the current transaction request according to the current limiting parameters of the current transaction request.

[0015] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, a flow control method as described in any one of the embodiments of the present invention is implemented.

[0016] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a flow control method as described in any one of the embodiments of the present invention.

[0017] In a fifth aspect, an embodiment of the present invention provides a computer program product, including a computer program, which, when executed by a processor, implements a flow control method as described in any one of the embodiments of the present invention.

[0018] In an embodiment of the present invention, when at least one transaction request sent by the first user through each distributed node server is received, the usage information of the connection pool of the database at the current moment is obtained; for each transaction request, whether the current transaction request needs to be limited is determined according to the usage information, the predetermined flow limiting configuration files of each transaction type and the current transaction type of the current transaction request; when the current transaction request needs to be limited, the flow limiting parameters of the current transaction request are obtained according to the flow limiting configuration file and the usage information of the current transaction request; and the current transaction request is limited according to the flow limiting parameters of the current transaction request. The method of the embodiment of the present invention can determine in real time and dynamically whether the transaction request needs to be limited according to the usage information of the connection pool and the transaction type of the transaction request. When the transaction request needs to be limited, how to limit the transaction request is determined in real time according to the flow limiting configuration file and the usage information, which can ensure that some key business requests will not be arbitrarily limited, and can also accurately and efficiently limit the requests that need to be limited, thereby avoiding waste of resources, improving user experience, and promoting the development and progress of the financial technology field. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0020] Figure 1 A first flow chart of a flow control method provided by an embodiment of the present invention;

[0021] Figure 2 A second flow chart of a flow control method provided by an embodiment of the present invention;

[0022] Figure 3 A flow chart of a method for configuring current limiting parameters provided by an embodiment of the present invention;

[0023] Figure 4 A schematic diagram of a configuration interface provided by an embodiment of the present invention;

[0024] Figure 5 A structural diagram of modifying the current limiting configuration provided by an embodiment of the present invention;

[0025] Figure 6 A schematic diagram of the structure of a flow control device provided by an embodiment of the present invention;

[0026] Figure 7 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0027] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.

[0028] Figure 1 This is the first flow chart of a flow control method provided in an embodiment of the present invention. The method in the embodiment of the present invention can dynamically adjust the flow limiting strategy according to different types of transactions, which can not only ensure that requests for some key businesses will not be arbitrarily limited, but also avoid waste of resources, improve user experience, and promote the development and progress of the financial technology field. The information collected in the method in the embodiment of the present invention is information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of relevant data comply with the relevant laws, regulations and standards of relevant countries and regions, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse. The method can be executed by a flow control device provided in an embodiment of the present invention, and the device can be implemented in software and / or hardware. The following embodiments will be described by taking the device integrated in an electronic device as an example. The electronic device can be a server or a computer device, etc., with reference to Figure 1 , the method may specifically include the following steps:

[0029] Step 101: When receiving at least one transaction request sent by a first user through each distributed node server, obtain usage information of a connection pool of a database at the current moment.

[0030] Among them, the first user is an enterprise or individual who needs to perform business operations through a distributed node server. Each distributed node server can be an APP server, and multiple distributed node servers are connected to a database. The database provides a data basis for responding to transaction requests sent by the APP server. The transaction request is initiated by the first user through the APP, and requires the bank system to process a request for a certain business operation. Transaction requests include but are not limited to payment requests, transfer requests, login requests, and query requests. The database connection pool is a technology for managing database connections, and the connection pool includes a certain number of pre-created database connections. When needed (such as responding to a transaction request), the system (bank system) can directly obtain an idle connection from the connection pool for corresponding operations, and return the connection to the connection pool after the operation is completed, that is, the system provides data services for the APP through the connection pool. The usage information of the connection pool includes the number of active connections and the number of idle connections, and the active connection is the connection in use.

[0031] Specifically, due to the limited computing resources of the system, when there are too many active connections in the connection pool, the system performance will be affected. Therefore, when receiving a transaction request sent by the APP server, the system can obtain the usage information of the connection pool of the database at the current moment, so as to determine whether it is necessary to limit the flow of the received transaction request based on the usage information of the connection pool.

[0032] Step 102: For each transaction request, determine whether the current transaction request needs to be current limited according to the usage information, the predetermined current limiting configuration files of each transaction type, and the current transaction type of the current transaction request.

[0033] The current limiting profile includes pre-set current limiting rules, and the current limiting profile is used to determine whether to limit the transaction request and how to limit the flow. The importance of transactions corresponding to different transaction types is different, and the current limiting profiles corresponding to different transaction types are also different. In this solution, not all transaction requests of all transaction types have corresponding current limiting profiles. If a transaction request does not have a corresponding current limiting profile, it means that the importance of the transaction request is very high. No matter when the transaction request is received, it does not need to be limited.

[0034] Specifically, when a transaction request is received, the usage information of the connection pool of the database at the current moment is obtained, and it is determined whether the system has a high load at the current moment based on the usage information of the connection pool. If the system has a high load, it is determined whether there is a corresponding current limiting configuration file for the transaction type of the transaction request. If there is a corresponding current limiting configuration file, it is determined that the transaction request needs to be current limited. The system can further determine how to current limit the transaction request based on the current limiting rules defined in the current limiting configuration file. If the system has a high load, but there is no corresponding current limiting configuration file for the transaction type of the transaction request, it can be determined that the importance of the transaction request of this transaction type is very high and does not need to be current limited. If the system does not have a high load, it means that the system can process the transaction request normally, and no matter whether there is a corresponding current limiting configuration file for the transaction type of the transaction request, the transaction request does not need to be current limited.

[0035] Step 103: When it is necessary to limit the flow of the current transaction request, the flow limiting parameters of the current transaction request are obtained according to the flow limiting configuration file and usage information of the current transaction request.

[0036] Among them, the flow limiting parameters include the values ​​of various flow limiting indicators. The flow limiting indicators are a set of key parameters for measuring and controlling the system flow. The flow limiting indicators are used to indicate how the system should limit the flow of requests when facing high concurrent requests. The flow limiting indicators include but are not limited to the transaction processing frequency (Transactions Per Second, TPS), the transaction request frequency (Hits Per Second, HPS), the transaction query frequency (Queries Per Second, QPS), the transaction request frequency (Requests Per Second, RPS) and the number of concurrent connections. TPS refers to the number of transactions completed per second; HPS refers to the number of client requests received by the server per second; QPS refers to the number of query requests that the server can respond to per second; RPS is a performance indicator that measures the number of requests that the system can process in one second; the number of concurrent connections is used to limit the maximum number of clients that can establish connections with the server at the same time. Different flow limiting profiles can include different flow limiting indicators. The selection of flow limiting indicators depends on specific business needs, transaction requests, system architecture and expected traffic patterns.

[0037] Specifically, when it is determined that the received transaction request needs to be throttled, the throttling configuration file of the transaction request is obtained. According to the throttling rules defined in the throttling configuration file, combined with the usage information of the connection pool, the system can calculate the throttling index values ​​of the transaction request, thereby obtaining the throttling parameters of the transaction request. For example, if a throttling configuration file of a transaction type stipulates that a maximum of 10 transaction requests of this type can be processed per second, if the number of transaction requests exceeds 10, the TPS and QPS of the transaction request are limited. If the number of transaction requests of this type has reached 10 in the current number of active connections, the throttling parameters of the 11th transaction request of this transaction type can be obtained according to the throttling index value defined in the throttling configuration file, so as to limit its flow.

[0038] Step 104: Perform a flow limiting operation on the current transaction request according to the flow limiting parameters of the current transaction request.

[0039] Specifically, after obtaining the flow-limiting parameters of the transaction request, the flow-limiting parameters are applied to the transaction request to limit its flow. For example, if the maximum concurrency is 5, when 6 transaction requests of the same type are received at the same time, the system will only process the first 5 and put the 6th transaction request into the queue to wait.

[0040] In this solution, after each flow limiting operation is performed on a flow limiting request, key performance indicators (such as system response time, error rate, and throughput, etc.) and resource usage can be tracked in real time through pre-deployed monitoring tools. System logs related to transaction requests and feedback from first users are collected and analyzed, and the flow limiting configuration files of each transaction request are optimized in a timely manner based on the data, system logs, and feedback monitored by the monitoring tools to ensure the accuracy of the flow limiting rules of each transaction request.

[0041] The technical solution of this embodiment, when receiving at least one transaction request sent by the first user through each distributed node server, obtains the usage information of the connection pool of the database at the current moment; for each transaction request, determines whether it is necessary to limit the flow of the current transaction request according to the usage information, the predetermined flow limiting configuration files of each transaction type and the current transaction type of the current transaction request; when it is necessary to limit the flow of the current transaction request, obtains the flow limiting parameters of the current transaction request according to the flow limiting configuration file and the usage information of the current transaction request; and performs flow limiting operation on the current transaction request according to the flow limiting parameters of the current transaction request. The technical solution of this embodiment can determine whether it is necessary to limit the flow of the transaction request in real time and dynamically according to the usage information of the connection pool and the transaction type of the transaction request; when it is necessary to limit the flow of the transaction request, determines how to limit the flow of the transaction request in real time according to the flow limiting configuration file and the usage information, which can ensure that some key business requests will not be arbitrarily limited, and can also accurately and efficiently limit the flow of requests that need to be limited, avoiding waste of resources, improving user experience, and promoting the development and progress of the financial technology field.

[0042] Figure 2 The second flow chart of a flow control method provided by an embodiment of the present invention is a refinement of the above embodiment. The specific method can be as follows Figure 2 As shown, the method may include the following steps:

[0043] Step 201: When receiving at least one transaction request sent by a first user through each distributed node server, obtain usage information of a connection pool of a database at the current moment.

[0044] Step 202: When the number of active connections is greater than a preset connection threshold, determine whether current limiting is required for the current transaction request according to the current limiting configuration files of each transaction type and the current transaction type.

[0045] Among them, the connection threshold is a value pre-set according to domain big data, system performance, and actual application environment. The usage information of the connection pool includes the number of active connections and the number of idle connections, and the active connection is the connection in use. When the number of active connections is greater than the connection threshold, it means that the system is under high load and it may be necessary to limit the flow of the received transaction request. Different transaction types correspond to different importance of transactions, and transactions of different importance correspond to different flow limiting profiles. According to the flow limiting profile of the transaction type of the transaction request, it can be determined whether the transaction request needs to be limited. In this scheme, optionally, according to the flow limiting profile of each transaction type and the current transaction type, it is determined whether the current transaction request needs to be limited, including: searching for the flow limiting profile of the current transaction type in the flow limiting profiles of each transaction type; if the flow limiting profile of the current transaction type is found, it is determined that the current transaction request needs to be limited; if the flow limiting profile of the current transaction type cannot be found, it is determined that the current transaction request does not need to be limited.

[0046] Specifically, different transaction types represent the importance of different transactions. For example, there are three types of transactions, namely, Class I transactions, Class II transactions, and Class III transactions. Class I transactions are of the highest importance. Regardless of whether the system is overloaded or not, they cannot be throttled. Therefore, there is no corresponding throttling profile for Class I transactions. Class II and Class III transactions are less important. When the system is overloaded, how to throttle them can be determined based on their corresponding throttling profiles and the usage information of the connection pool.

[0047] Furthermore, when the number of active connections is greater than a preset connection threshold, a flow limiting profile for the current transaction type is searched in the pre-set flow limiting profiles for each transaction type. If the flow limiting profile for the current transaction type cannot be found, it is determined that the importance of the current transaction type is very high, and there is no need to limit the flow of the current transaction request. If the flow limiting profile for the current transaction type can be found, it is determined that the current transaction request needs to be limited. In this solution, by configuring different flow limiting profiles for different transaction types, it can be ensured that some very important transactions are not affected by flow limiting under any circumstances, thereby ensuring business continuity and stability. By implementing flow limiting for non-critical businesses, the flow entering the system can be effectively controlled to prevent system overload, thereby protecting the stability and reliability of the system.

[0048] Step 203: When the number of active connections is less than or equal to the connection threshold, it is determined that there is no need to limit the flow of at least one transaction request received at the current moment.

[0049] Specifically, when the number of active connections is less than or equal to the connection threshold, it indicates that the system is not under high load. It can be further determined that the system can process transaction requests normally. Regardless of whether there is a corresponding flow limiting configuration file for the transaction type of the transaction request, there is no need to limit the flow of the transaction request.

[0050] Step 204: When the current transaction request needs to be limited, the current current limiting indicator values ​​stored in the current limiting configuration file of the current transaction request are obtained.

[0051] Among them, the flow limiting indicators are a set of key parameters for measuring and controlling the system flow. The flow limiting indicators are used to indicate how the system should limit the flow of requests when facing high concurrent requests. The flow limiting indicators include but are not limited to TPS, HPS, QPS, RPS, and the number of concurrent connections. Specifically, after determining that the current transaction request needs to be limited, the system reads the current flow limiting indicator values ​​from the flow limiting configuration file of the transaction type. In order to determine how to limit the flow of the current transaction request based on the flow limiting indicator values ​​in the flow limiting configuration file and the usage information of the connection pool. For example, if a flow limiting configuration file of a transaction type stipulates that a maximum of 10 requests can be processed per second, "10" is a flow limiting indicator value.

[0052] By configuring different flow limiting rules for different transaction types, the flow limiting strategy can be flexibly adjusted according to actual business needs. In addition, as the business develops and changes, the flow limiting profile of the transaction type can be easily added, modified or deleted, so that the flow limiting profile can adapt to new business needs and improve the scalability and adaptability of the flow limiting control method.

[0053] Step 205: Determine target current limiting index values ​​of the current transaction request based on the current current limiting index values ​​and the usage information.

[0054] After obtaining the current limiting indicator values, the system can calculate the target limiting indicator value in combination with the connection pool usage information (such as the number of active connections and the number of idle connections). For example, if the number of active connections is close to or has reached the maximum concurrent limit, the system will decide to lower the target limiting indicator value for new transaction requests to reduce the burden on the system. For example, if a transaction type's limiting configuration file stipulates that a maximum of 10 transaction requests of this type can be processed per second, if more than 10 transaction requests are processed, the TPS and QPS of the transaction request will be limited. If the number of transaction requests of this type in the current active connection number has reached 10, the TPS and QPS values ​​of the 11th transaction request can be reduced according to the limiting indicator value defined in the limiting configuration file, that is, the target limiting indicator values ​​of the 11th transaction request of this transaction type are obtained.

[0055] Step 206: determine the current distributed node server corresponding to the current transaction request, and send each target current limiting indicator value of the current transaction request to the current distributed node server, so that the current distributed node server performs a current limiting operation on the current transaction request according to each target current limiting indicator value.

[0056] Specifically, a transaction request is a request sent by a distributed node server to the system, and multiple distributed node servers are connected to a database. After obtaining the current limiting parameters of the current transaction request, the current distributed node server that sends the current transaction request is determined according to the current transaction request. After the current distributed node server is determined, each target current limiting index value of the current transaction request is sent to the current distributed node server. After the current distributed node server receives each target current limiting index value, it performs a current limiting operation on the current transaction request according to each target current limiting index value, such as temporarily rejecting the current transaction request, or putting the current transaction request in a waiting queue until there are enough resources to process the current transaction request.

[0057] In the technical solution of this embodiment, when at least one transaction request sent by each distributed node server is received, the usage information of the connection pool of the database at the current moment is obtained. When the number of active connections is greater than the preset connection threshold, it is determined whether the current transaction request needs to be limited according to the flow limiting configuration file of each transaction type and the current transaction type. When the number of active connections is less than or equal to the connection threshold, it is determined that there is no need to limit the flow of at least one transaction request received at the current moment. When the current transaction request needs to be limited, the current flow limiting index values ​​stored in the flow limiting configuration file of the current transaction request are obtained; wherein the flow limiting index includes the transaction processing frequency and the transaction query frequency. Based on the current flow limiting index values ​​and the usage information, the target flow limiting index values ​​of the current transaction request are determined. The current distributed node server corresponding to the current transaction request is determined, and the target flow limiting index values ​​of the current transaction request are sent to the current distributed node server, so that the current distributed node server performs flow limiting operations on the current transaction request according to the target flow limiting index values. The technical solution of this embodiment realizes the refined management of various types of transactions by configuring exclusive flow limiting rules for different transaction types, and ensures that some key businesses are not affected by flow limiting. By setting the flow-limiting indicator value, the transaction flow entering the system can be controlled more accurately, avoiding unnecessary waiting and waste of resources, thereby improving the efficiency of the system in processing requests.

[0058] Figure 3 Flow chart of the method for configuring current limiting parameters provided by an embodiment of the present invention. The specific method can be as follows Figure 3 As shown, the method may include the following steps:

[0059] Step 301: Receive a configuration instruction sent by a second user, and display a configuration interface to the second user in response to the configuration instruction.

[0060] The second user is a system administrator or configuration personnel with high-level permissions. The second user can be responsible for monitoring system performance, adjusting flow control parameters, and maintaining system stability. When the second user needs to manually limit the flow of a transaction request, he can send a configuration instruction to the system. After receiving the configuration instruction, the system displays the configuration interface to the second user in response to the configuration instruction. For example, Figure 4 Schematic diagram of the configuration interface provided by the embodiment of the present invention. Figure 4 As shown, the configuration interface includes an application name selection box, a cluster name selection box, a resource name selection box, a current limiting indicator selection box, and a current limiting indicator value input box. The application name indicates the name of the distributed node server, the cluster name indicates the cluster where the distributed node server is located, and the resource name corresponds to different transaction types. The second user can select the application name through the application name selection box, select the cluster name through the cluster name selection box, select the resource name through the resource name selection box, select the current limiting indicator through the resource name selection box, and enter the current limiting indicator value through the current limiting indicator value input box.

[0061] Step 302: Receive the current limiting parameter modification information sent by the second user through the configuration interface.

[0062] The current limiting parameter modification information includes a current limiting object and a current limiting index value. The current limiting object may be a transaction request for which manual current limiting is required. Specifically, after sending the configuration interface to the second user, the application name, cluster name, resource name, current limiting index, current limiting index value and other data sent by the second user through the configuration interface are received, and the current limiting parameter modification information is determined based on these data.

[0063] Step 303: determine the target distributed node server according to the current limiting object, and send the current limiting parameter modification information to the target distributed node server, so that the target distributed node server performs a current limiting operation on the current limiting object according to the current limiting parameter modification information.

[0064] Specifically, after obtaining the current limiting parameter modification information, the distributed node server of the current limiting object (the transaction request for which current limiting is required) is determined, and the distributed node server is determined as the target distributed node server. After determining the target distributed node server, in this solution, the current limiting parameter modification information can be sent to the target distributed node server through the pre-set distributed parameter management distribution component. After receiving the current limiting parameter modification information, the target distributed node server performs current limiting operations on the current limiting object according to the current limiting parameter modification information.

[0065] The distribution component provides a unified interface to centrally manage the configuration of different environments, clusters, and namespaces. After the second user modifies the configuration on the distribution component and publishes it, the client can receive the latest configuration in a very short time (usually 1 second) and notify the corresponding application in real time. For example, Figure 5 A schematic diagram of the structure of modifying the current limiting configuration provided by an embodiment of the present invention. Figure 5 As shown, the second user sends a configuration instruction to the distribution configuration center, and the distribution configuration center obtains the current limiting parameter modification information sent by the second user through the configuration interface, and generates a configuration update notification based on the current limiting parameter modification information, and sends the current limiting configuration update notification to the distribution client (target distributed node server). After the distribution client modifies the current limiting configuration according to the current limiting configuration update notification, it returns the modified current limiting configuration information to the distribution configuration center so that the distribution center can confirm whether the distribution client has modified successfully.

[0066] The technical solution of this embodiment receives the configuration instruction sent by the second user, and displays the configuration interface to the second user in response to the configuration instruction; receives the current limiting parameter modification information sent by the second user through the configuration interface; wherein the current limiting parameter modification information includes the current limiting object and the current limiting index value; determines the target distributed node server according to the current limiting object, and sends the current limiting parameter modification information to the target distributed node server, so that the target distributed node server performs the current limiting operation on the current limiting object according to the current limiting parameter modification information. The technical solution of this embodiment can manually adjust the current limiting parameters according to actual needs, so that the system can respond to different load conditions and business needs more flexibly. Through configuration management tools such as distribution components, the system can send the current limiting parameter modification information to the target distributed node server in real time, ensuring that the current limiting strategy can take effect quickly and respond to system load changes in a timely manner. The flexibility, controllability and user experience of the system are enhanced, while reducing the complexity of system management and the risk of misoperation.

[0067] Figure 6 FIG. 1 is a schematic diagram of the structure of a flow control device provided in an embodiment of the present invention, and the device is suitable for executing the flow control method provided in an embodiment of the present invention. Figure 6 As shown, the device may specifically include:

[0068] The information acquisition module 601 is used to acquire the usage information of the connection pool of the database at the current moment when receiving at least one transaction request sent by the first user through each distributed node server;

[0069] The current limiting triggering module 602 is used to determine, for each transaction request, whether the current transaction request needs to be current limited according to the usage information, the predetermined current limiting configuration files of each transaction type and the current transaction type of the current transaction request;

[0070] The parameter determination module 603 is used to obtain the current limiting parameters of the current transaction request according to the current limiting configuration file of the current transaction request and the usage information when the current transaction request needs to be limited.

[0071] The current limiting control module 604 is used to perform a current limiting operation on the current transaction request according to the current limiting parameters of the current transaction request.

[0072] Optionally, the usage information includes the number of active connections, where an active connection is a connection in use; the current limiting trigger module 602 is specifically configured to: when the number of active connections is greater than a preset connection threshold, determine whether the current transaction request needs to be current limited according to a current limiting configuration file of each transaction type and the current transaction type;

[0073] When the number of active connections is less than or equal to the connection threshold, it is determined that there is no need to limit the flow of the at least one transaction request received at the current moment.

[0074] Optionally, the current limiting triggering module 602 is further used to: search for a current limiting configuration file of the current transaction type in the current limiting configuration files of each transaction type;

[0075] If the current limiting configuration file of the current transaction type is found, it is determined that the current transaction request needs to be current limited; if the current limiting configuration file of the current transaction type is not found, it is determined that the current transaction request does not need to be current limited.

[0076] Optionally, the current limiting parameters include various current limiting index values; the parameter determination module 603 is specifically used to: obtain the current current limiting index values ​​stored in the current limiting configuration file of the current transaction request;

[0077] The target current limiting index values ​​of the current transaction request are determined based on the current current limiting index values ​​and the usage information.

[0078] Optionally, the current limiting control module 604 is specifically used to: determine the current distributed node server corresponding to the current transaction request;

[0079] The target current limiting index values ​​of the current transaction request are sent to the current distributed node server, so that the current distributed node server performs a current limiting operation on the current transaction request according to the target current limiting index values.

[0080] Optionally, the current limiting control module 604 is further configured to: receive a configuration instruction sent by a second user, and display a configuration interface to the second user in response to the configuration instruction;

[0081] Receiving the current limiting parameter modification information sent by the second user through the configuration interface; wherein the current limiting parameter modification information includes a current limiting object and a current limiting index value;

[0082] A target distributed node server is determined according to the current limiting object, and the current limiting parameter modification information is sent to the target distributed node server, so that the target distributed node server performs a current limiting operation on the current limiting object according to the current limiting parameter modification information.

[0083] The flow control device provided in the embodiment of the present invention can execute the flow control method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method. For the contents not described in detail in this embodiment, reference can be made to the description in any method embodiment of the present invention.

[0084] An embodiment of the present invention also provides a computer program product.

[0085] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer program products, which can include one or more computer programs, which can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor, which can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0086] Figure 7 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention, referring to Figure 7 , Figure 7 The electronic device 12 shown is only an example and should not limit the functions and scope of use of the embodiments of the present application. Figure 7 As shown, the electronic device 12 is in the form of a general purpose computing device. The components of the electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that connects various system components (including the system memory 28 and the processing unit 16).

[0087] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.

[0088] The electronic device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 12, including volatile and non-volatile media, removable and non-removable media.

[0089] The system memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The electronic device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 7 not shown, usually called a "hard drive"). Although Figure 7 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical medium) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present application.

[0090] A program / utility 40 having a set (at least one) of program modules 46 may be stored, for example, in the memory 28, such program modules 46 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 46 generally perform the functions and / or methods of the embodiments described herein.

[0091] The electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, etc.), may communicate with one or more devices that enable a user to interact with the electronic device 12, and / or may communicate with any device that enables the electronic device 12 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). Such communication may be performed via an input / output (I / O) interface 22. Furthermore, the electronic device 12 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 via the bus 18. It should be understood that although Figure 7 Not shown, other hardware and / or software modules may be used in conjunction with the electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0092] The processing unit 16 executes various functional applications and data processing by running the program stored in the system memory 28, for example, implementing a flow control method provided in an embodiment of the present invention: when receiving at least one transaction request sent by the first user through each distributed node server, obtaining the usage information of the connection pool of the database at the current moment; for each transaction request, determining whether it is necessary to limit the flow of the current transaction request according to the usage information, the predetermined flow limiting configuration files of each transaction type and the current transaction type of the current transaction request; when it is necessary to limit the flow of the current transaction request, obtaining the flow limiting parameters of the current transaction request according to the flow limiting configuration file of the current transaction request and the usage information; and performing flow limiting operation on the current transaction request according to the flow limiting parameters of the current transaction request.

[0093] The embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, a flow control method as provided in all the embodiments of the present invention is implemented: when receiving at least one transaction request sent by a first user through each distributed node server, obtaining the usage information of the connection pool of the database at the current moment; for each transaction request, determining whether it is necessary to limit the flow of the current transaction request according to the usage information, the predetermined flow limiting configuration files of each transaction type and the current transaction type of the current transaction request; when it is necessary to limit the flow of the current transaction request, obtaining the flow limiting parameters of the current transaction request according to the flow limiting configuration file of the current transaction request and the usage information; performing flow limiting operation on the current transaction request according to the flow limiting parameters of the current transaction request. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but not limited to, an electronic device, device or device of electrical, magnetic, optical, electromagnetic, infrared, or semiconductor, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: 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 this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction-executing electronic device, apparatus, or device.

[0094] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. 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. Computer-readable signal media 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 conjunction with an instruction-executing electronic device, apparatus, or device.

[0095] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0096] Computer program code for performing the operations of the present invention may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, 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 the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0097] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A flow control method, characterized in that: The method comprises: When receiving at least one transaction request sent by the first user through each distributed node server, obtaining usage information of the connection pool of the database at the current moment; For each transaction request, determining whether it is necessary to limit the flow of the current transaction request according to the usage information, the predetermined flow limiting configuration files of each transaction type, and the current transaction type of the current transaction request; When it is necessary to limit the flow of the current transaction request, obtaining the flow limiting parameters of the current transaction request according to the flow limiting configuration file of the current transaction request and the usage information; Perform a current limiting operation on the current transaction request according to the current limiting parameters of the current transaction request.

2. The method according to claim 1, characterized in that The usage information includes the number of active connections, where an active connection is a connection in use; determining whether it is necessary to limit the flow of the current transaction request according to the usage information, a predetermined flow limiting configuration file of each transaction type, and a current transaction type of the current transaction request, including: When the number of active connections is greater than a preset connection threshold, determining whether it is necessary to limit the flow of the current transaction request according to the flow limiting configuration file of each transaction type and the current transaction type; When the number of active connections is less than or equal to the connection threshold, it is determined that there is no need to limit the flow of the at least one transaction request received at the current moment.

3. The method according to claim 2, characterized in that Determining whether to perform flow limiting on the current transaction request according to the flow limiting configuration file of each transaction type and the current transaction type includes: Searching for a current limiting configuration file of the current transaction type in the current limiting configuration files of each transaction type; If the current limiting configuration file of the current transaction type is found, it is determined that the current transaction request needs to be current limited; if the current limiting configuration file of the current transaction type is not found, it is determined that the current transaction request does not need to be current limited.

4. The method according to claim 1, characterized in that: The current limiting parameters include various current limiting index values; the current limiting parameters of the current transaction request are obtained according to the current limiting configuration file of the current transaction request and the usage information, including: Obtaining current current limiting indicator values ​​stored in the current limiting configuration file of the current transaction request; The target current limiting index values ​​of the current transaction request are determined based on the current current limiting index values ​​and the usage information.

5. The method according to claim 4, characterized in that Performing a flow limiting operation on the current transaction request according to the flow limiting parameter of the current transaction request includes: Determine a current distributed node server corresponding to the current transaction request; The target current limiting index values ​​of the current transaction request are sent to the current distributed node server, so that the current distributed node server performs a current limiting operation on the current transaction request according to the target current limiting index values.

6. The method according to claim 1, characterized in that The method further comprises: receiving a configuration instruction sent by a second user, and displaying a configuration interface to the second user in response to the configuration instruction; Receiving the current limiting parameter modification information sent by the second user through the configuration interface; wherein the current limiting parameter modification information includes a current limiting object; A target distributed node server is determined according to the current limiting object, and the current limiting parameter modification information is sent to the target distributed node server, so that the target distributed node server performs a current limiting operation on the current limiting object according to the current limiting parameter modification information.

7. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the computer program implements a flow control method according to any one of claims 1 to 6.

8. A flow control device, characterized in that: include: An information acquisition module, configured to acquire usage information of a connection pool of a database at a current moment when receiving at least one transaction request sent by a first user through each distributed node server; A current limiting triggering module is used to determine, for each transaction request, whether it is necessary to limit the current transaction request according to the usage information, the predetermined current limiting configuration files of each transaction type and the current transaction type of the current transaction request; A parameter determination module, configured to obtain a current limiting parameter of the current transaction request according to a current limiting configuration file of the current transaction request and the usage information when current limiting is required for the current transaction request; The current limiting control module is used to perform a current limiting operation on the current transaction request according to the current limiting parameters of the current transaction request.

9. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the flow control method according to any one of claims 1 to 6 is implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the flow control method according to any one of claims 1 to 6 is implemented.