Transaction processing method, device and computer readable storage medium

By dynamic management of online transactions and the sending decisions of queue transactions, according to the data values ​​and counting conditions, to ensure the maximum use of transaction channel flows under the limit of payment channel traffic, solving the problem that the existing technology fails to make full use of the payment channel traffic. A more efficient transaction processing has been achieved.

CN114282915BActive Publication Date: 2025-01-28WEBANK (CHINA)
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111614004.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-27
Publication Date
2025-01-28
Estimated Expiration
2041-12-27

AI Technical Summary

Technical Problem

The prior art failed to maximize the utilization of transaction channel traffic under the payment channel traffic limit, resulting in the insufficient utilization of payment channel traffic.

Method used

By receiving the target online transaction sent by the product system, the corresponding target transaction path is determined, and in the online sending detection and queue sending detection, according to the current data values ​​and counting conditions, dynamically decide whether the transaction is sent to the transaction channel or join the addition Line queues to ensure the maximum use of trading paths in different scenarios.

Benefits of technology

To maximize the traffic and performance of the transaction path under various scenarios, ensure that the traffic of the payment path is most effective, and improve the efficiency of transaction processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114282915B_ABST
    Figure CN114282915B_ABST
Patent Text Reader

Abstract

The present invention discloses a transaction processing method, device and computer-readable storage medium, the method comprising: when performing online sending detection on online transactions, if it is detected that the online count is less than the online flow threshold, and the total count is less than the total flow threshold, the online transaction is sent to the transaction path in the transaction path; the online flow threshold is set to the total flow threshold minus the queue guaranteed flow when the transaction path has a queue, and is set to the total flow threshold when there is no queue in the transaction path; when performing queue sending detection on queue transactions obtained from the queue queue, if it is detected that the queue count is less than the queue flow threshold, and the total count is less than the total flow threshold, the queue transaction is sent to the transaction path in the transaction path; the queue flow threshold is set to the total flow threshold minus the preset online guaranteed flow. In the present invention, it is achieved that the flow of the transaction path can be maximized in various scenarios, and the performance of the transaction path can be maximized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of financial technology, and in particular to a transaction processing method, device and computer-readable storage medium. Background Art

[0002] The front end of the payment platform is the product system, and the back end is the payment channel. Banks connect to various payment channels. The payment platform is positioned to shield the differences in payment channels and provide unified and optimal payment services for products. Product transactions submitted by the product system are divided into real-time deduction type transactions and scheduled or batch deduction type transactions. The former, such as the purchase of financial products, has high requirements for timeliness, while the latter, such as loan repayments, has a large transaction volume but relatively low requirements for timeliness. The flow of the payment channel has certain limitations. Therefore, it is necessary to solve the problem of processing product transactions with the maximum capacity under the limitation of payment channel flow. One current solution is to split the flow of the payment channel into partly supporting batch classes and partly supporting real-time classes. The rate allocation is fixed. When there is only batch class or only real-time class at a certain time, the flow of the payment channel is not maximized. Summary of the invention

[0003] The main purpose of the present invention is to provide a transaction processing method, device and computer-readable storage medium, aiming to solve the technical problem that the current transaction processing strategy does not maximize the utilization of transaction channel traffic.

[0004] To achieve the above object, the present invention provides a transaction processing method, which comprises the following steps:

[0005] receiving a target online transaction sent by a product system, and determining a target transaction path corresponding to the target online transaction;

[0006] When performing online sending detection on the target online transaction, if it is detected that the current online count is less than the currently set online flow threshold, and the current total count is less than the preset total flow threshold, the target online transaction is sent to the transaction channel in the target transaction path, so that the transaction channel processes the target online transaction;

[0007] The online count is the number of online transactions issued to the target transaction path within the latest first preset time period, the total count is the total number of online transactions and queue transactions issued to the target transaction path within the latest first preset time period, and the online flow threshold is set to the preset total flow threshold minus the preset queue guaranteed flow when there is a queue on the current target transaction path, and is set to the preset total flow threshold when there is no queue on the current target transaction path;

[0008] When performing queue sending detection on the target queue transaction corresponding to the target transaction path obtained from the queue queue, if it is detected that the current queue count is less than the currently set queue flow threshold, and the current total count is less than the preset total flow threshold, the target queue transaction is sent to the transaction channel in the target transaction path, so that the transaction channel processes the target queue transaction;

[0009] The queue count is the number of queue transactions issued to the target transaction path within the latest first preset time period, and the queue flow threshold is set to the preset total flow threshold minus the preset online guaranteed flow.

[0010] Optionally, after the step of receiving the target online transaction sent by the product system and determining the target transaction path corresponding to the target online transaction, the step further includes:

[0011] Detect whether the target transaction path is currently queued;

[0012] If the target transaction path is not currently queued, performing the online sending detection on the target online transaction;

[0013] If the target transaction path currently has a queue, determining whether the target online transaction is allowed to enter the queue when there is a queue according to the transaction attribute information of the target online transaction;

[0014] If it is determined that the target online transaction is allowed to enter the queue when there is a queue, then the target online transaction is added to the queue;

[0015] If it is determined that the target online transaction is not allowed to enter the queue when there is a queue, the online sending detection is performed on the target online transaction.

[0016] Optionally, after the step of receiving the target online transaction sent by the product system and determining the target transaction path corresponding to the target online transaction, the step further includes:

[0017] When performing online sending detection on the target online transaction, if it is detected that the current online count is greater than or equal to the currently set online flow threshold, or the current total count is greater than or equal to the preset total flow threshold, then determining whether the target online transaction is allowed to enter the queue when the flow threshold is exceeded according to the transaction attribute information of the target online transaction;

[0018] If it is determined that the target online transaction is allowed to enter the queue when the flow threshold is exceeded, then the target online transaction is added to the queue;

[0019] If it is determined that the target online transaction is not allowed to enter the queuing queue when the flow threshold is exceeded, the target online transaction is rejected.

[0020] Optionally, the step of adding the target online transaction to a queue includes:

[0021] Determine the target queue number corresponding to the target online transaction according to a preset allocation strategy;

[0022] Adding the target online transaction to a queue corresponding to the target queue number in a persistent database to convert the target online transaction into a queue transaction;

[0023] Wherein, the preset allocation strategy includes one of a first strategy, a second strategy and a third strategy;

[0024] The first strategy is to use the preset queue number corresponding to the target transaction path as the target queue number;

[0025] The second strategy is to generate a random number and determine one of a plurality of preset queue numbers corresponding to the target transaction path as the target queue number according to the random number;

[0026] The third strategy is to perform a hash calculation on the bank number in the target transaction path and then take the result modulo the number of queues as the target queue number.

[0027] Optionally, the method further comprises:

[0028] Supplement loading queue transactions from the queue queue of the persistent database to the cache queue of the same queue number in the cache database, wherein the queue queue in the persistent database corresponds one-to-one to the cache queue in the cache database;

[0029] The queue transactions are periodically obtained from each cache queue of the cache database in a first-in-first-out order to perform the queue sending detection.

[0030] Optionally, after the step of adding the target online transaction to the queue corresponding to the target queue number in the persistent database, the method further includes:

[0031] Setting the state of the target online transaction in the persistent database queue to a pending loading state;

[0032] The step of supplementing the loading queue transaction from the queue queue of the persistent database to the cache queue of the same queue number in the cache database comprises:

[0033] Obtaining queue transactions in a waiting-to-be-loaded state from the queue queue of the persistent database, supplementing and loading them into the cache queue of the same queue number in the cache database, and setting the state of the queue transactions loaded this time to a loaded state;

[0034] After the step of sending the target queue transaction to the transaction path in the target transaction path, the method further includes:

[0035] Setting the state of the target queue transaction in the persistent database queue to a sent state;

[0036] The method further comprises:

[0037] When performing queue sending detection on the target queue transaction, if it is detected that the current queue count is greater than or equal to the currently set queue flow threshold, or the current total count is greater than or equal to the preset total flow threshold, the state of the target queue transaction in the persistent database queue is set to a pending loading state.

[0038] Optionally, the method further comprises:

[0039] Setting the online flow threshold corresponding to the target transaction path according to the current queue identifier of the target transaction path, wherein the queue identifier is an identifier indicating whether the target transaction path is in a queue;

[0040] After adding the target online transaction to the queue, the current queue count of the target transaction path is increased by one, and when it is detected that the current queue identifier of the target transaction path indicates that the target transaction path is not queued, the queue identifier is changed to indicate that the target transaction path is queued;

[0041] After the target queue transaction is sent to the transaction channel in the target transaction path, the current queue count of the target transaction path is reduced by one, and when it is detected that the queue count is less than or equal to zero, the queue identifier is changed to indicate that there is no queue on the target transaction path.

[0042] Optionally, the method further comprises:

[0043] Regularly checking the last update time of the queue count of the target transaction path;

[0044] If the time between the last update time and the current time is greater than a second preset time, then counting the number of queue transactions corresponding to the target transaction path in the queue;

[0045] If the transaction quantity is 0 and the current queue identifier of the target transaction path indicates that the target transaction path is queued, the queue identifier is changed to indicate that the target transaction path is not queued, and the queue count of the target transaction path obtained when checking the last update time is subtracted from the current queue count of the target transaction path.

[0046] Optionally, the method further comprises:

[0047] Regularly check whether the current queue count of the target transaction path is greater than a preset fuse threshold;

[0048] If the current queue count of the target transaction path is greater than the preset fuse threshold, then counting the number of queue transactions corresponding to the target transaction path in the queue;

[0049] If the transaction quantity is greater than the preset fuse threshold, the target transaction path is closed.

[0050] To achieve the above objectives, the present invention also provides a transaction processing device, which includes: a memory, a processor, and a transaction processing program stored in the memory and executable on the processor, and the transaction processing program implements the steps of the transaction processing method described above when executed by the processor.

[0051] In addition, to achieve the above-mentioned purpose, the present invention also proposes a computer-readable storage medium, on which a transaction processing program is stored, and when the transaction processing program is executed by a processor, the steps of the transaction processing method described above are implemented.

[0052] In the present invention, the target online transaction sent by the product system is received by the payment middle station, and the target transaction path corresponding to the target online transaction is determined. When the target online transaction is detected for online transmission, if it is detected that the current online count is less than the currently set online flow threshold, and the current total count is less than the preset total flow threshold, the target online transaction is sent to the transaction channel in the target transaction path, so that the transaction channel can process the target online transaction; wherein the online count is the number of online transactions sent to the target transaction path within the most recent preset time, the total count is the total number of online transactions and queue transactions sent to the target transaction path within the most recent preset time, and the online flow threshold is the number of online transactions and queue transactions sent to the target transaction path within the most recent preset time. When there is a queue, it is set to the preset total flow threshold minus the preset queue minimum flow; when there is no queue in the current target transaction path, it is set to the preset total flow threshold; when the queue sending detection is performed on the target queue transaction corresponding to the target transaction path obtained from the queue queue, if it is detected that the current queue count is less than the currently set queue flow threshold, and the current total count is less than the preset total flow threshold, the target queue transaction is sent to the transaction channel in the target transaction path, so that the transaction channel can process the target queue transaction; wherein, the queue count is the number of queue transactions sent to the target transaction path within the most recent preset time period, and the queue flow threshold is set to the preset total flow threshold minus the preset online minimum flow. In the present invention, by reserving guaranteed traffic for online transactions and queue transactions respectively, and dynamically setting the online traffic threshold of online transactions according to whether there is a queue, when there is a queue but few or no online transactions, the traffic of the transaction path is allocated to the queue transaction to the maximum extent while ensuring that some traffic is reserved for online transactions to support transactions with high timeliness; and when there is no queue, the traffic of the transaction path is allocated to the online transaction to the maximum extent, thereby achieving maximum utilization of the traffic of the transaction path and maximization of the performance of the transaction path in various scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 A schematic diagram of the structure of the hardware operating environment involved in the embodiment of the present invention;

[0054] Figure 2 A schematic diagram of a flow chart of a first embodiment of a transaction processing method of the present invention;

[0055] Figure 3 A transaction processing system architecture diagram according to an embodiment of the present invention;

[0056] Figure 4 A schematic diagram of a queue structure involved in an embodiment of the present invention;

[0057] Figure 5 The present invention is a schematic diagram of a queue transaction processing task involved in an embodiment of the present invention.

[0058] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0059] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0060] Definitions of Abbreviations and Key Terms:

[0061] Redis: (Remote Dictionary Server), also known as remote dictionary service, is a high-performance Key-Value database. In distributed applications, it is usually used as a global cache.

[0062] like Figure 1 As shown, Figure 1 It is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present invention.

[0063] It should be noted that the transaction processing device in the embodiment of the present invention can be a smart phone, a personal computer, a server and other devices, and no specific limitation is made here.

[0064] like Figure 1 As shown, the transaction processing device may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the user interface 1003 may optionally include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may optionally be a storage device independent of the aforementioned processor 1001.

[0065] Those skilled in the art will understand that Figure 1 The device structure shown in the figure does not constitute a limitation on the transaction processing device, and may include more or fewer components than shown in the figure, or a combination of certain components, or a different arrangement of components.

[0066] like Figure 1As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a transaction processing program. The operating system is a program that manages and controls the hardware and software resources of the device and supports the operation of the transaction processing program and other software or programs. Figure 1 In the device shown, the user interface 1003 is mainly used for data communication with the client; the network interface 1004 is mainly used for establishing a communication connection with the server; and the processor 1001 can be used to call the transaction processing program stored in the memory 1005 and perform the following operations:

[0067] receiving a target online transaction sent by a product system, and determining a target transaction path corresponding to the target online transaction;

[0068] When performing online sending detection on the target online transaction, if it is detected that the current online count is less than the currently set online flow threshold, and the current total count is less than the preset total flow threshold, the target online transaction is sent to the transaction channel in the target transaction path, so that the transaction channel processes the target online transaction;

[0069] The online count is the number of online transactions issued to the target transaction path within the latest first preset time period, the total count is the total number of online transactions and queue transactions issued to the target transaction path within the latest first preset time period, and the online flow threshold is set to the preset total flow threshold minus the preset queue guaranteed flow when there is a queue on the current target transaction path, and is set to the preset total flow threshold when there is no queue on the current target transaction path;

[0070] When performing queue sending detection on the target queue transaction corresponding to the target transaction path obtained from the queue queue, if it is detected that the current queue count is less than the currently set queue flow threshold, and the current total count is less than the preset total flow threshold, the target queue transaction is sent to the transaction channel in the target transaction path, so that the transaction channel processes the target queue transaction;

[0071] The queue count is the number of queue transactions issued to the target transaction path within the latest first preset time period, and the queue flow threshold is set to the preset total flow threshold minus the preset online guaranteed flow.

[0072] Furthermore, after receiving the target online transaction sent by the product system and determining the target transaction path corresponding to the target online transaction, the processor 1001 may also be used to call the transaction processing program stored in the memory 1005 and perform the following operations:

[0073] Detect whether the target transaction path is currently queued;

[0074] If the target transaction path is not currently queued, performing the online sending detection on the target online transaction;

[0075] If the target transaction path currently has a queue, determining whether the target online transaction is allowed to enter the queue when there is a queue according to the transaction attribute information of the target online transaction;

[0076] If it is determined that the target online transaction is allowed to enter the queue when there is a queue, then the target online transaction is added to the queue;

[0077] If it is determined that the target online transaction is not allowed to enter the queue when there is a queue, the online sending detection is performed on the target online transaction.

[0078] Furthermore, after receiving the target online transaction sent by the product system and determining the target transaction path corresponding to the target online transaction, the processor 1001 may also be used to call the transaction processing program stored in the memory 1005 and perform the following operations:

[0079] When performing online sending detection on the target online transaction, if it is detected that the current online count is greater than or equal to the currently set online flow threshold, or the current total count is greater than or equal to the preset total flow threshold, then determining whether the target online transaction is allowed to enter the queue when the flow threshold is exceeded according to the transaction attribute information of the target online transaction;

[0080] If it is determined that the target online transaction is allowed to enter the queue when the flow threshold is exceeded, then the target online transaction is added to the queue;

[0081] If it is determined that the target online transaction is not allowed to enter the queuing queue when the flow threshold is exceeded, the target online transaction is rejected.

[0082] Furthermore, the operation of adding the target online transaction to a queue includes:

[0083] Determine the target queue number corresponding to the target online transaction according to a preset allocation strategy;

[0084] Adding the target online transaction to a queue corresponding to the target queue number in a persistent database to convert the target online transaction into a queue transaction;

[0085] Wherein, the preset allocation strategy includes one of a first strategy, a second strategy and a third strategy;

[0086] The first strategy is to use the preset queue number corresponding to the target transaction path as the target queue number;

[0087] The second strategy is to generate a random number and determine one of a plurality of preset queue numbers corresponding to the target transaction path as the target queue number according to the random number;

[0088] The third strategy is to perform a hash calculation on the bank number in the target transaction path and then take the result modulo the number of queues as the target queue number.

[0089] Furthermore, the processor 1001 may also be used to call the transaction processing program stored in the memory 1005 and perform the following operations:

[0090] Supplement loading queue transactions from the queue queue of the persistent database to the cache queue of the same queue number in the cache database, wherein the queue queue in the persistent database corresponds one-to-one to the cache queue in the cache database;

[0091] The queue transactions are periodically obtained from each cache queue of the cache database in a first-in-first-out order to perform the queue sending detection.

[0092] Further, after the operation of adding the target online transaction to the queue corresponding to the target queue number in the persistent database, the processor 1001 may also be used to call the transaction processing program stored in the memory 1005 and perform the following operations:

[0093] Setting the state of the target online transaction in the persistent database queue to a pending loading state;

[0094] The operation of supplementing the loading of queue transactions from the queue of the persistent database to the cache queue of the same queue number in the cache database includes:

[0095] Obtaining queue transactions in a waiting-to-be-loaded state from the queue queue of the persistent database, supplementing and loading them into the cache queue of the same queue number in the cache database, and setting the state of the queue transactions loaded this time to a loaded state;

[0096] After the operation of sending the target queue transaction to the transaction path in the target transaction path, the processor 1001 may also be used to call the transaction processing program stored in the memory 1005 and perform the following operations:

[0097] Setting the state of the target queue transaction in the persistent database queue to a sent state;

[0098] The processor 1001 may also be used to call the transaction processing program stored in the memory 1005 and perform the following operations:

[0099] When performing queue sending detection on the target queue transaction, if it is detected that the current queue count is greater than or equal to the currently set queue flow threshold, or the current total count is greater than or equal to the preset total flow threshold, the state of the target queue transaction in the persistent database queue is set to a pending loading state.

[0100] Furthermore, the processor 1001 may also be used to call the transaction processing program stored in the memory 1005 and perform the following operations:

[0101] Setting the online flow threshold corresponding to the target transaction path according to the current queue identifier of the target transaction path, wherein the queue identifier is an identifier indicating whether the target transaction path is in a queue;

[0102] After adding the target online transaction to the queue, the current queue count of the target transaction path is increased by one, and when it is detected that the current queue identifier of the target transaction path indicates that the target transaction path is not queued, the queue identifier is changed to indicate that the target transaction path is queued;

[0103] After the target queue transaction is sent to the transaction channel in the target transaction path, the current queue count of the target transaction path is reduced by one, and when it is detected that the queue count is less than or equal to zero, the queue identifier is changed to indicate that there is no queue on the target transaction path.

[0104] Furthermore, the processor 1001 may also be used to call the transaction processing program stored in the memory 1005 and perform the following operations:

[0105] Regularly checking the last update time of the queue count of the target transaction path;

[0106] If the time between the last update time and the current time is greater than a second preset time, then counting the number of queue transactions corresponding to the target transaction path in the queue;

[0107] If the transaction quantity is 0 and the current queue identifier of the target transaction path indicates that the target transaction path is queued, the queue identifier is changed to indicate that the target transaction path is not queued, and the queue count of the target transaction path obtained when checking the last update time is subtracted from the current queue count of the target transaction path.

[0108] Furthermore, the processor 1001 may also be used to call the transaction processing program stored in the memory 1005 and perform the following operations:

[0109] Regularly check whether the current queue count of the target transaction path is greater than a preset fuse threshold;

[0110] If the current queue count of the target transaction path is greater than the preset fuse threshold, then counting the number of queue transactions corresponding to the target transaction path in the queue;

[0111] If the transaction quantity is greater than the preset fuse threshold, the target transaction path is closed.

[0112] Based on the above structure, various embodiments of the transaction processing method are proposed.

[0113] Reference Figure 2 , Figure 2 It is a flowchart of the first embodiment of the transaction processing method of the present invention.

[0114] The embodiment of the present invention provides an embodiment of a transaction processing method. It should be noted that although the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than here. In this embodiment, the execution subject of the transaction processing method may be a payment middle station. The transaction processing method includes:

[0115] Step S10, receiving a target online transaction sent by a product system, and determining a target transaction path corresponding to the target online transaction;

[0116] like Figure 3 As shown, the front end of the payment platform is the product system, and the back end is the payment channel. Banks connect to different payment channels. Transactions are submitted by the product system to the payment platform, which then sends them to the corresponding payment channel for processing, and performs traffic control in the process. Figure 3 Products A, B, and C are three different product systems.

[0117] In this embodiment, considering that the traffic of the payment channel may be restricted by the dedicated line bandwidth, the payment channel center and the issuing bank, the path formed by a payment channel and a bank is called a transaction path, and traffic control is performed based on the transaction path.

[0118] The payment center receives transactions sent by the product system. For the sake of distinction, transactions received from the product system are referred to as online transactions, and transactions in the queue or obtained from the queue are referred to as queue transactions. An online transaction received from a product system (hereinafter referred to as the target online transaction) is taken as an example to illustrate the various embodiments.

[0119] After receiving the target online transaction, the payment center determines the transaction path corresponding to the target online transaction (hereinafter referred to as the target transaction path for distinction). It can be understood that the target transaction path is one of the transaction paths. The target online transaction corresponds to the target transaction path, indicating that the target online transaction needs to be processed along the target transaction path. The method for determining the target transaction path is not limited in this embodiment, and can be calculated according to a preset static rule, for example.

[0120] In one embodiment, after receiving the target online transaction and determining the target transaction path, the payment middle station can register the target online transaction and related information into the mainstream water meter, and record each received transaction through the mainstream water meter.

[0121] Step S20, when performing online sending detection on the target online transaction, if it is detected that the current online count is less than the currently set online flow threshold, and the current total count is less than the preset total flow threshold, the target online transaction is sent to the transaction channel in the target transaction path, so that the transaction channel processes the target online transaction; wherein the online count is the number of online transactions sent to the target transaction path within the latest first preset time period obtained by statistics, the total count is the total number of online transactions and queue transactions sent to the target transaction path within the latest first preset time period obtained by statistics, the online flow threshold is set to the preset total flow threshold minus the preset queue guaranteed flow when the target transaction path currently has a queue, and is set to the preset total flow threshold when there is no queue on the target transaction path currently;

[0122] After receiving the target online transaction, the payment center can directly perform an online sending test on the target online transaction, or perform an online sending test when it detects that certain conditions are met (the conditions can be set as needed). Among them, the online sending test is to detect whether the target online transaction will exceed the flow threshold when it is directly sent to the payment channel for processing.

[0123] Specifically, in order to solve the problem of maximizing the use of payment channel traffic, in this embodiment, a total traffic threshold (i.e., a preset total traffic threshold) is set in advance according to the transaction processing capacity of the target transaction path. The total traffic threshold is fixed when the transaction processing capacity of the target transaction path remains unchanged, indicating the number of transactions that the target transaction path can process within the first preset time. The first preset time is set as needed, for example, to 1 second.

[0124] In addition, the payment platform dynamically sets an online flow threshold. It is called a dynamic setting because when the target transaction path is currently queued, the online flow threshold is set to the preset total flow threshold minus the preset queue guaranteed flow. When the target transaction path is currently not queued, that is, when there is no queued transaction, the online flow threshold is set to the preset total flow threshold. Among them, the preset queue guaranteed flow is the flow reserved for queue transactions, which can be set as needed. That is, when there is a queue, part of the flow of the transaction path is reserved for queue transactions, so as to support timely processing of transactions placed in the queue due to exceeding the flow threshold. When there is no queue, the flow of the transaction path is all given to online transactions, so as to maximize the use of the flow of the transaction path. In addition, a queue flow threshold is also set, and the queue flow threshold is set to the preset total flow threshold minus the preset online guaranteed flow. Among them, the preset online guaranteed traffic is the traffic reserved for online transactions, which can be set as needed. That is, regardless of whether there is a queue or not, a part of the traffic in the transaction path is reserved for online transactions, thereby supporting the rapid processing of online transactions with high timeliness requirements.

[0125] The preset online guaranteed minimum flow and the preset queue guaranteed minimum flow are set separately according to the needs. The sum of the queue flow threshold and the online flow threshold at the same time is not necessarily equal to the preset total flow threshold. When set to a smaller value, the sum at the same time will be greater than the preset total flow threshold. For example, the preset online guaranteed minimum flow and the preset queue guaranteed minimum flow are both set to 20% of the preset total flow threshold, then the queue flow threshold setting = preset total flow threshold * (1-20%), when there is a queue, the online flow threshold = preset total flow threshold * (1-20%), when there is no queue, the online flow threshold = preset total flow threshold. The purpose of this setting is to ensure that when there is a queue but there are fewer or no online transactions, the flow of the transaction path is allocated to the queue transaction to the maximum extent while ensuring that some flow is reserved for online transactions to support transactions with high timeliness; and when there is no queue, the flow of the transaction path is allocated to the online transaction to the maximum extent, so that the flow of the transaction path can be maximized in various scenarios, that is, the performance of the transaction path can be maximized.

[0126] The payment center records the total count, online count and queue count corresponding to each transaction path in real time. The target transaction path is used as an example for explanation below. The total count of the target transaction path is the total number of online transactions and queue transactions issued to the target transaction path within the last first preset time period, where the first preset time period is the same as the first preset time period mentioned in the definition of the above total flow threshold. The online count of the target transaction path is the number of online transactions issued to the target transaction path within the last first preset time period. The queue count of the target transaction path is the number of queue transactions issued to the target transaction path within the last first preset time period.

[0127] When performing online sending detection on the target online transaction, the payment platform detects whether the current online count is less than the currently set online flow threshold, and detects whether the current total count is less than the preset total flow threshold. In one embodiment, during the detection, the current online count and the total count may include the target online transaction in the calculation, that is, if the target online transaction is directly sent, it is detected whether it will exceed the online flow threshold and the preset total flow threshold.

[0128] If the payment center detects that the current online count is less than the currently set online flow threshold, and the current total count is less than the preset total flow threshold, the target online transaction can be sent out, that is, sent to the transaction channel in the target transaction path, so that the transaction channel can process the target online transaction.

[0129] In one embodiment, if the payment platform detects that the current online count is greater than or equal to the currently set online flow threshold, or detects that the current total count is greater than or equal to the preset total flow threshold, the target online transaction can be added to the queue and wait for transmission in the queue. It is understandable that when the online transaction is added to the queue, the online transaction is converted into a queue transaction.

[0130] Step S30, when performing queue sending detection on the target queue transaction corresponding to the target transaction path obtained from the queuing queue, if it is detected that the current queue count is less than the currently set queue flow threshold, and the current total count is less than the preset total flow threshold, the target queue transaction is sent to the transaction channel in the target transaction path, so that the transaction channel can process the target queue transaction; wherein the queue count is the number of queue transactions sent to the target transaction path within the most recent first preset time period, and the queue flow threshold is set to the preset total flow threshold minus the preset online guaranteed flow.

[0131] The payment platform can periodically obtain queue transactions from the queue for queue sending detection. The following takes the example of obtaining a queue transaction corresponding to the target transaction path from the queue (hereinafter referred to as the target queue transaction). Queue sending detection is to detect whether sending the target queue transaction to the payment channel for processing will exceed the flow threshold.

[0132] Specifically, when performing queue sending detection on the target queue transaction, the payment platform detects whether the current queue count is less than the currently set queue flow threshold, and detects whether the current total count is less than the preset total flow threshold. In one embodiment, during the detection, the current queue count and the total count may include the target queue transaction, that is, to detect whether the queue flow threshold and the preset flow threshold will be exceeded if the target queue transaction is sent.

[0133] If the payment center detects that the current queue count is less than the currently set queue flow threshold, and the current total count is less than the preset total flow threshold, the target queue transaction can be sent out, that is, sent to the transaction channel in the target transaction path, so that the transaction channel can process the target queue transaction.

[0134] In one embodiment, if the payment center detects that the current queue count is greater than or equal to the currently set queue flow threshold, or detects that the current total count is greater than or equal to the preset total flow threshold, the target queue transaction may not be issued temporarily, and the queue sending detection will be performed again when the target queue transaction is obtained from the queue next time.

[0135] In one embodiment, after the target online transaction or the target queue transaction is sent, the transaction information can be registered in the sending flow table to avoid the payment center from repeatedly sending the transaction.

[0136] Further, in one embodiment, three variables corresponding to each transaction path can be set in Redis according to the transaction path dimension: total count, online count and queue count. When performing online sending detection on the target online transaction, first request Redis to add one to the total count and online count of the target transaction path respectively, and then compare with the flow threshold; when performing queue sending detection on the target queue transaction, first request Redis to add one to the total count and queue count of the target transaction path respectively, and then compare with the flow threshold. Using the variable validity period feature of Redis, the value of each variable is equivalent to being set to 0 every first preset time length, thereby achieving an effect similar to counting the number of transactions sent within the most recent first preset time length. Among them, when requesting Redis to add one to the total count, queue count or online count, the api provided by Redis can be called, that is, INCR. When calling INCR, the key key is passed in. The method is implemented as adding 1 to the digital value stored in the key key. If the key key does not exist, its value will be initialized to 0 first, and then the INCR command will be executed. The INCR command will return the value of the key key after the addition operation is executed.

[0137] In this embodiment, the target online transaction sent by the product system is received by the payment middle station, and the target transaction path corresponding to the target online transaction is determined. When the target online transaction is detected for online transmission, if it is detected that the current online count is less than the currently set online flow threshold, and the current total count is less than the preset total flow threshold, the target online transaction is sent to the transaction channel in the target transaction path, so that the transaction channel can process the target online transaction; wherein the online count is the number of online transactions sent to the target transaction path within the most recent preset time, the total count is the total number of online transactions and queue transactions sent to the target transaction path within the most recent preset time, and the online flow threshold is the number of online transactions and queue transactions sent to the target transaction path within the most recent preset time. When there is a queue in the current target transaction path, it is set to the preset total flow threshold minus the preset queue guaranteed flow; when there is no queue in the current target transaction path, it is set to the preset total flow threshold; when the queue sending detection is performed on the target queue transaction corresponding to the target transaction path obtained from the queue queue, if it is detected that the current queue count is less than the currently set queue flow threshold, and the current total count is less than the preset total flow threshold, the target queue transaction is sent to the transaction channel in the target transaction path, so that the transaction channel processes the target queue transaction; wherein the queue count is the number of queue transactions sent to the target transaction path within the most recent preset time period obtained by statistics, and the queue flow threshold is set to the preset total flow threshold minus the preset online guaranteed flow. In this embodiment, by reserving minimum traffic for online transactions and queue transactions respectively, and dynamically setting the online traffic threshold of online transactions according to whether there is a queue, when there is a queue but few or no online transactions, the traffic of the transaction path is allocated to the queue transaction to the maximum extent while ensuring that some traffic is reserved for online transactions to support transactions with high timeliness; and when there is no queue, the traffic of the transaction path is allocated to the online transaction to the maximum extent, thereby achieving maximum utilization of the traffic of the transaction path and maximization of the performance of the transaction path in various scenarios.

[0138] Further, based on the above first embodiment, a second embodiment of the transaction processing method of the present invention is proposed. In this embodiment, after step S10, the method further includes:

[0139] Step A10, detecting whether the target transaction path is currently queued;

[0140] In this embodiment, after receiving the target online transaction, the payment middle station can first detect whether the target transaction path is currently in a queue. In one embodiment, the payment middle station can detect whether the target transaction path is in a queue by detecting whether there is a queue transaction corresponding to the target transaction path in the queue queue. In another embodiment, in order to improve the detection efficiency, a queue identifier can also be used to record whether the target transaction path is in a queue, and a queue count can be set to update the queue identifier according to the queue count for the number of queue transactions corresponding to the target transaction path; whenever an online transaction corresponding to the target transaction path is added to the queue queue, the queue count is increased by 1, and whenever a queue transaction corresponding to the target transaction path is sent out, the queue count is reduced by 1; when it is necessary to detect whether the target transaction path is currently in a queue, the current queue identifier can be obtained to obtain the detection result.

[0141] Step A20, if the target transaction path is not currently queued, then performing the online sending detection on the target online transaction;

[0142] If the payment center detects that there is no queue in the target transaction path, it means that the current transaction volume is not large. At this time, the target online transaction can be sent online for detection so that the target online transaction can be sent out for processing as soon as possible without exceeding the online traffic threshold and the preset total traffic threshold, thereby improving transaction processing efficiency and performance utilization of the transaction path.

[0143] Step A30, if the target transaction path currently has a queue, determining whether the target online transaction is allowed to enter the queue when there is a queue according to the transaction attribute information of the target online transaction;

[0144] If the payment platform detects that there is currently a queue in the target transaction path, it means that the current transaction volume is large. At this time, the transaction attribute information of the target online transaction can be obtained, and whether the target online transaction is allowed to enter the queue when there is a queue can be determined based on the transaction attribute information. If it is determined that the target online transaction is allowed to enter the queue when there is a queue, it means that the target online transaction does not require high timeliness, and delayed processing is allowed to give traffic to transactions with high timeliness. If it is determined that the target online transaction is not allowed to enter the queue when there is a queue, it means that the target online transaction has a high timeliness requirement and needs to be processed as soon as possible.

[0145] The transaction attribute information may be the information carried by the product system when sending the online transaction to the payment center. The information items and value ranges of the transaction attribute information may be set in advance, and detection rules may be defined for detecting whether the online transaction is allowed to enter the queue when there is a queue according to different values ​​of the information items. The payment center determines whether the target online transaction is allowed to enter the queue when there is a queue according to the detection rules. For example, the information item includes the product type to which the online transaction belongs, and the detection rule stipulates that when the product type is loan repayment, it is determined that the online transaction is allowed to enter the queue first when there is a queue.

[0146] Step A40, if it is determined that the target online transaction is allowed to enter the queue when there is a queue, then the target online transaction is added to the queue;

[0147] If the payment platform determines that the target online transaction is allowed to enter the queue when there is a queue, the target online transaction is added to the queue. In one embodiment, the queue can be recorded in the persistent database of the payment platform, and the payment platform adds the target online transaction to the queue of the database. When obtaining the queue transaction from the queue for queue sending detection, it can be directly obtained from the queue, or it can be first loaded from the queue into the cache database and then obtained from the cache database.

[0148] Step A50: If it is determined that the target online transaction is not allowed to enter the queue when there is a queue, the online sending detection is performed on the target online transaction.

[0149] If the payment middle station determines that the target online transaction is not allowed to enter the queue when there is a queue, it can perform online sending detection on the target online transaction so that the target online transaction with higher timeliness requirements can be sent out in time when the online traffic threshold is not reached, ensuring the sending efficiency of real-time transactions while maximizing the performance of the transaction path.

[0150] Furthermore, in one embodiment, after step S10, the following steps are further included:

[0151] Step A60, when performing online sending detection on the target online transaction, if it is detected that the current online count is greater than or equal to the currently set online flow threshold, or the current total count is greater than or equal to the preset total flow threshold, then determining whether the target online transaction is allowed to enter the queue when the flow threshold is exceeded according to the transaction attribute information of the target online transaction;

[0152] When the payment platform performs online transmission detection on the target online transaction, if it detects that the current online count is greater than or equal to the currently set online flow threshold, or the current total count is greater than or equal to the preset total flow threshold, it means that the current online transaction volume is large. At this time, the target online transaction can only be added to the queue. However, in some application scenarios, the target online transaction may have too high a timeliness requirement and is not allowed to enter the queue for delayed transmission. In view of this situation, in this embodiment, the payment platform can determine whether the target online transaction is allowed to enter the queue when the flow threshold is exceeded based on the transaction attribute information of the target online transaction.

[0153] Among them, the transaction attribute information may be the information carried by the product system when sending the online transaction to the payment middle station. The information items and value ranges of the transaction attribute information may be set in advance, and detection rules are defined for detecting whether the online transaction is allowed to enter the queue when the flow threshold is exceeded according to different values ​​of the information items. The payment middle station determines whether the target online transaction is allowed to enter the queue when the flow threshold is exceeded according to the detection rules. For example, the information item includes the product type to which the online transaction belongs, and the detection rule stipulates that when the product type is the purchase of a financial product, it is determined that the online transaction is not allowed to enter the queue first when the flow threshold is exceeded.

[0154] Step A70, if it is determined that the target online transaction is allowed to enter the queue when the flow threshold is exceeded, then the target online transaction is added to the queue;

[0155] Step A80: If it is determined that the target online transaction is not allowed to enter the queue when the flow threshold is exceeded, the target online transaction is rejected.

[0156] If the payment center determines that the target online transaction is allowed to enter the queue when the flow threshold is exceeded, the target online transaction will be added to the queue. If the payment center determines that the target online transaction is not allowed to enter the queue when there is a queue, the target online transaction will be rejected so that the product system can give feedback to the front end to reject the transaction to avoid unnecessary delays in the transaction.

[0157] Further, based on the above-mentioned first and / or second embodiments, a third embodiment of the transaction processing method of the present invention is proposed, wherein the step of adding the target online transaction to the queue in step A40 and step A70 comprises:

[0158] Step B10, determining the target queue number corresponding to the target online transaction according to a preset allocation strategy;

[0159] Assuming that the number of banks is b and the number of payment channels is r, there can be at most b*r transaction paths. If a separate queue is to be created for each transaction path, the number of queues is obviously too large. Therefore, a limited number of queues n is used in this embodiment, that is, n is less than or equal to b*r.

[0160] Record n ​​queues in the persistent database of the payment platform, and number the queues, for example, 1 to n. An allocation strategy can be set in advance as needed, and the payment platform determines which queue to assign the target online transaction to based on the preset allocation strategy, that is, determines the queue number corresponding to the target online transaction (hereinafter referred to as the target queue number). In this embodiment, there is no limitation on the preset allocation strategy.

[0161] Step B20, adding the target online transaction to the queue corresponding to the target queue number in the persistent database to convert the target online transaction into a queue transaction;

[0162] The payment platform adds the target online transaction to the queue corresponding to the target queue number in the persistent database, thereby converting the target online transaction into a queue transaction, which is then obtained by the payment platform from the queue for queue sending detection. Among them, the payment platform can execute the task of processing queue transactions in each queue at a regular time. In a distributed system, multiple applications can also be used to execute the task of queue transactions in each queue in parallel.

[0163] Since the total count, queue count, online count, queue count and queue ID of each transaction path are recorded separately, placing transactions of different transaction paths in the same queue will not affect the payment middle station's flow control of each transaction path separately.

[0164] In one embodiment, the preset allocation strategy includes a first strategy, and the first strategy is to use the preset queue number corresponding to the target transaction path as the target queue number. This strategy is to pre-set the queue number corresponding to each transaction path, wherein the queue numbers corresponding to different transaction paths can be the same, and when allocating the target online transaction, the queue number corresponding to the target transaction path is directly used as the target queue number. This strategy is simple to implement and can increase the speed at which transactions are added to the queue, thereby increasing the overall transaction processing speed.

[0165] In one embodiment, the preset allocation strategy may include a second strategy, and the second strategy is to generate a random number and determine one of the preset multiple queue numbers corresponding to the target transaction path according to the random number as the target queue number. This strategy is to pre-set multiple queue numbers corresponding to each transaction path, and when allocating the target online transaction, determine one of the multiple queue numbers corresponding to the target transaction path according to the generated random number as the target queue number. Among them, determining the target queue number from multiple queue numbers according to the random number can be specifically to pre-define the value ranges corresponding to multiple queue numbers from 0 to 9, take the random number modulo 10, and the queue number corresponding to the value range in which the result is located is the target queue number. For example, if two queues numbered A and B are specified for the target transaction path, then by generating a random number and taking the modulo 10, if the result is in the range of 0-5, A will be used as the target queue number, and if the result is in the range of 6-9, B will be used as the target queue number. This strategy is to avoid transactions of the same transaction path from waiting serially in a queue, and to improve the concurrency of transaction processing of the same transaction path by dispersing transactions of the same transaction path into different queues.

[0166] In one embodiment, the preset allocation strategy may include a third strategy, and the third strategy is to perform a hash calculation on the bank number in the target transaction path and then modulo the result by the number of queues as the target queue number.

[0167] Furthermore, in one embodiment, the method further comprises:

[0168] Step B30, supplementing the loading queue transactions from the queuing queue of the persistent database to the cache queue of the same queue number in the cache database, wherein the queuing queue in the persistent database corresponds one-to-one to the cache queue in the cache database;

[0169] In this embodiment, the payment center can first load queue transactions from the queue of the persistent database to the queue of the cache database (which is also a queue in terms of function, but is referred to as the cache queue below to distinguish it from the queue in the persistent database), and then obtain queue transactions from the cache queue for queue sending detection. The cache database can use a Redis database. The queue in the persistent database corresponds one-to-one to the cache queue in the cache database, and the two queues that correspond one-to-one can use the same queue number. For example, Figure 4 As shown, n groups of tables are divided in the persistent database to record n ​​queues, and each group of tables corresponds to a queue in the Redis database.

[0170] The payment middle station adds queue transactions from the queue in the persistent database to the cache queue with the same queue number in the cache database. The depth of the queue is not limited in this embodiment, and the cache queue can be set to a depth as needed. Then the number of queue transactions added each time is the depth of the cache queue minus the current number of queue transactions in the cache queue. It should be noted that loading queue transactions from the queue to the cache queue specifically means copying the queue transactions to the cache queue, and the queue queue still records the loaded queue transactions.

[0171] In one embodiment, the payment platform can supplement the loading of queue transactions from the queue to the cache queue in a first-in-first-out manner. In another embodiment, when an online transaction enters the queue, the payment platform can determine the priority of the online transaction in the queue according to the transaction attribute information of the queue, and the payment platform preferentially loads queue transactions with high priority to the cache; wherein, the information items of the transaction attribute information and the value range of the information items can be set in advance, and the rules for determining the priority of the online transaction according to the different values ​​of the information items are defined, and the payment platform determines the priority of the target online transaction when it enters the queue according to the rules. In another embodiment, when an online transaction enters a queue, the payment middle station can set a trigger time for the online transaction in the queue. The trigger time is a timestamp, and when the timestamp is reached, it indicates that the queue transaction can be sent; when the transaction enters the queue for the first time, the trigger time can be set to the time when it enters the queue, indicating that the transaction can be processed at any time. When it enters the queue again after being taken out of the cache queue due to exceeding the traffic threshold, the trigger time can be set to a time after the current time as needed to indicate that the queue transaction needs to be delayed; the payment middle station can select queue transactions from the queue transactions that reach the trigger time and load them into the cache queue in a first-in-first-out manner or in a priority manner.

[0172] Step B40, periodically obtaining queue transactions from each cache queue of the cache database in a first-in-first-out order to perform the queue sending detection.

[0173] The payment platform periodically obtains queue transactions from each cache queue of the cache database in a first-in-first-out order to perform queue sending detection. After the queue transaction is taken out from the cache queue, there is no queue transaction in the cache queue. In a distributed system, the payment platform can use multiple applications to perform the task of obtaining queue transactions from each cache queue for queue sending detection. For example, Figure 5 As shown, each application has a corresponding task for processing the Redis queue.

[0174] Furthermore, in one embodiment, after step B20, the method further includes:

[0175] Step B50, setting the state of the target online transaction in the persistent database queue to a waiting-to-be-loaded state;

[0176] The status of each queue transaction can be recorded in the queue, and the status can include the waiting to be loaded state, the loaded state and the sent state. Among them, the waiting to be loaded state means the state of waiting to be loaded from the queue to the cache queue, the loaded state means the state of having been loaded into the cache queue and waiting to be obtained and sent from the cache queue, and the sent state means the state of having been sent to the corresponding transaction path.

[0177] After the payment middle station adds the target online transaction to the queue in the persistent database, it can set the state of the target online transaction in the queue to a pending loading state.

[0178] The step B30 comprises:

[0179] Step B301, obtaining queue transactions in a waiting-to-be-loaded state from the queues of the persistent database, supplementing and loading them into the cache queues with the same queue numbers in the cache database, and setting the state of the queue transactions loaded this time to a loaded state;

[0180] When the payment center obtains queue transactions from the queue queue of the persistent database and loads them into the cache queue, it obtains them from the queue transactions in the queue queue that are in the waiting-to-be-loaded state. After the queue transactions are loaded into the cache queue, the state of the queue transactions in the queue queue is set to the loaded state to avoid repeated loading.

[0181] After step S30, the method further includes:

[0182] Step B60, setting the state of the target queue transaction in the persistent database queue to a sent state;

[0183] After the payment middle station sends the queue transaction to the corresponding transaction path, it can set the status of the queue transaction in the persistent database queue to the sent status.

[0184] The method further comprises:

[0185] Step B70, when performing queue sending detection on the target queue transaction, if it is detected that the current queue count is greater than or equal to the currently set queue flow threshold, or the current total count is greater than or equal to the preset total flow threshold, the state of the target queue transaction in the persistent database queue is set to a pending loading state.

[0186] When the payment center performs queue sending detection on the target queue transaction, if it detects that the current queue count is greater than or equal to the currently set queue flow threshold, or the current total count is greater than or equal to the preset total flow threshold, the state of the target queue transaction in the persistent database queue can be set to the pending loading state, that is, because the flow threshold is exceeded, the target queue transaction is not sent temporarily, and the state is changed back to the pending loading state so that it can be loaded into the cache queue next time.

[0187] Further, based on the above-mentioned first, second and / or third embodiments, a fourth embodiment of the transaction processing method of the present invention is proposed. In this embodiment, the method further includes:

[0188] Step C10, setting the online flow threshold corresponding to the target transaction path according to the current queue identifier of the target transaction path, wherein the queue identifier is an identifier indicating whether the target transaction path is in a queue;

[0189] In this embodiment, in order to improve the detection efficiency when detecting whether a transaction path has a queue, a queue identifier is set according to the dimension of the transaction path, that is, a queue identifier is set for each transaction path, and the queue identifier is used to indicate whether the corresponding transaction path has a queue, and the queue identifier is updated regularly to reflect whether the transaction path is currently queued. For example, when the queue identifier is "N", it means that the corresponding transaction path is currently not queued, and when the queue identifier is "Y", it means that the corresponding transaction path is currently queued.

[0190] After the payment center receives the target online transaction and determines the target transaction path, it can set the online traffic threshold corresponding to the target transaction path according to the current queue identifier of the target transaction path. That is, it determines whether the target transaction path is currently queued according to the current queue identifier. If there is a queue, the online traffic threshold is set to the preset total traffic threshold minus the preset queue minimum traffic; if there is no queue, the online traffic threshold is set to the preset total traffic threshold.

[0191] Step C20, after adding the target online transaction to the queue, adding one to the current queue count of the target transaction path, and when detecting that the current queue identifier of the target transaction path indicates that the target transaction path is not queued, changing the queue identifier to indicate that the target transaction path is queued;

[0192] In order to improve the updating efficiency of the queue identification, in this embodiment, the payment middle station can also set the queue count according to the dimension of the transaction path, that is, a queue count is set for each transaction path to indicate the number of transactions currently in the queue of the corresponding transaction path.

[0193] After adding the target online transaction to the queue, the payment center can increase the current queue count of the target transaction path by one, and detect the current queue identifier of the target transaction path. If the current queue identifier indicates that the target transaction path is not queued, the queue identifier will be changed to indicate that the target transaction path is queued.

[0194] Step C30, after sending the target queue transaction to the transaction channel in the target transaction path, reducing the current queue count of the target transaction path by one, and when detecting that the queue count is less than or equal to zero, changing the queue identifier to indicate that there is no queue on the target transaction path.

[0195] After the payment middle station sends the target queue transaction to the transaction channel in the target transaction path, it can reduce the current queue count of the target transaction path by one, and then detect whether the current queue count is greater than zero. If it is less than or equal to zero, the queue identifier is changed to indicate that there is no queue for the target transaction path.

[0196] In one embodiment, two variables corresponding to each transaction path can be set in Redis according to the transaction path dimension: queue count and queue identifier. The values ​​of the two variables can be changed by requesting Redis. When requesting the queue count to be reduced by one, the API provided by Redis, namely DECR, can be called. When calling DECR, the key key is passed in. This method is implemented as the digital value stored in the key key minus 1. If the key key does not exist, its value will be initialized to 0 first, and then the DECR command will be executed. The DECR command will return the value of the key key after the minus 1 operation is executed.

[0197] Furthermore, in one embodiment, the method further comprises:

[0198] Step C40, regularly checking the last update time of the queue count of the target transaction path;

[0199] In order to avoid the possibility that the queue count may be inaccurate, resulting in the queue identifier always indicating that the transaction path is in a queue, in this embodiment, the queue identifier is checked and corrected at regular intervals.

[0200] Specifically, the payment platform can periodically check the last update time of the queue count of the target transaction path and obtain the current queue count at the same time. The timestamp of the update can be recorded each time the queue count is updated.

[0201] Step C50, if the time between the last update time and the current time is greater than a second preset time, counting the number of queue transactions corresponding to the target transaction path in the queue;

[0202] If the time between the last update time and the current time is longer than the second preset time, the payment center will count the number of queue transactions corresponding to the target transaction path in the queue. Among them, the second preset time can be set as needed, and is not limited in this embodiment; setting the number of transactions to be counted only when the last update time is longer than the second preset time is to avoid frequently counting transactions in the persistent database. Specifically, the payment center can count the number of queue transactions whose transaction path is the target transaction path in each queue in the persistent database, and obtain the number of queue transactions of the target transaction path currently in the queue. It can be understood that the queue transactions that have been sent in the queue are not counted.

[0203] Step C60, if the transaction quantity is 0, and the current queue identifier of the target transaction path indicates that the target transaction path is queued, the queue identifier is changed to indicate that the target transaction path is not queued, and the queue count of the target transaction path obtained when checking the last update time is subtracted from the current queue count of the target transaction path.

[0204] If the number of transactions is 0, it means that there is no queued transaction in the current target transaction path. If the queue identifier of the target transaction path indicates that the target transaction path is queued, it means that the queue identifier is wrong. At this time, the payment center can change the queue identifier to indicate that the target transaction path is not queued, and can subtract the queue count obtained when checking the last update time from the current queue count of the target transaction path to correct the queue count. It should be noted that when the queue count is changed, a certain amount of time has passed since the moment of checking the last update time in step C40 (that is, the moment of obtaining the queue count), and the queue count may have increased in the middle. Therefore, the queue count is corrected by subtracting the queue count obtained when checking the last update time from the current queue count.

[0205] Furthermore, in one embodiment, the method further comprises:

[0206] Step C70, regularly checking whether the current queue count of the target transaction path is greater than a preset fuse threshold;

[0207] In order to avoid a high transaction processing delay caused by too many transactions in a queue due to too many transactions in a certain transaction path, in this embodiment, the transaction path can be fused when there are too many queued transactions. Specifically, the payment platform can periodically check whether the current queue count of the target transaction path is greater than the preset fuse threshold. The preset fuse threshold can be set as needed and is not limited in this embodiment.

[0208] Step C80: if the current queue count of the target transaction path is greater than the preset fuse threshold, then counting the number of queue transactions corresponding to the target transaction path in the queue;

[0209] When it is checked that the current queue count of the target transaction path is greater than the preset fuse threshold, the payment center counts the number of queue transactions corresponding to the target transaction path in the queue. Specifically, the payment center can count the number of queue transactions whose transaction paths are the target transaction paths in each queue in the persistent database, and obtain the number of queue transactions of the target transaction path currently in the queue. It is understandable that the queue transactions that have been sent in the queue are not counted.

