CN117745426A - Hot account billing processing method and device - Google Patents
Hot account billing processing method and device Download PDFInfo
- Publication number
- CN117745426A CN117745426A CN202311660456.6A CN202311660456A CN117745426A CN 117745426 A CN117745426 A CN 117745426A CN 202311660456 A CN202311660456 A CN 202311660456A CN 117745426 A CN117745426 A CN 117745426A
- Authority
- CN
- China
- Prior art keywords
- account
- hot spot
- balance
- overdraft
- billing
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 25
- 238000000034 method Methods 0.000 claims abstract description 23
- 230000004044 response Effects 0.000 claims abstract description 11
- 238000012545 processing Methods 0.000 claims description 29
- 238000004590 computer program Methods 0.000 claims description 16
- 230000008569 process Effects 0.000 claims description 9
- 238000000926 separation method Methods 0.000 claims description 8
- 238000007619 statistical method Methods 0.000 claims description 8
- 238000001514 detection method Methods 0.000 claims description 7
- 238000005096 rolling process Methods 0.000 claims description 5
- 238000004458 analytical method Methods 0.000 claims description 4
- 238000012163 sequencing technique Methods 0.000 claims description 4
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 claims description 4
- 238000004891 communication Methods 0.000 description 5
- 238000011144 upstream manufacturing Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 4
- 230000007246 mechanism Effects 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 230000032683 aging Effects 0.000 description 3
- 230000003139 buffering effect Effects 0.000 description 3
- 238000013461 design Methods 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 230000018109 developmental process Effects 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 239000000463 material Substances 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 238000012795 verification Methods 0.000 description 2
- 238000004422 calculation algorithm Methods 0.000 description 1
- 230000015556 catabolic process Effects 0.000 description 1
- 230000007812 deficiency Effects 0.000 description 1
- 238000006731 degradation reaction Methods 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 238000013467 fragmentation Methods 0.000 description 1
- 238000006062 fragmentation reaction Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000007704 transition Effects 0.000 description 1
Abstract
The embodiment of the invention provides a hot spot account billing processing method and device, wherein the method comprises the following steps: determining that the account to be billed is a hot spot account or a non-hot spot account, and separating and billing the hot spot account from the non-hot spot account; in response to detecting that the first account is a hot spot account, configuring the first account as a overdraft account, and setting overdraft amount; acquiring the account balance of a first account, responding to the account balance of the first account in the overdraft limit, and performing account counting operation by the first account according to a request sequence, and performing account balance updating once at intervals of a preset round of operation; and responding to the fact that the second account is a non-hot spot account, acquiring the account balance of the second account, and responding to the fact that the account balance of the second account is not smaller than the amount required by the accounting operation, carrying out one-time accounting operation and carrying out one-time account balance update by the second account. The invention solves the problem of system bottleneck caused by frequent balance update of the hot spot account in a short time, and improves billing timeliness.
Description
Technical Field
The invention relates to the technical field of computers, in particular to a hot spot account billing processing method and device.
Background
A hot spot account refers to a large number of transaction requests generated in a short time, mostly falling on one or several accounts, which are called hot spot accounts. Frequent cash out and cash in operations on these accounts create a system bottleneck.
The account system is the bottommost and core part of the whole payment link, and carries the accounting requirement of almost all upstream business products, and has high requirements on system stability, security and throughput. When a service peak is met, in a high concurrency scene, frequent gold-in and gold-out operations appear on a hot spot account, the system performance is seriously influenced, and meanwhile, billing on other non-hot spot accounts can also be influenced, so that hot spot account billing is always a big and difficult problem in an account system.
In order to solve the problems, firstly, the account is locked before accounting, and after all requests come in, the account is queued and then accounted according to the sequence of acquiring the locks, but the method is easy to cause a large number of backlog of the requests, has extremely low processing time and severely restricts the development of business.
The scheme II is that the billing pressure is shared by splitting a plurality of sub-accounts, and the scheme can solve a part of problems, but when a scene of deduction and balance shortage is met, balance adjustment needs to be frequently carried out among the sub-accounts, the scheme complexity is high, and billing errors are easily caused.
Disclosure of Invention
Aiming at the problems of system bottleneck, low processing timeliness, complex optimization scheme and the like caused in the hot spot account billing process, the embodiment of the invention provides a hot spot account billing processing method and device, which are based on a buffer storage and fragmentation batch processing mode, and the hot spot account processing is simple and efficient, can solve the system bottleneck caused by hot spot account billing in a high concurrency scene, effectively improves service processing timeliness, and is simple in design and good in maintainability.
Specifically, the embodiment of the invention provides the following technical scheme:
in a first aspect, an embodiment of the present invention provides a method for processing hot account billing, including:
determining that the account to be billed is a hot spot account or a non-hot spot account, and separating and billing the hot spot account from the non-hot spot account;
in response to detecting that a first account is a hot spot account, configuring the first account as a overdraft account, and setting overdraft amount;
acquiring the account balance of the first account, responding to the account balance of the first account in the overdraft limit, and performing account counting operation on the first account according to a request sequence, and performing account balance updating once at intervals of a preset round of operation;
and responding to the fact that the second account is a non-hot spot account, acquiring the account balance of the second account, and responding to the fact that the account balance of the second account is not smaller than the amount required by the accounting operation, performing one-time accounting operation and performing one-time account balance update on the second account.
Further, the determining that the account to be billed is a hot spot account or a non-hot spot account specifically includes:
carrying out statistical analysis on transaction flowing water within a preset time interval from account dimension to obtain a statistical analysis result, wherein the statistical analysis result comprises processing traffic in unit time;
and sequencing the statistical analysis result according to the processing traffic volume of unit time from high to low, selecting accounts with a preset quantity before sequencing, and determining the accounts as hot accounts, wherein other accounts are non-hot accounts.
Further, the separate billing of the hot-spot account and the non-hot-spot account specifically includes:
storing account information of the hot spot account in a hot spot account filter;
comparing account information of an account to be billed with account information stored in the hot spot account filter, detecting the account to be billed as a hot spot account when the account information of the account to be billed is consistent with the account information stored in the hot spot account filter, and caching transaction details of the hot spot account in the hot spot account filter; otherwise, detecting the non-hot account, and storing the transaction information of the non-hot account in a preset database;
the hot spot account filter adopts a multi-level cache mode; the hot spot account filter is used for separating a hot spot account from a non-hot spot account through account information, and caching transaction details of the hot spot account through a multi-level caching mode.
Further, the responding to the detection that the first account is a hot spot account configures the first account as a overdraft account and sets overdraft amount specifically includes:
after detecting that the first account is a hot spot account, judging whether the first account accords with overdraft account setting rules, if so, determining that the first account is a overdraft account, wherein the overdraft account setting rules are preset according to service requirements;
obtaining balance information in a preset period of the first account;
carrying out balance trend analysis and prediction on the balance information to obtain a prediction result;
and setting the prediction result as overdraft limit of the first account.
Further, the responding to the account balance of the first account being in the overdraft amount, the first account performing accounting operation according to the request sequence, performing account balance update once at intervals of a predetermined round of operation, including:
the first account receives a billing request, judges whether the account balance of the first account is within the overdraft amount, and stops billing if the account balance of the first account is not within the overdraft amount;
if yes, the first account performs accounting operation according to the request sequence, and transaction details corresponding to the accounting request are cached in the hot spot account filter;
when the preset round of operation is reached, rolling the cached transaction details to obtain the account balance of the first account after the preset round of operation;
based on the account balance of the first account after the preset round of operation, sequentially updating the cached transaction details and the account balance corresponding to the transaction details, and storing the updated transaction details and the account balance corresponding to the transaction details in a preset database, wherein the database is used for storing the transaction details after balance updating and the updated account balance.
Further, the account balance update is realized through an interlocking mode, the interlocking mode comprises account locking and database locking,
the primary account balance updating method specifically comprises the following steps:
locking the account to be updated in balance, and if the locking fails, returning the account to be updated in balance for retry;
under the condition that the account to be balance updated is successfully locked, locking a database corresponding to the account to be balance updated, and if the database is not locked, continuing to return the account to be balance updated for re-locking;
and if the database is successfully locked, updating the account balance of the account to be updated, and updating the transaction details related to the account balance.
In a second aspect, an embodiment of the present invention further provides a hotspot account accounting processing device, including:
the separation module is used for determining that the account to be billed is a hot spot account or a non-hot spot account, and separating and billing the hot spot account from the non-hot spot account;
the first accounting module is used for responding to the detection that the first account is a hot spot account, configuring the first account as a overdraft account and setting overdraft limit;
the first accounting module is further used for acquiring the account balance of the first account, and responding to the account balance of the first account in the overdraft limit, the first account performs accounting operation according to the request sequence, and performs account balance update once at intervals of a preset round of operation;
the second accounting module is used for responding to the detection that the second account is a non-hot spot account, obtaining the account balance of the second account, responding to the fact that the account balance of the second account is not smaller than the amount required by accounting operation, performing one accounting operation on the second account, and performing one account balance update.
In a third aspect, an embodiment of the present invention further provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the steps of any one of the hot spot account billing processing methods according to the first aspect when the program is executed.
In a fourth aspect, embodiments of the present invention also provide a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of any of the hotspot account billing processes of the first aspect.
In a fifth aspect, embodiments of the present invention also provide a computer program product having stored thereon executable instructions that when executed by a processor cause the processor to perform the steps of any of the hot spot account billing processes of the first aspect.
According to the technical scheme, the hot spot account billing processing method and device provided by the embodiment of the invention have the advantages that the hot spot account is set as the overdraft account, the balance update is only carried out once within the preset time period, the billing aging of the hot spot account is improved, the account processing pressure is reduced, the problem of system bottleneck caused by frequent balance update of the hot spot account in a short time is solved, the billing process is simplified, and the service processing aging is effectively improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a hot spot account billing processing method according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of hot spot account buffering billing according to an embodiment of the present invention;
fig. 3 is a schematic diagram of a structure of separating a hot account from a non-hot account according to an embodiment of the present invention;
FIG. 4 is a schematic flow chart of non-hot account billing provided by an embodiment of the present invention;
FIG. 5 is a flowchart of a hot spot account billing processing apparatus according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device provided by the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Before describing the hot account billing processing method provided in this embodiment, the concept of a hot account will be introduced. It should be noted that the account system is the bottommost and core part of the whole payment link, and carries the accounting requirement of almost all upstream business products, and has high requirements on system stability, security and throughput. When a service peak is met, in a high concurrency scene, frequent gold-in and gold-out operations appear on a hot spot account, the system performance is seriously influenced, and meanwhile, billing on other non-hot spot accounts can also be influenced, so that hot spot account billing is always a big and difficult problem in an account system. Current solutions to the hotspot account billing problem: scheme one: locking accounts before accounting, queuing and accounting according to the sequence of acquiring the locks after all the requests come in, so that a large number of requests are backlogged, the processing time is extremely low, and the service development is seriously restricted; scheme II: splitting the plurality of sub-accounts and sharing the billing pressure. The balance adjustment method can solve a part of problems, when a scene of insufficient balance deduction is met, balance adjustment needs to be frequently conducted among all sub accounts, the complexity of the scheme is high, and billing errors are easy to cause. In order to solve the problem, the embodiment of the invention provides a hot spot account billing processing method and device, when a hot spot account is detected, the hot spot account and a non-hot spot account are separately billed, overdraft limit is set for the hot spot account, and after a preset round of operation, the balance is updated instead of updating the balance every time, so that the system bottleneck caused by hot spot account billing under a high concurrency scene is solved to a certain extent, service processing timeliness is effectively improved, and the design is simple and maintainability is good.
The hot spot account billing processing method and device provided by the invention are explained in detail below through specific embodiments.
Fig. 1 is a flowchart of a hot spot account billing processing method provided by an embodiment of the present invention, and as shown in fig. 1, the hot spot account billing processing method provided by the embodiment of the present invention includes the following steps:
step 101: determining that the account to be billed is a hot spot account or a non-hot spot account, and separating and billing the hot spot account from the non-hot spot account;
step 102: in response to detecting that a first account is a hot spot account, configuring the first account as a overdraft account, and setting overdraft amount;
step 103: acquiring the account balance of the first account, responding to the account balance of the first account in the overdraft limit, and performing account counting operation on the first account according to a request sequence, and performing account balance updating once at intervals of a preset round of operation;
step 104: and responding to the fact that the second account is a non-hot spot account, acquiring the account balance of the second account, and responding to the fact that the account balance of the second account is not smaller than the amount required by the accounting operation, performing one-time accounting operation and performing one-time account balance update on the second account.
The above steps are described in detail with reference to specific examples.
Step 101: determining that the account to be billed is a hot spot account or a non-hot spot account, and separating and billing the hot spot account from the non-hot spot account;
in this embodiment, it should be noted that before detecting whether the account is a hot account, it is necessary to determine whether there is a situation that the instantaneous accounting concurrency is large, which causes a system bottleneck.
For example, the transaction flow in the last months can be statistically analyzed from the account dimension, the processing traffic is ranked from high to low according to unit time, the account ranked at the top can be used as a hot spot account, and the account ranked at the top can be used as a non-hot spot account.
After the account is detected as a hot spot account, storing account information of the hot spot account in a hot spot account filter; the hot spot account filter adopts a multi-level cache mode and is used for separating a hot spot account from a non-hot spot account through account information, and caching transaction details of the hot spot account through the multi-level cache mode.
Step 102: in response to detecting that a first account is a hot spot account, configuring the first account as a overdraft account, and setting overdraft amount;
in this step, after the hot-spot account is screened, it is further required to determine whether the account allows overdraft or not, and whether the risk is controllable or not.
Specifically, after detecting that a first account is a hot spot account, judging whether the first account accords with overdraft account setting rules, if so, determining that the first account is an overdraft account, wherein the overdraft account setting rules are preset according to service requirements; obtaining balance information in a preset period of the first account; carrying out balance trend analysis and prediction on the balance information to obtain a prediction result; and setting the prediction result as overdraft limit of the first account.
For example, since the buffer billing mode does not update the balance in real time, a balance deficiency may occur, and in order to ensure the normal operation of the service, the hot spot account needs to be configured to be overdraft and to allocate a corresponding overdraft amount, so an account with a low overdraft risk, such as an inner account or a main merchant account in a group, is generally selected as the hot spot account.
Further, it is necessary to determine whether the overdraft amount of the hot account is acceptable.
Specifically, the hot spot account needs to analyze and predict balance trend in advance, so that frequent overdraft and overdraft limit are prevented from bringing extra risks. That is, the balance trend analysis is performed on the hot account to predict whether balance overdrawing will occur frequently and whether overdrawing amount service parties are acceptable.
Step 103, acquiring account balance of the first account, and responding to the account balance of the first account within the overdraft limit, wherein the first account performs account counting operation according to a request sequence, and performs account balance updating once at intervals of a preset round of operation;
in the step, an accounting request is received, whether the balance of the hot spot account is within a preset overdraft limit is judged, and if not, the accounting is stopped; if the hot spot account performs accounting operation according to the request sequence, and when the preset round of operation is not reached, caching transaction details corresponding to the accounting request in a hot spot account filter; when the preset round of operation is reached, rolling the cached transaction details to obtain the account balance of the hot spot account after the preset round of operation; based on the account balance, sequentially updating the cached transaction details and the balances corresponding to the transaction details, and storing the updated transaction details and the balances corresponding to the transaction details in a preset database, wherein the database is used for storing the transaction details after balance updating and the updated account balances.
In a specific embodiment, the hot-spot account buffer explicit sub-slice batch processing can be realized through a lightweight distributed task scheduling platform XXLJOB+state machine+task scheduling mechanism for processing running batch tasks, so that the hot-spot account billing aging is improved, the billing pressure is reduced, and the system bottleneck is solved. For example, 100 cash-out and cash-in operations are performed on the same hot-spot account, firstly, the cash-in list is subjected to rolling calculation, after the final amount to be updated is obtained, 100 times of request accounting can be realized by only carrying out balance updating once, the result is accurate, and the transaction running water is strictly generated according to the real request sequence.
Fig. 2 is a schematic flow chart of hot-spot account buffering billing provided in an embodiment of the present invention, as shown in fig. 2, implementing hot-spot account buffering explicit sub-slice batch processing by xxljob+state machine+task orchestration, and specifically includes the steps of:
s1: starting XXLJOB task, checking whether a task is being processed, if so, directly exiting;
s2: if no task is currently being executed, inquiring a buffer detail record to be processed (state W-to be processed), and if no task to be processed exists, directly exiting;
s3: if a task to be processed exists, acquiring a unique self-increasing serial number from redis as a batch number, and updating the batch to-be-processed buffer detail in batches;
s4: generating batch information corresponding to the batch detail, and performing state P-processing;
s5: grouping the batch of details to be processed according to account numbers, wherein key=account number values=account details;
s6: performing rolling calculation on account details, and calculating the amount to be updated of the account;
s7: performing account balance updating operation according to the non-hot-spot account billing flow;
s8: after the balance is finer, generating account corresponding running water detail information in batches according to the sequence;
s9, updating the buffer billing details and the batch status, changing the p-processing to the S-processing successfully, and ending the billing.
In the embodiment provided by the invention, it is to be noted that: the node can be understood as a distributed system, wherein an application corresponds to a plurality of machines for distributing request pressure, and each machine is called an application node; a state machine can be understood as giving state definitions of various task steps, and paths and conditions of state transitions; the XXL-JOB broadcasting mode refers to that the XXL-JOB platform maintains the numbers of all the nodes of an application and the total number of the nodes, when the XXL-JOB platform is executed in the broadcasting mode, the XXL-JOB carries the numbers of the application nodes and the total number of the nodes to request each application node, and when the nodes receive the request, the nodes judge which data in the task scheduling need to be executed and skipped according to the modulo algorithm and the like. All nodes process data volume addition = all data volumes to be processed.
Step 104: and responding to the fact that the second account is a non-hot spot account, acquiring the account balance of the second account, and responding to the fact that the account balance of the second account is not smaller than the amount required by the accounting operation, performing one-time accounting operation and performing one-time account balance update on the second account.
In this embodiment, after obtaining a hot spot account and a non-hot spot account, implementing fast filtering of the hot spot account and the non-hot spot account by using a local cache, and performing billing separation on the hot spot account and the non-hot spot account; for a non-hot spot account, normal accounting is carried out, the load of a database is reduced by utilizing an interlocking mode, meanwhile, quick fusing is realized, the database lock is closed off, and the high availability of the system in a high concurrency scene is improved; and for the hot spot account, only the accounting details are stored according to the request sequence, and balance update is not performed, so that the processing performance of the system is improved.
Optionally, the billing link implements a hotspot account and non-hotspot account billing separation by means of a hotspot account filter. Fig. 3 is a schematic diagram of a structure of separation between a hot account and a non-hot account according to an embodiment of the present invention, as shown in fig. 3, a filter adopts a local cache+redis distributed cache multi-level cache design manner, so as to prevent cache avalanche, and details of implementation of the distributed caches adopted by the hot account and separation accounting are shown in fig. 3.
Further, the non-hotspot account realizes account balance updating through an interlocking mode, wherein the interlocking mode comprises account locking and database locking. Optionally, the account balance updating is realized through an interlocking mode, which specifically comprises the following steps: locking the account to be updated in balance, and if the locking fails, returning the account to be updated in balance for retry; under the condition that the account to be balance updated is successfully locked, locking a database corresponding to the account to be balance updated, and if the database is not locked, continuing to return the account to be balance updated for re-locking; and if the database is successfully locked, updating the account balance of the account to be updated, and updating the transaction details related to the account balance.
Specifically, fig. 4 is a schematic flow chart of non-hot account billing provided in the embodiment of the present invention, as shown in fig. 4, for non-hot account billing, in order to promote high availability of a system in a high concurrency scenario, an interlocking multi lock layer+database DB layer processing mechanism is adopted, and layered processing is performed, so that single responsibility is achieved as much as possible. The mutilLock layer is responsible for maintaining a billing lock mechanism, realizing service degradation through quick fusing when the concurrency is excessive, and protecting a database.
For example, in a specific embodiment, when there are two lending parties and a non-hot account opens a billing link, pre-verification is needed to verify that the content includes whether the billing state is normal, whether the account balance is sufficient, and the like; after the front verification is finished, accounting is started on the accounts of the lending and lending parties, balance needs to be updated after accounting is finished, a redis interlocking mechanism is adopted to lock the accounts of the lending and lending parties, if the locking fails, the accounting failure of the calling party is returned, and the upstream retries are carried out; if the locking is successful, continuously acquiring database locks corresponding to the lending parties, wherein the database locks are used as a spam scheme to prevent the problem of inaccurate accounting balance caused by invalidation of redis locks; if the database lock is successful, updating the balance of the account, generating a corresponding account running list after the balance is updated successfully, and returning to the upstream accounting success; if the database lock fails, the caller billing failure is returned, and the upstream retries. The method adopts a database layer to realize accounting atomic operation by utilizing transactions, realizes final spam through database locks, and prevents cache avalanche through multi-level cache for frequent query operations such as accounting rule query, such as red display part in the figure, and also utilizes a local cache+redis distributed cache mode.
Fig. 5 is a flowchart of a hot spot account billing processing device according to an embodiment of the present invention, where, as shown in fig. 5, the hot spot account billing processing device according to the embodiment of the present invention includes: separation module 51, first billing module 52, and second billing module 53, wherein:
the separation module 51 is configured to determine that the account to be billed is a hot account or a non-hot account, and separate the hot account from the non-hot account;
the first accounting module 52 is configured to configure the first account as a overdraft account and set overdraft amount in response to detecting that the first account is a hot spot account;
the first accounting module 53 is further configured to obtain an account balance of the first account, and perform accounting operations according to a request sequence in response to the account balance of the first account being within the overdraft amount, and perform account balance update at intervals of a predetermined round of operations;
the second accounting module is used for responding to the detection that the second account is a non-hot spot account, obtaining the account balance of the second account, responding to the fact that the account balance of the second account is not smaller than the amount required by accounting operation, performing one accounting operation on the second account, and performing one account balance update.
Based on the same inventive concept, still another embodiment of the present invention provides an electronic device, referring to fig. 6, fig. 6 is a schematic structural diagram of the electronic device provided by the present invention, where the electronic device specifically includes the following contents: a processor 601, a memory 602, a communication interface 603 and a communication bus 604;
wherein the processor 601, the memory 602, and the communication interface 603 complete communication with each other through the communication bus 604;
the processor 601 is configured to invoke a computer program in the memory 602, where the processor executes the computer program to implement all the steps of the hot spot account billing processing method described above, for example, the processor executes the computer program to implement the following procedures: determining that the account to be billed is a hot spot account or a non-hot spot account, and separating and billing the hot spot account from the non-hot spot account; in response to detecting that a first account is a hot spot account, configuring the first account as a overdraft account, and setting overdraft amount; acquiring the account balance of the first account, responding to the account balance of the first account in the overdraft limit, and performing account counting operation on the first account according to a request sequence, and performing account balance updating once at intervals of a preset round of operation; and responding to the fact that the second account is a non-hot spot account, acquiring the account balance of the second account, and responding to the fact that the account balance of the second account is not smaller than the amount required by the accounting operation, performing one-time accounting operation and performing one-time account balance update on the second account.
It will be appreciated that the refinement and expansion functions that the computer program may perform are as described with reference to the above embodiments.
Based on the same inventive concept, a further embodiment of the present invention provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements all the steps of the above-mentioned hot spot account billing processing method, for example, the processor implements the following procedure when executing the computer program: determining that the account to be billed is a hot spot account or a non-hot spot account, and separating and billing the hot spot account from the non-hot spot account; in response to detecting that a first account is a hot spot account, configuring the first account as a overdraft account, and setting overdraft amount; acquiring the account balance of the first account, responding to the account balance of the first account in the overdraft limit, and performing account counting operation on the first account according to a request sequence, and performing account balance updating once at intervals of a preset round of operation; and responding to the fact that the second account is a non-hot spot account, acquiring the account balance of the second account, and responding to the fact that the account balance of the second account is not smaller than the amount required by the accounting operation, performing one-time accounting operation and performing one-time account balance update on the second account.
It will be appreciated that the refinement and expansion functions that the computer program may perform are as described with reference to the above embodiments.
Based on the same inventive concept, a further embodiment of the present invention provides a computer program product having stored thereon executable instructions that when executed by a processor cause the processor to perform all the steps of the above-mentioned hot spot account billing processing method, for example, the processor performing the following procedure when executing the computer program: determining that the account to be billed is a hot spot account or a non-hot spot account, and separating and billing the hot spot account from the non-hot spot account; in response to detecting that a first account is a hot spot account, configuring the first account as a overdraft account, and setting overdraft amount; acquiring the account balance of the first account, responding to the account balance of the first account in the overdraft limit, and performing account counting operation on the first account according to a request sequence, and performing account balance updating once at intervals of a preset round of operation; and responding to the fact that the second account is a non-hot spot account, acquiring the account balance of the second account, and responding to the fact that the account balance of the second account is not smaller than the amount required by the accounting operation, performing one-time accounting operation and performing one-time account balance update on the second account.
Further, the logic instructions in the memory described above may be implemented in the form of software functional units and stored in a computer-readable storage medium when sold or used as a stand-alone product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules can be selected according to actual needs to achieve the purpose of the embodiment of the invention. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on such understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform the hot spot account billing processing method according to the respective embodiments or some parts of the embodiments.
Moreover, in the present invention, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Furthermore, in the present disclosure, descriptions of the terms "one embodiment," "some embodiments," "examples," "particular examples," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present disclosure. In this specification, schematic representations of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, the different embodiments or examples described in this specification and the features of the different embodiments or examples may be combined and combined by those skilled in the art without contradiction.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims (10)
1. A hot spot account billing processing method, comprising:
determining that the account to be billed is a hot spot account or a non-hot spot account, and separating and billing the hot spot account from the non-hot spot account;
in response to detecting that a first account is a hot spot account, configuring the first account as a overdraft account, and setting overdraft amount;
acquiring the account balance of the first account, responding to the account balance of the first account in the overdraft limit, and performing account counting operation on the first account according to a request sequence, and performing account balance updating once at intervals of a preset round of operation;
and responding to the fact that the second account is a non-hot spot account, acquiring the account balance of the second account, and responding to the fact that the account balance of the second account is not smaller than the amount required by the accounting operation, performing one-time accounting operation and performing one-time account balance update on the second account.
2. The hot spot account billing processing method according to claim 1, wherein the determining that the account to be billed is a hot spot account or a non-hot spot account specifically includes:
carrying out statistical analysis on transaction flowing water within a preset time interval from account dimension to obtain a statistical analysis result, wherein the statistical analysis result comprises processing traffic in unit time;
and sequencing the statistical analysis result according to the processing traffic volume of unit time from high to low, selecting accounts with a preset quantity before sequencing, and determining the accounts as hot accounts, wherein other accounts are non-hot accounts.
3. The hot spot account billing processing method according to claim 2, wherein the separating billing of the hot spot account from the non-hot spot account specifically includes:
storing account information of the hot spot account in a hot spot account filter;
comparing account information of an account to be billed with account information stored in the hot spot account filter, detecting the account to be billed as a hot spot account when the account information of the account to be billed is consistent with the account information stored in the hot spot account filter, and caching transaction details of the hot spot account in the hot spot account filter; otherwise, detecting the non-hot account, and storing the transaction information of the non-hot account in a preset database;
the hot spot account filter adopts a multi-level cache mode; the hot spot account filter is used for separating a hot spot account from a non-hot spot account through account information, and caching transaction details of the hot spot account through a multi-level caching mode.
4. The hot spot account billing processing method according to claim 1, wherein the responding to the detection that the first account is a hot spot account configures the first account as a overdraft account and sets a overdraft amount specifically includes:
after detecting that the first account is a hot spot account, judging whether the first account accords with overdraft account setting rules, if so, determining that the first account is a overdraft account, wherein the overdraft account setting rules are preset according to service requirements;
obtaining balance information in a preset period of the first account;
carrying out balance trend analysis and prediction on the balance information to obtain a prediction result;
and setting the prediction result as overdraft limit of the first account.
5. The billing processing method of claim 1 or 4, wherein the first account performs billing operations in a requested order in response to the account balance of the first account being within the overdraft amount, performing an account balance update at intervals of a predetermined round of operations, comprising:
the first account receives a billing request, judges whether the account balance of the first account is within the overdraft amount, and stops billing if the account balance of the first account is not within the overdraft amount;
if yes, the first account performs accounting operation according to the request sequence, and transaction details corresponding to the accounting request are cached in the hot spot account filter;
when the preset round of operation is reached, rolling the cached transaction details to obtain the account balance of the first account after the preset round of operation;
based on the account balance of the first account after the preset round of operation, sequentially updating the cached transaction details and the account balance corresponding to the transaction details, and storing the updated transaction details and the account balance corresponding to the transaction details in a preset database, wherein the database is used for storing the transaction details after balance updating and the updated account balance.
6. The hot spot account billing process of claim 1 wherein the account balance update is accomplished by an interlock scheme, the interlock scheme comprising account locking and database locking,
the primary account balance updating method specifically comprises the following steps:
locking the account to be updated in balance, and if the locking fails, returning the account to be updated in balance for retry;
under the condition that the account to be balance updated is successfully locked, locking a database corresponding to the account to be balance updated, and if the database is not locked, continuing to return the account to be balance updated for re-locking;
and if the database is successfully locked, updating the account balance of the account to be updated, and updating the transaction details related to the account balance.
7. A hotspot account billing processing apparatus, comprising:
the separation module is used for determining that the account to be billed is a hot spot account or a non-hot spot account, and separating and billing the hot spot account from the non-hot spot account;
the first accounting module is used for responding to the detection that the first account is a hot spot account, configuring the first account as a overdraft account and setting overdraft limit;
the first accounting module is further used for acquiring the account balance of the first account, and responding to the account balance of the first account in the overdraft limit, the first account performs accounting operation according to the request sequence, and performs account balance update once at intervals of a preset round of operation;
the second accounting module is used for responding to the detection that the second account is a non-hot spot account, obtaining the account balance of the second account, responding to the fact that the account balance of the second account is not smaller than the amount required by accounting operation, performing one accounting operation on the second account, and performing one account balance update.
8. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor performs the steps of the hot spot account billing processing method of any one of claims 1 to 6 when the program is executed.
9. A non-transitory computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the hot spot account billing processing method of any one of claims 1 to 6.
10. A computer program product having stored thereon executable instructions which when executed by a processor cause the processor to carry out the steps of the hot spot account billing processing method of any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311660456.6A CN117745426A (en) | 2023-12-05 | 2023-12-05 | Hot account billing processing method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311660456.6A CN117745426A (en) | 2023-12-05 | 2023-12-05 | Hot account billing processing method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117745426A true CN117745426A (en) | 2024-03-22 |
Family
ID=90255483
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311660456.6A Pending CN117745426A (en) | 2023-12-05 | 2023-12-05 | Hot account billing processing method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117745426A (en) |
-
2023
- 2023-12-05 CN CN202311660456.6A patent/CN117745426A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5698235B2 (en) | Account parallel processing method and system | |
CN106656839A (en) | Resource transfer method and apparatus | |
CN110889751B (en) | Enterprise fund pool management method, device, system, electronic equipment and readable medium | |
CN109272404B (en) | Service authorization method and device | |
CN110490734B (en) | Transaction group construction and broadcasting method and system, equipment and storage medium | |
CN112036863A (en) | Payment amount processing method and device, electronic equipment and storage medium | |
CN110809024B (en) | Service resource providing method and device and subscription package providing method and device | |
CN117745426A (en) | Hot account billing processing method and device | |
CN117541172A (en) | Hot account concurrent processing method, device and equipment based on sub-account splitting | |
CN111105306A (en) | Resource transaction strategy determination method and device and server | |
CN115358825A (en) | Matching transaction method and system based on block chain prediction machine | |
CN115421933A (en) | Intelligent processing method, device and storage medium for Unionpay transaction | |
CN112541768A (en) | Centralized routing method and device, electronic equipment and computer-readable storage medium | |
CN111010676B (en) | Short message caching method, device and system | |
CN113724077A (en) | Loan approval method, device and system | |
CN113055401B (en) | Enterprise business authorization processing method and device | |
CN112381537A (en) | Hotspot account billing method | |
CN116468551B (en) | Financial business management method, system, computer and readable storage medium | |
CN116719808A (en) | Billing method, billing device, storage medium and terminal | |
CN118014568A (en) | Current limiting processing method, system, storage medium and electronic equipment | |
CN111737262A (en) | Data processing method and device | |
CN116050550A (en) | Service booking processing method and electronic equipment | |
CN116579778A (en) | Refund commission trial calculation strategy application method and system | |
CN113762946A (en) | Account deposit and withdrawal method, device, electronic equipment, medium and program product | |
CN115511615A (en) | Method and device for determining unit loan guarantee mode |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |