CN114971874A - Transaction processing method, system, storage medium and electronic equipment - Google Patents

Transaction processing method, system, storage medium and electronic equipment Download PDF

Info

Publication number
CN114971874A
CN114971874A CN202210654250.1A CN202210654250A CN114971874A CN 114971874 A CN114971874 A CN 114971874A CN 202210654250 A CN202210654250 A CN 202210654250A CN 114971874 A CN114971874 A CN 114971874A
Authority
CN
China
Prior art keywords
transaction
account
balance
event
bgl
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210654250.1A
Other languages
Chinese (zh)
Inventor
冯玉财
陈树伟
蔡耿浩
李活力
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Bank of China Ltd
Original Assignee
Bank of China Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Bank of China Ltd filed Critical Bank of China Ltd
Priority to CN202210654250.1A priority Critical patent/CN114971874A/en
Publication of CN114971874A publication Critical patent/CN114971874A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/03Credit; Loans; Processing thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2308Concurrency control
    • G06F16/2336Pessimistic concurrency control approaches, e.g. locking or multiple versions without time stamps
    • G06F16/2343Locking methods, e.g. distributed locking or locking implementation details
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Development Economics (AREA)
  • General Business, Economics & Management (AREA)
  • Technology Law (AREA)
  • Strategic Management (AREA)
  • Marketing (AREA)
  • Economics (AREA)
  • Computational Linguistics (AREA)
  • Computing Systems (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The application discloses a transaction processing method, a transaction processing system, a storage medium and electronic equipment, wherein an event tracing mode is adopted, starting from a balance direction of a BGL account and a debit and credit direction of a transaction, according to whether the balance direction of the BGL account is consistent with the debit and credit direction of the transaction, the credibility of the transaction event is judged, the actual available balance of the account is calculated, the balance updating operation on the BGL account is converted into the writing operation on the event of the BGL account, the lock waiting of the account is eliminated, the efficiency of the account transaction processing of the BGL account is improved, the condition that the fund safety problem is caused by the compensation transaction failure due to account overdraft when the transaction fails and rolls back can not occur, and therefore the safety of the account processing of the BGL account is improved.

Description

Transaction processing method, system, storage medium and electronic equipment
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a transaction processing method, a transaction processing system, a storage medium, and an electronic device.
Background
Under the existing system architecture and mechanism of a core banking system, financial services adopt an internal account-hanging and keeping mode, and each service corresponds to a unique account-hanging and clearing account, namely a Branch General Ledger (BGL) for recording account change details of the corresponding service. Under the condition that the same business volume is increased sharply or initiated at a centralized time point, the BGL account becomes the bottleneck of the whole transaction process, and the system performance is seriously reduced due to the competition and waiting of the unique account checking account resources.
Most of the existing solutions for solving the performance degradation of the system adopt a combination of caching and asynchronous updating. However, since most BGL accounts are balance-limited, i.e., overdraft is not allowed, in a distributed framework, if the backend business unit fails to process or the balance is insufficient when the database is asynchronously updated, the transaction must be rolled back, whereas the Redis cache does not support transaction roll-back, and compensation transaction must be provided in case of transaction failure. The existing caching and asynchronous updating scheme cannot solve the problem of fund security due to the fact that compensation transaction failure is caused by account overdraft when transaction failure rolls back because of a high concurrency scene under distributed transactions.
Disclosure of Invention
In view of this, the application discloses a transaction processing method, a transaction processing system, a storage medium and an electronic device, which aim to eliminate the lock wait of an account, improve the efficiency of the accounting transaction processing of a BGL account, and avoid the situation that the account overdraft causes the fund security problem due to the failure of the compensation transaction when the transaction fails to roll back, thereby improving the security of the accounting processing of the BGL account.
In order to achieve the purpose, the technical scheme is as follows:
a first aspect of the present application discloses a transaction processing method, the method comprising:
acquiring the balance direction of the BGL account and the transaction direction of the BGL account; the balance direction is used for representing the limit of the account balance after BGL account transaction; the transaction direction is used for representing the flow direction of transaction funds;
determining an event type of a pre-acquired transaction event based on the balance direction and the transaction direction; the event type comprises a credible event after transaction or a credible event in transaction; the post-transaction credible event is used for representing an account balance so as to represent a credible event after the transaction is completed; the credible event in the transaction represents the credible event of the account balance in the transaction process;
when the event type is the post-transaction credible event and the BGL account is in an available state, generating a first asynchronous account entry message, and finishing balance updating operation and account running record operation of the BGL account based on the first asynchronous account entry message; the available state is used for representing that the BGL account is available for posting;
and when the event type is a credible event in the transaction, the BGL account is in an available state and the account balance of the BGL account is not overdrawn, generating a second asynchronous account entry message, and finishing balance updating operation and account running record operation of the BGL account based on the second asynchronous account entry message.
Preferably, the process of obtaining a transaction event comprises:
when a cross-unit transaction calling request is received, acquiring a transaction event corresponding to the cross-unit transaction calling request; the cross-unit transaction calling request is a cross-unit transaction calling request of various service units under a distributed framework.
Preferably, the determining the event type of the transaction event based on the balance direction and the transaction direction includes:
judging whether the balance direction is consistent with the transaction direction;
when the balance direction is a debit balance direction and the transaction direction is a debit, determining that the balance direction is consistent with the transaction direction, and determining that the event type of the transaction event is a post-transaction credible event; the debit balance direction is used for representing that the balance of the BGL account is less than 0; the debit is used for representing balance reduction of the BGL account;
when the balance direction is a credit side balance direction and the transaction direction is a credit side, determining that the balance direction is consistent with the transaction direction, and determining that the event type of the transaction event is a post-transaction credible event; the credit balance direction is used for representing that the balance of the BGL account is more than 0; the lender is used for representing balance increase of the BGL account;
when the balance direction is the debit balance direction and the transaction direction is the credit side, determining that the balance direction is inconsistent with the transaction direction and determining that the event type of the transaction event is a credible event in the transaction;
and when the balance direction is the credit side balance direction and the transaction direction is the debit side, determining that the balance direction is inconsistent with the transaction direction, and determining that the event type of the transaction event is a credible event in the transaction.
Preferably, the method further comprises the following steps:
when the balance direction is not limited, determining that the event type of the transaction event is the post-transaction credible event; the unrestricted balance is used to characterize the balance of the BGL account as unrestricted.
Preferably, the method further comprises the following steps:
and when the event type is the post-transaction trusted event and the BGL account is in an unavailable state, deleting the post-transaction trusted event.
Preferably, the method further comprises the following steps:
and when the event type is a credible event in the transaction and the BGL account is in an unavailable state or the account balance of the BGL account is overdrawn, deleting the credible event in the transaction.
A second aspect of the present application discloses a transaction processing system, the system comprising:
the acquiring unit is used for acquiring the balance direction of the BGL account and the transaction direction of the BGL account; the balance direction is used for representing the limit of the account balance after BGL account transaction; the transaction direction is used for representing the flow direction of transaction funds;
the first determining unit is used for determining the event type of a transaction event acquired in advance based on the balance direction and the transaction direction; the event type comprises a credible event after transaction or a credible event in transaction; the post-transaction credible event is used for representing an account balance so as to represent a credible event after the transaction is completed; the credible event in the transaction represents the credible event of the account balance in the transaction process;
the first operation unit is used for generating a first asynchronous account entry message when the event type is the post-transaction credible event and the BGL account is in an available state, and finishing balance updating operation and account running record operation of the BGL account based on the first asynchronous account entry message; the available state is used for representing that the BGL account is available for posting;
and the second operation unit is used for generating a second asynchronous account entry message when the event type is a credible event in the transaction, the BGL account is in an available state and the account balance of the BGL account is not overdrawn, and finishing the balance updating operation and the account running record operation of the BGL account based on the second asynchronous account entry message.
Preferably, the determining unit of the process of acquiring the transaction event is specifically configured to:
when a cross-unit transaction calling request is received, acquiring a transaction event corresponding to the cross-unit transaction calling request; the cross-unit transaction calling request is a cross-unit transaction calling request of various service units under a distributed framework.
A third aspect of the present application discloses a storage medium, which includes stored instructions, wherein when the instructions are executed, a device in which the storage medium is located is controlled to execute the transaction processing method according to any one of the first aspect.
A fourth aspect of the present application discloses an electronic device comprising a memory, and one or more instructions, wherein the one or more instructions are stored in the memory and configured to be executed by the one or more processors to perform the transaction processing method according to any one of the first aspect.
By the technical scheme, the application discloses a transaction processing method, a system, a storage medium and an electronic device, a balance direction of a BGL account and a transaction direction of the BGL account are obtained, the balance direction is used for representing the limitation of the account balance after the BGL account is transacted, the transaction direction is used for representing the flow direction of transaction funds, the event type of a transaction event obtained in advance is determined based on the balance direction and the transaction direction, the event type comprises a credible event after transaction or a credible event in transaction, the credible event after transaction is used for representing the account balance to represent the credible event after the transaction is completed, the credible event in transaction represents a debit event of the account balance in the transaction process, when the event type is the credible event after transaction, and the BGL account is in an available state, a first asynchronous posting message is generated, and balance updating operation and account pipelining operation of the BGL account are completed based on the first asynchronous posting message, the available state is used for representing that the BGL account can be checked in, when the event type is a credible event in a transaction, the BGL account is in the available state and the account balance of the BGL account is not overdrawn, a second asynchronous check-in message is generated, and balance updating operation and account running record operation of the BGL account are completed based on the second asynchronous check-in message. By adopting the scheme, an event tracing mode is adopted, starting from the balance direction of the BGL account and the loan direction of the transaction, according to whether the balance direction of the BGL account is consistent with the loan direction of the transaction, the credibility of the transaction event is judged, the actual available balance of the account is calculated, the balance updating operation on the BGL account is converted into the writing operation on the BGL account with the event, the locking waiting of the account is eliminated, the efficiency of the financial transaction processing of the BGL account is improved, and the condition that the fund safety problem is caused by the compensation transaction failure due to account overdraft when the transaction fails and rolls back can not occur, so that the safety of the financial processing of the BGL account is improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a schematic diagram of a distributed framework disclosed in an embodiment of the present application;
FIG. 2 is a schematic flow chart diagram illustrating a transaction processing method according to an embodiment of the present disclosure;
FIG. 3 is a block diagram of a transaction processing system according to an embodiment of the disclosure;
fig. 4 is a schematic structural diagram of an electronic device disclosed in an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In this application, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
As can be seen from the background art, since most BGL accounts are balance-limited, that is, overdraft is not allowed, in a distributed framework, if a post-business unit fails to process the transaction or the balance is insufficient when the database is asynchronously updated, the transaction must be rolled back, whereas the Redis cache does not support transaction roll-back, and a compensation transaction must be provided in case of transaction failure. The existing caching and asynchronous updating scheme cannot solve the problem of fund security due to the fact that compensation transaction failure is caused by account overdraft when transaction failure rolls back because of a high concurrency scene under distributed transactions.
In order to solve the above problems, the embodiments of the present application disclose a transaction processing method, a system, a storage medium, and an electronic device, which use an event tracing manner, start from a direction of balance of a BGL account and a direction of loan for a transaction, determine the credibility of the transaction event and calculate the actual available balance of the account according to whether the direction of balance of the BGL account is consistent with the direction of loan for the transaction, convert the balance update operation on the BGL account into a write operation on the BGL account for an event, eliminate lock waiting of the account, improve the efficiency of processing the accounting transaction of the BGL account, and avoid the situation that a fund security problem is caused by a compensation transaction failure due to account overdraft when the transaction fails to rollback, thereby improving the security of the accounting processing of the BGL account. The specific implementation is specifically illustrated by the following examples.
Referring first to fig. 1, an architecture diagram of a distributed framework to which the transaction processing method and system disclosed in the present application are applicable is described, and the distributed framework includes a plurality of other service units (other service unit 11, other service unit 12 …, other service unit n) and a BGL service unit 13. Wherein the value of n is an integer greater than 1 and equal to 1.
The data interaction process between the multiple other service units and the BGL service unit 13 is as follows:
the BGL service unit 13 receives cross-unit call requests of other service units, that is, records transaction events, and the efficiency of recording transaction events can be improved by using Redis cache, and the BGL service unit can also use a database.
The other business units can be business units such as deposit, loan and credit card, and the other business units can call the BGL account to perform the account entering service processing.
The BGL business unit 13 acquires the balance direction of the BGL account and the transaction direction of the BGL account; the balance direction is used for representing the limit of the account balance after BGL account transaction; the transaction direction is used to characterize the direction of flow of the transaction funds.
The BGL account balance direction refers to the limit of balance after BGL account transaction, and the BGL account balance direction has three types: the balance, debit balance, credit balance are not limited. The balance is not limited, namely the balance of the BGL account is not limited, the debit balance means that the balance of the BGL account cannot be larger than 0, and the credit balance means that the balance of the BGL account cannot be smaller than 0.
The direction of the transaction is the direction of flow of funds, which includes borrowers and lenders. Debit means a decrease in the balance of the account and credit means an increase in the direction of the balance.
The BGL service unit 13 determines the event type of the transaction event acquired in advance based on the balance direction and the transaction direction; the event type comprises a credible event after transaction or a credible event in transaction; the credible event after the transaction is used for representing the account balance so as to represent the credible event after the transaction is completed; the trusted event in the transaction represents a debit event of the account balance during the transaction.
Based on the balance direction and the transaction direction, the BGL service unit 13 determines the event type of the transaction event as follows:
the BGL service unit 13 determines whether the balance direction and the transaction direction are consistent.
When the balance direction is the debit balance direction and the transaction direction is the debit, the BGL service unit 13 determines that the balance direction is consistent with the transaction direction and determines that the event type of the transaction event is a post-transaction credible event; the debit balance direction is used for representing that the balance of the BGL account is less than 0; the debit is used to characterize the balance decrease of the BGL account.
When the balance direction is the credit side balance direction and the transaction direction is the credit side, the BGL service unit 13 determines that the balance direction is consistent with the transaction direction, and determines that the event type of the transaction event is a post-transaction credible event; the credit balance direction is used for representing that the balance of the BGL account is more than 0; the lender is used to characterize the balance increase of the BGL account.
When the balance direction is the debit balance direction and the transaction direction is the credit side, the BGL service unit 13 determines that the balance direction is inconsistent with the transaction direction, and determines that the event type of the transaction event is a credible event in the transaction.
When the balance direction is the credit balance direction and the transaction direction is the debit direction, the BGL service unit 13 determines that the balance direction is inconsistent with the transaction direction, and determines that the event type of the transaction event is a credible event in the transaction.
When the event type is a post-transaction credible event and the BGL account is in an available state, the BGL service unit 13 generates a first asynchronous posting message, and completes balance updating operation and account running record operation of the BGL account based on the first asynchronous posting message; the available state is used for representing that the BGL account can be billed;
and when the event type is a credible event in the transaction, the BGL account is in an available state and the account balance of the BGL account is not overdrawn, generating a second asynchronous account entry message, and finishing balance updating operation and account flow record operation of the BGL account based on the second asynchronous account entry message.
When the balance direction is not limited, the BGL service unit 13 determines that the event type of the transaction event is a post-transaction trusted event; unlimited balance the balance used to characterize a BGL account is unlimited.
When the event type is a trusted event after transaction and the BGL account is in an unavailable state, the BGL service unit 13 deletes the trusted event after transaction.
When the event type is the trusted event in the transaction and the BGL account is in an unavailable state or the account balance of the BGL account is overdrawn, the BGL service unit 13 deletes the trusted event in the transaction.
In the embodiment of the application, an event tracing mode is adopted, starting from the balance direction of a BGL account and the loan direction of a transaction, according to whether the balance direction of the BGL account is consistent with the loan direction of the transaction, the credibility of the transaction event is judged, the actual available balance of the account is calculated, the balance updating operation of the BGL account is converted into the writing operation of the BGL account with the event, the locking waiting of the account is eliminated, the efficiency of the financial transaction processing of the BGL account is improved, the condition that the fund safety problem is caused by the compensation transaction failure due to account overdraft when the transaction fails and rolls back can not occur, and therefore the safety of the financial processing of the BGL account is improved.
Referring to fig. 2, a schematic flow chart of a transaction processing method disclosed in an embodiment of the present application is shown, where the transaction processing method mainly includes the following steps:
s201: acquiring a balance direction of a BGL account and a transaction direction of the BGL account; the balance direction is used for representing the limit of the account balance after BGL account transaction; the transaction direction is used to characterize the direction of flow of the transaction funds.
The balance direction refers to the limit of balance after BGL account transaction, and the balance direction comprises the following steps: the balance, debit balance, credit balance are not limited.
The balance is not limited, namely the balance of the BGL account is not limited, the debit balance means that the balance of the account cannot be larger than 0, and the credit balance means that the balance of the account cannot be smaller than 0.
The transaction direction is the flow direction of funds, and there are two types: a borrower and a lender. Debit means a decrease in the balance of the account and credit means an increase in the direction of the balance.
S202: determining the event type of a transaction event acquired in advance based on the balance direction and the transaction direction; the event type comprises a credible event after transaction or a credible event in transaction; the credible event after the transaction is used for representing the account balance so as to represent the credible event after the transaction is completed; the transaction creditability event characterizes the creditability event of the account balance during the transaction.
The process of the acquired transaction event is as follows:
and when the cross-unit transaction calling request is received, acquiring a transaction event corresponding to the cross-unit transaction calling request. The cross-unit transaction calling request is a cross-unit transaction calling request of various service units under a distributed framework.
The process of determining the event type of the transaction event obtained in advance based on the balance direction and the transaction direction is shown as a1-a 5.
A1: and judging whether the balance direction is consistent with the transaction direction.
A2: when the balance direction is the debit balance direction and the transaction direction is the debit, determining that the balance direction is consistent with the transaction direction, and determining that the event type of the transaction event is a post-transaction credible event; the debit balance direction is used for representing that the balance of the BGL account is less than 0; the debit is used to characterize the balance decrease of the BGL account.
A3: when the balance direction is a credit side balance direction and the transaction direction is a credit side, determining that the balance direction is consistent with the transaction direction, and determining that the event type of the transaction event is a post-transaction credible event; the credit balance direction is used for representing that the balance of the BGL account is more than 0; the lender is used to characterize the balance increase of the BGL account.
A4: and when the balance direction is the debit balance direction and the transaction direction is the credit side, determining that the balance direction is inconsistent with the transaction direction and determining that the event type of the transaction event is a credible event in the transaction.
A5: and when the balance direction is a credit balance direction and the transaction direction is a debit direction, determining that the balance direction is inconsistent with the transaction direction and determining that the event type of the transaction event is a credible event in the transaction.
S203: when the event type is a credible event after transaction and the BGL account is in an available state, generating a first asynchronous account entry message, and finishing balance updating operation and account running record operation of the BGL account based on the first asynchronous account entry message; the available state is used for representing that the BGL account is billable.
In S203, the updating of the account balance and the recording of the account flow are completed according to the first asynchronous message, and the event status is updated to be account entry completed.
The first asynchronous posting Message is a Message Queue (MQ) type Message corresponding to a post-transaction trusted event, and posting information of a BGL account is stored in the MQ type Message.
The credible event after the transaction indicates that the BGL account balance is credible after the transaction is completed, and the account balance is the real-time balance of the database. In the transaction process, only whether the BGL account is available or not needs to be judged, if the BGL account is unavailable, the event is deleted, and if the BGL account is available, a first asynchronous account entry message is sent, so that the balance of the account is updated asynchronously, and the flow of the account is recorded asynchronously.
And when the event type is a post-transaction trusted event and the BGL account is in an unavailable state, deleting the post-transaction trusted event.
When the BGL account does not exist or is frozen, the BGL account is in an unavailable state.
S204: when the event type is a credible event in the transaction, the BGL account is in an available state, and the account balance of the BGL account is not overdrawn, generating a second asynchronous account entry message, and completing balance updating operation and account running record operation of the BGL account based on the second asynchronous account entry message.
In S204, the updating of the account balance and the recording of the account flow are completed according to the second asynchronous message, and the update event state is the completion of the posting.
And the second asynchronous posting message is an MQ type message corresponding to a trusted event in the transaction.
The credible event in the transaction indicates that the account balance is credible in the transaction process, and the BGL account balance is the sum of the real-time balance of the database and the transaction amount of all events which occur but are not finished to be posted. In the transaction process, whether an account is available or not needs to be judged, whether balance of a BGL account is overdrawn or not is judged, and when the event type is a credible event in the transaction and the BGL account is in an unavailable state or the balance of the BGL account is overdrawn, the credible event in the transaction is deleted. And if the BGL account is available and not overdrawn, sending a second asynchronous account entry message, and asynchronously updating the account balance and recording the account flow.
Optionally, when the balance direction is not limited, determining that the event type of the transaction event is a post-transaction credible event; unlimited balance the balance used to characterize a BGL account is unlimited.
To facilitate an understanding of the real-time balance calculation process for an account, it is described herein in connection with Table 1.
Event ID Event name Event status Account Amount of transaction Event creation time
00001 Debit event Has been completed A 100 15:57:08
00002 Debit event Has already occurred A 500 15:57:20
00003 Crediting event Has already occurred A 300 15:57:27
00004 Crediting event Has already occurred A 200 15:57:34
00005 Debit events Has already occurred A 300 15:57:43
TABLE 1
In table 1, for account a, the current account balance is 1000, the balance direction is credit, that is, the debit event is a trusted event in the transaction, the credit event is a trusted event after the transaction, and there are 5 events that have been recorded by the system. The transaction amount of the credible event after the transaction can be reflected in the account balance only after the event is completed, and the transaction amount of the credible event after the transaction is completed is already reflected in the account balance, so the real-time account balance does not calculate the credible event after the transaction, only the transaction amount of the credible event in the incomplete transaction, namely the transaction amounts of the events 00002 and 00005, is calculated, and the real-time balance of the account A is 200 (1000 plus 500 plus 300).
In the embodiment of the application, an event tracing mode is adopted, starting from the balance direction of a BGL account and the loan direction of a transaction, according to whether the balance direction of the BGL account is consistent with the loan direction of the transaction, the credibility of the transaction event is judged, the actual available balance of the account is calculated, the balance updating operation of the BGL account is converted into the writing operation of the BGL account with the event, the locking waiting of the account is eliminated, the efficiency of the financial transaction processing of the BGL account is improved, the condition that the fund safety problem is caused by the compensation transaction failure due to account overdraft when the transaction fails and rolls back can not occur, and therefore the safety of the financial processing of the BGL account is improved.
As the balance updating operation of the BGL account in the conventional operation is performed, when a transaction occurs, the BGL account records in the database are locked until the transaction is completed, and in the process, other transactions cannot acquire the BGL account lock and only can wait in a queue, namely lock waiting. The event mechanism (such as debit event, credit event, etc.) in the present application inserts an event record directly after receiving a transaction request, and there is no lock wait because there is no update operation, thereby increasing the concurrency of transactions.
Based on the transaction processing method disclosed in fig. 2 in the above embodiment, the embodiment of the present application further discloses a transaction processing system, and as shown in fig. 3, the transaction processing system includes an obtaining unit 301, a first determining unit 302, a first operating unit 303, and a second operating unit 304.
An obtaining unit 301, configured to obtain a balance direction of a BGL account and a transaction direction of the BGL account; the balance direction is used for representing the limit of the account balance after BGL account transaction; the transaction direction is used for characterizing the flow direction of transaction funds.
A first determining unit 302, configured to determine an event type of a transaction event acquired in advance based on a balance direction and a transaction direction; the event type comprises a credible event after transaction or a credible event in transaction; the credible event after the transaction is used for representing the account balance so as to represent the credible event after the transaction is completed; the transaction creditability event characterizes the creditability event of the account balance during the transaction.
The first operation unit 303 is configured to generate a first asynchronous posting message when the event type is a post-transaction trusted event and the BGL account is in an available state, and complete a balance update operation and an account flow record operation of the BGL account based on the first asynchronous posting message; the available state is used for representing that the BGL account is billable.
And a second operation unit 304, configured to generate a second asynchronous posting message when the event type is a trusted event in the transaction, the BGL account is in an available state, and the account balance of the BGL account is not overdrawn, and complete a balance update operation and an account flow record operation of the BGL account based on the second asynchronous posting message.
Further, the determining unit for acquiring the process of the transaction event is specifically configured to acquire the transaction event corresponding to the cross-unit transaction calling request when the cross-unit transaction calling request is received; the cross-unit transaction calling request is a cross-unit transaction calling request of various service units under a distributed framework.
Further, the first determining unit 302 includes a judging module, a first determining module, a second determining module, a third determining module, and a fourth determining module.
And the judging module is used for judging whether the balance direction is consistent with the transaction direction.
The first determining module is used for determining that the balance direction is consistent with the transaction direction and determining that the event type of the transaction event is a post-transaction credible event when the balance direction is a debit balance direction and the transaction direction is a debit; the debit balance direction is used for representing that the balance of the BGL account is less than 0; the debit is used to characterize the balance decrease of the BGL account.
The second determining module is used for determining that the balance direction is consistent with the transaction direction and determining that the event type of the transaction event is a post-transaction credible event when the balance direction is a credit balance direction and the transaction direction is a credit; the lender balance direction is used for representing that the balance of the BGL account is more than 0; the lender is used to characterize the balance increase of the BGL account.
And the third determining module is used for determining that the balance direction is inconsistent with the transaction direction and determining that the event type of the transaction event is a credible event in the transaction when the balance direction is the debit balance direction and the transaction direction is the credit side.
And the fourth determining module is used for determining that the balance direction is inconsistent with the transaction direction and determining that the event type of the transaction event is a credible event in the transaction when the balance direction is a credit balance direction and the transaction direction is a debit direction.
Further, the transaction processing system further comprises a second determination unit.
The second determining unit is used for determining the event type of the transaction event as a post-transaction credible event when the balance direction is not limited; unlimited balance the balance used to characterize a BGL account is unlimited.
Further, the device also comprises a first deleting unit.
The first deleting unit is used for deleting the post-transaction trusted event when the event type is the post-transaction trusted event and the BGL account is in the unavailable state.
Further, a second deleting unit is also included.
And the second deleting unit is used for deleting the credible event in the transaction when the event type is the credible event in the transaction and the BGL account is in an unavailable state or the account balance of the BGL account is overdrawn.
In the embodiment of the application, an event tracing mode is adopted, starting from the balance direction of a BGL account and the loan direction of a transaction, according to whether the balance direction of the BGL account is consistent with the loan direction of the transaction, the credibility of the transaction event is judged, the actual available balance of the account is calculated, the balance updating operation of the BGL account is converted into the writing operation of the BGL account with the event, the locking waiting of the account is eliminated, the efficiency of the financial transaction processing of the BGL account is improved, the condition that the fund safety problem is caused by the compensation transaction failure due to account overdraft when the transaction fails and rolls back can not occur, and therefore the safety of the financial processing of the BGL account is improved.
The embodiment of the application also provides a storage medium, wherein the storage medium comprises stored instructions, and when the instructions are executed, the equipment where the storage medium is located is controlled to execute the transaction processing method.
The embodiment of the present application further provides an electronic device, which has a schematic structural diagram as shown in fig. 4, and specifically includes a memory 401 and one or more instructions 402, where the one or more instructions 402 are stored in the memory 401, and are configured to be executed by one or more processors 403 to execute the one or more instructions 402 to perform the transaction processing method.
While, for purposes of simplicity of explanation, the foregoing method embodiments have been described as a series of acts or combination of acts, it will be appreciated by those skilled in the art that the present application is not limited by the order of acts or acts described, as some steps may occur in other orders or concurrently with other steps in accordance with the application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
It should be noted that, in the present specification, the embodiments are all described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. For the system-class embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The steps in the method of the embodiments of the present application may be sequentially adjusted, combined, and deleted according to actual needs.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The foregoing is only a preferred embodiment of the present application and it should be noted that those skilled in the art can make several improvements and modifications without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.

Claims (10)

1. A transaction processing method, the method comprising:
acquiring the balance direction of the BGL account and the transaction direction of the BGL account; the balance direction is used for representing the limit of the account balance after BGL account transaction; the transaction direction is used for representing the flow direction of transaction funds;
determining an event type of a pre-acquired transaction event based on the balance direction and the transaction direction; the event type comprises a credible event after transaction or a credible event in transaction; the post-transaction credible event is used for representing an account balance so as to represent a credible event after the transaction is completed; the credible event in the transaction represents the credible event of the account balance in the transaction process;
when the event type is the post-transaction credible event and the BGL account is in an available state, generating a first asynchronous account entry message, and finishing balance updating operation and account running record operation of the BGL account based on the first asynchronous account entry message; the available state is used for representing that the BGL account is available for posting;
and when the event type is a credible event in the transaction, the BGL account is in an available state and the account balance of the BGL account is not overdrawn, generating a second asynchronous account entry message, and finishing balance updating operation and account running record operation of the BGL account based on the second asynchronous account entry message.
2. The method of claim 1, wherein the process of obtaining a transaction event comprises:
when a cross-unit transaction calling request is received, acquiring a transaction event corresponding to the cross-unit transaction calling request; the cross-unit transaction calling request is a cross-unit transaction calling request of various service units under a distributed framework.
3. The method of claim 2, wherein the determining an event type of the pre-acquired transaction event based on the balance direction and the transaction direction comprises:
judging whether the balance direction is consistent with the transaction direction;
when the balance direction is a debit balance direction and the transaction direction is a debit, determining that the balance direction is consistent with the transaction direction, and determining that the event type of the transaction event is a post-transaction credible event; the debit balance direction is used for representing that the balance of the BGL account is less than 0; the debit is used for representing balance reduction of the BGL account;
when the balance direction is a credit side balance direction and the transaction direction is a credit side, determining that the balance direction is consistent with the transaction direction, and determining that the event type of the transaction event is a post-transaction credible event; the lender balance direction is used to characterize the balance of the BGL account as greater than 0; the lender is used for representing balance increase of the BGL account;
when the balance direction is the debit balance direction and the transaction direction is the credit side, determining that the balance direction is inconsistent with the transaction direction and determining that the event type of the transaction event is a credible event in the transaction;
and when the balance direction is the credit side balance direction and the transaction direction is the debit side, determining that the balance direction is inconsistent with the transaction direction, and determining that the event type of the transaction event is a credible event in the transaction.
4. The method of claim 3, further comprising:
when the balance direction is not limited, determining the event type of the transaction event as a credible event after the transaction; the unrestricted balance is used to characterize the balance of the BGL account as unrestricted.
5. The method of claim 1, further comprising:
and when the event type is the post-transaction trusted event and the BGL account is in an unavailable state, deleting the post-transaction trusted event.
6. The method of claim 1, further comprising:
and when the event type is a credible event in the transaction and the BGL account is in an unavailable state or the account balance of the BGL account is overdrawn, deleting the credible event in the transaction.
7. A transaction processing system, the system comprising:
the acquiring unit is used for acquiring the balance direction of the BGL account and the transaction direction of the BGL account; the balance direction is used for representing the limit of the account balance after BGL account transaction; the transaction direction is used for representing the flow direction of transaction funds;
the first determining unit is used for determining the event type of a transaction event acquired in advance based on the balance direction and the transaction direction; the event type comprises a credible event after transaction or a credible event in transaction; the credible event after the transaction is used for representing the account balance so as to obtain the credible event after the transaction is completed; the credible event in the transaction represents the credible event of the account balance in the transaction process;
the first operation unit is used for generating a first asynchronous posting message when the event type is the post-transaction credible event and the BGL account is in an available state, and finishing balance updating operation and account running record operation of the BGL account based on the first asynchronous posting message; the available state is used for representing that the BGL account is available for posting;
and the second operation unit is used for generating a second asynchronous account entry message when the event type is a credible event in the transaction, the BGL account is in an available state and the account balance of the BGL account is not overdrawn, and finishing balance updating operation and account running record operation of the BGL account based on the second asynchronous account entry message.
8. The system according to claim 7, characterized in that the determining unit of the process of obtaining transaction events is specifically configured to:
when a cross-unit transaction calling request is received, acquiring a transaction event corresponding to the cross-unit transaction calling request; the cross-unit transaction calling request is a cross-unit transaction calling request of various service units under a distributed framework.
9. A storage medium comprising stored instructions, wherein the instructions, when executed, control a device on which the storage medium resides to perform a transaction processing method as claimed in any one of claims 1 to 6.
10. An electronic device comprising a memory and one or more instructions, wherein the one or more instructions are stored in the memory and configured to be executed by the one or more processors to perform the transaction processing method of any of claims 1-6.
CN202210654250.1A 2022-06-10 2022-06-10 Transaction processing method, system, storage medium and electronic equipment Pending CN114971874A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210654250.1A CN114971874A (en) 2022-06-10 2022-06-10 Transaction processing method, system, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210654250.1A CN114971874A (en) 2022-06-10 2022-06-10 Transaction processing method, system, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN114971874A true CN114971874A (en) 2022-08-30

Family

ID=82960734

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210654250.1A Pending CN114971874A (en) 2022-06-10 2022-06-10 Transaction processing method, system, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN114971874A (en)

Similar Documents

Publication Publication Date Title
US7513418B2 (en) Systems and methods for performing a simplified risk assessment
US20180197167A1 (en) System and method for person-to-person payments
US8645264B2 (en) Apparatus and methods for verifying a credit applicant's income that enhance a credit applicant's experience
CN111259083A (en) Distributed transaction processing method and device
CN108762895B (en) Method and device for processing distributed transaction
CN110298644B (en) Account additional money method, account additional money device, server and readable storage medium
US9195978B1 (en) Dynamic query sequences for retrieval of negotiable instrument image
CN114971874A (en) Transaction processing method, system, storage medium and electronic equipment
AU2008323996B2 (en) Financial transaction funds collection and distribution
CN115860952A (en) Transaction processing method and device
CN115271694A (en) Order payment method and system
CN113034125A (en) Transaction account separating method and system
CN113064837A (en) Database benchmark test method and device based on transaction scene
JP2003168004A (en) Method for processing payment, method for processing financing certification and financial institution system
CN114240610B (en) Automatic fund collection method, device, computer equipment and storage medium
CN115018325B (en) Service processing method and device
CN115526722B (en) Method and device for processing positive flushing transaction
JP6890753B1 (en) Pooling management system, pooling management method and pooling management program
CN117036031A (en) Account hanging processing method, device, equipment and storage medium
CN117635355A (en) Tax data processing method, electronic device, storage medium and program product
CN116362754A (en) Transaction processing method and device
JP2001195528A (en) Account settlement system and account settlement processing method
CN114998019A (en) Transaction processing method and device, electronic equipment and readable storage medium
CN118014573A (en) Method, system and equipment for controlling limit of digital RMB wallet
CN116485407A (en) Transaction resource processing method, system, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination