Method and apparatus for flow control of service requests

By receiving and processing banking business requests, calculating the flow control coefficient and configuring the number of threads, the problem of poor universality of forwarding of business requests in the prior art is solved, and efficient processing of business requests and stable traffic control is achieved.

CN113360277BActive Publication Date: 2025-01-10CHINABANK PAYMENT (BEIJING) TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110574078.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-25
Publication Date
2025-01-10
Estimated Expiration
2041-05-25

AI Technical Summary

Technical Problem

When the prior art forwards the business requests of the enterprise to the relevant bank, the generality is poor, and it is easy to cause the current business timeout due to too much business acceptance data at the target bank at the last moment, or the thread is idle due to too little business acceptance data.

Method used

By receiving the service request from the user, confirm the bank channel identification and cache it to the corresponding cache queue, obtain the banking service acceptance completion data of the target bank at the last moment, calculate the flow control coefficient, and decide how to send the cache queue based on this coefficient. The business request is to the target bank, configure the traffic growth control coefficient and the number of accepting threads threshold, and generate the number of allocable business accepting threads to balance traffic and thread usage.

Benefits of technology

It effectively avoids business timeouts and thread idleness, improves the processing efficiency and universality of business requests, and ensures smooth traffic control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113360277B_ABST
    Figure CN113360277B_ABST
Patent Text Reader

Abstract

The present invention provides a flow control method and device for business requests. The flow control method for business requests includes receiving a business request sent by a user terminal, confirming a bank channel identifier corresponding to the business request, caching the business request to a cache queue corresponding to the bank channel identifier; obtaining the bank business acceptance completion data of the target bank at the last moment corresponding to the bank channel identifier, processing the bank business acceptance completion data at the last moment, and obtaining the flow control coefficient of the target bank; based on the flow control coefficient, sending the business request in the cache queue to the target bank. The flow control method for business requests provided by the present invention effectively avoids the current business timeout caused by too much business acceptance data of the target bank at the last moment, or the current thread idleness caused by too little business acceptance data of the target bank at the last moment, thereby improving its versatility.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer networks, and in particular to a method and device for controlling the flow of service requests. Background Art

[0002] With the financial digital transformation of banks and enterprises, more and more enterprises are accessing payment platforms and cooperating with banks to carry out corporate online wallet business, further realizing financial business such as guarantee transactions, balance payments and member transactions. Each enterprise realizes or carries out related financial business by forwarding its business requests to relevant banks.

[0003] In summary, commonly used methods for forwarding business requests to relevant banks include establishing multiple thread pools at the channel layer, corresponding to the bank channels connected to the relevant banks, and forwarding the business requests of various enterprises to the relevant banks through the relevant bank channels; or, obtaining the user's payment request, selecting the best bank channel based on the payment request and the business cost and stability of each bank channel and recommending it to the customer, and then the customer specifies it from the recommended bank channels, and forwarding the business requests of various enterprises to the relevant banks through the designated bank channels.

[0004] The disadvantages or shortcomings of the above method of forwarding the business requests of each enterprise to the relevant bank include that the above method of forwarding the business requests of each enterprise to the relevant bank has the problem of poor universality. Summary of the invention

[0005] In view of the problems existing in the prior art, an embodiment of the present invention provides a method and device for flow control of service requests.

[0006] The present invention provides a method for controlling the flow of service requests, comprising:

[0007] Receive a service request sent by a user terminal, confirm a bank channel identifier corresponding to the service request, and cache the service request in a cache queue corresponding to the bank channel identifier;

[0008] Acquire the bank business acceptance completion data of the target bank corresponding to the bank channel identifier at the last moment, process the bank business acceptance completion data at the last moment, and obtain the flow control coefficient of the target bank;

[0009] Based on the flow control coefficient, the business request in the cache queue is sent to the target bank.

[0010] According to a flow control method for business requests provided by the present invention, the processing of the bank business acceptance completion data at the previous moment to obtain the flow control coefficient of the target bank includes:

[0011] Obtaining the initial business acceptance thread number of the target bank;

[0012] Based on the initial business acceptance thread number, the bank business acceptance completion data at the previous moment is processed to obtain the flow control coefficient of the target bank.

[0013] According to a flow control method for a business request provided by the present invention, the business request in the cache queue is sent to the target bank based on the flow control coefficient, comprising:

[0014] Configure the traffic growth control coefficient and acceptance thread number threshold of the target bank;

[0015] Based on the traffic growth control coefficient, the initial number of service acceptance threads and the acceptance thread number threshold, the traffic control coefficient is processed to generate the number of allocable service acceptance threads;

[0016] Based on the number of allocatable business acceptance threads, the business requests in the cache queue are sent to the target bank.

[0017] According to a flow control method for business requests provided by the present invention, the bank business acceptance completion data at the previous moment is processed based on the initial business acceptance thread number to obtain the flow control coefficient of the target bank, including:

[0018] X i =(x i-1 mod BT)*BT

[0019] Among them, x i-1 represents the bank business acceptance completion data at the previous moment, BT represents the initial business acceptance thread number of the target bank, and X i represents the flow control coefficient.

[0020] According to a method for controlling the flow of service requests provided by the present invention, the flow control coefficient is processed based on the flow growth control coefficient, the initial number of service acceptance threads and the acceptance thread number threshold to generate the number of allocable service acceptance threads, including:

[0021]

[0022] Wherein, M represents the acceptance thread number threshold of the target bank, BT represents the initial business acceptance thread number of the target bank, Target represents the flow growth control coefficient of the target bank, and X i represents the flow control coefficient, y′ i Indicates the number of assignable business acceptance threads.

[0023] According to a method for flow control of business requests provided by the present invention, the business requests in the cache queue are sent to the target bank based on the number of allocable business acceptance threads, including:

[0024] Determining the number of requests of the business request to be processed in the cache queue;

[0025] The smaller value of the number of assignable business acceptance threads and the number of requests is used as a target standard, and the business requests in the cache queue having the same number as the target standard are sent to the target bank.

[0026] The present invention also provides a traffic control device for a service request, comprising:

[0027] A receiving module, configured to receive a service request sent by a user terminal, confirm a bank channel identifier corresponding to the service request, and cache the service request in a cache queue corresponding to the bank channel identifier;

[0028] An acquisition module, used to acquire the bank business acceptance completion data of the target bank corresponding to the bank channel identifier at the last moment, and process the bank business acceptance completion data at the last moment to obtain the flow control coefficient of the target bank;

[0029] A sending module is used to send the business request in the cache queue to the target bank based on the flow control coefficient.

[0030] According to a traffic control device for service requests provided by the present invention, the acquisition module includes:

[0031] An acquisition submodule, used to acquire the initial business acceptance thread number of the target bank;

[0032] The control submodule is used to process the bank business acceptance completion data at the previous moment based on the initial business acceptance thread number to obtain the flow control coefficient of the target bank.

[0033] According to a flow control device for a service request provided by the present invention, the sending module comprises:

[0034] A configuration submodule, used to configure the traffic growth control coefficient and acceptance thread number threshold of the target bank;

[0035] A generating submodule, configured to process the flow control coefficient based on the flow growth control coefficient, the initial service acceptance thread number and the acceptance thread number threshold, and generate the allocable service acceptance thread number;

[0036] A sending submodule is used to send the business request in the cache queue to the target bank based on the number of allocatable business acceptance threads.

[0037] According to a flow control device for service requests provided by the present invention, the control submodule is specifically used for:

[0038] X i =(x i-1 mod BT)*BT

[0039] Among them, x i-1 represents the bank business acceptance completion data at the previous moment, BT represents the initial business acceptance thread number of the target bank, and X i represents the flow control coefficient.

[0040] According to a traffic control device for a service request provided by the present invention, the generating submodule is specifically used for:

[0041]

[0042] Wherein, M represents the threshold of the number of acceptance threads of the target bank, BT represents the number of initial business acceptance threads of the target bank, Target represents the flow growth control coefficient of the target bank, and X i represents the flow control coefficient, y′ i Indicates the number of assignable business acceptance threads.

[0043] According to a flow control device for a service request provided by the present invention, the sending submodule is specifically used for:

[0044] Determining the number of requests of the business request to be processed in the cache queue;

[0045] The smaller value of the number of assignable business acceptance threads and the number of requests is used as a target standard, and the business requests in the cache queue having the same number as the target standard are sent to the target bank.

[0046] The present invention also 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, the steps of the flow control method for service requests as described above are implemented.

[0047] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the traffic control method for service requests as described in any one of the above are implemented.

[0048] The present invention provides a method and device for flow control of business requests; by receiving a business request sent by a user terminal, confirming a bank channel identifier corresponding to the business request, and caching the business request to a cache queue corresponding to the bank channel identifier; further, by processing the acquired bank business acceptance completion data of the target bank at the last moment, the flow control coefficient of the target bank is obtained; and based on the flow control coefficient, the business request in the cache queue is sent to the target bank; the method for flow control of business requests provided by the present invention effectively avoids the current business timeout caused by too much business acceptance data of the target bank at the last moment, or the current thread idleness caused by too little business acceptance data of the target bank at the last moment, thereby improving its versatility. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0050] Figure 1 It is a flow chart of a method for flow control of service requests provided by an embodiment of the present invention;

[0051] Figure 2 It is a schematic diagram of a flow chart of generating a flow control coefficient in a flow control method for a service request provided by an embodiment of the present invention;

[0052] Figure 3 It is a schematic diagram of a process of sending a business request to a target bank based on a flow control coefficient provided by an embodiment of the present invention;

[0053] Figure 4 It is a structural diagram of a business system for executing a flow control method for business requests provided by an embodiment of the present invention;

[0054] Figure 5 It is a detailed flow chart of a method for controlling the flow of service requests provided by an embodiment of the present invention;

[0055] Figure 6 It is a structural schematic diagram of a flow control device for service requests provided by an embodiment of the present invention;

[0056] Figure 7 It is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0057] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0058] The accompanying drawings are for illustration only and are not drawn strictly to scale. As used herein, the term "preferably" and similar terms are used to indicate approximations, not degrees, and are intended to illustrate the inherent deviations in measured or calculated values ​​that will be recognized by a person of ordinary skill in the art. It should be noted that in this specification, the expressions "first", "second", "third", etc. are only used to distinguish one feature from another, and do not represent any limitation on the features, especially not any order of precedence.

[0059] It should also be understood that expressions such as "include", "comprising", "including" and / or "comprising" are open rather than closed expressions in this specification, which indicate the presence of the stated features, elements and / or components, but do not exclude the presence of one or more other features, elements, components and / or their combinations. In addition, when describing the embodiments of the present application, "may" is used to mean "one or more embodiments of the present application". And, the term "exemplary" is intended to refer to an example or illustration.

[0060] Unless otherwise specified, all words (including engineering terms and scientific and technological terms) used in this article have the same meaning as those commonly understood by ordinary technicians in the field to which this application belongs. It should also be understood that, unless clearly stated in this application, words defined in common dictionaries should be interpreted as having the same meaning as their meaning in the context of the relevant technology, and should not be interpreted in an idealized or overly formal sense.

[0061] In order to solve the problems existing in the prior art, an embodiment of the present invention provides a method and device for flow control of service requests.

[0062] Figure 1 FIG. 1 is a flow chart of a method for controlling the flow of service requests according to an embodiment of the present invention. Figure 1 As shown, the method includes:

[0063] Step 101, receiving a service request sent by a user terminal, confirming a bank channel identifier corresponding to the service request, and caching the service request to a cache queue corresponding to the bank channel identifier.

[0064] Specifically, step 101 includes receiving a service request sent by a user terminal, confirming a bank channel identifier corresponding to the service request, forwarding the service request according to the bank channel identifier, and caching it in a cache queue corresponding to the bank channel identifier. Service requests belonging to different bank channels will be cached in cache queues corresponding to the bank channel identifiers to which they belong.

[0065] Correspondingly, a business request refers to a request by an enterprise to realize financial services such as secured transactions, balance payments and / or membership transactions through online wallet services. The bank channel identifier is also called the bank channel ID. In general, it refers to the route identifier for the bank to communicate with the outside world. Among them, the business system corresponding to the online wallet business will add a cache queue for each bank connected. The identifier corresponding to the cache queue is the bank channel identifier of the bank; and the newly added cache queue is used to cache business requests related to the bank.

[0066] Step 102, obtaining the bank business acceptance completion data of the target bank corresponding to the bank channel identifier at the last moment, processing the bank business acceptance completion data at the last moment, and obtaining the flow control coefficient of the target bank.

[0067] Specifically, step 102 includes determining the target bank corresponding to the bank channel identifier, obtaining the target bank's bank business acceptance completion data at the last moment, processing the bank business acceptance completion data at the last moment, and obtaining the flow control coefficient of the target bank.

[0068] It should be noted that the previous moment is a specific time point or a specific time period that can be set according to actual needs, and can include multiple types, which are not specifically limited in the embodiment of the present invention.

[0069] Correspondingly, the target bank's bank business acceptance completion data at the last moment refers to the number of business threads that the target bank successfully processed at the last moment during the transaction process. Furthermore, the target bank's flow control coefficient is a parameter that characterizes the target bank's business acceptance capacity at the last moment, which is specifically used to adjust the parameter of the flow size of the business request to be sent to the relevant bank at the current moment.

[0070] Among them, when obtaining the target bank's bank business acceptance completion data at the last moment, you can only refer to the target bank's last moment business acceptance success number s(x), or you can refer to the target bank's last moment business acceptance success number s(x) and failure number f(x) combined scenario, that is, x = f(s(x), f(x)).

[0071] Step 103: Based on the flow control coefficient, the business requests in the cache queue are sent to the target bank.

[0072] Specifically, step 103 includes: taking out part or all of the business requests cached in the cache queue according to the flow control coefficient, and sending the taken business requests to the target bank.

[0073] Correspondingly, according to the flow control coefficient, some or all of the business requests cached in the cache queue are taken out, and the taken out business requests are sent to the target bank; this can effectively avoid business timeouts or idle business threads that may occur in the target bank, thereby improving the processing efficiency of business requests.

[0074] Based on the above embodiments, Figure 2 FIG. 1 is a flow chart of generating a flow control coefficient in a flow control method for a service request according to an embodiment of the present invention. Figure 2 As shown, the flow control coefficient is generated, including:

[0075] Step 201, obtaining the initial business acceptance thread number of the target bank.

[0076] Specifically, step 201 includes obtaining the initial number of business acceptance threads allocated to the target bank by the business system when it is started. The business system refers to the business system corresponding to the enterprise online wallet business.

[0077] Exemplarily, if the target bank is BBB, when the business system is started, an initial business acceptance thread number BT for accepting business requests will be allocated to BBB, and the BT of BBB will be obtained accordingly.

[0078] Among them, BT is the initial number of business acceptance threads. When the target bank encounters performance problems such as hot accounts, the business system can effectively limit the waste caused by excessive issuance of acceptance threads by reasonably setting the BT value.

[0079] Step 202: Based on the initial business acceptance thread number, the bank business acceptance completion data at the previous moment is processed to obtain the flow control coefficient of the target bank.

[0080] Specifically, step 202, see the following formula (1):

[0081] X i =(x i-1 mod BT)*BT (1)

[0082] Among them, x i-1 Indicates the bank business acceptance completion data at the last moment, BT indicates the number of initial business acceptance threads of the target bank, and X i Indicates the flow control coefficient.

[0083] Correspondingly, the flow control coefficient X iIt is used to adjust the flow size of the business request allocated to the target bank; and the flow control coefficient X i The larger it is, the greater the traffic volume of business requests allocated to the target bank.

[0084] Among them, for target banks with small business acceptance volume or extremely low business acceptance completion data, that is, x i-1 is less than BT, and X in formula (1) i If the value is 0, no traffic requested by the business will be allocated to the target bank.

[0085] It should be noted that the target bank's bank business acceptance completion data at the previous moment cannot be greater than any one of the target bank's initial business acceptance thread number, the target bank's acceptance thread number threshold and the number of pending business requests at the same moment; in summary, the upper limit of the target bank's bank business acceptance completion data at the previous moment is the minimum value of the target bank's initial business acceptance thread number, the target bank's acceptance thread number threshold and the number of pending business requests at the same moment.

[0086] In addition, every time the target bank completes the same number of business acceptances as the initial number of business acceptance threads, the flow control coefficient increases accordingly and increases by an integer multiple of the initial number of business acceptance threads.

[0087] Based on the above embodiments, Figure 3 FIG. 1 is a flow chart of sending a service request to a target bank based on a flow control coefficient according to an embodiment of the present invention. Figure 3 As shown, a business request is sent to a target bank based on a flow control coefficient, including:

[0088] Step 301, configure the traffic growth control coefficient and acceptance thread number threshold of the target bank.

[0089] Specifically, step 301 includes configuring the traffic growth control coefficient and acceptance thread number threshold of the target bank through configuration information synchronization.

[0090] Among them, the traffic growth control coefficient of the target bank refers to the parameter used to dynamically adjust the growth rate of the business request traffic to be sent to the target bank at the current moment; the acceptance thread number threshold refers to the maximum number of threads that the target bank can accept at the current moment.

[0091] Step 302: Based on the traffic growth control coefficient, the initial number of service acceptance threads and the acceptance thread number threshold, the traffic control coefficient is processed to generate the number of allocable service acceptance threads.

[0092] Specifically, step 302, see the following formula (2):

[0093]

[0094] Where M represents the target bank’s acceptance thread number threshold, BT represents the target bank’s initial business acceptance thread number, Target represents the target bank’s traffic growth control coefficient, and X i represents the flow control coefficient, y′ i Indicates the number of allocable business acceptance threads.

[0095] It should be noted that the value range of the target bank's flow growth control coefficient Target is (1, + ∞ ); and, the larger the value of Target is, the easier it is to reach the target bank's acceptance thread number threshold M.

[0096] Step 303: Based on the number of allocable business acceptance threads, the business requests in the cache queue are sent to the target bank.

[0097] Specifically, step 303 includes:

[0098] Step 3031, determining the number of pending business requests in the cache queue.

[0099] Step 3032, taking the smaller value of the number of allocable business acceptance threads and the number of requests as the target standard, and sending the business requests in the cache queue with the same number as the target standard to the target bank.

[0100] Specifically, step 3032 can refer to the following formula (3):

[0101] y i =min(y′ i ,w) (3)

[0102] Among them, y′ i represents the number of service acceptance threads that can be allocated, w represents the number of service requests to be processed in the cache queue, and y i Indicates the target standard, that is, the number of business acceptance threads that can actually be allocated.

[0103] Correspondingly, in order to ensure a steady increase in the traffic of business requests sent to the target bank, y i The value range of is preferably (1,2).

[0104] Furthermore, in determining the target standard y i , that is, the number of business acceptance threads that can actually be allocated, the cache queue and y i Business requests with the same value are sent to the target bank.

[0105] Among them, the cache queue and y i There are many technologies for sending the same number of service requests to the target bank, including token buckets, counters, etc., which are not specifically limited in the embodiment of the present invention.

[0106] In order to further verify any of the above embodiments, the application scenario of the technical solution recorded in any of the above embodiments is exemplarily described:

[0107] If the target bank's acceptance thread number threshold M is 25, the initial business acceptance thread number BT is 5, and the traffic growth control coefficient Target is 1.1.

[0108] Based on the technical solution recorded in any of the above embodiments, the target bank's bank business acceptance completion data x at the last moment is obtained. i-1 The value range and target standard y i The corresponding relationship is shown in Table 1.

[0109] Table 1

[0110] <![CDATA[x i-1 The value range of]]> <![CDATA[y i Value (integer)]]> [0,5) 5 [5,10) 12 [10,15) 17 [15,20) 20 [20,25) 22

[0111] Different numbers of business requests are randomly sent to the business system of the target bank at different times. Based on the technical solution recorded in any of the above embodiments, relevant data when the target bank processes the received business requests is obtained, as shown in Table 2.

[0112] Table 2

[0113]

[0114] Specifically, at time T1, the default allocated BT is 5, y = BT = 5, and the number of pending requests in the system is 5, so x1 = 5;

[0115] At time T2, it can be found from the table that when x1=5, y2=12, the target bank receives 12 business requests. If the target bank successfully processes all the 12 business requests received, then x2=12;

[0116] At time T3, the traffic surged, and the number of unaccepted requests was 40. However, because when x2=12, y3=17 (look up the table), the number of business requests received by the target bank was controlled to be less than or equal to 17. By observing that as the requests continued to surge, the traffic sent to the target bank's business system was always controlled within a reasonable range and would not exceed the target bank's acceptance thread number threshold, effectively controlling the traffic. In this part of the example, the traffic of business requests fluctuated in a wave-like manner, while the number of business requests received by the target bank could still remain constant; further, it can be verified that the technical solution recorded in any of the above embodiments can effectively control the smooth flow.

[0117] On the one hand, if the target bank fails and its business acceptance capacity is reduced from 25 transactions per second to 4 transactions per second, based on the technical solution recorded in any of the above embodiments, relevant data of the target bank processing received business requests is obtained, as shown in Table 3.

[0118] Table 3

[0119]

[0120] At time T7, although the target bank received 22 business requests, due to a failure of the target bank, the target bank's business acceptance completion data x7 = 4;

[0121] At time T8, because x7=4, the formula calculates that y8=5, that is, the number of business requests assigned to the target bank at time T8 also drops to 5, effectively alleviating the pressure on the bank.

[0122] Furthermore, it can be verified that the technical solution recorded in any of the above embodiments can effectively limit the excessive issuance of acceptance threads and avoid waste.

[0123] On the other hand, if the acceptance capacity of the target bank is greatly upgraded, and the target bank's business acceptance capacity is increased to 50 transactions per second. Based on the current acceptance capacity of the target bank, the business system will adjust the target bank's acceptance thread number threshold M to 50 through dynamic configuration; then, based on the technical solution recorded in any of the above embodiments, the target bank's bank business acceptance completion data x at the last moment is obtained. i-1 The value range and target standard y i The corresponding relationship is shown in Table 4.

[0124] Table 4

[0125]

[0126]

[0127] In Table 4, x i-1 The value range and target standard y i On the basis of the corresponding relationship, based on the technical solution recorded in any of the above embodiments, the relevant data when the target bank processes the received business request is obtained, as shown in Table 5.

[0128] Table 5

[0129]

[0130]

[0131] Based on Table 5, it can be seen that when the performance of the target bank is improved, based on the technical solution recorded in any of the above embodiments, the control flow of the business requests received by the target bank can be quickly and smoothly adjusted to the optimal value.

[0132] It can be proved that when the control flow of business requests decreases, the number of business requests in the cache queue will be consumed quickly. When the number of pending business requests decreases sharply, the number of business acceptance threads that can be allocated, y i The value also decays rapidly, which effectively releases the thread resources of the business system.

[0133] Preferably, based on the above application example, when the target bank is in a scenario where its business acceptance capacity increases, the flow growth control coefficient Target of the target bank is adjusted accordingly, so that the number of business acceptance threads y that can be allocated to the target bank can be reduced. i The value increases rapidly, corresponding to the data shown in Table 6.

[0134] Table 6

[0135]

[0136] It should be noted that, based on the above application example, if the target bank's acceptance thread number threshold M is unknown, the target bank's acceptance thread number threshold prediction value M can be predicted based on the following situation: ′ :When the target bank's acceptance thread number threshold prediction value M ′ When the target bank's acceptance thread number threshold M is less than the target bank's acceptance thread number threshold, the target bank's thread number threshold will not be reached, and the business system will smoothly accept all types of business requests received; when the target bank's acceptance thread number threshold prediction value M ′ When it is greater than the target bank's acceptance thread number threshold M, the target bank will fail to accept the business.

[0137] In summary, when multiple companies request different banks at the same time, because the business system will cache the received business requests sent by the companies according to the cache queue of the relevant target bank, and the acceptance thread number threshold of each bank is within a fixed range, even if the business acceptance of a bank times out, the overall number of threads allocated to the bank will be protected from being exhausted as described in the previous example.

[0138] Based on the above embodiments, Figure 4 FIG. 1 is a schematic diagram of the structure of a service system for executing a flow control method for service requests according to an embodiment of the present invention. Figure 4 As shown, the service system for executing the traffic control method for service requests includes: a message forwarding module 410 , a traffic allocation module 420 and a service acceptance module 430 .

[0139] Specifically, the process of executing the flow control method of the service request includes: the message forwarding module 410 receives the service request sent by the user end, confirms the bank channel identifier corresponding to the service request, and caches the service request to the cache queue corresponding to the bank channel identifier. The flow distribution module 420 obtains the bank service acceptance completion data of the target bank corresponding to the bank channel identifier at the last moment, processes the bank service acceptance completion data at the last moment, and obtains the flow control coefficient of the target bank. The service acceptance module 430 sends the service request in the cache queue to the target bank based on the flow control coefficient.

[0140] Based on the above embodiments, Figure 5 FIG. 1 is a detailed flow chart of a method for controlling the flow of service requests according to an embodiment of the present invention. Figure 5 As shown, the method includes:

[0141] Step 501: Receive a service request sent by a user terminal, confirm the bank channel identifier corresponding to the service request, and cache the service request to a cache queue corresponding to the bank channel identifier.

[0142] Step 502, obtaining the bank business acceptance completion data of the target bank corresponding to the bank channel identifier at the last moment.

[0143] Step 503, obtaining the initial business acceptance thread number of the target bank.

[0144] Step 504: Based on the initial business acceptance thread number, the bank business acceptance completion data at the previous moment is processed to obtain the flow control coefficient of the target bank.

[0145] Step 505, configure the traffic growth control coefficient and acceptance thread number threshold of the target bank.

[0146] Step 506: Based on the traffic growth control coefficient, the initial number of service acceptance threads and the acceptance thread number threshold, the traffic control coefficient is processed to generate the number of allocable service acceptance threads.

[0147] Step 507: Determine the number of service requests to be processed in the cache queue.

[0148] Step 508: The smaller value of the number of allocable business acceptance threads and the number of requests is used as the target standard, and the business requests in the cache queue with the same number as the target standard are sent to the target bank.

[0149] Based on the above embodiments, in summary, the flow control method for business requests provided by the embodiments of the present invention effectively avoids the current business timeout caused by too much business acceptance data of the target bank at the last moment, or the current thread idleness caused by too little business acceptance data of the target bank at the last moment, thereby improving its versatility.

[0150] Based on the above embodiments, Figure 6 FIG. 1 is a schematic diagram of the structure of a flow control device for service requests according to an embodiment of the present invention. Figure 6 As shown, the traffic control device for service requests includes: a receiving module 610 , an acquiring module 620 and a sending module 630 .

[0151] The receiving module 610 is used to receive a service request sent by a user terminal, confirm the bank channel identifier corresponding to the service request, and cache the service request to a cache queue corresponding to the bank channel identifier.

[0152] The acquisition module 620 is used to acquire the bank business acceptance completion data of the target bank corresponding to the bank channel identifier at the last moment, process the bank business acceptance completion data at the last moment, and obtain the flow control coefficient of the target bank.

[0153] The acquisition module 620 includes: an acquisition submodule and a control submodule.

[0154] The acquisition submodule is used to obtain the initial business acceptance thread number of the target bank.

[0155] The control submodule is used to process the bank business acceptance completion data at the previous moment based on the initial business acceptance thread number to obtain the flow control coefficient of the target bank.

[0156] Control submodule, specifically used for:

[0157] X i =(x i-1 mod BT)*BT

[0158] Among them, x i-1 Indicates the bank business acceptance completion data at the last moment, BT indicates the number of initial business acceptance threads of the target bank, and X i Indicates the flow control coefficient.

