A flow control method and device

By determining the flow control dimensions and thresholds in the server, precise traffic control is carried out for each server, which solves the problems of individual servers being prone to downtime and indiscriminate interception, improves the accuracy of user experience and traffic control, and reduces server downtime frequency.

CN113973084BActive Publication Date: 2024-12-20CHINA CONSTRUCTION BANK
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111273425.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-29
Publication Date
2024-12-20
Estimated Expiration
2041-10-29

AI Technical Summary

Technical Problem

Existing traffic control technology cannot effectively solve the problem of individual servers being prone to downtime, and intercepts the requests of some users indiscriminately, resulting in the inability to handle urgent and important requests in a timely manner.

Method used

By determining the flow control dimensions and thresholds in the server, precise flow control is carried out for each server, ensuring that the current concurrent and outgoing numbers do not reach the threshold, avoiding undifferentiated interception, and through the flow control field-Flow control Dimensional configuration table improves flow control efficiency and accuracy.

Benefits of technology

Reduce the frequency of server downtime, improve the accuracy of user experience and traffic control, ensure the timely processing of emergency requests, reduce the burden on the control system, and save computing resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113973084B_ABST
    Figure CN113973084B_ABST
Patent Text Reader

Abstract

Embodiments of the present invention relate to the field of resource scheduling technology, and in particular to a flow control method and device. The method includes: a first server determines that the current overall concurrency is less than the overall flow control threshold of the first server. For any flow control field in the received first transaction message, the first server determines the flow control dimension corresponding to the field value of the first transaction message under the flow control field; the first server determines whether the flow control dimension meets the set requirements; the set requirement is that the current group concurrency of the flow control dimension is less than the group flow control threshold of the flow control dimension. The first server processes the first transaction message when the flow control dimensions of each flow control field meet the set requirements. Flow control for each server is implemented, and the corresponding flow control dimension is determined for the field value under the flow control field in the transaction message. The transaction message can be targeted and comprehensively flow controlled, so as not to intercept all transaction requests indiscriminately, thereby improving the accuracy of the server's flow control.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the technical field of resource scheduling, and in particular, to a flow control method, apparatus, computing device, and computer-readable storage medium. Background Art

[0002] When the application system receives a user transaction request, it will allocate corresponding resources to the user transaction request to process the user transaction request. For large-scale application systems, due to the large scale of business, they often encounter millions or even more user transaction requests, which will put a lot of pressure on the resource scheduling of the application system. If no protective measures are taken, when the number of requests exceeds the limit that the application system can bear, the server in the application system will go down and the application system will crash, resulting in no one being able to access it. In order to achieve high availability of the application system, the application system can be flow controlled, intercepting some user requests and only providing services to some users, that is, only allocating resources to some users, so as to prevent system crashes caused by a large number of requests, thereby ensuring high availability of the application.

[0003] The current flow control technology mainly targets the entire application system and performs flow control by controlling the average rate of requests. This still does not solve the problem of individual servers being prone to downtime; and indiscriminate interception of some user requests will result in some urgent and important user requests not being processed in a timely manner.

[0004] In summary, the embodiments of the present invention provide a flow control method for accurately controlling flow according to user requests, thereby reducing the frequency of server downtime and improving user experience. Summary of the invention

[0005] The embodiment of the present invention provides a flow control method for accurately controlling flow according to user requests, thereby reducing the frequency of server downtime and improving user experience.

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

[0007] The first server determines that the current overall concurrency number is less than the overall flow control threshold of the first server; the current overall concurrency number is the total number of transactions currently carried by the first server; the first server is any server in the first data center;

[0008] For any flow control field in the received first transaction message, the first server determines the flow control dimension corresponding to the field value of the first transaction message under the flow control field; the first server determines whether the flow control dimension meets the set requirement; the set requirement is that the current concurrent number of packets of the flow control dimension is less than the packet flow control threshold of the flow control dimension; the current concurrent number of packets is the total number of transactions with the flow control dimension currently carried by the first server;

[0009] The first server processes the first transaction message when the flow control dimensions of the various flow control fields meet the set requirements.

[0010] The first server receives the first transaction message, and determines the flow control dimension through the flow control field in the first transaction message, so that the transaction message can be subjected to flow control in multiple flow control dimensions. Specifically, if the current group concurrency of the flow control dimension is less than the group flow control threshold, and the current overall concurrency of the first server is less than the overall flow control threshold, the first transaction message is processed. In this way, flow control is implemented for each server, and the high availability design of the entire application system is realized. At the same time, the corresponding flow control dimension is determined according to the field value under the flow control field in the transaction message, so that the transaction message can be subjected to targeted and comprehensive flow control, without indiscriminately intercepting all transaction requests. Thereby, the accuracy of the server's flow control can be improved, and the user experience can be enhanced.

[0011] Optionally, processing the first transaction message includes:

[0012] After executing the first subtask of the first transaction message, the first server generates a second transaction message based on the second subtask of the first transaction message;

[0013] When the first server determines that the current overall outgoing call number is less than the overall outgoing call threshold of the first server, the second transaction message is sent to the second server, where the second server is any server in the first data center; the current overall outgoing call number is the total number of transactions currently outgoing by the first server;

[0014] The first server receives an execution result of the second transaction message executed by the second server.

[0015] After the first server completes the first subtask of the first transaction message, it will generate a second transaction message based on the second subtask of the first transaction message. Before the first server calls out the second transaction message, it will determine whether the current overall number of outgoing calls is less than the overall outgoing call threshold of the first server. If it is less than the overall outgoing call threshold, the second transaction message can be called out. In this way, the first server can perform flow control on its own outgoing requests, which increases the dimension of flow control and further improves the accuracy of flow control.

[0016] Optionally, the first transaction message is sent by a control system to the first server; the control system does not have a flow control function.

[0017] By enabling the first server to have a flow control function, the control system does not need to perform flow control on the entire application system, thereby reducing the burden on the control system and saving computing resources.

[0018] Optionally, the first server determines the flow control dimension corresponding to the field value of the first transaction message under the flow control field, including:

[0019] The first server obtains a flow control field of the first transaction message, and determines a field value of the first transaction message under the flow control field;

[0020] In the field-flow control dimension configuration table, determine the flow control dimension corresponding to the field value.

[0021] By setting up a field-flow control dimension configuration table, the correspondence between the fields and the flow control dimensions is listed in detail. In this way, the flow control dimension corresponding to the field value under the flow control field of the first transaction message can be accurately determined, thereby improving the efficiency of flow control.

[0022] Optionally, the packet flow control threshold is obtained by the following method, including:

[0023] For any flow control dimension, multiple test transaction messages with the same flow control dimension are sent to a test server; the test server has the same hardware configuration as the first server;

[0024] After each performance of the test server reaches a set threshold, determining the transactions per second TPS received by the test server and the average response time of the test server to the multiple test transaction messages;

[0025] A packet flow control threshold of the test server is determined according to the TPS and the average response time.

[0026] By sending a test transaction message to a test server with the same hardware configuration as the first server, and after the various performances of the test server reach the set threshold, the TPS received by the test server and the average response time of the test server to multiple test transaction messages are determined. Through the TPS and the average response time, the packet flow control threshold of the test server can be determined, that is, the packet flow control threshold of the first server is determined. In this way, the packet flow control thresholds of multiple flow control dimensions of the first server can be determined. By using the number of concurrency as the flow control threshold, the calculation is convenient, and the accuracy of flow control can be improved more intuitively and accurately.

[0027] Optionally, it also includes:

[0028] If the first server determines that one or more flow control dimensions among the multiple flow control dimensions corresponding to the first transaction message do not meet the set requirement, determine whether the first transaction message has a flow control dimension that needs to be processed first;

[0029] If yes, the first transaction message is processed.

[0030] When one or more flow control dimensions corresponding to the first transaction message do not meet the set requirements and the first transaction message cannot be processed, the first transaction message can be processed by setting the flow control dimensions for priority processing, thereby ensuring that urgent and important transaction messages are not arbitrarily intercepted and improving the user experience.

[0031] Optionally, the flow control field includes any one or more of the following:

[0032] Transaction code, sender node number, and transaction initiation channel number.

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

[0034] Identify units for:

[0035] Determine that the current overall concurrent number is less than the overall flow control threshold of the first server; the current overall concurrent number is the total number of transactions currently carried by the first server; the first server is any server in the first data center;

[0036] For any flow control field in the received first transaction message, determine the flow control dimension corresponding to the field value of the first transaction message under the flow control field; the first server determines whether the flow control dimension meets the set requirement; the set requirement is that the current concurrent number of packets in the flow control dimension is less than the packet flow control threshold of the flow control dimension; the current concurrent number of packets is the total number of transactions with the flow control dimension currently carried by the first server;

[0037] A processing unit is used to process the first transaction message when the flow control dimensions of each flow control field meet the set requirements.

[0038] Optionally, the processing unit is specifically configured to:

[0039] After executing the first subtask of the first transaction message, the first server generates a second transaction message based on the second subtask of the first transaction message;

[0040] When the first server determines that the current overall outgoing call number is less than the overall outgoing call threshold of the first server, the second transaction message is sent to the second server, where the second server is any server in the first data center; the current overall outgoing call number is the total number of transactions currently outgoing by the first server;

[0041] The first server receives an execution result of the second transaction message executed by the second server.

[0042] Optionally, the first transaction message is sent by a control system to the first server; the control system does not have a flow control function.

[0043] Optionally, the determining unit is specifically configured to:

[0044] The first server obtains a flow control field of the first transaction message, and determines a field value of the first transaction message under the flow control field;

[0045] In the field-flow control dimension configuration table, determine the flow control dimension corresponding to the field value.

[0046] Optionally, the determining unit is specifically configured to:

[0047] For any flow control dimension, multiple test transaction messages with the same flow control dimension are sent to a test server; the test server has the same hardware configuration as the first server;

[0048] After each performance of the test server reaches a set threshold, determining the transactions per second TPS received by the test server and the average response time of the test server to the multiple test transaction messages;

[0049] A packet flow control threshold of the test server is determined according to the TPS and the average response time.

[0050] Optionally, the determining unit is further configured to:

[0051] If the first server determines that one or more flow control dimensions among the multiple flow control dimensions corresponding to the first transaction message do not meet the set requirement, determine whether the first transaction message has a flow control dimension that needs to be processed first;

[0052] If yes, the first transaction message is processed.

[0053] Optionally, the flow control field includes any one or more of the following:

[0054] Transaction code, sender node number, and transaction initiation channel number.

[0055] In a third aspect, an embodiment of the present invention further provides a computing device, including:

[0056] Memory for storing computer programs;

[0057] The processor is used to call the computer program stored in the memory and execute the flow control method listed in any of the above-mentioned ways according to the obtained program.

[0058] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer-executable program, and the computer-executable program is used to enable a computer to execute the flow control method listed in any of the above-mentioned ways. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0060] Figure 1A A schematic diagram of a leaky bucket algorithm provided by an embodiment of the present invention;

[0061] Figure 1B A schematic diagram of a token bucket algorithm provided by an embodiment of the present invention;

[0062] Figure 2 A schematic diagram of the architecture of an application system provided by an embodiment of the present invention;

[0063] Figure 3 A schematic diagram of the architecture of a server provided in an embodiment of the present invention;

[0064] Figure 4 A schematic diagram of a flow control method provided by an embodiment of the present invention;

[0065] Figure 5 A schematic diagram of the architecture of another application system provided by an embodiment of the present invention;

[0066] Figure 6 A flow chart of a flow control method provided by an embodiment of the present invention;

[0067] Figure 7 A schematic structural diagram of a flow control device provided by an embodiment of the present invention;

[0068] Figure 8 A schematic diagram of the structure of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0069] In order to make the purpose, implementation mode and advantages of the present application clearer, the exemplary implementation mode of the present application will be clearly and completely described below in conjunction with the drawings in the exemplary embodiments of the present application. Obviously, the described exemplary embodiments are only part of the embodiments of the present application, rather than all the embodiments.

[0070] Based on the exemplary embodiments described in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the claims attached to this application. In addition, although the disclosure in this application is introduced according to one or several exemplary examples, it should be understood that each aspect of the disclosure can also constitute a complete implementation method separately.

[0071] It should be noted that the brief description of terms in this application is only for the convenience of understanding the embodiments described below, and is not intended to limit the embodiments of this application. Unless otherwise specified, these terms should be understood according to their common and usual meanings.

[0072] The terms "first", "second", "third", etc. in the specification and claims of this application and the above drawings are used to distinguish similar or similar objects or entities, and do not necessarily mean to limit a specific order or sequence, unless otherwise indicated. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, for example, they can be implemented according to orders other than those given in the diagrams or descriptions of the embodiments of this application.

[0073] In addition, the terms "include" and "have" and any variations thereof are intended to cover but not exclude inclusion, for example, a product or device comprising a list of components is not necessarily limited to those components expressly listed but may include other components not expressly listed or inherent to such products or devices.

[0074] In the prior art, the application system performs flow control mainly through the leaky bucket algorithm and the token bucket algorithm. Figure 1A The diagram of the leaky bucket algorithm is shown. The main idea of ​​the leaky bucket algorithm is: a leaky bucket with a fixed capacity, user requests flow into the bucket at any rate, and the bucket flows out at a fixed rate. When the inflow rate is too high, it overflows directly. It can be seen that the leaky bucket algorithm can forcibly limit the transmission rate of user requests.

[0075] Figure 1BThe schematic diagram of the token bucket algorithm is shown. The main idea of ​​the token bucket algorithm is: a bucket that stores fixed tokens, and tokens are added to the bucket at a fixed rate. If the bucket is full, the tokens are discarded. If a user request needs to be processed, it is necessary to obtain a token from the token bucket first. If it is not obtained, the service is denied. If there is a sudden large number of user requests, as long as there are tokens in the bucket, the sudden user requests are allowed to be processed until there are no tokens in the token bucket. It can be found that compared with the leaky bucket algorithm, the token bucket algorithm allows sudden user requests to pass.

[0076] The above algorithms all perform flow control on the entire application system, which can be specifically executed by the control system. In the leaky bucket algorithm, the control system controls the capacity of the leaky bucket and the rate at which user requests are processed. When there are too many user requests in the bucket, some user requests are intercepted. In the token bucket algorithm, the control system controls the capacity of the token bucket and the rate at which tokens are issued. When there are too many user requests, some user requests are intercepted.

[0077] However, this method of flow control for the entire application system may still result in problems such as individual servers receiving more user requests than load, leading to downtime; and indiscriminate interception of some user requests will result in some urgent and important user requests not being processed in a timely manner.

[0078] Figure 2 The architecture of an application system applicable to the embodiment of the present invention is exemplarily shown. The architecture of the application system may include a control system 100 and a first data center 200, wherein the first data center 200 includes a plurality of servers, such as Figure 2 The first server 210, the first server 220 and the first server 230 are shown in FIG. The above is only an example, and the embodiment of the present invention does not limit this.

[0079] The control system 100 is used to receive the transaction message of the user and send the transaction message to any server in the first data center 200 so that the server can process it. Optionally, the control system 100 can have a flow control function. After receiving the transaction message of the user, the control system 100 determines whether the current concurrency of the entire application system is less than the concurrency threshold of the entire application system. If so, the transaction message can be sent to any server in the first data center 200; if not, the transaction message is intercepted. The current concurrency of the entire application system can be determined by the sum of the current overall concurrency of each server in the first data center 200, and the concurrency threshold of the entire application system can be determined by the sum of the overall flow control threshold of each server in the first data center 200, which is not limited in the embodiment of the present invention.

[0080] Optionally, the control system 100 may not have a flow control function, and after receiving the transaction message from the user, the transaction message is directly sent to any server in the first data center 200 for processing by the server. After receiving the transaction message, any server determines whether to process the transaction message by judging the current overall concurrency and the overall flow control threshold, the current group concurrency and the group flow control threshold.

[0081] Optionally, in Figure 2 The system architecture shown may not include the control system 100. When the transaction message of the user is sent to the application system, any server receives the transaction message. After receiving the transaction message, any server determines whether to process the transaction message by judging the current overall concurrency and the overall flow control threshold, the current group concurrency and the group flow control threshold.

[0082] The above is only an example, and the embodiments of the present invention are not limited thereto.

[0083] Figure 3 1 shows a possible architecture diagram of a server provided by an embodiment of the present invention, including a processor 110, a communication interface 120 and a memory 130.

[0084] The communication interface 120 is used to communicate with the terminal device, send and receive information transmitted by the terminal device, and realize communication.

[0085] The processor 110 is the control center of the server 100, and uses various interfaces and routes to connect various parts of the entire server 100, and executes various functions of the server 100 and processes data by running or executing software programs and / or modules stored in the memory 130, and calling data stored in the memory 130. Optionally, the processor 110 may include one or more processing units.

[0086] The memory 130 can be used to store software programs and modules. The processor 110 executes various functional applications and data processing by running the software programs and modules stored in the memory 130. The memory 130 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function, etc.; the data storage area can store data created according to business processing, etc. In addition, the memory 130 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0087] It should be noted that the above Figure 3 The structure shown is only an example and is not limited to this embodiment of the present invention.

[0088] Figure 3 The server shown can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), as well as big data and artificial intelligence platforms.

[0089] Figure 4 A flow control method provided by an embodiment of the present invention is shown, comprising:

[0090] Step 401, the first server determines that the current overall concurrency is less than the overall flow control threshold of the first server; the current overall concurrency is the total number of transactions currently carried by the first server; the first server is any server in the first data center.

[0091] Step 402, for any flow control field in the received first transaction message, the first server determines the flow control dimension corresponding to the field value of the first transaction message under the flow control field; the first server determines whether the flow control dimension meets the set requirements; the set requirement is that the current group concurrency number of the flow control dimension is less than the group flow control threshold of the flow control dimension; the current group concurrency number is the total number of transactions with the flow control dimension currently carried by the first server.

[0092] Step 403: When the flow control dimensions of the flow control fields meet the set requirements, the first server processes the first transaction message.

[0093] The first server receives the first transaction message, and determines the flow control dimension through the flow control field in the first transaction message, so that the transaction message can be subjected to flow control in multiple flow control dimensions. Specifically, if the current group concurrency of the flow control dimension is less than the group flow control threshold, and the current overall concurrency of the first server is less than the overall flow control threshold, the first transaction message is processed. In this way, flow control is implemented for each server, and the high availability design of the entire application system is realized. At the same time, the corresponding flow control dimension is determined according to the field value under the flow control field in the transaction message, so that the transaction message can be subjected to targeted and comprehensive flow control, without indiscriminately intercepting all transaction requests. Thereby, the accuracy of the server's flow control can be improved, and the user experience can be enhanced.

[0094] In step 401, the first server is any server in the first data center, and the overall flow control threshold of the first server can be obtained by sending a test transaction message to the test server.

[0095] Specifically, one or more test servers with the same hardware configuration as the first server are selected, and a large number of test transaction messages are sent to the test servers. After various performances of the test servers reach set thresholds, the TPS (Transactions Per Second) received by the test servers and the average response time of the test servers to the multiple test transaction messages are determined; based on the TPS and the average response time, the overall flow control threshold of the test server is determined.

[0096] For example, 10 test servers with the same hardware configuration as the first server are selected, and a large number of test transaction messages are sent to the test servers. After the performance of the test servers, such as CPU utilization and memory utilization, reaches the set threshold, for example, when the CPU utilization reaches 60% and the memory utilization reaches 80%, the TPS received by the 10 test servers and the average response time T of the 10 test servers to the multiple test transaction messages are determined. The overall flow control threshold is calculated using the formula: C = (TPS / M) * T, where C is the overall flow control threshold and M is the number of test servers.

[0097] The first server obtains the total number of transactions currently carried, that is, the current overall concurrency number, and determines whether the current overall concurrency number is less than the overall flow control threshold of the first server. If so, it means that the first server has not reached the performance limit and can continue to process user requests.

[0098] It is worth noting that multiple flow control fields can be set in the transaction message. The flow control field can be a transaction code, a sender node number, a transaction initiation channel number, etc. Each flow control field corresponds to one or more flow control dimensions. Table 1 shows a possible correspondence between flow control fields and flow control dimensions.

[0099] Table 1

[0100]

[0101]

[0102] Table 1 above is only an example, and the flow control field may also include a bank system, a card number, etc., and the flow control dimensions corresponding to each flow control field are not limited to those listed in the table. Those skilled in the art may set them as needed.

[0103] A transaction message may include multiple flow control fields. For example, the format of a transaction message is (transaction code, account number, sender node number, transaction initiation channel number, amount of money), where the transaction code, sender node number, and transaction initiation channel number are flow control fields. The field value under the flow control field in the transaction message can reflect the flow control dimension corresponding to the flow control field. For example, a transaction message is (balance query, 62193××××, acquiring system, WeChat, null). According to the field values ​​of the transaction message, it can be determined that the flow control dimensions corresponding to the transaction message are balance query, acquiring system, and WeChat.

[0104] In addition to determining the overall flow control threshold of the first server, the group flow control threshold of each flow control dimension can also be determined. The determination method is the same as the method for determining the overall flow control threshold. It includes: for any flow control dimension, sending multiple test transaction messages with the same flow control dimension to a test server with the same hardware configuration as the first server; after the various performances of the test server reach the set threshold, determining the TPS received by the test server and the average response time of the test server to multiple test transaction messages; based on the TPS and the average response time, determining the group flow control threshold of the test server.

[0105] For example, to determine the group flow control threshold of the flow control dimension of "check balance": select 10 test servers with the same hardware configuration as the first server, send a large number of test transaction messages containing the field value of "check balance" to the test servers, and after the performance of the test servers reaches the set threshold, determine the TPS received by the 10 test servers and the average response time T of the 10 test servers to the multiple test transaction messages. Use the formula: C = (TPS / M) * T to calculate the group flow control threshold.

[0106] By adopting the above method, the overall flow control threshold of the first server and the group flow control threshold of each flow control dimension are obtained, and the flow control field-flow control dimension configuration table is obtained as a whole, as shown in Table 2. The numbers in Table 2 are only examples and are not intended to limit the embodiments of the present invention.

[0107] Table 2

[0108]

[0109] The flow control field-flow control dimension configuration table shown in Table 2 is loaded into the first server, so that the first server can determine whether to process any transaction message in combination with the overall flow control threshold and the group flow control threshold.

[0110] In step 402, the first server receives a first transaction message sent by a user or a control system, obtains a flow control field in the first transaction message, and determines a field value of the first transaction message under the flow control field; in the flow control field-flow control dimension configuration table, determines the flow control dimension corresponding to the field value.

[0111] For example, the first transaction message received is (check balance, 62193××××, acquiring system, WeChat, null), and the flow control fields contained in the first transaction message are determined to be the transaction code, the sender node number, and the transaction initiation channel number. The field value of the transaction code in the flow control field of the first transaction message is "check balance"; the field value of the sender node number in the flow control field is "acquiring system"; the field value of the transaction initiation channel number in the flow control field is "WeChat". Therefore, according to Table 2, the flow control dimension corresponding to the first transaction message and the corresponding group flow control threshold can be determined. The flow control dimensions corresponding to the first transaction message are "check balance", "acquiring system", and "WeChat" respectively.

[0112] The first server obtains the current concurrent number of packets for each flow control dimension, and determines whether the current concurrent number of packets is less than the packet flow control threshold corresponding to each flow control dimension. The current concurrent number of packets is the total number of transactions with the corresponding flow control dimension currently carried by the first server. If it is determined that the current concurrent numbers of packets for multiple flow control dimensions are all less than the packet flow control threshold, the first transaction message is processed.

[0113] For example, the relationship between the current number of concurrent packets and the packet flow control threshold corresponding to each flow control dimension corresponding to the first transaction message obtained by the first server is shown in Table 3.

[0114] Table 3

[0115]

[0116] According to Table 3, among the three flow control dimensions of the first transaction message, the current concurrent number of packets of the "acquiring system" is not less than the packet flow control threshold, which does not meet the set requirements. Therefore, the first server does not process the first transaction message.

[0117] Optionally, when a user request for a certain flow control dimension is more urgent and important, the flow control dimension can be set as a priority dimension. Even when the first server determines that the flow control dimension of the first transaction message does not meet the set requirements, if there is a flow control dimension for priority processing in the first transaction message, the first transaction message can be processed. For example, if the flow control dimension that is more urgent and important for the user in the current period is set to "Alipay", for the first transaction message, if the flow control dimensions of the first transaction message do not meet the set requirements, but the field value contains "Alipay", the first transaction message can be processed.

[0118] The embodiment of the present invention does not limit the order of step 401 and step 402 , and they may be performed simultaneously or step 402 may be performed first and then step 401 .

[0119] Optionally, the first transaction message may further include multiple subtasks, and the multiple subtasks need to be executed separately.

[0120] For example, if the first transaction message is (transfer, 62163×××××→62152×××××, acquiring system, Alipay, 3000), then executing the first transaction message needs to be divided into two subtasks: the first subtask: transfer 3000 from account number 62163×××××; the second subtask: transfer 3000 yuan to account number 62152×××××. If the first server receives the first transaction message and determines that both account numbers 62163×××× and 62152××××× are located in the first data center, the first server can execute the second subtask after executing the first subtask. After the execution is completed, the prompt message "transfer successful" is returned to the user. If the execution fails due to the current overall concurrency being less than the overall flow control threshold, or the current group concurrency being less than the group flow control threshold, or other network reasons, machine reasons, etc., then the prompt message "transfer failed" can be returned to the user.

[0121] However, if accounts 62163×××× and 62152××××× are located in different data centers, for example, in the first data center and the second data center respectively, the first server needs to generate a second transaction message based on the second subtask of the first transaction message after executing the first subtask of the first transaction message; send the second transaction message to any server in the second data center so that the second server processes the second transaction message. After the processing is completed, the execution result is fed back to the first server. If the execution is successful, the first server returns a prompt message of "transfer successful" to the user.

[0122] Figure 5 Another system architecture diagram provided by an embodiment of the present invention includes a first data center 200 and a second data center 300, wherein the first data center 200 includes multiple servers, such as Figure 5 The first server 210, the first server 220 and the first server 230 shown in FIG. The second data center 300 includes a plurality of servers, such as Figure 5 The second server 310, the second server 320 and the second server 330 are shown in FIG. The above are only examples, and the embodiment of the present invention does not limit this.

[0123] The first server 210 processes the first transaction message as an example. The first server receives the first transaction message (transfer, 62163×××××→62152×××××, acquiring system, Alipay, 3000), and confirms that the first transaction message includes two subtasks, the first subtask: transfer 3000 from the account number 62163×××××; the second subtask: transfer 3000 yuan to the account number 62152×××××. For the first subtask, the first server confirms that the current overall concurrency of the first server is less than the overall flow control threshold of the first server, and the flow control dimensions of the first transaction message: transfer money, acquiring system, Alipay, etc. all meet the set requirements, then the first server executes the first subtask.

[0124] After executing the first subtask of the first transaction message, the first server generates a second transaction message based on the second subtask of the first transaction message: (transfer money, 62152×××××, first server IP address, Alipay, 3000).

[0125] The first server confirms that the account number 62152××××× is located in the second data center, so the second transaction message is called out. Before calling out, the first server can judge the current overall call-out number and the overall call-out threshold of the first server. If it is determined that the current overall call-out number is less than the overall call-out threshold of the first server, the second transaction message is called out. The current overall call-out number is the total number of transactions currently called out by the first server; the overall call-out threshold can be obtained by the sum of the overall flow control thresholds of each server in the second data center.

[0126] Taking the second server 310 receiving the second transaction message as an example, the second server 310 may also execute the following Figure 4 The method flow shown in , thereby determining whether to process the second transaction message. The embodiment of the present invention does not limit this.

[0127] In order to better explain the embodiment of the present invention, the above-mentioned flow control process will be described in general below. Figure 6 shown. Figure 6 The step numbers in the figure are only for illustration and are not intended to limit the present invention. The order of the steps can be freely adjusted during the specific implementation.

[0128] Step 601: The first server receives a first transaction message.

[0129] Step 602: The first server determines whether the current overall concurrency number is less than the overall flow control threshold. If so, proceed to step 603; if not, proceed to step 607.

[0130] Step 603: The first server determines the flow control dimension according to the first transaction message, and for any flow control dimension, determines whether the current concurrent number of packets in the flow control dimension is less than the packet flow control threshold. If so, proceed to step 604; if not, proceed to step 605.

[0131] Step 604: Process the first transaction message, increase the current overall concurrency by 1, and increase the current group concurrency by 1.

[0132] Step 605: Determine whether the first transaction message has a flow control dimension that needs to be processed first. If yes, proceed to step 604; if no, proceed to step 607.

[0133] Step 606: After the first transaction message is processed, the current overall concurrency number is reduced by 1, and the current group concurrency number is reduced by 1.

[0134] Step 607: Refuse to process the first transaction message.

[0135] Based on the same technical concept, Figure 7 The structure of a flow control device provided by an embodiment of the present invention is exemplarily shown, and the structure can execute the flow control process.

[0136] like Figure 7 As shown, the device specifically includes:

[0137] The determining unit 701 is configured to:

[0138] Determine that the current overall concurrent number is less than the overall flow control threshold of the first server; the current overall concurrent number is the total number of transactions currently carried by the first server; the first server is any server in the first data center;

[0139] For any flow control field in the received first transaction message, determine the flow control dimension corresponding to the field value of the first transaction message under the flow control field; the first server determines whether the flow control dimension meets the set requirement; the set requirement is that the current concurrent number of packets in the flow control dimension is less than the packet flow control threshold of the flow control dimension; the current concurrent number of packets is the total number of transactions with the flow control dimension currently carried by the first server;

[0140] The processing unit 702 is used to process the first transaction message when the flow control dimensions of each flow control field meet the set requirements.

[0141] Optionally, the processing unit 702 is specifically configured to:

[0142] After executing the first subtask of the first transaction message, the first server generates a second transaction message based on the second subtask of the first transaction message;

[0143] When the first server determines that the current overall outgoing call number is less than the overall outgoing call threshold of the first server, the second transaction message is sent to the second server, where the second server is any server in the first data center; the current overall outgoing call number is the total number of transactions currently outgoing by the first server;

[0144] The first server receives an execution result of the second transaction message executed by the second server.

[0145] Optionally, the first transaction message is sent by a control system to the first server; the control system does not have a flow control function.

[0146] Optionally, the determining unit 701 is specifically configured to:

[0147] The first server obtains a flow control field of the first transaction message, and determines a field value of the first transaction message under the flow control field;

[0148] In the field-flow control dimension configuration table, determine the flow control dimension corresponding to the field value.

[0149] Optionally, the determining unit 701 is specifically configured to:

[0150] For any flow control dimension, multiple test transaction messages with the same flow control dimension are sent to a test server; the test server has the same hardware configuration as the first server;

[0151] After each performance of the test server reaches a set threshold, determining the transactions per second TPS received by the test server and the average response time of the test server to the multiple test transaction messages;

[0152] A packet flow control threshold of the test server is determined according to the TPS and the average response time.

[0153] Optionally, the determining unit 701 is further configured to:

[0154] If the first server determines that one or more flow control dimensions among the multiple flow control dimensions corresponding to the first transaction message do not meet the set requirement, determine whether the first transaction message has a flow control dimension that needs to be processed first;

[0155] If yes, the first transaction message is processed.

[0156] Optionally, the flow control field includes any one or more of the following:

[0157] Transaction code, sender node number, and transaction initiation channel number.

[0158] Based on the same technical concept, the embodiment of the present application provides a computer device, such as Figure 8 As shown, it includes at least one processor 801 and a memory 802 connected to the at least one processor. The specific connection medium between the processor 801 and the memory 802 is not limited in the embodiment of the present application. Figure 8 For example, the processor 801 and the memory 802 are connected via a bus. The bus can be divided into an address bus, a data bus, a control bus, etc.

[0159] In the embodiment of the present application, the memory 802 stores instructions that can be executed by at least one processor 801, and the at least one processor 801 can perform the steps of the above-mentioned flow control method by executing the instructions stored in the memory 802.

[0160] The processor 801 is the control center of the computer device, and can use various interfaces and lines to connect various parts of the computer device, and perform flow control by running or executing instructions stored in the memory 802 and calling data stored in the memory 802. Optionally, the processor 801 may include one or more processing units, and the processor 801 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 801. In some embodiments, the processor 801 and the memory 802 may be implemented on the same chip, and in some embodiments, they may also be implemented separately on independent chips.

[0161] Processor 801 can be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit (ASIC), a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, and can implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware processor for execution, or can be executed by a combination of hardware and software modules in the processor.

[0162] The memory 802 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory 802 may include at least one type of storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (Random Access Memory, RAM), a static random access memory (Static Random Access Memory, SRAM), a programmable read-only memory (Programmable Read Only Memory, PROM), a read-only memory (Read Only Memory, ROM), an electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a magnetic memory, a disk, an optical disk, etc. The memory 802 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 802 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.

[0163] Based on the same technical concept, an embodiment of the present invention further provides a computer-readable storage medium, which stores a computer-executable program. The computer-executable program is used to enable a computer to execute the flow control method listed in any of the above-mentioned ways.

[0164] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0165] The present application is described with reference to the flowchart and / or block diagram of the method, device (system), and computer program product according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the process and / or box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for implementing the function specified in one process or multiple processes in the flowchart and / or one box or multiple boxes in the block diagram.

[0166] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0167] These computer program instructions may also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0168] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A flow control method, It is characterized in that include: The first server determines that the current overall concurrency number is less than the overall flow control threshold of the first server; the current overall concurrency number is the total number of transactions currently carried by the first server; The first server is any server in the first data center; For any flow control field in the received first transaction message, the first server determines a flow control dimension corresponding to a field value of the first transaction message under the flow control field; The first server determines whether the flow control dimension meets the set requirements. If not, it determines whether the first transaction message has a flow control dimension that needs to be processed first. If yes, it processes the first transaction message; if not, it refuses to process the first transaction message. The set requirement is that the current concurrent number of packets of the flow control dimension is less than the group flow control threshold of the flow control dimension. The current concurrent number of packets is the total number of transactions with the flow control dimension currently carried by the first server. When the flow control dimensions of each flow control field of the first server meet the set requirements, the first server generates a second transaction message based on the second subtask of the first transaction message after executing the first subtask of the first transaction message; when the first server determines that the current overall outgoing call number is less than the overall outgoing call threshold of the first server, the second transaction message is sent to the second server, and the second server is any server in the first data center; the current overall outgoing call number is the total number of transactions currently called out by the first server; the first server receives the execution result of the second transaction message executed by the second server.

2. The method according to claim 1, It is characterized in that The first transaction message is sent by the control system to the first server; the control system does not have a flow control function.

3. The method according to claim 1, It is characterized in that The first server determines the flow control dimension corresponding to the field value of the first transaction message under the flow control field, including: The first server obtains a flow control field of the first transaction message, and determines a field value of the first transaction message under the flow control field; In the flow control field-flow control dimension configuration table, determine the flow control dimension corresponding to the field value.

4. The method according to claim 1, It is characterized in that The packet flow control threshold is obtained by the following method, including: For any flow control dimension, multiple test transaction messages with the same flow control dimension are sent to a test server; the test server has the same hardware configuration as the first server; After each performance of the test server reaches a set threshold, determining the transactions per second TPS received by the test server and the average response time of the test server to the multiple test transaction messages; A packet flow control threshold of the test server is determined according to the TPS and the average response time.

5. The method according to any one of claims 1 to 4, It is characterized in that The flow control field includes any one or more of the following: Transaction code, sender node number, and transaction initiation channel number.

6. A flow control device, It is characterized in that include: Identify units for: Determine that the current overall concurrent number is less than the overall flow control threshold of the first server; the current overall concurrent number is the total number of transactions currently carried by the first server; the first server is any server in the first data center; For any flow control field in the received first transaction message, determine a flow control dimension corresponding to a field value of the first transaction message under the flow control field; The first server determines whether the flow control dimension meets the set requirements. If not, it determines whether the first transaction message has a flow control dimension that needs to be processed first. If yes, it processes the first transaction message; if not, it refuses to process the first transaction message. The set requirement is that the current concurrent number of packets of the flow control dimension is less than the group flow control threshold of the flow control dimension. The current concurrent number of packets is the total number of transactions with the flow control dimension currently carried by the first server. A processing unit, configured to generate a second transaction message based on a second subtask of the first transaction message after the first server completes executing the first subtask of the first transaction message when the flow control dimensions of each flow control field meet the set requirements; the first server sends the second transaction message to a second server when it determines that the current overall number of outgoing calls is less than the overall outgoing call threshold of the first server, the second server being any server of the first data center; the current overall number of outgoing calls is the total number of transactions currently called out by the first server; the first server receives the execution result of the second transaction message executed by the second server.

7. A computing device, It is characterized in that include: Memory for storing computer programs; A processor, configured to call a computer program stored in the memory, and execute the method according to any one of claims 1 to 5 according to the obtained program.

8. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer-executable program, and the computer-executable program is used to enable a computer to execute the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Flow-classification-based grouping flow control system and control method

    CN102387082A

  • Flow control method, device and equipment and computer readable storage medium

    CN111669334A

  • Method and system for spooling diameter transactions

    US20140189151A1