Computer-implemented hot spot account transaction processing method and apparatus, storage medium

By creating hot account log statements and frozen account log statements in the banking system, and periodically summarizing and updating the balances, the problem of limited concurrent write capability for hot accounts was solved, enabling fast and efficient account balance processing and reducing hardware costs.

CN116012002BActive Publication Date: 2025-11-25BEIJING JIEHUI TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202211664755.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-23
Publication Date
2025-11-25
Estimated Expiration
2042-12-23

AI Technical Summary

Technical Problem

The concurrent write capability of popular accounts in banking systems is limited, leading to database response delays or even crashes. Existing technologies that address this issue using pessimistic locking suffer from high costs and affect the efficiency of concurrent operations.

Method used

By creating a hot account inflow log table and a freeze log table, the account balance is summarized and updated regularly, reducing direct write operations to hot account data, using idempotent checks to prevent duplicate transactions, and using a cached database to synchronize data.

Benefits of technology

It improves the concurrent write capability of hot accounts, quickly processes account balance changes, avoids database crashes, and reduces hardware costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116012002B_ABST
    Figure CN116012002B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of computer, and specifically provides a computer-implemented hot account transaction processing method and device and storage medium, aiming at solving the problem that multiple concurrent users need to queue and wait when operating the same hot account and the cost cannot be increased. For this purpose, the computer-implemented hot account transaction processing method of the present application comprises: when there is a request for account debiting or crediting, if the account is a hot account, storing the hot account data in a relational database; in the account crediting request stage, creating a hot account credit log serial table, and updating the balance of the hot account data according to the hot account credit log serial table and the hot account data in the relational database; in the account debiting request stage, creating a hot account freezing log serial table and a hot account data cache table, and updating the balance of the hot account data according to the hot account freezing log serial table, the hot account data cache table and the hot account data.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, and particularly provides a computer-implemented hot account transaction processing method and device, a storage medium and a control device. BACKGROUND

[0002] In the current bank business system, there are often a large number of business transactions for the same account, for example, frequent transfer of the same account needs to update the account record in the database, and we usually call the account with a transaction concurrency of up to 500 per second as a hot account.

[0003] Generally, for updating an account record in the bank business system, the following process is needed, first, the data of the account record is locked using the pessimistic lock in the relational database, after the lock is completed, the balance is updated, and then the lock of the pessimistic lock is released, which is to prevent other businesses from also operating the account data at the same time, avoid unnecessary data errors, and ensure that only one business subject operates the account data at the same time. But in this process, the concurrent write ability of the account operation is affected, assuming that the database needs 10 milliseconds to update the data once, and if a hot account with a large transaction concurrency is encountered, several thousand or even ten thousand operations need to be processed within a minute, then the database will not be able to respond in time and finally crash.

[0004] Correspondingly, there is a need in the art for a new computer-implemented hot account transaction processing scheme to solve the above problems. SUMMARY

[0005] The present application aims to solve the above technical problems, that is, to solve the technical problems that multiple concurrent users need to queue and wait for the same hot account and the cost cannot be increased, and the present application provides a computer-implemented hot account transaction processing method and device, and a storage medium.

[0006] In a first aspect, the present application provides a computer-implemented hot account transaction processing method, which comprises:

[0007] When there is a request for account debiting or account crediting, it is determined whether the account debiting request account or the account crediting request account is a hot account, and if so, the hot account data is stored in a relational database;

[0008] In the account crediting request stage of the hot account, a hot account account crediting log sequence table is created, and the balance of the hot account data is updated according to the hot account account crediting log sequence table and the hot account data in the relational database;

[0009] In the account-out request phase of the hot account, a hot account frozen log table and a cached hot account data table are created, and the balance of the hot account data is updated in a timely manner according to the hot account frozen log table, the cached hot account data table and the hot account data in the relational database.

[0010] In one of the above technical solutions of the computer-implemented hot account transaction processing method, in the account-in request phase of the hot account, a hot account account-in log table is created, and the balance of the hot account data is updated in a timely manner according to the hot account account-in log table and the hot account data in the relational database, including:

[0011] A hot account account-in log table is created in the relational database.

[0012] In response to the account-in request of the hot account, the account-in request of the hot account is recorded in the hot account account-in log table.

[0013] The hot account account-in log table is scanned in a timely manner, the account-in amount of the hot account account-in log table is summarized, the summarized account-in amount is added to the corresponding hot account data in the relational database, and the balance of the updated hot account data is obtained.

[0014] In the scanning of the hot account account-in log table, the summarization of the account-in amount of the hot account account-in log table and the updating of the balance of the hot account data, the hot account data is locked by using a pessimistic lock; after the balance of the hot account data is updated, the pessimistic lock is released.

[0015] In one of the above technical solutions of the computer-implemented hot account transaction processing method, before the account-in request of the hot account is recorded in the hot account account-in log table, the method further includes:

[0016] The hot account is idempotently checked according to the serial number in the message header of the account-in request of the hot account.

[0017] In one of the above technical solutions of the computer-implemented hot account transaction processing method, in the account-out request phase of the hot account, a hot account frozen log table and a cached hot account data table are created, and the balance of the hot account data is updated in a timely manner according to the hot account frozen log table, the cached hot account data table and the hot account data in the relational database, including:

[0018] A cached hot account data table corresponding to the hot account data is created in the cached database, and the hot account data is synchronized to the cached hot account data table.

[0019] create a hot account frozen log stream table in the relational database;

[0020] in response to the hot account withdrawal request, determine whether the balance in the cached hot account data table is greater than the withdrawal amount, if yes, record the hot account withdrawal request to the hot account frozen log stream table, and update the available balance of the cached hot account data table;

[0021] scan the hot account withdrawal log stream table at regular intervals, aggregate the withdrawal amount of the hot account withdrawal log stream table, and when the updated available balance of the cached hot account data table is greater than zero, subtract the aggregated withdrawal amount of the hot account withdrawal log stream table from the corresponding hot account data in the relational database to obtain the updated balance of the hot account data;

[0022] wherein, when scanning the hot account withdrawal log stream table, aggregating the withdrawal amount of the hot account withdrawal log stream table, and updating the balance of the hot account data, the hot account data is locked using a pessimistic lock; after updating the balance of the hot account data, the pessimistic lock is released.

[0023] In one of the above computer-implemented hot account transaction processing methods, the method further comprises:

[0024] in response to the hot account withdrawal request, determine whether the balance in the cached hot account data table is greater than the withdrawal amount, if not, send a balance insufficient reminder notification.

[0025] In one of the above computer-implemented hot account transaction processing methods, before determining whether the balance in the cached hot account data table is greater than the withdrawal amount, the method further comprises:

[0026] performing idempotent check on the hot account according to the serial number in the message header of the hot account withdrawal request.

[0027] In one of the above computer-implemented hot account transaction processing methods, the idempotent check on the hot account according to the serial number in the message header of the hot account withdrawal request comprises:

[0028] checking whether the hot account withdrawal order exists;

[0029] if it exists, verifying whether the hot account withdrawal order and its unfreezing type are consistent;

[0030] if consistent, storing the withdrawal unfreezing request in the hot account frozen log stream table.

[0031] In a second aspect, the present application provides a computer-implemented hotspot account transaction processing device, which comprises:

[0032] A query module is configured to query whether an account with a debit or credit request is a hotspot account when the account has a debit or credit request, and store hotspot account data in a relational database if the account is a hotspot account.

[0033] A credit module is configured to create a hotspot account credit log sheet during a credit request phase of the hotspot account, and update a balance of the hotspot account data in the relational database according to the hotspot account credit log sheet and the hotspot account data.

[0034] A debit module is configured to create a hotspot account frozen log sheet and a cached hotspot account data table during a debit request phase of the hotspot account, and update the balance of the hotspot account data in the relational database according to the hotspot account frozen log sheet, the cached hotspot account data table, and the hotspot account data.

[0035] In a third aspect, the present application provides a control device, which comprises a processor and a storage device adapted to store a plurality of program codes adapted to be loaded and run by the processor to perform the method described in any one of the technical solutions of the above computer-implemented hotspot account transaction processing method.

[0036] In a fourth aspect, the present application provides a computer-readable storage medium having a plurality of program codes stored therein, which are adapted to be loaded and run by a processor to perform the method described in any one of the technical solutions of the above computer-implemented hotspot account transaction processing method.

[0037] The above one or more technical solutions of the present application have at least one or more of the following advantages

[0038] Advantages:

[0039] In the implementation of the technical solutions of the present application, a computer-implemented hotspot account transaction processing method is proposed, which aims to improve the concurrent write capability of the hotspot account by reducing the frequent balance changes of the hotspot account, and can rapidly process the account balance concurrently, and does not directly perform write operation on the hotspot account data itself, but establishes a hotspot account credit log sheet and a hotspot account frozen log sheet, batch aggregates the credit or debit information through the logs, and uniformly completes the change of the balance of the hotspot account according to the batch aggregated credit or debit information. BRIEF DESCRIPTION OF DRAWINGS

[0040] The disclosure of the present application will become more fully understood from the detailed description given herein below, and appended drawings. It is understood that these drawings are not intended to limit the scope of the present application, and that they are merely intended to accentuate and highlight the present application. Like reference numerals are intended to represent similar and / or analogous elements and features.

[0041] Figure 1 is a main flow chart of the computer-implemented hot spot account transaction processing method according to an embodiment of the present application;

[0042] Figure 2 is a main flow chart of step S102 according to an embodiment of the present application;

[0043] Figure 3 is a main flow chart of step S103 according to an embodiment of the present application;

[0044] Figure 4 is a main structure block diagram of the computer-implemented hot spot account transaction processing apparatus according to an embodiment of the present application;

[0045] Figure 5 is a main structure block diagram of the control apparatus according to an embodiment of the present application. DETAILED DESCRIPTION

[0046] Some embodiments of the present application will be described below with reference to the accompanying drawings. It is understood that these embodiments are only used to explain the technical principles of the present application, and are not intended to limit the protection scope of the present application.

[0047] In the description of the present application, "module" and "processor" can include hardware, software or a combination of both. A module can include hardware circuitry, various suitable sensors, communication ports, memories, and can also include a software part such as program code, and can be a combination of software and hardware. The processor can be a central processing unit, a microprocessor, a graphic processing unit, a digital signal processor or any other suitable processor. The processor has data and / or signal processing functions. The processor can be implemented in software, hardware or a combination of both. The non-transitory computer readable storage medium includes any suitable medium that can store program code, such as a magnetic disk, a hard disk, an optical disk, a flash memory, a read-only memory, a random access memory and the like. The term "A and / or B" means all possible combinations of A and B, such as only A, only B or both A and B. The term "at least one of A or B" or "at least one of A and B" has a similar meaning as "A and / or B", and can include only A, only B or both A and B. The singular form of the term "one", "this" can also include the plural form.

[0048] Generally, when a large-scale fund movement occurs in a single account (such as a fee account) at a moment in a transaction system of a bank or a third-party payment institution, the account needs to be controlled to ensure the accuracy of the account balance change. Generally, the transaction processing method for such an account (hereinafter collectively referred to as a hot account) mostly uses a pessimistic lock in a relational database to control. The pessimistic lock in the relational database is used every time the hot account is operated to prevent other users from simultaneously operating the account, causing, for example, the balance in the hot account to be inaccurate.

[0049] For example, in the hot account credit stage, multiple customers simultaneously make payment to account A, and when a customer makes a payment, the payment system sends a payment request to the accounting system, and the accounting system directly writes data to account A of the relational database to change the balance. At this time, the relational database will use the pessimistic lock to lock account A, and other customers can only wait for account A to be unlocked. For example, in the hot account debit stage, when account A makes a payment to a payment account, the accounting system directly writes data to the payment account to change the balance of the payment account, and at this time, the pessimistic lock is also used to lock the payment account, and other accounts such as account B or account C can only wait for the payment account to be unlocked before making a transfer operation to the payment account.

[0050] In order to solve the problem of queuing and waiting of multiple concurrent users operating the same hot account and not increasing the cost of hardware overhead, the present application provides a computer-implemented hot account transaction processing method and device, a storage medium and a control device. The computer-implemented hot account transaction processing method can improve the concurrent write capability of the hot account by reducing the frequent balance change of the hot account, can process the account balance concurrently more quickly, and does not directly write to the hot account data itself, but establishes a hot account credit log stream table and a hot account frozen log stream table, batch aggregates the credit or debit information through the log, and uniformly completes the balance change of the hot account according to the batch aggregated credit or debit information.

[0051] Referring to the accompanying Figure 1 , Figure 1 is a main step flow diagram of the computer-implemented hot account transaction processing method according to an embodiment of the present application. As shown in Figure 1 , the computer-implemented hot account transaction processing method in the embodiment of the present application mainly includes the following steps S101-S103.

[0052] Step S101: When there is a debit or credit request for an account, it is queried whether the debit request account or the credit request account is a hot account, and if so, the hot account data is stored in the relational database.

[0053] In this embodiment, if an account is frequently operated, i.e., read and written frequently, the account is a hot account.

[0054] In one embodiment, in the specific scenario of third-party payment, in the account entry stage, for example, a merchant sets up accounts A, B and C in a third-party payment company (such as Alipay), and the account A of the merchant is frequently traded, for example, in the scenarios of shopping in a supermarket or dining in a restaurant, 2000 entries are made to the account A of the merchant per second by customers through card swiping / code scanning, and the account A of the merchant is a hot account.

[0055] The hot account data is stored in a relational database, such as an oracle database, and the read and write operations are operations on the hot account data stored in the relational database.

[0056] In step S102, a hot account entry log serial table is created in the account entry request stage of the hot account, and the balance of the hot account data is updated in a timely manner according to the hot account entry log serial table and the hot account data in the relational database.

[0057] In this embodiment, the hot account entry log serial table records the entry request information of the hot account in a period of time, and when a customer makes a transfer to the hot account recorded in the hot account entry log serial table, the account entry request information is recorded in the hot account entry log serial table in response to the transaction system initiating the entry request information, wherein the entry request information includes the number of the hot account of the merchant, the transaction amount, the transaction time and other information.

[0058] In one embodiment, the hot account entry log serial table is stored in the same database as the relational database where the hot account data is stored, i.e., also stored in the oracle database, and when a customer swipes a card or scans a consumption on the pos machine of a merchant, the transaction system of the third-party payment company sends the entry request information of the hot account of the merchant to the account system. After the account system receives the entry request information of the hot account of the merchant sent by the transaction system of the third-party payment company, the entry request information of the hot account of the merchant is stored in the hot account entry log serial table in the oracle database.

[0059] Every interval, scan the hot account entry log serial table, then summarize the hot account entry log serial table of the interval, and update the balance of the hot account data according to the summarized hot account entry log serial table and the hot account data before the interval of the entry stage.

[0060] In one embodiment of the present application, before the hot account credit request is recorded in the hot account credit log table, the method further comprises:

[0061] The hot account is idempotently checked according to the serial number in the message header of the hot account credit request.

[0062] In one specific example, in response to the transaction system initiating the credit request information, before the account system records the hot account credit request information in the hot account credit log table, the account system idempotently checks the hot account according to the serial number in the message header of the hot account credit request, which can prevent the hot account from being repeatedly credited and prevent the loss of assets of the customer or the third-party payment company.

[0063] Step S103: In the hot account debit request phase, a hot account freezing log table and a cached hot account data table are created, and the balance of the hot account data is updated in real time according to the hot account freezing log table, the cached hot account data table, and the hot account data in the relational database.

[0064] In this embodiment, in the hot account debit request phase, including fund freezing, fund unfreezing, and updating hot account data, first, for the fund freezing aspect, a hot account freezing log table is established in a relational database such as an oracle database, wherein the hot account freezing log table is used to record the fund freezing information of the hot account within a period of time, and the frozen fund exists in the bank account and cannot be operated during the fund freezing period. After the fund is unfrozen, the balance of the hot account is updated.

[0065] In one embodiment, a cached hot account data table is established in a cached database, the cached hot account data table contains a cached account corresponding to the hot account, and the current balance of the hot account data is initialized to the cached database, wherein the cached database is, for example, a redis database. When a merchant uses account A for settlement, that is, when the merchant uses account A to transfer money to other bank accounts, the merchant initiates a settlement request, and the settlement system sends a freezing request to the account system after receiving the settlement request. The account system stores the hot account debit request information of the merchant, that is, the freezing request information, in the hot account freezing log table in the oracle database.

[0066] The hot account freezing log table is scanned every interval, and the balance of the hot account data is updated in real time according to the hot account freezing log table, the cached hot account data table, and the hot account data in the relational database.

[0067] The steps S101-S103 are further described as follows.

[0068] In one embodiment of the embodiment of the application, as shown in Figure 2 The account entry request phase of the hotspot account includes creating a hotspot account entry log table, and updating the balance of the hotspot account data in the relational database according to the hotspot account entry log table and the hotspot account data.

[0069] Step S1021: creating a hotspot account entry log table in the relational database;

[0070] Step S1022: recording the account entry request of the hotspot account into the hotspot account entry log table in response to the account entry request of the hotspot account;

[0071] Step S1023: periodically scanning the hotspot account entry log table, summing up the account entry amount of the hotspot account entry log table, adding the summed account entry amount to the corresponding hotspot account data in the relational database, and obtaining the updated balance of the hotspot account data;

[0072] In the scanning of the hotspot account entry log table, the summing up of the account entry amount of the hotspot account entry log table, and the updating of the balance of the hotspot account data, the hotspot account data is locked by using a pessimistic lock. After the updating of the balance of the hotspot account data is completed, the pessimistic lock is released.

[0073] In one specific example, a hotspot account entry log table is established in the relational database to record the account entry request information of the hotspot account in a period of time. When a customer performs card swiping or scanning consumption on the pos machine of a merchant, the transaction system of the third-party payment company sends the account entry request information of the hotspot account of the merchant to the account system. After receiving the account entry request information of the hotspot account of the merchant sent by the transaction system of the third-party payment company, the account system stores the account entry request information of the hotspot account of the merchant in the hotspot account entry log table in the oracle database.

[0074] Afterwards, the hot account entry log stream table is scanned in time, the entry amount of the hot account entry log stream table is summarized, the summarized entry amount is added to the corresponding hot account data in the relational database, and the balance of the updated hot account data is obtained. For example, the scanning is performed at 11:00 am every day, the record of the entry request information in the hot account entry log stream table before 11:00 am every day is obtained, when the scanning is performed, the hot account data is locked by using the pessimistic lock, the process of locking also includes summarizing the entry amount of the hot account entry log stream table and updating the balance of the hot account data. When the entry amount of the hot account entry log stream table is summarized, the summarized entry amount is added to the corresponding hot account data in the relational database, and the balance of the updated hot account data is obtained. When the balance of the hot account data is updated, the pessimistic lock is released.

[0075] The above embodiment can not directly perform a write operation on the hot account itself, but can establish a hot account entry log stream table, batch summarize entry information through the hot account entry log stream table, and uniformly update the balance of the hot account according to the batch summarized entry information.

[0076] In one embodiment of the embodiment of the application, as shown in Figure 3 the account request phase of the hot account, a hot account freezing log stream table and a cache hot account data table are created, the balance of the hot account data is updated in time according to the hot account freezing log stream table, the cache hot account data table and the hot account data in the relational database, and the method comprises the following steps.

[0077] Step S1031: a cache hot account data table corresponding to the hot account data is created in the cache database, and the hot account data is synchronized to the cache hot account data table.

[0078] Step S1032: a hot account freezing log stream table is created in the relational database.

[0079] Step S1033: in response to the account request of the hot account, it is judged whether the balance in the cache hot account data table is greater than the account amount, if yes, the account request of the hot account is recorded to the hot account freezing log stream table, and the available balance of the cache hot account data table is updated.

[0080] Step S1034: the hot account entry log stream table is scanned in time, the account amount of the hot account entry log stream table is summarized, when the updated available balance of the cache hot account data table is greater than zero, the corresponding hot account data in the relational database is subtracted by the summarized account amount of the hot account entry log stream table, and the balance of the updated hot account data is obtained.

[0081] wherein, in scanning the hot account out-account log stream table, summing up the out-account amount of the hot account out-account log stream table and updating the balance of the hot account data, the hot account data is locked using a pessimistic lock; after the balance of the hot account data is updated, the pessimistic lock is released.

[0082] In one specific example, the current balance of a hot account is initialized into a cache database, specifically, a cache hot account data table corresponding to the hot account is created in a redis database, and the balance of the hot account is written into the cache hot account data table. A hot account freezing log stream table is created in a relational database to record the freezing information of the hot account in a period of time. When a merchant uses account A to settle, that is, when the merchant uses account A to transfer to other bank accounts, the merchant initiates a settlement request, and the settlement system sends a freezing request to the account system after receiving the settlement request. The account system judges whether the balance in the cache hot account data table stored in redis is sufficient, for example, whether the balance is greater than 100 yuan. If the available balance is sufficient, the freezing request information is stored in the hot account freezing log stream table in the oracle database, and the balance in the cache hot account data table stored in redis is reduced by the amount to be debited, and the available balance of the cache hot account data table is updated.

[0083] Then, the settlement unfreezing operation of the hot account is performed, that is, the settlement system initiates an unfreezing request to the account system, and the account system performs idempotent verification.

[0084] In one embodiment of the embodiment of the application, before judging whether the balance in the cache hot account data table is greater than the out-account amount, the method further comprises:

[0085] The hot account is subjected to idempotent verification according to the serial number in the message header of the out-account request of the hot account. This embodiment can prevent the hot account from repeatedly debiting and prevent the loss of funds of the hot account.

[0086] In one embodiment of the embodiment of the application, the idempotent verification of the hot account according to the serial number in the message header of the out-account request of the hot account comprises:

[0087] checking whether the out-account order of the hot account exists;

[0088] If it exists, checking whether the out-account order of the hot account is consistent with the unfreezing type thereof;

[0089] If consistent, storing the out-account unfreezing request in the hot account freezing log stream table.

[0090] In one specific example, it is checked whether a hot account original freeze order (outbound order) exists. If the hot account original freeze order exists and the unfreezing type (for example, including multiple types such as settlement freeze and risk control freeze, and in the settlement scenario, the unfreezing type is settlement freeze, which means that the types are consistent) and the unfreezing amount are consistent, the unfreezing request information is stored in the hot account freeze log table in the oracle database; if the type or the amount is inconsistent, it is prompted that the unfreezing cannot be completed.

[0091] After the unfreezing is completed, the balance of the hot account can be updated. Specifically, the hot account outbound log table is scanned at a fixed time, the outbound amount of the hot account outbound log table is summarized, and when the available balance of the updated cache hot account data table is still greater than zero, the corresponding hot account data in the relational database is subtracted by the summarized outbound amount of the hot account outbound log table, to obtain the updated balance of the hot account data. Or the balance of the hot account data is directly updated according to the available balance recorded in the cache hot account data table.

[0092] In the scanning of the hot account outbound log table, the summarizing of the outbound amount of the hot account outbound log table, and the updating of the balance of the hot account data, the hot account data is locked by using a pessimistic lock; after the balance of the hot account data is updated, the pessimistic lock is released. For example, a scanning task is executed at 14:00, the outbound information recorded in the hot account outbound log table before 14:00 of the day is obtained, and the balance of the hot account in the relational database and the balance of the hot account in the cache data redis are updated, and then the pessimistic lock is released. After the balance of the hot account data is updated, the cache account in the cache hot account data table in redis is synchronized, so that the two are consistent.

[0093] The above embodiment can not directly perform a write operation on the hot account itself, but can establish a hot account outbound log table, batch summarize the outbound information through the hot account outbound log table, and uniformly complete the change of the balance of the hot account according to the batch summarized outbound information and the cache hot account data table corresponding to the hot account recorded in the cache database.

[0094] In one embodiment of the embodiment of the application, the method further comprises:

[0095] In response to the outbound request of the hot account, it is judged whether the balance in the cache hot account data table is greater than the outbound amount, and if not, a balance insufficient prompt notification is sent.

[0096] Based on the steps S101-S103, a computer-implemented hotspot account transaction processing method is provided, which aims to improve the concurrent write ability of the hotspot account by reducing the frequent balance changes of the hotspot account, can process the account balance concurrently more quickly, and does not directly perform write operation on the hotspot account data itself, but establishes a hotspot account entry log table and a hotspot account frozen log table, batch collects entry or withdrawal information through the logs, and uniformly completes the change of the balance of the hotspot account according to the batch-collected entry or withdrawal information.

[0097] It should be noted that, although the steps in the above embodiments are described in a specific order, those skilled in the art can understand that, in order to achieve the effect of the present application, the different steps do not have to be executed in such an order, and can be executed simultaneously (in parallel) or in other orders, and these changes are within the protection scope of the present application.

[0098] Further, the present application also provides a computer-implemented hotspot account transaction processing device.

[0099] Reference is made to the accompanying drawings Figure 4 , Figure 4 is the main structure block diagram of the computer-implemented hotspot account transaction processing device according to an embodiment of the present application. As shown in Figure 4 , the computer-implemented hotspot account transaction processing device in the embodiment of the present application mainly includes a query module 11, an entry module 12 and a withdrawal module 13. In some embodiments, the query module 11 can be configured to query whether an account with a withdrawal request or an entry request is a hotspot account when there is a withdrawal request or an entry request, and if so, store the hotspot account data in a relational database. The entry module 12 can be configured to create a hotspot account entry log table in the entry request stage of the hotspot account, and update the balance of the hotspot account data in the relational database according to the hotspot account entry log table and the hotspot account data. The withdrawal module 13 can be configured to create a hotspot account frozen log table and a cached hotspot account data table in the withdrawal request stage of the hotspot account, and update the balance of the hotspot account data in the relational database according to the hotspot account frozen log table, the cached hotspot account data table and the hotspot account data. In one embodiment, the description of the specific implementation function can be referred to the steps S101-S103.

[0100] The computer-implemented hotspot account transaction processing device described above is used for executing Figure 1The computer-implemented hot account transaction processing method embodiments shown, the technical principles, the technical problems solved and the technical effects produced are similar, and the person skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process and related description of the computer-implemented hot account transaction processing device can refer to the description of the computer-implemented hot account transaction processing method embodiments, which will not be repeated here.

[0101] The person skilled in the art can understand that all or part of the processes in the method of the above-mentioned embodiment can also be completed by a computer program instructing related hardware, and the computer program can be stored in a computer-readable storage medium. When the processor executes the computer program, the steps of each method embodiment described above can be implemented. The computer program includes computer program code, which can be in the form of source code, object code, executable file or some intermediate form, etc. The computer-readable storage medium can include any entity or device, medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory, random access memory, electrical carrier signal, telecommunication signal and software distribution medium, etc. that can carry the computer program code. It should be noted that the contents included in the computer-readable storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction, for example, in some jurisdictions, according to legislation and patent practice, the computer-readable storage medium does not include electrical carrier signals and telecommunication signals.

[0102] Further, the present application also provides a control device. As shown in Figure 5 In an embodiment of the control device according to the present application, the control device includes a processor and a storage device, the storage device can be configured to store the program of the computer-implemented hot account transaction processing method for executing the above-mentioned method embodiments, and the processor can be configured to execute the program in the storage device, which includes but is not limited to the program of the computer-implemented hot account transaction processing method for executing the above-mentioned method embodiments. For the convenience of description, only the parts related to the embodiments of the present application are shown, and the specific technical details not disclosed are referred to the method part of the embodiments of the present application. The control device can be a control device device formed by various electronic devices.

[0103] Further, the present application also provides a computer readable storage medium. In an embodiment of the computer readable storage medium according to the present application, the computer readable storage medium can be configured to store a program of the computer implemented hotspot account transaction processing method of the above-mentioned method embodiment, which can be loaded and run by the processor to implement the computer implemented hotspot account transaction processing method. For the convenience of illustration, only the parts related to the embodiments of the present application are shown, and the specific technical details not disclosed are referred to the method part of the embodiments of the present application. The computer readable storage medium can be a storage device formed by various electronic devices, and optionally, the computer readable storage medium in the embodiments of the present application is a non-transitory computer readable storage medium.

[0104] Further, it should be understood that, since the setting of each module is only for illustrating the functional units of the device of the present application, the corresponding physical device of the module can be the processor itself, or a part of the software, a part of the hardware, or a part of the combination of the software and the hardware in the processor. Therefore, the number of each module in the figure is only illustrative.

[0105] Those skilled in the art can understand that each module in the device can be adaptively split or combined. Such splitting or combining of the specific module will not cause the technical solution to deviate from the principles of the present application, therefore, the technical solution after splitting or combining will fall within the protection scope of the present application.

[0106] So far, the technical solution of the present application has been described in combination with the preferred embodiments shown in the drawings, but those skilled in the art can easily understand that the protection scope of the present application is obviously not limited to these specific embodiments. Those skilled in the art can make equivalent changes or replacements to the related technical features without deviating from the principles of the present application, and the technical solution after the changes or replacements will fall within the protection scope of the present application.

Claims

1. A computer-implemented method for processing hot account transactions, characterized in that, include: When an account has a billing or billing request, check whether the account requesting the billing or billing is a hot account. If so, store the hot account data in a relational database. During the inflow request phase of hot accounts, a hot account inflow log table is created, and the balance of the hot account data is updated periodically based on the hot account inflow log table and the hot account data in the relational database. During the billing request phase of hot accounts, a hot account freeze log table and a cached hot account data table are created. The balance of the hot account data is updated periodically based on the hot account freeze log table, the cached hot account data table, and the hot account data in the relational database. During the billing request phase for hot accounts, a hot account freeze log table and a cached hot account data table are created. The balance of the hot account data is periodically updated based on the hot account freeze log table, the cached hot account data table, and the hot account data in the relational database. This includes: Create a cached hot account data table corresponding to the hot account data in the cache database, and synchronize the hot account data to the cached hot account data table; Create a log table of frozen accounts in a relational database; In response to a billing request from a hot account, determine whether the balance in the cached hot account data table is greater than the billing amount. If so, record the billing request for the hot account in the hot account freeze log log and update the available balance in the cached hot account data table. The hot account billing log is scanned periodically, and the billing amount of the hot account billing log is summarized. When the available balance of the updated cached hot account data table is greater than zero, the billing amount of the summarized hot account billing log is subtracted from the corresponding hot account data in the relational database to obtain the balance of the updated hot account data. Specifically, when scanning the billing log of the hot account, summarizing the billing amount of the hot account billing log and updating the balance of the hot account data, a pessimistic lock is used to lock the hot account data; after updating the balance of the hot account data, the pessimistic lock is released.

2. The computer-implemented hotspot account transaction processing method according to claim 1, characterized in that, During the inflow request phase for hot accounts, a hot account inflow log table is created, and the balance of the hot account data is periodically updated based on the hot account inflow log table and the hot account data in the relational database, including: Create a log table of frequently accessed accounts in a relational database; In response to a hot account's inflow request, the inflow request for the hot account is recorded in the hot account inflow log table; The hot account inflow log is scanned periodically, the inflow amount of the hot account inflow log is summarized, and the summarized inflow amount is added to the corresponding hot account data in the relational database to obtain the balance of the updated hot account data. Specifically, when scanning the hot account inflow log, summarizing the inflow amount in the hot account inflow log, and updating the balance of the hot account data, a pessimistic lock is used to lock the hot account data; after updating the balance of the hot account data, the pessimistic lock is released.

3. The computer-implemented hotspot account transaction processing method according to claim 2, characterized in that, Before recording the inflow request for the hot account in the hot account inflow log table, the process also includes: The hot account is idempotent based on the serial number in the header of the incoming payment request.

4. The computer-implemented hotspot account transaction processing method according to claim 1, characterized in that, Also includes: In response to a billing request from a hot account, determine whether the balance in the cached hot account data table is greater than the billing amount. If not, send an insufficient balance reminder notification.

5. The computer-implemented hotspot account transaction processing method according to claim 1, characterized in that, Before determining whether the balance in the cached hot account data table is greater than the billing amount, the process also includes: The hot account is idempotent based on the serial number in the message header of the billing request for the hot account.

6. The computer-implemented hotspot account transaction processing method according to claim 5, characterized in that, The step of performing idempotency verification on the hot account based on the serial number in the message header of the billing request for the hot account includes: Verify that the billing statements for the aforementioned hot accounts exist; If so, check whether the billing statement for the hot account matches its unfreezing type; If they match, the unfreezing request will be stored in the hot account freeze log log.

7. A computer-implemented hotspot account transaction processing device, characterized in that, include: The query module is used to query whether the account requesting the outflow or inflow is a hot account when there is an outflow or inflow request. If so, the hot account data is stored in a relational database. The invoicing module is used to create an invoicing log table for hot accounts during the invoicing request phase, and to periodically update the balance of the hot account data based on the invoicing log table and the hot account data in the relational database. The billing module is used to create a hot account freeze log table and a cached hot account data table during the billing request phase of a hot account. It periodically updates the balance of the hot account data based on the hot account freeze log table, the cached hot account data table, and the hot account data in the relational database. The steps of creating the hot account freeze log table and the cached hot account data table during the billing request phase, and periodically updating the balance of the hot account data based on the hot account freeze log table, the cached hot account data table, and the hot account data in the relational database, include: creating a cached hot account data table corresponding to the hot account data in the cached database and synchronizing the hot account data to the cached hot account data table; creating a hot account freeze log table in the relational database; and responding to the billing request of the hot account by determining... Check if the balance in the cached hot account data table is greater than the billing amount. If so, record the billing request for the hot account in the hot account freeze log table and update the available balance in the cached hot account data table. Periodically scan the hot account billing log table, summarize the billing amount in the hot account billing log table. When the available balance in the updated cached hot account data table is greater than zero, subtract the summarized billing amount in the hot account billing log table from the corresponding hot account data in the relational database to obtain the updated balance of the hot account data. During the scanning of the hot account billing log table, summarizing the billing amount in the hot account billing log table, and updating the balance of the hot account data, a pessimistic lock is used to lock the hot account data. After updating the balance of the hot account data, the pessimistic lock is released.

8. A control device, comprising a processor and a storage device, said storage device being adapted to store a plurality of program codes, characterized in that, The program code is adapted to be loaded and run by the processor to perform the hot account transaction processing method implemented by a computer according to any one of claims 1 to 6.

9. A computer-readable storage medium storing a plurality of program codes, characterized in that, The program code is adapted to be loaded and run by a processor to perform the hot account transaction processing method implemented by a computer according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Accounting method and device for hotspot account

    CN111061748A

  • Data updating method and device

    CN112347111A

  • Interbank payment system and interbank payment method

    WO2016019532A1