Transaction processing method and device

By defining interceptors and concurrent control functions in the bank core system, the concurrent transactions of non-hot-spot accounts are controlled, and the problems of low efficiency of concurrent transaction processing and overdraft in the existing technology are solved, and effective control of specified types of transactions is achieved. and efficient processing.

CN111709731BActive Publication Date: 2024-11-19WEBANK (CHINA)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010561247.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-18
Publication Date
2024-11-19
Estimated Expiration
2040-06-18

AI Technical Summary

Technical Problem

The existing technology cannot effectively control concurrent transactions in non-hot spot accounts, resulting in inefficient processing of bank core systems or risk of overdrafting funds, and cannot be applied to all account groups.

Method used

By defining an interceptor on the transaction service, obtaining the pending transaction and determining whether the limitations of the concurrency control function are met, and if it is not met, the transaction will be refused to be executed, and a memory database is used to store transaction data to improve processing efficiency.

Benefits of technology

It realizes flexible concurrent control of specified types of transactions, avoids the risk of bank core system crashes and capital overdrafts, and improves transaction processing efficiency and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111709731B_ABST
    Figure CN111709731B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention relates to the field of financial technology (Fintech), and discloses a transaction processing method and device, which obtains pending transactions through an interceptor; the interceptor is used to intercept transactions of a specified type; the interceptor determines whether the pending transactions meet the restriction conditions of the concurrency control function; when the pending transactions do not meet the restriction conditions, the transaction service is called to process the pending transactions. In the transaction processing process, the concurrency control function is set for the specified transaction factors in the specified type of transactions, and the method is relatively flexible; and when the pending transactions meet the restriction conditions of the concurrency control function, the intercepted pending transactions of the specified type are directly refused to be executed, thereby achieving the purpose of concurrency control of the specified type of transactions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of financial technology (Fintech), and in particular, to a transaction processing method and device. Background Art

[0002] With the development of computer technology, more and more technologies (such as big data, cloud computing or blockchain) are being applied in the financial field. Traditional finance is gradually transforming into financial technology, and big data technology is no exception. However, due to the security and real-time requirements of the financial and payment industries, higher requirements are also placed on big data technology.

[0003] At present, the traditional banking core system has the following common solutions for single-account transaction processing:

[0004] Solution 1: By adding exclusive locks to the accounts of both parties to the transaction. When the peripheral system sends a business request to the bank's core system, the bank's core system uses exclusive locks to process the accounts one by one in the order of the business requests sent by the peripheral system.

[0005] Solution 2: Configure hotspot accounts. Before the product is launched, configure which accounts are hotspot accounts in advance. For example, preset a hotspot account table, configure some accounts as hotspot accounts, and store them in the table. When a transaction processing request for the account comes in, first check whether the account belongs to a hotspot account. If the account belongs to a hotspot account, then use the corresponding accounting solution for the hotspot account to process it.

[0006] The above two technical solutions have the following problems respectively:

[0007] For Solution 1, firstly, by setting exclusive locks, the bank's core system cannot perform differentiated concurrent transaction control on different types of accounts, that is, the same transaction control mode is adopted for all account transactions; secondly, at the same time, if the business volume of an account is huge, the account will be frequently locked and released, resulting in the occupation of a lot of database resources, making the processing efficiency of the entire bank's core system low, and even causing the bank's core system to be paralyzed.

[0008] For Solution 2, firstly, the method of setting up hotspot accounts is not suitable for all groups. This method requires the corresponding customers of the account to accept the user experience that transactions cannot be credited in real time, so the user group of hotspot accounts is generally non-personal accounts, such as accounts opened in banks for companies and administrative institutions; secondly, since the former causes the account balance to not be updated in real time, if the account is an account with frequent deductions, there may be a risk of overdraft.

[0009] With regard to the above problems, the existing technology currently cannot provide a method for effectively controlling concurrent transactions of non-hotspot accounts. Summary of the invention

[0010] The embodiment of the present invention provides a transaction processing method and device, which are used to solve the problem of effective control when concurrent transactions occur in an account.

[0011] In a first aspect, an embodiment of the present invention provides a transaction processing method, the method comprising: obtaining a pending transaction through an interceptor; the interceptor is used to intercept transactions of a specified type; determining through the interceptor whether the pending transaction meets the restriction conditions of a concurrency control function; the concurrency control function is set for specified transaction factors in transactions of the specified type; wherein the restriction conditions are used to determine whether to refuse to execute transactions of the specified type; when the pending transaction does not meet the restriction conditions, calling a transaction service to process the pending transaction.

[0012] Based on this solution, an interceptor is defined on a transaction service of a specified type to intercept and obtain transactions of the specified type. For the obtained pending transactions, the method in the interceptor is called to determine whether it meets the restriction conditions of the concurrency control function. When it does not meet the restriction conditions, the transaction service is called to process it. The transaction processing flow sets the concurrency control function for the specified transaction factors in the specified type of transactions, and this method is relatively flexible. Moreover, when the pending transaction meets the restriction conditions of the concurrency control function, the intercepted pending transaction of the specified type is directly refused to be executed, thereby achieving the purpose of concurrency control of transactions of the specified type.

[0013] In a possible implementation method, determining whether the pending transaction meets the restriction conditions of the concurrency control function through the interceptor includes: obtaining a record value corresponding to the concurrency control function; the record value is used to indicate the number of transactions of a specified type to be executed; and determining whether the record value has reached the restriction threshold corresponding to the concurrency control function.

[0014] Based on this solution, by obtaining the record value corresponding to the concurrency control function, the record value is used to represent the number of transactions of the specified type to be executed, and according to the record value and the limit threshold corresponding to the concurrency control function, it is determined whether the record value has reached the limit threshold. By setting a threshold for the concurrency control function, the value of the limit threshold can be adjusted according to actual needs, so that when determining whether to perform concurrency control on the pending transactions, by applying this method, it is usually more flexible.

[0015] In a possible implementation method, before calling the transaction service to process the pending transaction, it also includes: if the record value does not reach the limit threshold, increasing the record value; after calling the transaction service to process the pending transaction, it also includes: after the pending transaction is processed, reducing the record value.

[0016] Based on this solution, by comparing the record value with the limit threshold, when the record value is less than the limit threshold, a record corresponding to the pending transaction is included in the record value, and after the pending transaction is processed by the called transaction service, a record corresponding to the pending transaction in the record value needs to be deleted, thereby promoting the entire transaction processing process and ensuring that the transaction is successfully processed.

[0017] In a possible implementation method, the concurrency control function also includes an alarm threshold; the alarm threshold is less than the limit threshold; if the record value reaches the alarm threshold for the first time, the record value is increased and an alarm is issued; the pending transaction is executed; after the pending transaction is executed, the record value is reduced.

[0018] Based on this solution, for the concurrency control function, in addition to setting a limit threshold, an alarm threshold is also set. When the record value reaches the alarm threshold for the first time, in addition to processing the pending transaction normally, an alarm needs to be issued to the outside world to remind the staff to be alert to whether the pending transaction will have abnormalities in the future.

[0019] In a possible implementation method, after the pending transaction fails to meet the restriction condition and before the calling of the transaction service to process the pending transaction, the method further includes: storing the pending transaction in an in-memory database.

[0020] Based on this solution, by storing pending transactions in an in-memory database, compared to the traditional method of using a relational database to store pending transactions, the advantage of an in-memory database is that the content of the database can be saved in memory, increasing the data reading and writing efficiency while avoiding occupying database resources again.

[0021] In a possible implementation method, the specified transaction factor in the concurrency control function is at least one of the following: a transaction subject set in the single-account concurrency control configuration information, and an execution function set in the single-account concurrency control configuration information.

[0022] Based on this solution, by defining an interceptor on a transaction service of a specified type, the pending transactions obtained are transactions of the specified type. However, in the actual transaction processing process, it is not required to perform concurrent control on all pending transactions. For example, concurrent control will be performed on pending transactions of specified transaction factors, where the specified transaction factors may include the transaction subject set in the single-account concurrent control configuration information and / or the execution function set in the single-account concurrent control configuration information. Therefore, in the process of concurrent control of pending transactions, this method will appear more flexible and changeable.

[0023] In one possible implementation method, the record value and the single-account concurrency control configuration information are stored in an in-memory database.

[0024] Based on this solution, by storing record values ​​and single-account concurrency control configuration information in an in-memory database, compared to the traditional method of using a relational database to store pending transactions, the advantage of an in-memory database is that the content in the database can be saved in memory, increasing the data reading and writing efficiency while avoiding occupying database resources again.

[0025] In a second aspect, an embodiment of the present invention provides a transaction processing device, which includes: a transaction acquisition unit, used to acquire a pending transaction through an interceptor; the interceptor is used to intercept transactions of a specified type; a determination unit, used to determine through the interceptor whether the pending transaction meets the restriction conditions of a concurrency control function; the concurrency control function is set for specified transaction factors in transactions of the specified type; wherein the restriction conditions are used to determine whether to refuse to execute transactions of the specified type; a transaction processing unit, used to call a transaction service to process the pending transaction when the pending transaction does not meet the restriction conditions.

