Hotspot account transaction processing method, device, electronic device and storage medium

By adding the transaction requests of hot accounts to the high-frequency temporary queue and summarizing the transaction amounts, the problem of low transaction processing efficiency of hot accounts is solved, and efficient processing of high-frequency transactions is achieved and the system throughput rate is improved.

CN113762954BActive Publication Date: 2024-08-27BIGO TECH PTE LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111048283.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-08
Publication Date
2024-08-27
Estimated Expiration
2041-09-08

AI Technical Summary

Technical Problem

In the existing technology, the processing efficiency of high-frequency transactions of hot accounts is low, and accumulation timeouts are prone to occur, affecting transactions in other accounts.

Method used

Add all transaction requests of hotspot accounts to the high-frequency temporary queue, summarize the transaction amount, query the current balance from the database and update the latest balance, achieving one query and update to facilitate the processing of all transaction requests.

Benefits of technology

It improves the efficiency of high-frequency transaction processing, reduces the revenue loss of the system due to low processing efficiency, and reduces the power consumption of electronic equipment when creating high-frequency temporary queues.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113762954B
    Figure CN113762954B
Patent Text Reader

Abstract

The present invention discloses a hotspot account transaction processing method, device, electronic device and storage medium, the method comprising: determining a hotspot account, adding all transaction requests of the hotspot account to a corresponding high-frequency temporary queue; querying the current balance of the hotspot account from a database; summarizing the transaction amounts carried by all transaction requests in the high-frequency temporary queue to obtain a total transaction amount; determining the latest balance of the hotspot account according to the current balance of the hotspot account and the total transaction amount; updating the latest balance of the hotspot account to the database. The embodiment of the present invention achieves transaction processing of all transaction requests by summarizing the transaction amounts carried by all transaction requests by querying the database once and updating the database once. The efficiency of high-frequency transaction processing is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a hotspot account transaction processing method, device, electronic device and storage medium. Background Art

[0002] In the application of virtual currency, there are often some high-frequency transaction requests for the same account. For example, in an entertainment live broadcast, fans keep sending gifts to the anchor, which is reflected in the currency account as continuous deductions from the fan account and credits to the anchor account. Accounts with high-frequency transactions are called hot accounts.

[0003] In the related art, each time a transaction request is received, the current balance needs to be queried from the database, and then the new balance needs to be determined based on the transaction amount and the current balance carried in the transaction request, and then the new balance needs to be updated to the database. The process of querying the current balance from the database and updating the balance to the database is time-consuming, so the high-frequency transaction processing efficiency of hot accounts is low, and it is easy to accumulate timeouts, and even affect the transactions of other accounts. Summary of the invention

[0004] The embodiments of the present invention provide a hotspot account transaction processing method, device, electronic device and storage medium, which are used to solve the problem of low efficiency in high-frequency transaction processing of existing hotspot accounts.

[0005] An embodiment of the present invention provides a hotspot account transaction processing method, the method comprising:

[0006] Determine hot accounts and add all transaction requests of the hot accounts to the corresponding high-frequency temporary queue;

[0007] Query the current balance of the hotspot account from the database; aggregate the transaction amounts carried by all transaction requests in the high-frequency temporary queue to obtain a total transaction amount; determine the latest balance of the hotspot account based on the current balance of the hotspot account and the total transaction amount;

[0008] The latest balance of the hotspot account is updated in the database.

[0009] On the other hand, an embodiment of the present invention provides a hotspot account transaction processing device, the device comprising:

[0010] A first determination module is used to determine a hotspot account and add all transaction requests of the hotspot account to a corresponding high-frequency temporary queue;

[0011] The second determination module is used to query the current balance of the hotspot account from the database; summarize the transaction amounts carried by all transaction requests in the high-frequency temporary queue to obtain a total transaction amount; and determine the latest balance of the hotspot account according to the current balance of the hotspot account and the total transaction amount;

[0012] An updating module is used to update the latest balance of the hotspot account into the database.

[0013] On the other hand, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0014] Memory, used to store computer programs;

[0015] The processor is used to implement any of the method steps described above when executing the program stored in the memory.

[0016] On the other hand, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, any of the method steps described above is implemented.

[0017] An embodiment of the present invention provides a hotspot account transaction processing method, device, electronic device and storage medium, the method comprising: determining a hotspot account, adding all transaction requests of the hotspot account to a corresponding high-frequency temporary queue; querying the current balance of the hotspot account from a database; summarizing the transaction amounts carried by all transaction requests in the high-frequency temporary queue to obtain a total transaction amount; determining the latest balance of the hotspot account based on the current balance of the hotspot account and the total transaction amount; and updating the latest balance of the hotspot account to the database.

[0018] Since in the embodiment of the present invention, all transaction requests of the hotspot account are added to the corresponding high-frequency temporary queue, when the transaction is processed, the transaction amounts carried by all transaction requests in the high-frequency temporary queue are summarized to obtain the total transaction amount. After querying the current balance of the hotspot account from the database, the latest balance of the hotspot account is determined based on the current balance of the hotspot account and the total transaction amount and updated to the database. There are many transaction requests for hotspot accounts. The embodiment of the present invention summarizes the transaction amounts carried by all transaction requests, thereby realizing transaction processing for all transaction requests by querying the database once and updating the database once. The efficiency of high-frequency transaction processing is improved. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0020] Figure 1 A schematic diagram of a hotspot account transaction processing process provided by Embodiment 1 of the present invention;

[0021] Figure 2 A detailed flow chart of hotspot account transaction processing provided by Embodiment 3 of the present invention;

[0022] Figure 3 A framework diagram of the hotspot account transaction processing principle provided by Embodiment 3 of the present invention;

[0023] Figure 4 A high-frequency temporary queue processing flow chart provided in Example 3 of the present invention;

[0024] Figure 5 A schematic diagram of the structure of a hotspot account transaction processing device provided in Embodiment 4 of the present invention;

[0025] Figure 6 This is a schematic diagram of the structure of an electronic device provided in Example 5 of the present invention. DETAILED DESCRIPTION

[0026] The present invention will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0027] Embodiment 1:

[0028] Figure 1 A schematic diagram of a hotspot account transaction processing process provided by an embodiment of the present invention includes the following steps:

[0029] S101: Determine a hotspot account, and add all transaction requests of the hotspot account to a corresponding high-frequency temporary queue.

[0030] S102: query the current balance of the hotspot account from the database; aggregate the transaction amounts carried by all transaction requests in the high-frequency temporary queue to obtain a total transaction amount; determine the latest balance of the hotspot account based on the current balance of the hotspot account and the total transaction amount.

[0031] S103: Update the latest balance of the hotspot account into the database.

[0032] The hotspot account transaction processing method provided in the embodiment of the present invention is applied to an electronic device, which may be a PC, a tablet computer, a smart phone, etc. The rankings involved in the embodiment of the present invention are explained as follows:

[0033] QPS: The number of transaction requests per second, used to measure transaction frequency.

[0034] UID: User identification code, this document specifically refers to the account ID.

[0035] High-frequency trading: Trading at a very high frequency, here refers to operating the account balance at a very high frequency.

[0036] Hot accounts: accounts with high-frequency trading characteristics.

[0037] Hash routing: Requests are diverted after hash mapping the UID in the request. Requests for a certain UID will always be diverted to the same processing node.

[0038] Hash sharding: Hash routing distributes requests to a fixed number of processing nodes (here refers to threads). Each processing node is a hash shard.

[0039] Account Transaction: refers to the deduction or credit operation of the account balance.

[0040] Transaction merging: A batch of consecutive transaction requests from the same account within a short period of time are merged and processed in a unified manner.

[0041] In the embodiment of the present invention, different accounts are mapped to processing nodes through hash routing. For example, processing node A processes transaction requests of account 1, account 2 and account 3, and processing node B processes transaction requests of account 4, account 5 and account 6.

[0042] For each processing node, a hotspot account in the processing node is determined. When determining the hotspot account, the QPS of each account can be counted to determine whether the QPS of the account is greater than a preset threshold. If so, the account is determined to be a hotspot account, otherwise the account is determined to be a non-hotspot account.

[0043] The embodiment of the present invention can process hotspot account transactions according to a preset cycle, for example, every 1 second or 2 seconds, or in real time. When the electronic device processes hotspot account transactions, a corresponding high-frequency temporary queue is established for each hotspot account, and all transaction requests of the hotspot account are added to the corresponding high-frequency temporary queue. Then, the transaction amounts carried by all transaction requests in the high-frequency temporary queue are aggregated to obtain the total transaction amount. The current balance of the hotspot account is obtained by querying from the database, and then the latest balance of the hotspot account is determined based on the current balance of the hotspot account and the total transaction amount. Finally, the latest balance of the hotspot account is updated to the database.

[0044] The process of determining the latest balance of the hotspot account based on the current balance and the total transaction amount of the hotspot account is as follows: if it is a debit transaction, the current balance is subtracted from the total transaction amount to obtain the latest balance. If it is an account transaction, the current balance is added to the total transaction amount to obtain the latest balance. The transaction request carries information on whether the transaction amount is an account or a debit.

[0045] Since in the embodiment of the present invention, all transaction requests of the hotspot account are added to the corresponding high-frequency temporary queue, when the transaction is processed, the transaction amounts carried by all transaction requests in the high-frequency temporary queue are summarized to obtain the total transaction amount. After querying the current balance of the hotspot account from the database, the latest balance of the hotspot account is determined based on the current balance of the hotspot account and the total transaction amount and updated to the database. There are many transaction requests for hotspot accounts. The embodiment of the present invention summarizes the transaction amounts carried by all transaction requests, thereby realizing transaction processing for all transaction requests by querying the database once and updating the database once. The efficiency of high-frequency transaction processing is improved.

[0046] Embodiment 2:

[0047] When the transaction request processing tasks of the processing node are relatively small, even if the hotspot account performs high-frequency transactions, the transaction amounts carried in the transaction requests of the hotspot account are not aggregated, because the computing resources of the processing node are sufficient, thus ensuring the efficiency of high-frequency transaction processing. Based on this consideration, on the basis of the above embodiment, in the embodiment of the present invention, before determining the hotspot account and adding all the transaction requests of the hotspot account to the corresponding high-frequency temporary queue, the method further includes:

[0048] The number of transactions processed by the statistical processing node within a first time length is set, and according to the number of transactions and the maximum number of transactions processed by the processing node within the first time length, it is determined whether the processing node is in a busy state or an idle state; if the processing node is in a busy state, a hotspot account is determined, and all transaction requests of the hotspot account are added to a corresponding high-frequency temporary queue.

[0049] In an embodiment of the present invention, the number of transactions processed within a first time length set by the processing node is counted, wherein the first time length set may be 1 second, 2 seconds, etc. The number of transactions processed by the processing node at its maximum capacity within the first time length set is obtained. According to the ratio of the number of transactions processed within the first time length set by the processing node to the number of transactions processed by the processing node at its maximum capacity within the first time length set, it is determined whether the processing node is in a busy state or an idle state. For example, when the ratio exceeds a certain threshold, the processing node is determined to be in a busy state, and when it is less than a certain threshold, the processing node is determined to be in an idle state. Preferably, in order to avoid the processing node frequently switching between the busy state and the idle state, the process of determining whether the processing node is in a busy state or an idle state is as follows: before the processing node processes a transaction request, the processing node is initialized to an idle state. In the process of processing the transaction request, the ratio of the number of transactions processed within the first time length set by the processing node to the number of transactions processed by the processing node at its maximum capacity within the first time length set is determined. When the ratio is greater than a preset first threshold, it is determined that the processing node switches from an idle state to a busy state. The preset first threshold is, for example, 0.8, 0.85, etc. If the current state is busy, when the ratio is less than a preset second threshold, it is determined that the processing node is switched from the busy state to the idle state, and the preset second threshold is, for example, 0.5, 0.25, etc. It should be noted that if the current state is idle, when the ratio is not greater than the preset first threshold, the current idle state is maintained. If the current state is busy, when the ratio is not less than the preset second threshold, the current busy state is maintained.

[0050] If it is determined that the processing node is busy, the hotspot account is determined and all transaction requests of the hotspot account are added to the corresponding high-frequency temporary queue.

[0051] In an embodiment of the present invention, the method further includes:

[0052] If the processing node is in a busy state, a non-hotspot account is determined, and the transaction request of the non-hotspot account is added to the main queue; or if the processing node is in an idle state, no determination is made as to whether the account is a hotspot account or a non-hotspot account, and the transaction request of the account is added to the main queue;

[0053] For the transaction request in the main queue, query the current balance of the account corresponding to the transaction request from the database, determine the latest balance of the account corresponding to the transaction request based on the current balance of the account corresponding to the transaction request and the transaction amount carried by the transaction request in the main queue; and update the latest balance of the account corresponding to the transaction request into the database.

[0054] Because when the processing node is in an idle state, the computing resources of the processing node are sufficient, even if the hotspot account performs high-frequency transactions, the transaction amount carried in the transaction request of the hotspot account is not aggregated, and the efficiency of high-frequency transaction processing can be guaranteed. Therefore, in the embodiment of the present invention, if the processing node is in an idle state, no judgment is made on hotspot accounts or non-hotspot accounts, and the transaction requests of all accounts are added to the main queue. When the processing node is in a busy state, a non-hotspot account is determined, and because the number of transaction requests of the non-hotspot account is small, the transaction requests of the non-hotspot account are also added to the main queue.

[0055] The process of processing the transaction request in the main queue is to query the current balance of the account corresponding to the transaction request from the database for the transaction request in the main queue. The transaction request carries the transaction amount, information on whether the transaction is a deposit or a deduction, and the account identification information of the transaction. Therefore, for each transaction request in the main queue, the account corresponding to the transaction request can be obtained. Then, the current balance of the account corresponding to the transaction request is queried from the database. The latest balance of the account corresponding to the transaction request is determined based on the current balance of the account corresponding to the transaction request and the transaction amount carried by the transaction request in the main queue.

[0056] If it is a debit transaction, the current balance is subtracted from the transaction amount to obtain the latest balance. If it is a credit transaction, the current balance is added to the transaction amount to obtain the latest balance. The latest balance of the account corresponding to the transaction request is updated in the database.

[0057] It should be noted that for a certain account, when the processing node is busy and the account is determined to be a hot account, if there are transaction requests for the account in the main queue, the transaction requests for the account in the main queue need to be migrated to the corresponding high-frequency temporary queue.

[0058] Because in the embodiment of the present invention, if the processing node is in a busy state, a non-hotspot account is determined, and the transaction request of the non-hotspot account is added to the main queue; or if the processing node is in an idle state, no judgment is made on the hotspot account or the non-hotspot account, and the transaction request of the account is added to the main queue. If the processing node is in a busy state, a hotspot account is determined, and the transaction request of the hotspot account is added to the corresponding high-frequency temporary queue. That is, the efficiency of high-frequency transaction processing is improved. When there is no need to add a high-frequency temporary queue, the power consumption caused by the electronic device creating a high-frequency temporary queue is avoided.

[0059] Embodiment 3:

[0060] In order to improve the efficiency of determining hotspot accounts, based on the above embodiments, in an embodiment of the present invention, if the processing node is in a busy state, determining the hotspot account includes:

[0061] If the processing node is in a busy state, for each account, determine whether the account exists in the hot account whitelist. If so, determine that the account is a hot account. If not, count the number of transaction requests for the account within a set second time length. If the number of transaction requests for the account within the set second time length exceeds a preset number threshold, determine that the account is a hot account.

[0062] The electronic device stores a hotspot account whitelist. If the processing node is busy, the account in the hotspot account whitelist is directly determined as a hotspot account. For an account that does not exist in the hotspot account whitelist, the number of transaction requests of the account within a set second time length is counted. If the number of transaction requests of the account within the set second time length exceeds a preset number threshold, the account is determined to be a hotspot account. The set second time length can be 1 second, 2 seconds, etc.

[0063] In order to facilitate the rapid determination of hotspot accounts when the next transaction is processed, for each account, if the account does not exist in the hotspot account whitelist and the account is determined to be a hotspot account, the method further includes:

[0064] Add the account to the hotspot account whitelist.

[0065] The method further comprises:

[0066] If the processing node changes from a busy state to an idle state, all transaction requests in the high-frequency temporary queue are migrated to the main queue.

[0067] In order to avoid mistakenly confirming a non-hotspot account as a hotspot account, in an embodiment of the present invention, the method further includes:

[0068] If the processing node changes from a busy state to an idle state, the hotspot account in the hotspot account whitelist is removed.

[0069] Figure 2 A detailed flow chart of hotspot account transaction processing provided by an embodiment of the present invention, such as Figure 2As shown, first determine whether the processing node (shard) is busy or idle. If it is idle, add the transaction request to the main queue, perform shard QPS statistics, and the process ends. If it is busy, determine whether the account UID is in the hot account whitelist. If it is in the hot account whitelist, determine the account as a hot account, and add the transaction request of the account to the high-frequency temporary queue. If it is not in the hot account whitelist, count the QPS of the account, and determine whether the QPS exceeds the threshold. If it does not exceed the threshold, determine that the account is a non-hot account, and write the transaction request of the account to the main queue. If it exceeds the threshold, determine that the account is a hot account, and add the transaction request of the account to the high-frequency temporary queue. Then perform UID QPS statistics and shard QPS statistics, and determine whether the shard has returned to the idle state based on the statistical results. If it has not returned to the idle state, the process ends. If it returns to the idle state, migrate all transaction requests in the high-frequency temporary queue to the main queue. And clean up the hot account whitelist, the process ends.

[0070] The hotspot account transaction processing process provided by the embodiment of the present invention is explained below with reference to the framework diagram.

[0071] Figure 3 A framework diagram of the hotspot account transaction processing principle provided by an embodiment of the present invention. Figure 3 Hash routing: Requests are diverted by performing hash mapping on the UID in the request. Requests for a certain UID will always be diverted to the same processing node. Hash sharding: Requests are distributed to a fixed number of processing nodes (threads) by hash routing. Each processing node is a hash shard.

[0072] Traffic monitoring module: responsible for counting the traffic of the current hash shard, monitoring whether there are hot accounts in the current hash shard, and automatically transferring its transaction requests to the high-frequency temporary queue when a hot account is identified. The specific working principle is as follows:

[0073] 1. Receive account transaction requests from this hash shard for QPS statistics;

[0074] 2. Determine whether the current shard is in a busy state (if the QPS is greater than the maximum processing capacity of a single thread per second * 80%, it is determined to be in a busy state, otherwise it is currently in an idle state);

[0075] 3. When the current shard is in idle state, the request is directly written to the main queue;

[0076] 4. When the current shard is in a busy state, if the UID of the current request has been added to the hot account whitelist, the current transaction will be directly written to the corresponding high-frequency temporary queue. If it is not in the hot account whitelist, the QPS statistics of the UID dimension will be performed for each request, and it will be determined whether the current QPS of the UID has exceeded the threshold. If it exceeds the threshold, a new high-frequency temporary queue needs to be created and the UID needs to be added to the hot account whitelist. All requests of the UID in the main queue will be migrated to the new temporary queue, and finally the current request will also be written to the new temporary queue.

[0077] 5. When recovering from a busy state to an idle state (QPS is less than 50% of the maximum processing capacity of a single thread per second), all temporary queue requests need to be migrated to the main queue, and the high-frequency whitelist needs to be cleared. The QPS in the UID dimension is no longer counted.

[0078] Main queue: used to store low-frequency account transaction requests.

[0079] Main queue processing thread: Gets transaction requests from the main queue to perform account operations, which mainly includes the following four steps:

[0080] 1. Query the current balance of UID from the database;

[0081] 2. Calculate the new balance after the operation based on the transaction direction and amount:

[0082] Debit transaction: New balance = current balance – transaction amount;

[0083] It should be noted that when the new balance is less than 0, a prompt message indicating insufficient business balance needs to be returned;

[0084] Incoming transaction: New balance = current balance – transaction amount;

[0085] 3. Record the balance change in the database;

[0086] 4. Update the new balance of UID to the database.

[0087] High-frequency temporary queue: used to store high-frequency account transaction requests. Each queue only stores requests from the same UID. The queue is automatically created and diverted by the traffic monitoring module.

[0088] High-frequency temporary thread: Batch fetch requests from the high-frequency temporary queue and merge them to perform account operations. The main steps are as follows:

[0089] 1. Loop through each non-empty high-frequency temporary queue, take out all requests in batches and do the following processing;

[0090] 2. Query the current balance of UID from the database;

[0091] 3. Generate a balance change log for each request and write it into the database;

[0092] 4. Summarize the amounts of all requests, calculate the new balance based on the current balance and update it to the database.

[0093] Figure 4 The high-frequency temporary queue processing flow chart provided by the embodiment of the present invention first obtains a non-idle high-frequency temporary queue. If there is no non-idle high-frequency temporary queue, the process ends. After obtaining a non-idle high-frequency temporary queue, all requests are taken out in batches, the current balance of the UID is queried, a balance change flow is generated for each request and written to the database, all request amounts are summarized, the new balance is calculated and updated to the database, and the current queue processing ends.

[0094] The solution provided by the embodiment of the present invention enables the account system to efficiently handle high-frequency transactions of hotspot accounts, greatly improving the system throughput and reducing revenue losses caused by system reasons. Dynamic identification of hotspot accounts: By performing hash sharding on the request, performing load checks within the shards and then identifying the hotspot accounts, the overhead brought to the system by the identification work is greatly reduced. Hotspot account request diversion: After identifying the hotspot account, a separate temporary queue is created to process the hotspot account's requests, and the hotspot account requests are merged to significantly improve the system throughput.

[0095] Embodiment 4:

[0096] Figure 5 A schematic diagram of the structure of a hotspot account transaction processing device provided by an embodiment of the present invention, the device comprising:

[0097] A first determination module 51 is used to determine a hotspot account and add all transaction requests of the hotspot account to a corresponding high-frequency temporary queue;

[0098] The second determination module 52 is used to query the current balance of the hotspot account from the database; summarize the transaction amounts carried by all transaction requests in the high-frequency temporary queue to obtain a total transaction amount; and determine the latest balance of the hotspot account according to the current balance of the hotspot account and the total transaction amount;

[0099] The updating module 53 is used to update the latest balance of the hotspot account into the database.

[0100] The device also includes:

[0101] The third determination module 54 is used to count the number of transactions processed by the processing node within the first time length set, and determine whether the processing node is busy or idle according to the number of transactions and the maximum number of transactions processed by the processing node within the first time length set; if the processing node is busy, determine the hotspot account and add all transaction requests of the hotspot account to the corresponding high-frequency temporary queue.

[0102] The device also includes:

[0103] The fourth determination module 55 is used to determine a non-hotspot account if the processing node is in a busy state, and add the transaction request of the non-hotspot account to the main queue; or if the processing node is in an idle state, do not judge whether it is a hotspot account or a non-hotspot account, and add the transaction request of the account to the main queue; for the transaction request in the main queue, query the current balance of the account corresponding to the transaction request from the database, determine the latest balance of the account corresponding to the transaction request based on the current balance of the account corresponding to the transaction request and the transaction amount carried by the transaction request in the main queue; and update the latest balance of the account corresponding to the transaction request to the database.

[0104] The third determination module 54 is specifically used to determine, for each account, whether the account exists in the hot account whitelist if the processing node is in a busy state. If so, determine that the account is a hot account. If not, count the number of transaction requests for the account within a set second time length. If the number of transaction requests for the account within the set second time length exceeds a preset number threshold, determine that the account is a hot account.

[0105] The device also includes:

[0106] The adding module 56 is used to add the account to the hotspot account whitelist if the account does not exist in the hotspot account whitelist and the account is determined to be a hotspot account.

[0107] The device also includes:

[0108] The migration module 57 is used to migrate all transaction requests in the high-frequency temporary queue to the main queue if the processing node changes from a busy state to an idle state.

[0109] The device also includes:

[0110] The removal module 58 is used to remove the hotspot account in the hotspot account whitelist if the processing node changes from a busy state to an idle state.

[0111] Embodiment 5:

[0112] Based on the above embodiments, an electronic device is also provided in an embodiment of the present invention, such as Figure 6 As shown, it includes: a processor 301, a communication interface 302, a memory 303 and a communication bus 304, wherein the processor 301, the communication interface 302, and the memory 303 communicate with each other through the communication bus 304;

[0113] The memory 303 stores a computer program. When the program is executed by the processor 301, the processor 301 performs the following steps:

[0114] Determine hot accounts and add all transaction requests of the hot accounts to the corresponding high-frequency temporary queue;

[0115] Query the current balance of the hotspot account from the database; aggregate the transaction amounts carried by all transaction requests in the high-frequency temporary queue to obtain a total transaction amount; determine the latest balance of the hotspot account based on the current balance of the hotspot account and the total transaction amount;

[0116] The latest balance of the hotspot account is updated in the database.

[0117] An electronic device provided by an embodiment of the present invention can be used to execute the hotspot account transaction processing method provided by any of the above embodiments, and has corresponding functions and beneficial effects.

[0118] Embodiment 6:

[0119] On the basis of the above embodiments, an embodiment of the present invention further provides a computer storage readable storage medium, wherein the computer readable storage medium stores a computer program executable by an electronic device, and when the program is run on the electronic device, the electronic device implements the following steps when executing:

[0120] Determine hot accounts and add all transaction requests of the hot accounts to the corresponding high-frequency temporary queue;

[0121] Query the current balance of the hotspot account from the database; aggregate the transaction amounts carried by all transaction requests in the high-frequency temporary queue to obtain a total transaction amount; determine the latest balance of the hotspot account based on the current balance of the hotspot account and the total transaction amount;

[0122] The latest balance of the hotspot account is updated in the database.

[0123] The embodiment of the present invention also provides a computer storage readable storage medium, which stores a computer program that can be executed by an electronic device. When the program runs on the electronic device, it can be used to execute the hotspot account transaction processing method provided in any of the above embodiments, and has corresponding functions and beneficial effects.

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

Claims

1. A method for processing hotspot account transactions. It is characterized in that The method comprises: Determine hot accounts and add all transaction requests of the hot accounts to the corresponding high-frequency temporary queue; Query the current balance of the hotspot account from the database; aggregate the transaction amounts carried by all transaction requests in the high-frequency temporary queue to obtain a total transaction amount; determine the latest balance of the hotspot account based on the current balance of the hotspot account and the total transaction amount; Updating the latest balance of the hotspot account into the database; Before adding all transaction requests of the hotspot account to the corresponding high-frequency temporary queue, the method further includes: The number of transactions processed by the statistical processing node within a first time length is set, and according to the number of transactions and the maximum number of transactions processed by the processing node within the first time length, it is determined whether the processing node is in a busy state or an idle state; if the processing node is in a busy state, a hotspot account is determined, and all transaction requests of the hotspot account are added to a corresponding high-frequency temporary queue.

2. The method according to claim 1, It is characterized in that The method further comprises: If the processing node is in a busy state, a non-hotspot account is determined, and the transaction request of the non-hotspot account is added to the main queue; or if the processing node is in an idle state, no determination is made as to whether the account is a hotspot account or a non-hotspot account, and the transaction request of the account is added to the main queue; For the transaction request in the main queue, query the current balance of the account corresponding to the transaction request from the database, determine the latest balance of the account corresponding to the transaction request based on the current balance of the account corresponding to the transaction request and the transaction amount carried by the transaction request in the main queue; and update the latest balance of the account corresponding to the transaction request into the database.

3. The method according to claim 1, It is characterized in that If the processing node is in a busy state, determining the hotspot account includes: If the processing node is in a busy state, for each account, determine whether the account exists in the hot account whitelist. If so, determine that the account is a hot account. If not, count the number of transaction requests for the account within a set second time length. If the number of transaction requests for the account within the set second time length exceeds a preset number threshold, determine that the account is a hot account.

4. The method according to claim 3, It is characterized in that For each account, if the account does not exist in the hotspot account whitelist and the account is determined to be a hotspot account, the method further includes: Add the account to the hotspot account whitelist.

5. The method according to claim 1, It is characterized in that The method further comprises: If the processing node changes from a busy state to an idle state, all transaction requests in the high-frequency temporary queue are migrated to the main queue.

6. The method according to claim 3, It is characterized in that The method further comprises: If the processing node changes from a busy state to an idle state, the hotspot account in the hotspot account whitelist is removed.

7. A hotspot account transaction processing device, It is characterized in that The device comprises: A first determination module is used to determine a hotspot account and add all transaction requests of the hotspot account to a corresponding high-frequency temporary queue; The second determination module is used to query the current balance of the hotspot account from the database; summarize the transaction amounts carried by all transaction requests in the high-frequency temporary queue to obtain a total transaction amount; and determine the latest balance of the hotspot account according to the current balance of the hotspot account and the total transaction amount; An updating module, used to update the latest balance of the hotspot account into the database; The device also includes: The third determination module 54 is used to count the number of transactions processed by the processing node within the first time length set, and determine whether the processing node is busy or idle according to the number of transactions and the maximum number of transactions processed by the processing node within the first time length set; if the processing node is busy, determine the hotspot account and add all transaction requests of the hotspot account to the corresponding high-frequency temporary queue.

8. An electronic device, It is characterized in that It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 6 when executing a program stored in a memory.

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