[0210] Step C90: If the transaction quantity is greater than the preset fuse threshold, the target transaction path is closed.

[0211] If the transaction quantity is greater than the preset circuit breaker threshold, the payment center can close the target transaction path. Specifically, when determining the transaction path corresponding to the online transaction, the target transaction path can be not selected as an option, that is, subsequent online transactions received will not follow the target transaction path.

[0212] In addition, an embodiment of the present invention further proposes a computer-readable storage medium, on which a transaction processing program is stored. When the transaction processing program is executed by a processor, the steps of the transaction processing method described in the above embodiment are implemented.

[0213] The various embodiments of the transaction processing device and computer-readable storage medium of the present invention may refer to the various embodiments of the transaction processing method of the present invention, and will not be described in detail here.

[0214] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0215] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0216] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0217] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A transaction processing method, characterized in that: The method comprises the following steps: receiving a target online transaction sent by a product system, and determining a target transaction path corresponding to the target online transaction; When performing online sending detection on the target online transaction, if it is detected that the current online count is less than the currently set online flow threshold, and the current total count is less than the preset total flow threshold, the target online transaction is sent to the transaction channel in the target transaction path, so that the transaction channel processes the target online transaction; The online count is the number of online transactions issued to the target transaction path within the latest first preset time period, the total count is the total number of online transactions and queue transactions issued to the target transaction path within the latest first preset time period, and the online flow threshold is set to the preset total flow threshold minus the preset queue guaranteed flow when there is a queue on the current target transaction path, and is set to the preset total flow threshold when there is no queue on the current target transaction path; When performing queue sending detection on the target queue transaction corresponding to the target transaction path obtained from the queue queue, if it is detected that the current queue count is less than the currently set queue flow threshold, and the current total count is less than the preset total flow threshold, the target queue transaction is sent to the transaction channel in the target transaction path, so that the transaction channel processes the target queue transaction; The queue count is the number of queue transactions issued to the target transaction path within the latest first preset time period, and the queue flow threshold is set to the preset total flow threshold minus the preset online guaranteed flow.

2. The transaction processing method according to claim 1, characterized in that: After the step of receiving the target online transaction sent by the product system and determining the target transaction path corresponding to the target online transaction, the method further includes: Detect whether the target transaction path is currently queued; If the target transaction path is not currently queued, performing the online sending detection on the target online transaction; If the target transaction path currently has a queue, determining whether the target online transaction is allowed to enter the queue when there is a queue according to the transaction attribute information of the target online transaction; If it is determined that the target online transaction is allowed to enter the queue when there is a queue, then the target online transaction is added to the queue; If it is determined that the target online transaction is not allowed to enter the queue when there is a queue, the online sending detection is performed on the target online transaction.

3. The transaction processing method according to claim 1, characterized in that: After the step of receiving the target online transaction sent by the product system and determining the target transaction path corresponding to the target online transaction, the method further includes: When performing online sending detection on the target online transaction, if it is detected that the current online count is greater than or equal to the currently set online flow threshold, or the current total count is greater than or equal to the preset total flow threshold, then determining whether the target online transaction is allowed to enter the queue when the flow threshold is exceeded according to the transaction attribute information of the target online transaction; If it is determined that the target online transaction is allowed to enter the queue when the flow threshold is exceeded, then the target online transaction is added to the queue; If it is determined that the target online transaction is not allowed to enter the queuing queue when the flow threshold is exceeded, the target online transaction is rejected.

4. The transaction processing method according to claim 3, characterized in that: The step of adding the target online transaction to a queue comprises: Determine the target queue number corresponding to the target online transaction according to a preset allocation strategy; Adding the target online transaction to a queue corresponding to the target queue number in a persistent database to convert the target online transaction into a queue transaction; Wherein, the preset allocation strategy includes one of a first strategy, a second strategy and a third strategy; The first strategy is to use the preset queue number corresponding to the target transaction path as the target queue number; The second strategy is to generate a random number and determine one of a plurality of preset queue numbers corresponding to the target transaction path as the target queue number according to the random number; The third strategy is to perform a hash calculation on the bank number in the target transaction path and then take the result modulo the number of queues as the target queue number.

5. The transaction processing method according to claim 4, characterized in that: The method further comprises: Supplement loading queue transactions from the queue queue of the persistent database to the cache queue of the same queue number in the cache database, wherein the queue queue in the persistent database corresponds one-to-one to the cache queue in the cache database; The queue transactions are periodically obtained from each cache queue of the cache database in a first-in-first-out order to perform the queue sending detection.

6. The transaction processing method according to claim 5, characterized in that: After the step of adding the target online transaction to the queue corresponding to the target queue number in the persistent database, the method further includes: Setting the state of the target online transaction in the persistent database queue to a pending loading state; The step of supplementing the loading queue transaction from the queue queue of the persistent database to the cache queue of the same queue number in the cache database comprises: Obtaining queue transactions in a waiting-to-be-loaded state from the queue queue of the persistent database, supplementing and loading them into the cache queue of the same queue number in the cache database, and setting the state of the queue transactions loaded this time to a loaded state; After the step of sending the target queue transaction to the transaction path in the target transaction path, the method further includes: Setting the state of the target queue transaction in the persistent database queue to a sent state; The method further comprises: When performing queue sending detection on the target queue transaction, if it is detected that the current queue count is greater than or equal to the currently set queue flow threshold, or the current total count is greater than or equal to the preset total flow threshold, the state of the target queue transaction in the persistent database queue is set to a pending loading state.

7. The transaction processing method according to any one of claims 1 to 6, characterized in that: The method further comprises: Setting the online flow threshold corresponding to the target transaction path according to the current queue identifier of the target transaction path, wherein the queue identifier is an identifier indicating whether the target transaction path is in a queue; After adding the target online transaction to the queue, the current queue count of the target transaction path is increased by one, and when it is detected that the current queue identifier of the target transaction path indicates that the target transaction path is not queued, the queue identifier is changed to indicate that the target transaction path is queued; After the target queue transaction is sent to the transaction channel in the target transaction path, the current queue count of the target transaction path is reduced by one, and when it is detected that the queue count is less than or equal to zero, the queue identifier is changed to indicate that there is no queue on the target transaction path.

8. The transaction processing method according to claim 7, characterized in that: The method further comprises: Regularly checking the last update time of the queue count of the target transaction path; If the time between the last update time and the current time is greater than a second preset time, then counting the number of queue transactions corresponding to the target transaction path in the queue; If the transaction quantity is 0 and the current queue identifier of the target transaction path indicates that the target transaction path is queued, the queue identifier is changed to indicate that the target transaction path is not queued, and the queue count of the target transaction path obtained when checking the last update time is subtracted from the current queue count of the target transaction path.

9. The transaction processing method according to claim 7, characterized in that: The method further comprises: Regularly check whether the current queue count of the target transaction path is greater than a preset fuse threshold; If the current queue count of the target transaction path is greater than the preset fuse threshold, then counting the number of queue transactions corresponding to the target transaction path in the queue; If the transaction quantity is greater than the preset fuse threshold, the target transaction path is closed.

10. A transaction processing device, characterized in that: The transaction processing device comprises: a memory, a processor and a transaction processing program stored in the memory and executable on the processor, wherein the transaction processing program implements the steps of the transaction processing method as claimed in any one of claims 1 to 9 when executed by the processor.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a transaction processing program, and when the transaction processing program is executed by a processor, the steps of the transaction processing method according to any one of claims 1 to 9 are implemented.

Citation Information

Patent Citations

  • Method and device for system to achieve flow control based on TUXEDO middleware

    CN103825830A

  • Transaction flow control method and system

    CN107819696A