[0026] Based on this solution, an interceptor is defined on a transaction service of a specified type to intercept and obtain transactions of the specified type. For the obtained pending transactions, the method in the interceptor is called to determine whether it meets the restriction conditions of the concurrency control function. When it does not meet the restriction conditions, the transaction service is called to process it. The transaction processing flow sets the concurrency control function for the specified transaction factors in the specified type of transactions, and this method is relatively flexible. Moreover, when the pending transaction meets the restriction conditions of the concurrency control function, the intercepted pending transaction of the specified type is directly refused to be executed, thereby achieving the purpose of concurrency control of transactions of the specified type.

[0027] In a possible implementation method, the determination unit is specifically used to: obtain a record value corresponding to the concurrency control function; the record value is used to indicate the number of transactions of a specified type to be executed; and determine whether the record value has reached a limit threshold corresponding to the concurrency control function.

[0028] Based on this solution, by obtaining the record value corresponding to the concurrency control function, the record value is used to represent the number of transactions of the specified type to be executed, and according to the record value and the limit threshold corresponding to the concurrency control function, it is determined whether the record value has reached the limit threshold. By setting a threshold for the concurrency control function, the value of the limit threshold can be adjusted according to actual needs, so that when determining whether to perform concurrency control on the pending transactions, by applying this method, it is usually more flexible.

[0029] In a possible implementation method, the transaction processing unit is further used to: if the record value does not reach the limit threshold, increase the record value; and after the pending transaction processing is completed, reduce the record value.

[0030] Based on this solution, by comparing the record value with the limit threshold, when the record value is less than the limit threshold, a record corresponding to the pending transaction is included in the record value, and after the pending transaction is processed by the called transaction service, a record corresponding to the pending transaction in the record value needs to be deleted, thereby promoting the entire transaction processing process and ensuring that the transaction is successfully processed.

[0031] In a possible implementation method, the concurrency control function also includes an alarm threshold; the alarm threshold is less than the limit threshold; the transaction processing unit is specifically used to: if the record value reaches the alarm threshold for the first time, increase the record value and issue an alarm; execute the pending transaction; after the pending transaction is executed, reduce the record value.

[0032] Based on this solution, for the concurrency control function, in addition to setting a limit threshold, an alarm threshold is also set. When the record value reaches the alarm threshold for the first time, in addition to processing the pending transaction normally, an alarm needs to be issued to the outside world to remind the staff to be alert to whether the pending transaction will have abnormalities in the future.

[0033] In a possible implementation method, the transaction processing device further includes a storage unit, and the storage unit is used to store the transaction to be processed in an in-memory database.

[0034] Based on this solution, by storing pending transactions in an in-memory database, compared to the traditional method of using a relational database to store pending transactions, the advantage of an in-memory database is that the content of the database can be saved in memory, increasing the data reading and writing efficiency while avoiding occupying database resources again.

[0035] In a possible implementation method, the specified transaction factor in the concurrency control function is at least one of the following: a transaction subject set in the single-account concurrency control configuration information, and an execution function set in the single-account concurrency control configuration information.

[0036] Based on this solution, by defining an interceptor on a transaction service of a specified type, the pending transactions obtained are transactions of the specified type. However, in the actual transaction processing process, it is not required to perform concurrent control on all pending transactions. For example, concurrent control will be performed on pending transactions of specified transaction factors, where the specified transaction factors may include the transaction subject set in the single-account concurrent control configuration information and / or the execution function set in the single-account concurrent control configuration information. Therefore, in the process of concurrent control of pending transactions, this method will appear more flexible and changeable.

[0037] In a possible implementation method, the record value and the single-account concurrency control configuration information are stored in an in-memory database.

[0038] Based on this solution, by storing record values ​​and single-account concurrency control configuration information in an in-memory database, compared to the traditional method of using a relational database to store pending transactions, the advantage of an in-memory database is that the content in the database can be saved in the content, increasing the data reading and writing efficiency while avoiding occupying database resources again.

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

[0040] A memory for storing program instructions;

[0041] The processor is used to call the program instructions stored in the memory and execute any method as described in the first aspect according to the obtained program.

[0042] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute any method as described in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0044] Figure 1 A transaction processing method provided by an embodiment of the present invention;

[0045] Figure 2 A transaction processing flow chart provided for an embodiment of the present invention;

[0046] Figure 3 A flow chart of a BizProcessorListener.beforeServiceProcess method provided by an embodiment of the present invention;

[0047] Figure 4 A flow chart of a BizProcessorListener.finalServiceProcess method provided by an embodiment of the present invention;

