A hotspot account accounting processing method and device

By setting hotspot accounts as overdraft accounts in high concurrency scenarios and only once balance updates are performed within the predetermined period, the system bottleneck caused by hotspot accounts accounting is solved, business processing timeliness and accounting process is simplified.

CN117745426BActive Publication Date: 2025-04-22北京理房通支付科技有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311660456.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-05
Publication Date
2025-04-22
Estimated Expiration
2043-12-05

AI Technical Summary

Technical Problem

The frequent deposit and withdrawal of hot accounts in high concurrency scenarios leads to system bottlenecks, low processing timeliness, and the existing optimization solutions are highly complex, which can easily lead to bookkeeping errors.

Method used

The hot account accounting processing method based on buffer storage plus shard batch processing mode is adopted. The hot account is set as an overdraft account, and the balance update is only once within the predetermined period, and the accounting is separated and the transaction details are cached through the multi-level cache mode.

Benefits of technology

It effectively solves the system bottleneck caused by hot account accounting in high concurrency scenarios, improves business processing timeliness, simplifies the accounting process, and reduces the pressure on account processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117745426B_ABST
    Figure CN117745426B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a hotspot account accounting processing method and device, the method comprising: determining whether the account to be accounted is a hotspot account or a non-hotspot account, and performing separate accounting for the hotspot account and the non-hotspot account; in response to detecting that the first account is a hotspot account, configuring the first account as an overdraft account and setting an overdraft limit; obtaining the account balance of the first account, in response to the account balance of the first account being within the overdraft limit, the first account performs an accounting operation in the order of request, and updates the account balance once at intervals of a predetermined round of operations; in response to detecting that the second account is a non-hotspot account, obtaining the account balance of the second account, in response to the account balance of the second account being not less than the amount required for the accounting operation, the second account performs an accounting operation and updates the account balance once. The present invention solves the problem of system bottlenecks caused by frequent balance updates of hotspot accounts in a short period of time, and improves the accounting timeliness.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a hotspot account accounting processing method and device. Background Art

[0002] Hot accounts refer to a large number of transaction requests generated in a short period of time, most of which fall on one or a few accounts. These accounts are called hot accounts. Frequent deposit and withdrawal operations on these accounts cause system bottlenecks.

[0003] The account system is the lowest and most core part of the entire payment chain. It carries the accounting needs of almost all upstream business products and has high requirements for system stability, security and throughput. When encountering business peaks, in high-concurrency scenarios, hot accounts frequently deposit and withdraw funds, which seriously affects system performance and also affects the accounting of other non-hot accounts. Therefore, hot account accounting has always been a long-standing problem in the account system.

[0004] At present, in order to solve the above problems, the first solution is to lock the account before accounting. After all requests come in, they are queued and then accounted according to the order of acquiring the lock. However, this method easily causes a large number of request backlogs and extremely low processing efficiency, which seriously restricts the development of the business.

[0005] The second solution is to distribute the accounting pressure by splitting into multiple sub-accounts. This solution can solve some problems, but when the deduction balance is insufficient, it is necessary to frequently transfer the balance between the sub-accounts. The solution is very complex and can easily cause accounting errors. Summary of the invention

[0006] In view of the problems of system bottlenecks, low processing efficiency, complex optimization solutions, etc. caused in the above-mentioned hot account accounting process, the embodiments of the present invention provide a hot account accounting processing method and device, which is based on buffer storage plus sharding batch processing mode. The hot account processing is simple and efficient, and can solve the system bottleneck caused by hot account accounting in high concurrency scenarios, effectively improve the business processing efficiency, and has a simple design and good maintainability.

[0007] Specifically, the embodiment of the present invention provides the following technical solutions:

[0008] In a first aspect, an embodiment of the present invention provides a hotspot account accounting processing method, including:

[0009] Determine whether the account to be recorded is a hotspot account or a non-hotspot account, and separate the hotspot account from the non-hotspot account;

[0010] In response to detecting that the first account is a hotspot account, configuring the first account as an overdraft account and setting an overdraft limit;

[0011] Acquiring the account balance of the first account, and in response to the account balance of the first account being within the overdraft limit, performing accounting operations on the first account in a requested order, and updating the account balance once every predetermined round of operations;

[0012] In response to detecting that the second account is a non-hotspot account, the account balance of the second account is obtained, and in response to the account balance of the second account being not less than the amount required for the accounting operation, the second account performs an accounting operation and updates the account balance.

[0013] Further, the determining whether the account to be debited is a hotspot account or a non-hotspot account specifically includes:

[0014] Performing statistical analysis on the transaction flow within a predetermined time interval from the account dimension to obtain statistical analysis results, wherein the statistical analysis results include the business volume processed per unit time;

[0015] The statistical analysis results are sorted from high to low according to the business volume processed per unit time, and accounts with a predetermined number of top rankings are selected as hot accounts, and other accounts are non-hot accounts.

[0016] Furthermore, the separate accounting of hotspot accounts and non-hotspot accounts specifically includes:

[0017] storing the account information of the hotspot account in a hotspot account filter;

[0018] Compare the account information of the account to be debited with the account information stored in the hotspot account filter; if the account information of the account to be debited is consistent with the account information stored in the hotspot account filter, detect it as a hotspot account, and cache the transaction details of the hotspot account in the hotspot account filter; otherwise, detect it as a non-hotspot account, and store the transaction information of the non-hotspot account in a preset database;

[0019] Among them, the hotspot account filter adopts a multi-level cache mode; the hotspot account filter is used to separate hotspot accounts from non-hotspot accounts through account information, and cache the transaction details of the hotspot accounts through the multi-level cache mode.

[0020] Further, in response to detecting that the first account is a hotspot account, configuring the first account as an overdraft account and setting an overdraft limit specifically includes:

[0021] After detecting that the first account is a hotspot account, determining whether the first account meets the overdraft account setting rules, and if so, determining the first account as an overdraft account, wherein the overdraft account setting rules are pre-set according to business requirements;

[0022] Obtaining the balance information of the first account within a predetermined period of time;

[0023] Performing balance trend analysis and prediction on the balance information to obtain a prediction result;

[0024] The prediction result is set as the overdraft limit of the first account.

[0025] Furthermore, in response to the account balance of the first account being within the overdraft limit, the first account performs accounting operations in a requested order and updates the account balance once every predetermined round of operations, including:

[0026] The first account receives the accounting request, determines whether the account balance of the first account is within the overdraft limit, and stops accounting if it is not within the overdraft limit;

[0027] If yes, the first account performs accounting operations according to the request order, and caches the transaction details corresponding to the accounting request in the hotspot account filter;

[0028] When the scheduled round of operations is reached, the cached transaction details are netted to obtain the account balance of the first account after the scheduled round of operations;

[0029] Based on the account balance of the first account after the predetermined round of operations, the cached transaction details and the account balance corresponding to each transaction detail are updated in sequence, and the updated transaction details and the account balance corresponding to each transaction detail are stored in a preset database, which is used to store the transaction details after the balance is updated and the updated account balance.

[0030] Furthermore, the account balance update is implemented through an interlocking mode, which includes account locking and database locking.

[0031] The updating of the account balance comprises the following steps:

[0032] Lock the account whose balance is to be updated. If the lock fails, return to the account whose balance is to be updated and try again.

[0033] If the account to be updated with a balance is locked successfully, the database corresponding to the account to be updated with a balance is locked. If the database lock fails, the account to be updated with a balance is returned to be locked again.

[0034] If the database is locked successfully, the account balance of the account to be updated is updated, and the transaction details associated with the account balance are updated.

[0035] In a second aspect, an embodiment of the present invention further provides a hotspot account accounting processing device, including:

[0036] A separation module is used to determine whether the account to be recorded is a hotspot account or a non-hotspot account, and to separate the hotspot account from the non-hotspot account;

[0037] A first accounting module, configured to configure the first account as an overdraft account and set an overdraft limit in response to detecting that the first account is a hotspot account;

[0038] The first accounting module is further used to obtain the account balance of the first account, and in response to the account balance of the first account being within the overdraft limit, the first account performs accounting operations in a requested order and updates the account balance once every predetermined round of operations;

[0039] The second accounting module is used to obtain the account balance of the second account in response to detecting that the second account is a non-hotspot account, and in response to the account balance of the second account being not less than the amount required for the accounting operation, the second account performs an accounting operation and updates the account balance.

[0040] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of any hotspot account accounting processing method described in the first aspect are implemented.

[0041] In a fourth aspect, an embodiment of the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the steps of hotspot account accounting processing described in the first aspect.

[0042] In a fifth aspect, an embodiment of the present invention further provides a computer program product having executable instructions stored thereon, which, when executed by a processor, enables the processor to implement any of the steps of hotspot account accounting processing described in the first aspect.

[0043] It can be seen from the above technical solution that an embodiment of the present invention provides a hotspot account accounting processing method and device, which sets the hotspot account as an overdraft account, and only updates the balance once within a predetermined period of time, thereby improving the hotspot account accounting timeliness, reducing account processing pressure, and solving the problem of system bottlenecks caused by frequent balance updates of hotspot accounts in a short period of time, simplifying the accounting process, and effectively improving business processing timeliness. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are 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.

[0045] Figure 1 A flowchart of a hotspot account accounting processing method provided by an embodiment of the present invention;

[0046] Figure 2 A schematic diagram of the process of hotspot account buffer accounting provided by an embodiment of the present invention;

[0047] Figure 3 A schematic diagram of a structure for separating hotspot accounts from non-hotspot accounts provided by an embodiment of the present invention;

[0048] Figure 4 A schematic diagram of a flow chart of non-hotspot account accounting provided by an embodiment of the present invention;

[0049] Figure 5 A flowchart of a hotspot account accounting processing device provided by an embodiment of the present invention;

[0050] Figure 6 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0051] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not 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.

[0052] Before describing the hotspot account accounting processing method provided by this embodiment, the concept of hotspot accounts is first introduced. It should be noted that the account system is the lowest and most core part of the entire payment link, carrying the accounting requirements of almost all upstream business products, and has high requirements for system stability, security and throughput. When encountering business peaks, in high-concurrency scenarios, hotspot accounts frequently have deposit and withdrawal operations, which seriously affect system performance, and also affect the accounting of other non-hotspot accounts. Therefore, hotspot account accounting has always been a long-standing problem in the account system. At present, the solution to the hotspot account accounting problem is: Solution 1: Lock the account before accounting. After all requests come in, they are queued first and then accounted according to the order of acquiring the lock, resulting in a large number of requests backlog, extremely low processing time, and seriously restricting the development of the business; Solution 2: Split multiple sub-accounts to share the accounting pressure. It can solve some problems. When encountering a scenario where the deduction balance is insufficient, it is necessary to frequently transfer the balance between each sub-account. The solution is very complex and it is very easy to cause accounting errors. To solve this problem, an embodiment of the present invention provides a hotspot account accounting processing method and device. When a hotspot account is detected, the embodiment of the present invention records the hotspot account separately from the non-hotspot account, sets an overdraft limit for the hotspot account, and updates the balance after a predetermined round of operations, rather than updating the balance for each operation. This solves the system bottleneck caused by hotspot account accounting in high-concurrency scenarios to a certain extent, effectively improves the timeliness of business processing, and has a simple design and good maintainability.

[0053] The hotspot account accounting processing method and device provided by the present invention will be described in detail through specific embodiments.

[0054] Figure 1 A flowchart of a hotspot account accounting processing method provided by an embodiment of the present invention, such as Figure 1 As shown, the hotspot account accounting processing method provided by the embodiment of the present invention includes the following steps:

[0055] Step 101: Determine whether the account to be recorded is a hotspot account or a non-hotspot account, and separate the hotspot account from the non-hotspot account;

[0056] Step 102: In response to detecting that the first account is a hotspot account, configuring the first account as an overdraft account and setting an overdraft limit;

[0057] Step 103: obtaining the account balance of the first account, and in response to the account balance of the first account being within the overdraft limit, performing accounting operations on the first account in a requested order, and updating the account balance once every predetermined round of operations;

[0058] Step 104: In response to detecting that the second account is a non-hotspot account, the account balance of the second account is obtained. In response to the account balance of the second account being not less than the amount required for the accounting operation, the second account performs an accounting operation and updates the account balance.

[0059] The above steps are described in detail below in conjunction with specific embodiments.

[0060] Step 101: Determine whether the account to be recorded is a hotspot account or a non-hotspot account, and separate the hotspot account from the non-hotspot account;

[0061] In this embodiment, it should be noted that before detecting whether an account is a hotspot account, it is necessary to determine whether there is a large amount of instantaneous accounting concurrency, which causes a system bottleneck.

[0062] For example, the transaction flow in recent months can be statistically analyzed from the account dimension, and the accounts can be sorted from high to low according to the business volume processed per unit time. The top-ranked accounts can be regarded as hot accounts, and the bottom-ranked accounts can be regarded as non-hot accounts.

[0063] After an account is detected as a hotspot account, the account information of the hotspot account is stored in a hotspot account filter; wherein the hotspot account filter adopts a multi-level cache mode, which is used to separate hotspot accounts from non-hotspot accounts through account information, and cache the transaction details of the hotspot account through the multi-level cache mode.

[0064] Step 102: In response to detecting that the first account is a hotspot account, configuring the first account as an overdraft account and setting an overdraft limit;

[0065] In this step, after filtering out the hot accounts, it is necessary to further determine whether the account allows overdraft and whether the risk is controllable.

[0066] Specifically, after detecting that the first account is a hot account, determine whether the first account meets the overdraft account setting rules, and if so, determine it as an overdraft account, wherein the overdraft account setting rules are pre-set according to business needs; obtain the balance information of the first account within a predetermined time period; perform balance trend analysis and prediction on the balance information to obtain a prediction result; and set the prediction result as the overdraft limit of the first account.

[0067] For example, since the buffered accounting mode does not update the balance in real time, insufficient balance may occur. In order to ensure the normal operation of the business, the hot account needs to be configured to be overdraft and the corresponding overdraft limit needs to be allocated. Therefore, accounts with lower overdraft risks, such as internal accounts or main merchant accounts within the group, are generally selected as hot accounts.

[0068] Furthermore, it is necessary to determine whether the overdraft limit of the hotspot account is acceptable.

[0069] Specifically, hot accounts need to be analyzed and predicted in advance to prevent frequent overdrafts and excessive overdrafts, which bring additional risks. In other words, balance trend analysis is performed on hot accounts to predict whether overdrafts will occur frequently and whether the overdraft limit can be accepted by the business party.

[0070] Step 103: Acquire the account balance of the first account. In response to the account balance of the first account being within the overdraft limit, the first account performs bookkeeping operations in a requested order and updates the account balance once every predetermined round of operations.

[0071] In this step, upon receiving an accounting request, it is determined whether the balance of the hotspot account is within the preset overdraft limit. If not, accounting is stopped; if yes, the hotspot account performs accounting operations in the order of requests, and before the scheduled round of operations is reached, the transaction details corresponding to the accounting request are cached in the hotspot account filter; when the scheduled round of operations is reached, the cached transaction details are netted to obtain the account balance of the hotspot account after the scheduled round of operations; based on the account balance, the cached transaction details and the balances corresponding to the transaction details are updated in sequence, and the updated transaction details and the balances corresponding to the transaction details are stored in a preset database, which is used to store the transaction details after the balance update and the updated account balance.

[0072] In a specific embodiment, the lightweight distributed task scheduling platform XXLJOB+state machine+task scheduling mechanism for processing batch tasks can be used to realize batch processing of hotspot account buffer details, improve the accounting efficiency of hotspot accounts, reduce accounting pressure, and solve system bottlenecks. For example, for 100 deposit and withdrawal operations on the same hotspot account, first calculate the difference between the deposit and withdrawal details, and after obtaining the final amount to be updated, only one balance update is required to realize 100 request accounting, and the result is accurate, and the transaction flow is generated strictly in accordance with the actual request order.

[0073] Figure 2 A schematic diagram of the hotspot account buffer accounting process provided by the embodiment of the present invention, such as Figure 2 As shown in the figure, XXLJOB+state machine+task scheduling is used to realize batch processing of hotspot account buffer segments. The specific steps include:

[0074] S1: XXLJOB task starts, checks whether there is a task being processed, if so, exits directly;

[0075] S2: If there is no task currently being executed, query the pending buffer details record (status W-pending). If there is no pending task, exit directly;

[0076] S3: If there are pending tasks, obtain the unique auto-incrementing serial number from redis as the batch number, and update the pending buffer details of the batch in batches;

[0077] S4: Generate batch information corresponding to the batch details, status P-processing;

[0078] S5: Group the batch of details to be processed by account number, key = account number values ​​= account details;

[0079] S6: Perform netting calculation on the account details to calculate the amount to be updated in the account;

[0080] S7: Update the account balance according to the non-hotspot account accounting process;

[0081] S8: After the balance is updated successfully, the corresponding account transaction details are generated in batches in order;

[0082] S9, update the buffer accounting details and batch status from p-processing to S-processing successful, and the accounting is completed.

[0083] In the embodiments provided by the present invention, it should be noted that: the node can be understood as a distributed system, one application corresponds to multiple machines, which are used to share the request pressure, and each machine is called an application node; the state machine can be understood as giving the state definition of each task step, and the path and conditions of the state transition; the XXL-JOB broadcast mode means that the XXL-JOB platform maintains the number of all nodes of an application, and the total number of nodes. When executed in broadcast mode, XXL-JOB will carry the number of the application node and the total number of nodes to request each application node. When the node receives the request, it will determine which data in this task scheduling needs to be executed and skipped according to algorithms such as modulo. The sum of the amount of data processed by all nodes = the total amount of data that needs to be processed.

[0084] Step 104: In response to detecting that the second account is a non-hotspot account, the account balance of the second account is obtained. In response to the account balance of the second account being not less than the amount required for the accounting operation, the second account performs an accounting operation and updates the account balance.

[0085] In this embodiment, after obtaining hot accounts and non-hot accounts, local cache is used to quickly filter hot accounts and non-hot accounts, and hot accounts and non-hot accounts are separated for accounting; for non-hot accounts, normal accounting is performed, and the interlocking mode is used to reduce the database load, and fast fuse is achieved at the same time, and the database lock is used to provide a backup, thereby improving the high availability of the system in high concurrency scenarios; for hot accounts, only accounting details are saved in the order of requests, and the balance is not updated, thereby improving the system processing performance.

[0086] Optionally, the hotspot account filter is used to separate the hotspot account from the non-hotspot account in the accounting process. Figure 3 A schematic diagram of a structure in which hotspot accounts and non-hotspot accounts are separated according to an embodiment of the present invention, such as Figure 3 As shown, the filter adopts the multi-level cache design of local cache + redis distributed cache to prevent cache avalanche. The distributed cache implementation details of hot accounts and separate accounting are as follows Figure 3 shown.

[0087] Furthermore, the non-hotspot account implements the account balance update through the interlocking mode, and the interlocking mode includes account locking and database locking. Optionally, the account balance update is implemented through the interlocking mode, which may specifically include the following steps: locking the account to be updated with the balance, and if the locking fails, returning to the account to be updated with the balance to retry; if the account to be updated with the balance is locked successfully, locking the database corresponding to the account to be updated with the balance, and if the database lock fails, continuing to return to the account to be updated with the balance to relock; if the database lock is successful, updating the account balance of the account to be updated with the balance, and updating the transaction details associated with the account balance.

[0088] Specifically, Figure 4 A schematic diagram of a non-hotspot account accounting process provided by an embodiment of the present invention, such as Figure 4 As shown in the figure, for non-hotspot account accounting, in order to improve the high availability of the system in high-concurrency scenarios, an interlocking multiLock layer + database DB layer processing mechanism is adopted, with layered processing to achieve single responsibility as much as possible. The mutilLock layer is responsible for maintaining the accounting lock mechanism. When the concurrency is too large, the service is downgraded through rapid fuse, while protecting the database.

[0089] For example, in a specific embodiment, when there are both borrowers and lenders, when a non-hotspot account starts the accounting process, a pre-verification is required, including whether the accounting status is normal and whether the account balance is sufficient. After the pre-verification is completed, the accounts of both borrowers and lenders begin to record accounts. After the accounting is completed, the balance needs to be updated. The redis interlocking mechanism is used to lock the accounts of both borrowers and lenders. If the locking fails, the caller returns that the accounting fails, and the upstream retry; if the locking is successful, continue to obtain the database locks corresponding to the borrowers and lenders. The database lock is used as a bottom-up solution to prevent the redis lock from failing and causing inaccurate accounting balances; if the database lock is locked successfully, the account balance is updated. After the update is successful, the corresponding account flow details are generated and the accounting is returned to the upstream successfully; if the database lock fails to lock, the caller returns that the accounting fails, and the upstream retry. The database layer uses transactions to implement atomic accounting operations, and the final bottom-up is achieved through database locks. For frequent query operations, such as accounting rule queries, as shown in the red part of the figure, the local cache + redis distributed cache mode is also used to prevent cache avalanche through multi-level cache.

[0090] Figure 5 A flowchart of a hotspot account accounting processing device provided by an embodiment of the present invention, such as Figure 5 As shown, the hotspot account accounting processing device provided by the embodiment of the present invention includes: a separation module 51, a first accounting module 52 and a second accounting module 53, wherein:

[0091] A separation module 51 is used to determine whether the account to be recorded is a hotspot account or a non-hotspot account, and to separate the hotspot account from the non-hotspot account;

[0092] A first accounting module 52, configured to configure the first account as an overdraft account and set an overdraft limit in response to detecting that the first account is a hotspot account;

[0093] The first accounting module 53 is further used to obtain the account balance of the first account, and in response to the account balance of the first account being within the overdraft limit, the first account performs accounting operations in a requested order and updates the account balance once every predetermined round of operations;

[0094] The second accounting module is used to obtain the account balance of the second account in response to detecting that the second account is a non-hotspot account, and in response to the account balance of the second account being not less than the amount required for the accounting operation, the second account performs an accounting operation and updates the account balance.

[0095] Based on the same inventive concept, another embodiment of the present invention provides an electronic device, see Figure 6 , Figure 660 is a schematic diagram of the structure of an electronic device provided by the present invention, wherein the electronic device specifically includes the following contents: a processor 601, a memory 602, a communication interface 603 and a communication bus 604;

[0096] The processor 601, the memory 602, and the communication interface 603 communicate with each other via the communication bus 604;

[0097] The processor 601 is used to call the computer program in the memory 602. When the processor executes the computer program, all steps of the above-mentioned hotspot account accounting processing method are implemented. For example, when the processor executes the computer program, the following process is implemented: determining whether the account to be accounted is a hotspot account or a non-hotspot account, and accounting the hotspot account and the non-hotspot account separately; in response to detecting that the first account is a hotspot account, configuring the first account as an overdraft account and setting an overdraft limit; obtaining the account balance of the first account, and in response to the account balance of the first account being within the overdraft limit, the first account performs accounting operations in the order of requests, and updates the account balance once every predetermined round of operations; in response to detecting that the second account is a non-hotspot account, obtaining the account balance of the second account, and in response to the account balance of the second account being not less than the limit required for the accounting operation, the second account performs an accounting operation and updates the account balance once.

[0098] It can be understood that the detailed functions and extended functions that can be executed by the computer program can refer to the description of the above embodiments.

[0099] Based on the same inventive concept, another embodiment of the present invention provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, all steps of the above-mentioned hotspot account accounting processing method are implemented. For example, when the processor executes the computer program, the following process is implemented: determining whether the account to be accounted is a hotspot account or a non-hotspot account, and accounting the hotspot account and the non-hotspot account separately; in response to detecting that the first account is a hotspot account, configuring the first account as an overdraft account and setting an overdraft limit; obtaining the account balance of the first account, and in response to the account balance of the first account being within the overdraft limit, the first account performs accounting operations in the order of requests, and updates the account balance once every predetermined round of operations; in response to detecting that the second account is a non-hotspot account, obtaining the account balance of the second account, and in response to the account balance of the second account being not less than the amount required for the accounting operation, the second account performs an accounting operation and updates the account balance once.

[0100] It can be understood that the detailed functions and extended functions that can be executed by the computer program can refer to the description of the above embodiments.

[0101] Based on the same inventive concept, another embodiment of the present invention provides a computer program product having executable instructions stored thereon, which, when executed by a processor, enables the processor to implement all steps of the above-mentioned hotspot account accounting processing method. For example, when the processor executes the computer program, the following process is implemented: determining whether the account to be accounted is a hotspot account or a non-hotspot account, and accounting the hotspot account and the non-hotspot account separately; in response to detecting that the first account is a hotspot account, configuring the first account as an overdraft account, and setting an overdraft limit; obtaining the account balance of the first account, and in response to the account balance of the first account being within the overdraft limit, the first account performs accounting operations in the order of requests, and updates the account balance once every predetermined round of operations; in response to detecting that the second account is a non-hotspot account, obtaining the account balance of the second account, and in response to the account balance of the second account being not less than the limit required for the accounting operation, the second account performs an accounting operation and updates the account balance once.

[0102] In addition, the logic instructions in the above-mentioned memory can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0103] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the embodiments of the present invention. Those of ordinary skill in the art may understand and implement them without creative effort.

[0104] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the hotspot account accounting processing method described in each embodiment or some parts of the embodiment.

[0105] In addition, in the present invention, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0106] In addition, in the present invention, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0107] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A hotspot account accounting processing method, characterized in that: include: Determine whether the account to be recorded is a hotspot account or a non-hotspot account, and separate the hotspot account from the non-hotspot account; In response to detecting that the first account is a hotspot account, configuring the first account as an overdraft account and setting an overdraft limit; Acquiring the account balance of the first account, and in response to the account balance of the first account being within the overdraft limit, performing accounting operations on the first account in a requested order, and updating the account balance once every predetermined round of operations; In response to detecting that the second account is a non-hotspot account, obtaining an account balance of the second account, and in response to the account balance of the second account being not less than the amount required for the bookkeeping operation, performing a bookkeeping operation on the second account and updating the account balance; In response to detecting that the first account is a hotspot account, configuring the first account as an overdraft account specifically includes: After detecting that the first account is a hotspot account, determining whether the first account meets the overdraft account setting rules, and if so, determining the first account as an overdraft account, wherein the overdraft account setting rules are pre-set according to business requirements; In response to the account balance of the first account being within the overdraft limit, the first account performs bookkeeping operations in a requested order and updates the account balance once every predetermined round of operations, including: The first account receives the accounting request, determines whether the account balance of the first account is within the overdraft limit, and stops accounting if it is not within the overdraft limit; If yes, the first account performs accounting operations according to the request order, and caches the transaction details corresponding to the accounting request in the hotspot account filter; When the scheduled round of operations is reached, the cached transaction details are netted to obtain the account balance of the first account after the scheduled round of operations; Based on the account balance of the first account after the predetermined round of operations, sequentially updating the cached transaction details and the account balances corresponding to the transaction details, and storing the updated transaction details and the account balances corresponding to the transaction details in a preset database, wherein the database is used to store the transaction details after the balance update and the updated account balances; The account balance update is achieved through an interlocking mode, which includes account locking and database locking. The updating of the account balance comprises the following steps: Lock the account whose balance is to be updated. If the lock fails, return to the account whose balance is to be updated and try again. If the account to be updated with a balance is locked successfully, the database corresponding to the account to be updated with a balance is locked. If the database lock fails, the account to be updated with a balance is returned to be locked again. If the database is locked successfully, the account balance to be updated is updated, and the transaction details associated with the account balance are updated.

2. The hotspot account accounting processing method according to claim 1, characterized in that: The step of determining whether the account to be debited is a hotspot account or a non-hotspot account specifically includes: Performing statistical analysis on the transaction flow within a predetermined time interval from the account dimension to obtain statistical analysis results, wherein the statistical analysis results include the business volume processed per unit time; The statistical analysis results are sorted from high to low according to the business volume processed per unit time, and accounts with a predetermined number of top rankings are selected as hot accounts, and other accounts are non-hot accounts.

3. The hotspot account accounting processing method according to claim 2, characterized in that: The separate accounting of hotspot accounts and non-hotspot accounts specifically includes: storing the account information of the hotspot account in a hotspot account filter; The account information of the account to be debited is compared with the account information stored in the hotspot account filter. When the account information of the account to be debited is consistent with the account information stored in the hotspot account filter, it is detected as a hotspot account, and the transaction details of the hotspot account are cached in the hotspot account filter; otherwise, it is detected as a non-hotspot account, and the transaction information of the non-hotspot account is stored in a preset database; Among them, the hotspot account filter adopts a multi-level cache mode; the hotspot account filter is used to separate hotspot accounts from non-hotspot accounts through account information, and cache the transaction details of the hotspot accounts through the multi-level cache mode.

4. The hotspot account accounting processing method according to claim 1, characterized in that: The setting of overdraft limit specifically includes: Obtaining the balance information of the first account within a predetermined period of time; Performing balance trend analysis and prediction on the balance information to obtain a prediction result; The prediction result is set as the overdraft limit of the first account.

5. A hotspot account accounting processing device, characterized in that: include: A separation module is used to determine whether the account to be recorded is a hotspot account or a non-hotspot account, and to separate the hotspot account from the non-hotspot account; A first accounting module, configured to configure the first account as an overdraft account and set an overdraft limit in response to detecting that the first account is a hotspot account; The first accounting module is further used to obtain the account balance of the first account, and in response to the account balance of the first account being within the overdraft limit, the first account performs accounting operations in a requested order and updates the account balance once every predetermined round of operations; A second accounting module, configured to, in response to detecting that the second account is a non-hotspot account, obtain an account balance of the second account, and in response to the account balance of the second account being not less than the amount required for the accounting operation, perform an accounting operation on the second account and update the account balance once; In response to detecting that the first account is a hotspot account, configuring the first account as an overdraft account specifically includes: After detecting that the first account is a hotspot account, determining whether the first account meets the overdraft account setting rules, and if so, determining the first account as an overdraft account, wherein the overdraft account setting rules are pre-set according to business requirements; In response to the account balance of the first account being within the overdraft limit, the first account performs bookkeeping operations in a requested order and updates the account balance once every predetermined round of operations, including: The first account receives the accounting request, determines whether the account balance of the first account is within the overdraft limit, and stops accounting if it is not within the overdraft limit; If yes, the first account performs accounting operations according to the request order, and caches the transaction details corresponding to the accounting request in the hotspot account filter; When the scheduled round of operations is reached, the cached transaction details are netted to obtain the account balance of the first account after the scheduled round of operations; Based on the account balance of the first account after the predetermined round of operations, sequentially updating the cached transaction details and the account balances corresponding to the transaction details, and storing the updated transaction details and the account balances corresponding to the transaction details in a preset database, wherein the database is used to store the transaction details after the balance update and the updated account balances; The account balance update is achieved through an interlocking mode, which includes account locking and database locking. The updating of the account balance comprises the following steps: Lock the account whose balance is to be updated. If the lock fails, return to the account whose balance is to be updated and try again. If the account to be updated with a balance is locked successfully, the database corresponding to the account to be updated with a balance is locked. If the database lock fails, the account to be updated with a balance is returned to be locked again. If the database is locked successfully, the account balance to be updated is updated, and the transaction details associated with the account balance are updated.

6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the hotspot account accounting processing method as described in any one of claims 1 to 4 are implemented.

7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the hotspot account accounting processing method as described in any one of claims 1 to 4 are implemented.

8. A computer program product having executable instructions stored thereon, characterized in that: When the instruction is executed by the processor, the processor implements the steps of the hotspot account accounting processing method as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Business processing method and device, electronic equipment and storage medium

    CN117333170A

  • Accounting method and device, readable medium, electronic equipment and product

    CN118587022A