[0159] The sending module 630 is used to send the business requests in the cache queue to the target bank based on the flow control coefficient.

[0160] The sending module 630 includes: a configuration submodule, a generation submodule and a sending submodule.

[0161] Configuration submodule, used to configure the traffic growth control coefficient and acceptance thread number threshold of the target bank;

[0162] A generation submodule is used to process the flow control coefficient based on the flow growth control coefficient, the initial business acceptance thread number and the acceptance thread number threshold, and generate the number of allocable business acceptance threads;

[0163] Generate submodules, specifically for:

[0164]

[0165] Where M represents the target bank’s acceptance thread number threshold, BT represents the target bank’s initial business acceptance thread number, Target represents the target bank’s traffic growth control coefficient, and X i represents the flow control coefficient, y′ i Indicates the number of allocable business acceptance threads.

[0166] The sending submodule is used to send the business requests in the cache queue to the target bank based on the number of allocable business acceptance threads.

[0167] The sending submodule is specifically used for:

[0168] Determine the number of pending business requests in the cache queue;

[0169] The smaller value of the number of allocatable business acceptance threads and the number of requests is used as the target standard, and the business requests in the cache queue with the same number as the target standard are sent to the target bank.

[0170] Based on the above embodiments, in summary, the flow control device for business requests provided by the embodiments of the present invention effectively avoids the current business timeout caused by too much business acceptance data of the target bank at the last moment, or the current thread being idle due to too little business acceptance data of the target bank at the last moment, thereby improving its versatility.

[0171] Figure 7 FIG. 1 is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present invention. Figure 7 As shown, the electronic device may include: a processor 710, a communication interface 720, a memory 730 and a communication bus 740; wherein the processor 710, the communication interface 720 and the memory 730 communicate with each other through the communication bus 740. The processor 710 may call the logic instructions in the memory 730 to execute the provided flow control method for the service request, the method comprising: receiving a service request sent by a user terminal, confirming the bank channel identifier corresponding to the service request, caching the service request to a cache queue corresponding to the bank channel identifier; obtaining the bank service acceptance completion data of the target bank corresponding to the bank channel identifier at the last moment, processing the bank service acceptance completion data at the last moment, and obtaining the flow control coefficient of the target bank; based on the flow control coefficient, sending the service request in the cache queue to the target bank.

[0172] In addition, the logic instructions in the above-mentioned memory 730 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0173] On the other hand, the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the flow control method of the business request provided in the above-mentioned embodiments, and the method includes: receiving a business request sent by a user terminal, confirming a bank channel identifier corresponding to the business request, and caching the business request to a cache queue corresponding to the bank channel identifier; obtaining the bank business acceptance completion data of the target bank corresponding to the bank channel identifier at the last moment, processing the bank business acceptance completion data at the last moment, and obtaining the flow control coefficient of the target bank; based on the flow control coefficient, sending the business request in the cache queue to the target bank.

[0174] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method for flow control of the business requests provided in the above-mentioned embodiments is implemented, and the method includes: receiving a business request sent by a user terminal, confirming a bank channel identifier corresponding to the business request, and caching the business request to a cache queue corresponding to the bank channel identifier; obtaining the bank business acceptance completion data of the target bank corresponding to the bank channel identifier at the last moment, processing the bank business acceptance completion data at the last moment, and obtaining the flow control coefficient of the target bank; based on the flow control coefficient, sending the business request in the cache queue to the target bank.

[0175] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0176] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0177] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for controlling the flow of service requests, characterized in that: include: Receive a service request sent by a user terminal, confirm a bank channel identifier corresponding to the service request, and cache the service request in a cache queue corresponding to the bank channel identifier; Obtain the bank business acceptance completion data of the target bank corresponding to the bank channel identifier at the last moment, process the bank business acceptance completion data at the last moment, and obtain the flow control coefficient of the target bank; the bank business acceptance completion data of the target bank at the last moment refers to the number of business threads successfully processed by the target bank at the last moment during the transaction process; the flow control coefficient of the target bank represents the parameter of the business acceptance capacity of the target bank at the last moment, and is used to adjust the parameter of the flow size of the business request to be sent to the relevant bank at the current moment; Based on the flow control coefficient, sending the business request in the cache queue to the target bank; The processing of the bank business acceptance completion data at the previous moment to obtain the flow control coefficient of the target bank includes: Obtaining the initial business acceptance thread number of the target bank; Based on the initial business acceptance thread number, the bank business acceptance completion data at the previous moment is processed to obtain the flow control coefficient of the target bank; Wherein, sending the service request in the cache queue to the target bank based on the flow control coefficient includes: Configure the traffic growth control coefficient and acceptance thread number threshold of the target bank; the traffic growth control coefficient refers to the parameter used to dynamically adjust the growth rate of the business request traffic to be sent to the target bank at the current moment; the acceptance thread number threshold refers to the maximum number of threads that the target bank can accept at the current moment; Based on the traffic growth control coefficient, the initial number of service acceptance threads and the acceptance thread number threshold, the traffic control coefficient is processed to generate the number of allocable service acceptance threads; Based on the number of allocatable business acceptance threads, the business requests in the cache queue are sent to the target bank.

2. The method for controlling the flow of service requests according to claim 1, characterized in that: The processing of the bank business acceptance completion data at the previous moment based on the initial business acceptance thread number to obtain the flow control coefficient of the target bank includes: ; in, Indicates the banking business acceptance completion data at the previous moment, Indicates the initial business acceptance thread number of the target bank, represents the flow control coefficient.

3. The method for controlling the flow of service requests according to claim 2, characterized in that: The processing of the flow control coefficient based on the flow growth control coefficient, the initial number of service acceptance threads and the acceptance thread number threshold to generate the number of allocable service acceptance threads includes: ; in, represents the acceptance thread number threshold of the target bank, Indicates the initial business acceptance thread number of the target bank, represents the flow growth control coefficient of the target bank, and the value range of Target is (1, +∞); represents the flow control coefficient, Indicates the number of assignable business acceptance threads.

4. The method for controlling the flow of service requests according to claim 3, characterized in that: The sending the business request in the cache queue to the target bank based on the number of allocatable business acceptance threads includes: Determining the number of requests of the business request to be processed in the cache queue; The smaller value between the number of assignable business acceptance threads and the number of requests is used as a target standard, and the business requests in the cache queue having the same number as the target standard are sent to the target bank.

5. A flow control device for service requests, characterized in that: include: A receiving module, configured to receive a service request sent by a user terminal, confirm a bank channel identifier corresponding to the service request, and cache the service request in a cache queue corresponding to the bank channel identifier; an acquisition module, used for acquiring the bank business acceptance completion data of the target bank corresponding to the bank channel identifier at the last moment, processing the bank business acceptance completion data at the last moment, and obtaining the flow control coefficient of the target bank; the bank business acceptance completion data of the target bank at the last moment refers to the number of business threads successfully processed by the target bank at the last moment during the transaction process; the flow control coefficient of the target bank represents the parameter of the business acceptance capacity of the target bank at the last moment, and is used for adjusting the parameter of the flow size of the business request to be sent to the relevant bank at the current moment; A sending module, configured to send the service request in the cache queue to the target bank based on the flow control coefficient; Wherein, the acquisition module includes: An acquisition submodule, used to acquire the initial business acceptance thread number of the target bank; A control submodule, for processing the bank business acceptance completion data at the previous moment based on the initial business acceptance thread number, to obtain a flow control coefficient of the target bank; Wherein, the sending module includes: A configuration submodule is used to configure the traffic growth control coefficient and acceptance thread number threshold of the target bank; the traffic growth control coefficient refers to a parameter used to dynamically adjust the growth rate of the business request traffic to be sent to the target bank at the current moment; the acceptance thread number threshold refers to the maximum number of threads that the target bank can accept at the current moment; A generating submodule, configured to process the flow control coefficient based on the flow growth control coefficient, the initial service acceptance thread number and the acceptance thread number threshold, and generate the allocable service acceptance thread number; A sending submodule is used to send the business request in the cache queue to the target bank based on the number of allocatable business acceptance threads.

6. The traffic control device for service requests according to claim 5, characterized in that: The control submodule is specifically used for: ; in, Indicates the banking business acceptance completion data at the previous moment, Indicates the initial business acceptance thread number of the target bank, represents the flow control coefficient.

7. The traffic control device for service requests according to claim 6, characterized in that: The generating submodule is specifically used for: ; in, represents the acceptance thread number threshold of the target bank, Indicates the initial business acceptance thread number of the target bank, represents the flow growth control coefficient of the target bank, and the value range of Target is (1, +∞); represents the flow control coefficient, Indicates the number of assignable business acceptance threads.

8. The traffic control device for service requests according to claim 7, characterized in that: The sending submodule is specifically used for: Determining the number of requests of the business request to be processed in the cache queue; The smaller value between the number of assignable business acceptance threads and the number of requests is used as a target standard, and the business requests in the cache queue having the same number as the target standard are sent to the target bank.

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 steps of the method for flow control of service requests as described in any one of claims 1 to 4 are implemented.

10. A non-transitory computer-readable storage medium, wherein a computer program is stored in the storage medium, characterized in that: When the computer program is executed by a processor, the steps of the method for flow control of service requests according to any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • Service processing method and device, equipment and computer readable storage medium

    CN109561133A

  • Request control method, related equipment and computer storage medium

    CN110120973A