[0048] Figure 5 A transaction processing device is provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0049] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0050] For ordinary accounts in the bank's core system that are not configured as hot accounts, normally, ordinary accounts send transaction requests to the bank's core system one by one, and only after the bank's core system has processed the current transaction request will the ordinary account continue to send the next transaction request to the bank's core system. Correspondingly, the bank's core system receives transaction requests sent by ordinary accounts one by one, and only after it has processed the current transaction request will the bank's core system continue to receive the next transaction request. However, if an ordinary account has some kind of abnormality, causing it to send a large number of transaction requests to the bank's core system at the same time, in other words, when the bank's core system has not yet processed a transaction request, the same transaction request continues to enter the bank's core system in the hope of being processed. Therefore, for high-concurrency transaction requests initiated by ordinary accounts, it is very easy to cause the bank's core system to crash and become unavailable.

[0051] In view of the above scenario where high-concurrency transaction requests enter the core system of a bank, an embodiment of the present invention provides a transaction processing method, such as Figure 1 As shown, the method comprises the following steps:

[0052] Step 101, obtaining a transaction to be processed through an interceptor; the interceptor is used to intercept transactions of a specified type;

[0053] Step 102, determining, by the interceptor, whether the transaction to be processed satisfies a restriction condition of a concurrency control function; the concurrency control function is set for a specified transaction factor in the specified type of transaction; wherein the restriction condition is used to determine whether to refuse to execute the specified type of transaction;

[0054] Step 103: When the pending transaction does not meet the restriction condition, call a transaction service to process the pending transaction.

[0055] Based on this solution, an interceptor is defined on a transaction service of a specified type to intercept and obtain transactions of the specified type. For the obtained pending transactions, the method in the interceptor is called to determine whether it meets the restriction conditions of the concurrency control function. When it does not meet the restriction conditions, the transaction service is called to process it. The transaction processing flow sets the concurrency control function for the specified transaction factors in the specified type of transactions, and this method is relatively flexible. Moreover, when the pending transaction meets the restriction conditions of the concurrency control function, the intercepted pending transaction of the specified type is directly refused to be executed, thereby achieving the purpose of concurrency control of transactions of the specified type.

[0056] Take customer A's financial subscription transaction as an example. When customer A initiates a financial subscription transaction, the IoDpTransDetl transaction service of the bank's core system will be called. Among them, the IoDpTransDetl transaction service is the method name of the financial subscription transaction calling the bank's core system. Specifically, the IoDpTransDetl transaction service includes the following 4 steps:

[0057] 1. Check the amount transfer out of the account of customer A using the CheckOut method. Among them, IoDpTransDetl.CheckOut mainly checks the account status, account balance, account limit, etc. of customer A. Among them, checking the account status mainly checks whether the account has been closed, whether the account is under the control of the judicial authorities, etc. Checking the account balance mainly confirms whether the account balance meets the amount that customer A wants to purchase; checking the account limit mainly confirms whether the amount that the account wants to purchase exceeds the amount of money specified by the bank for the account.

[0058] 2. For the counterparty of client A, for example, a pending account B, the amount is transferred into the check method CheckIn. Among them, IoDpTransDetl.CheckIn mainly checks the status and account limit of the pending account B.

[0059] 3. Perform the DoOut operation method to transfer the amount from the account of customer A. In other words, IoDpTransDetl.DoOut transfers the amount from the account of customer A to account B.

[0060] 4. Perform the amount transfer processing operation method DoIn on the clearing account B. In other words, IoDpTransDetl.DoIn receives the amount transferred from the account to which customer A belongs.

[0061] That is, IoDpTransDetl.CheckOut and IoDpTransDetl.CheckIn belong to the checking class methods, and IoDpTransDetl.DoOut and IoDpTransDetl.DoIn belong to the accounting processing class methods.

[0062] In the above step 101, the transaction to be processed is obtained through an interceptor; the interceptor is used to intercept transactions of a specified type.

[0063] For example, according to actual needs, bank staff will predefine which transaction services need to be intercepted, and define interceptors on these transaction services that need to be intercepted. As an example, the embodiment of the present invention defines the interceptor of the system by adopting Spring AOP (Aspect Oriented Programming, an aspect-oriented programming framework in the Spring framework). For example, it will be defined in advance that financial subscription transaction services and transfer transaction services will be intercepted, and it will be defined that financial redemption transaction services and judicial freezing transaction services will not be intercepted, and so on. This pre-definition can also be reflected in the concurrency control function, that is, the concurrency control function is given according to the needs of the business personnel, and the R&D personnel set the interceptor in the specific business code.

[0064] For example, in the embodiment of the present invention, if the financial subscription transaction service is defined as a transaction service that needs to be intercepted, the following information will be added to the financial subscription transaction service:

[0065] @Around("execution(*com.xxx.service.*.*(..)))

[0066] The above content indicates that the interceptor will intercept all methods of the transaction service. In order to distinguish the interceptors of different transaction services, as an example, in the embodiment of the present invention, the interceptor for intercepting the IoDpTransDetl transaction service is recorded as BizProcessorListener.

[0067] When customer A initiates a financial subscription transaction, the IoDpTransDetl transaction service of the bank's core system will be called. Therefore, each call by customer A to the IoDpTransDetl transaction service will be intercepted by the BizProcessorListener interceptor.

[0068] By setting an interceptor for a specified type of transaction server, the interceptor can intercept the specified type of transaction. For ordinary accounts that are not configured as hot accounts in the bank's core system, the use of interceptors is relatively flexible and has a wide range of application scenarios.

[0069] In addition to the above-mentioned method of obtaining pending transactions through an interceptor, another possible implementation method is to judge through fields in the pending transactions, such as determining that the type of the pending transaction is financial subscription, which is the type of restricted transaction set in the concurrency control function.

[0070] In step 102, the interceptor determines whether the transaction to be processed satisfies the restriction conditions of the concurrency control function; the concurrency control function is set for the specified transaction factors in the specified type of transaction; wherein the restriction conditions are used to determine whether to refuse to execute the specified type of transaction.

[0071] Optionally, the specified transaction factor in the concurrency control function is at least one of the following: a transaction subject set in the single-account concurrency control configuration information, and an execution function set in the single-account concurrency control configuration information.

[0072] Optionally, the single-account concurrency control configuration information is stored in an in-memory database; correspondingly, the single-account concurrency control configuration information is obtained from the in-memory database.

[0073] For example, when customer A's call to the IoDpTransDetl transaction service is intercepted by the BizProcessorListener interceptor, the BizProcessorListener interceptor will obtain the name of the transaction service and the input parameters for calling the transaction service; the input parameters may include information such as the card number and account name. After the IoDpTransDetl transaction service is intercepted, the method in the interceptor is executed, such as starting to execute the BizProcessorListener.beforeServiceProcess method.

[0074] Specifically, according to the name of the transaction service - IoDpTransDetl, the single-account concurrency control configuration information is obtained from the memory database, such as the single-account transaction count control table ksys_concur_control. As an example, the memory database can be redis. In fact, the single-account concurrency control configuration information is stored in the database. When the system is running, the single-account concurrency control configuration information is stored in the memory database, so that the single-account concurrency control configuration information can be quickly obtained when the transaction is processed later. Refer to Table 1, which is a single-account transaction count control table ksys_concur_control provided in an embodiment of the present invention.

[0075] Table 1

[0076]

[0077]

[0078] For example, if a bank needs to perform concurrent transaction control on events where the transaction subject is an account and the transaction behavior is a financial product subscription, then a configuration item will be added to the above table as follows:

[0079]

[0080] Referring to Table 1, since the value corresponding to the enabled field is 1, the meaning of Table 1 is: for a transaction event whose transaction subject is acctNo (account name) and whose transaction behavior is IoDpTransDetl (financial management subscription transaction service), concurrency control will be performed on the transaction when the transaction event occurs. That is, the concurrency control for transaction events is enabled / disabled by controlling the value corresponding to the enabled field. Specifically, whether to perform concurrency control on transaction events can be achieved in a preset manner. For example, when the value corresponding to the enabled field is 1, it indicates that concurrency control is performed on the transaction event. When the value corresponding to the enabled field is 0 or a null value, it indicates that concurrency control is not performed on the transaction event.

[0081] Therefore, when the financial subscription transaction initiated by customer A calls the method of the IoDpTransDetl transaction service in the bank's core system and is intercepted by the BizProcessorListener interceptor, the single-account transaction count control table ksys_concur_control is obtained according to the name of the transaction service - IoDpTransDetl, and by confirming that customer A's account is in the scope of the single-account transaction count control table (for example, customer A's account name appears in the acctNo column), and enabled in the single-account transaction count control table is confirmed to enable concurrent transaction control, it means that concurrent transaction control needs to be executed for the financial subscription transaction initiated by customer A.

[0082] According to the status of the enabled field in the single account transaction count control table ksys_concur_control, when the value corresponding to the enabled field is determined to be 1, it means that concurrent control is required for the financial subscription transaction of customer A; next, by calling the checkIgnore method, determine whether to ignore concurrent control according to the full path of the pre-check class configured in the table. For example, for the methods of the check class, by configuring the full path where this method is located, concurrent control of the methods of the check class can be achieved without the need for concurrent control; for another example, for the methods of processing the entry class, by configuring the full path where this method is located, concurrent control of the methods of processing the entry class can be achieved. Specifically, for the IoDpTransDetl transaction service, since IoDpTransDetl.CheckOut and IoDpTransDetl.CheckIn belong to the checking class methods, the concurrency control of these two methods will be ignored, that is, no concurrency control will be performed on the IoDpTransDetl.CheckOut or IoDpTransDetl.CheckIn methods; since IoDpTransDetl.DoOut and IoDpTransDetl.DoIn belong to the accounting processing class methods, concurrency control will be performed on these two methods.

[0083] Optionally, determining whether the pending transaction meets the restriction conditions of the concurrency control function through the interceptor includes: obtaining a record value corresponding to the concurrency control function; the record value is used to indicate the number of transactions of a specified type to be executed; and determining whether the record value has reached a restriction threshold corresponding to the concurrency control function.

[0084] Optionally, the record value is stored in an in-memory database; correspondingly, the record value is obtained from the in-memory database.

[0085] For the financial subscription transaction initiated by customer A, the IoDpTransDetl transaction service of the bank core system is called. When it is determined that concurrent transaction control is required, the corresponding value is obtained from the memory database according to the obtained transaction service name and the input parameters. This corresponding value is the record value, which is used to indicate the number of transactions of the specified type to be executed. As an example, the memory database can be redis. If the record value has reached the limit threshold corresponding to the concurrency control function, the specified type of transaction is refused to be executed.

[0086] In the embodiment of the present invention, by setting the number of concurrent rejected transactions (i.e., the limit threshold) in the single-account transaction count control table ksys_concur_control to a fixed value, such as setting the limit threshold to 10; when the record value reaches 10, the bank core system will reject the financial subscription transaction initiated by customer A. For example, if customer A simultaneously initiates 100 financial subscription transactions to the bank core system, the bank core system will only process the 10 financial subscription transactions it first receives, and reject the remaining 90 financial subscription transactions initiated subsequently. Thus, the bank core system can process transactions initiated by customers simultaneously within the scope of its own processing capabilities, and directly reject transactions beyond its own processing capabilities, thereby ensuring the high availability and robustness of the bank core system.

[0087] It is understandable that when the bank core system is able to process one or more transactions initiated by customer A at the same time, when customer A initiates a transaction to the bank system at the next time, the bank core system can continue to receive and process the transaction at the next time based on the difference between the record value and the limit threshold. In this way, by enabling the concurrency control function for pending transactions, the bank core system can flexibly process pending transactions initiated by customers.

[0088] In the above step 103, when the pending transaction does not meet the restriction condition, the transaction service is called to process the pending transaction.

[0089] Optionally, after the pending transaction fails to meet the restriction condition and before the calling of the transaction service to process the pending transaction, the method further includes: storing the pending transaction in an in-memory database.

[0090] By storing pending transactions in an in-memory database, such as a redis database, compared to the traditional method of using a relational database to store pending transactions, the advantage of an in-memory database is that the content of the database can be saved in memory, increasing the efficiency of data reading and writing while avoiding occupying database resources again.

[0091] Optionally, the concurrency control function also includes an alarm threshold; the alarm threshold is less than the limit threshold; if the record value reaches the alarm threshold for the first time, the record value is increased and an alarm is issued; the pending transaction is executed; after the pending transaction is executed, the record value is reduced.

[0092] In an embodiment of the present invention, by setting the alarm concurrency number (i.e., the alarm threshold) in the single-account transaction count control table ksys_concur_control to a fixed value, for example, setting the alarm threshold to 5; when the record value does not reach 5, 1 is accumulated on the basis of the record value, that is, 1 is added to the transaction service name and the value corresponding to the input parameter in the redis database; then the IoDpTransDetl transaction service is continuously called to process the transaction initiated by customer A; after a transaction initiated by customer A is processed, the BizProcessorListener.afterServiceProcess method is called to register the transaction flow and other log information for the relevant transaction service; finally, the BizProcessorListener.finalServiceProcess method is called to subtract 1 from the transaction service name and the value corresponding to the input parameter in the redis database for customer A.

[0093] Subsequently, when the record value reaches 5 for the first time, the alarm mechanism is triggered, that is, an alarm SMS is sent to the operation and maintenance personnel, and the bank core system will issue an alarm. The operation and maintenance personnel can make the next decision based on the alarm information. Since the alarm threshold is less than the limit threshold, it means that the issuance of the alarm information will not affect the processing of other pending transactions initiated by customer A by the bank core system, that is, the steps before the record value reaches 5 will also be executed. Since the steps before the record value reaches 5 have been described above, the processing flow of the bank core system for customer A's pending transactions when the record value is equal to the alarm threshold will not be described here.

[0094] Optionally, before calling the transaction service to process the pending transaction, it also includes: if the record value does not reach the limit threshold, increasing the record value; after calling the transaction service to process the pending transaction, it also includes: after the pending transaction is processed, reducing the record value.

[0095] As in the previous example, when the record value is greater than 5 but not more than 10, 1 is accumulated based on the record value, that is, 1 is added to the transaction service name and the value corresponding to the input parameter in the redis database; then the IoDpTransDetl transaction service is called to process the transaction initiated by customer A; after a transaction initiated by customer A is processed, the BizProcessorListener.afterServiceProcess method is called to register the transaction flow and other log information for the relevant transaction service; finally, the BizProcessorListener.finalServiceProcess method is called to subtract 1 from the transaction service name and the value corresponding to the input parameter in the redis database for customer A.

[0096] like Figure 2 The figure shows a transaction processing flow chart provided by an embodiment of the present invention.

[0097] Step 201, the bank core system is intercepted by the interceptor when calling the IoDpTransDetl transaction service;

[0098] Step 202, the interceptor executes the BizProcessorListener.beforeServiceProcess method;

[0099] Step 203, the bank core system continues to call the IoDpTransDetl transaction service to process the transaction;

[0100] Step 204, the interceptor executes the BizProcessorListener.afterServiceProcess method;

[0101] Step 205, the interceptor executes the BizProcessorListener.finalServiceProcess method;

[0102] Step 206, return.

[0103] like Figure 3 FIG. 1 is a flow chart of a BizProcessorListener.beforeServiceProcess method provided by an embodiment of the present invention.

[0104] Step 301, query the single account transaction count control table;

[0105] Step 302, determine whether to perform concurrent transaction control; if the determination result is "yes", execute step 303, otherwise return;

[0106] Step 303, call the checkIgnore method to check whether to ignore concurrency control according to the full path of the check class configured in the table; if the judgment result is "no", execute step 304, otherwise return;

[0107] Step 304, obtain the corresponding value from redis according to the acquired transaction service name and the input parameter (key), and when the number of concurrent transaction rejections is not reached, add 1 to the value corresponding to the key in redis;

[0108] Step 305, return.

[0109] like Figure 4FIG. 4 is a flow chart of a BizProcessorListener.finalServiceProcess method provided by an embodiment of the present invention.

[0110] Step 401, query the single account transaction count control table;

[0111] Step 402, determine whether to perform concurrent transaction control, if the determination result is "yes", execute step 403, otherwise return;

[0112] Step 403: Use the acquired transaction service name and input parameters as keys and obtain the corresponding value from redis. If the value corresponding to the key is less than or equal to 1, delete it directly from redis; otherwise, decrement the value corresponding to the key by 1.

[0113] Step 404, return.

[0114] Based on the same concept, an embodiment of the present invention also provides a transaction processing device. Figure 5 As shown, the device comprises:

[0115] The transaction acquisition unit 501 is used to acquire the pending transaction through an interceptor; the interceptor is used to intercept transactions of a specified type;

[0116] The determination unit 502 is used to determine whether the transaction to be processed satisfies the restriction condition of the concurrency control function through the interceptor; the concurrency control function is set for the specified transaction factor in the specified type of transaction; wherein the restriction condition is used to determine whether to refuse to execute the specified type of transaction;

[0117] The transaction processing unit 503 is used to call a transaction service to process the pending transaction when the pending transaction does not meet the restriction condition.

[0118] Further, for the device, the determination unit 502 is specifically used to: obtain a record value corresponding to the concurrency control function; the record value is used to indicate the number of transactions of a specified type to be executed; and determine whether the record value has reached a limit threshold corresponding to the concurrency control function.

[0119] Further, for the device, the transaction processing unit 503 is also used to: if the record value does not reach the limit threshold, increase the record value; and after the pending transaction processing is completed, reduce the record value.

[0120] Furthermore, for the device, the concurrency control function also includes an alarm threshold; the alarm threshold is less than the limit threshold; the transaction processing unit 503 is specifically used to: if the record value reaches the alarm threshold for the first time, increase the record value and issue an alarm; execute the pending transaction; after the pending transaction is executed, reduce the record value.

[0121] Furthermore, the device further includes a storage unit 504, and the storage unit 504 is used to store the transaction to be processed in an in-memory database.

[0122] Further, for the device, the specified transaction factor in the concurrency control function is at least one of the following: a transaction subject set in the single-account concurrency control configuration information, and an execution function set in the single-account concurrency control configuration information.

[0123] Furthermore, for the device, the record value and the single-account concurrency control configuration information are stored in a memory-type database.

[0124] The embodiment of the present invention further provides a computing device, which may be a desktop computer, a portable computer, a smart phone, a tablet computer, a personal digital assistant (PDA), etc. The computing device may include a central processing unit (CPU), a memory, an input / output device, etc. The input device may include a keyboard, a mouse, a touch screen, etc. The output device may include a display device, such as a liquid crystal display (LCD), a cathode ray tube (CRT), etc.

[0125] The memory may include a read-only memory (ROM) and a random access memory (RAM), and provides the processor with program instructions and data stored in the memory. In an embodiment of the present invention, the memory may be used to store program instructions of the transaction processing method;

[0126] The processor is used to call the program instructions stored in the memory and execute the transaction processing method according to the obtained program.

[0127] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the transaction processing method.

[0128] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0129] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0130] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0131] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0132] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

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

Claims

1. A transaction processing method, characterized in that: include: Obtaining pending transactions through an interceptor; the interceptor is used to intercept transactions of a specified type; Determining whether the pending transaction meets the restriction condition of the concurrency control function through the interceptor; the concurrency control function is set for the specified transaction factor in the specified type of transaction, the specified transaction factor includes the transaction subject set in the single account concurrency control configuration information, and the restriction condition is used to determine whether to refuse to execute the specified type of transaction; When it is necessary to perform concurrency control on the financial subscription transaction of the transaction subject of the pending transaction, the full path of the pre-check class of the concurrency control configuration information is obtained by calling a preset method. If it is determined that the full path of the pre-check class is the full path corresponding to the method of the account entry class, the method of the account entry class is concurrency controlled; The concurrency control includes: if the pending transaction does not meet the restriction condition, calling the transaction service to process the pending transaction.

2. The method according to claim 1, characterized in that The determining, by the interceptor, whether the pending transaction satisfies the restriction condition of the concurrency control function includes: Obtaining a record value corresponding to the concurrency control function; the record value is used to indicate the number of transactions of a specified type to be executed; Determine whether the record value has reached a limit threshold corresponding to the concurrency control function, wherein the limit threshold is used to determine whether to refuse to execute the transaction of the specified type.

3. The method according to claim 2, characterized in that Before calling the transaction service to process the pending transaction, the method further includes: If the recorded value does not reach the limit threshold, increase the recorded value; After calling the transaction service to process the pending transaction, the method further includes: After the pending transaction is processed, the record value is reduced.

4. The method according to claim 2, characterized in that Also includes: The concurrency control function also includes an alarm threshold; the alarm threshold is less than the limit threshold; If the recorded value reaches the alarm threshold for the first time, increase the recorded value and issue an alarm; Executing the pending transaction; After the pending transaction is executed, the record value is reduced.

5. The method according to claim 2, characterized in that The record value and the single-account concurrency control configuration information are stored in an in-memory database.

6. The method according to any one of claims 1 to 5, characterized in that: After the pending transaction fails to meet the restriction condition and before the calling of the transaction service to process the pending transaction, the method further includes: The pending transactions are stored in an in-memory database.

7. A transaction processing device, characterized in that: include: A transaction acquisition unit, used to acquire pending transactions through an interceptor; the interceptor is used to intercept transactions of a specified type; a determination unit, configured to determine, through the interceptor, whether the to-be-processed transaction satisfies a restriction condition of a concurrency control function; the concurrency control function is set for a specified transaction factor in the specified type of transaction; the specified transaction factor includes a transaction subject set in the single-account concurrency control configuration information, and the restriction condition is used to determine whether to refuse to execute the specified type of transaction; The transaction processing unit is used to obtain the full path of the pre-check class of the concurrency control configuration information by calling a preset method when it is necessary to perform concurrency control on the financial subscription transaction of the transaction subject of the pending transaction. If it is determined that the full path of the pre-check class is the full path corresponding to the method of the accounting class, concurrency control is performed on the method of the accounting class; wherein the concurrency control includes: if the pending transaction does not meet the restriction condition, calling the transaction service to process the pending transaction.

8. A computing device, characterized in that include: A memory for storing program instructions; A processor is used to call the program instructions stored in the memory and execute the method according to any one of claims 1 to 6 according to the obtained program.

9. A computer-readable storage medium, characterized in that: The storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the method according to any one of claims 1 to 6.