CN-121996668-A - Bank account hot spot identification upgrading parallel handling method and device based on optimistic lock
Abstract
The invention provides a bank account hot spot identification upgrading parallel processing method and device based on optimistic lock, which relate to the field of financial science and technology and comprise the steps of receiving an account operation request initiated by an external system; judging whether the account is marked as a hot spot account or not, if the account is not marked as the hot spot account, performing hot spot window checking, wherein the hot spot window checking comprises the steps of determining a preset time window, detecting concurrent operation in the time window, counting the concurrent operation in the time window based on an optimistic lock mechanism, wherein the optimistic lock mechanism comprises version number control and cyclic updating operation, automatically upgrading the account into the hot spot account and switching to a hot spot processing mode when the counting result exceeds a preset hot spot threshold value, and supporting parallel execution of common account processing operation and hot spot account processing operation in the account hot spot identification process. The method and the system realize the real-time dynamic identification of the account hot spots, improve the processing stability of multiple concurrent accounts, and ensure the normal processing and the normal response of the system.
Inventors
- WEN TAO
- WEI XIN
- DAI DUAN
- YANG CHAO
- XIA PENG
- PENG TAO
Assignees
- 神州数码融信软件有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20260122
Claims (10)
- 1. The bank account hot spot identification upgrading parallel disposal method based on the optimistic lock is characterized by comprising the following steps of: receiving an account operation request initiated by an external system; judging whether the account is marked as a hot spot account or not; If the hot account is not marked, performing hot window checking, wherein the hot window checking comprises the steps of determining a preset time window and detecting concurrent operation in the time window; counting concurrent operations within the time window based on an optimistic lock mechanism, wherein the optimistic lock mechanism includes version number control and cyclic update operations; when the counting result exceeds a preset hot spot threshold value, automatically upgrading the account into a hot spot account, and switching to a hot spot processing mode; in the account hot spot identification process, the account supports parallel execution of common account processing operation and hot spot account processing operation.
- 2. The optimistic lock-based bank account hotspot identification upgrade parallel handling method of claim 1, wherein the hotspot window check specifically comprises: When the operation of the first account is triggered, recording the starting time of a time window, and taking the starting time plus a preset duration as a window period; for subsequent account operations, determining whether it falls within the time window: if the concurrent operation count falls within the time window, participating in the concurrent operation count of the time window; if the time window falls outside the time window, reestablishing the time window; triggering the account operation for establishing the time window, and directly entering the common account processing flow after the time window is established.
- 3. The optimistic lock-based bank account hotspot identification upgrade parallel handling method of claim 1, wherein the optimistic lock-based counting mechanism comprises: inquiring a current count value and a version number when checking that account operation participates in concurrent operation counting of the time window; updating the count value and the version number by taking the query result as an updating condition; If the updating is successful, judging the threshold value with the preset hot spot threshold value; if the update fails, the retry is looped until the account operation is responded directly after the maximum number of attempts is reached.
- 4. The method for performing parallel processing on bank account hotspot identification upgrade based on optimistic lock according to claim 3, wherein if the update is successful, the account operation enters a synchronous parallel processing flow.
- 5. The optimistic lock-based bank account hotspot identification upgrade parallel handling method of claim 3, wherein performing a threshold determination with the preset hotspot threshold comprises: If the updated count value does not exceed the preset hot spot threshold value, the account operation enters a common account processing flow; If the updated count value exceeds the preset hot spot threshold value, the account is automatically updated into a hot spot account, and the account operation enters an asynchronous parallel processing flow.
- 6. The optimistic lock-based bank account hotspot identification upgrade parallel handling method of claim 5, wherein automatically upgrading the account to a hotspot account and the account operation enters an asynchronous parallel processing flow, comprising: when a thread triggering the account to be upgraded into a hot account is in the process of upgrading, the hot mark of the part of the threads of the account instantaneously becomes the process of upgrading, not upgrading and upgrading, and simultaneously enters a common account processing flow, a subsequent thread of the account enters a hot account balance processing flow, and at the moment, the threads of the process of upgrading, not upgrading and upgrading are synchronously and parallelly processed in the common account processing; When a thread triggering the account to be upgraded into the hot account is upgraded into the hot account thread, the thread also enters a hot account balance processing flow, and the account operation enters an asynchronous parallel processing flow.
- 7. The optimistically lock-based bank account hotspot identification upgrade parallel handling method of claim 1, wherein the switching of hotspot processing modes comprises asynchronous parallel processing and synchronous parallel processing: In the process of upgrading the account into the hot spot, other operations do not need to wait, directly enter a balance processing flow of the hot spot account, and carry out asynchronous parallel processing; In the common account processing flow, the threads in hot spot upgrading are compatible, and synchronous parallel processing is carried out through temporary running water registration and balance summarization.
- 8. The optimistic lock-based bank account hotspot identification upgrade parallel handling method of claim 7, wherein the synchronous parallel processing specifically comprises: in the ordinary account processing, pessimistic locks are used for inquiring the balance; registering temporary running water for concurrent balance verification; Summarizing the temporary running transaction amount to prevent overdraft; Updating the temporary running state, and performing formal marking when the account is updated to be a hot-spot account.
- 9. The optimistic lock-based bank account hotspot identification upgrade parallel handling apparatus for implementing the method of any of claims 1-5, comprising a hotspot routing module, a hotspot window inspection module, an optimistic lock counting module, and a parallel processing module, the apparatus operating in a distributed environment without introducing a central node; the hotspot routing module is used for: receiving a request and judging the account hot spot state; The hot spot window checking module is used for: Managing a time window and concurrency detection; the optimistic lock counting module is configured to: realizing concurrent safety counting; the parallel processing module is used for: asynchronous and synchronous process flows are supported.
- 10. The optimistic lock-based bank account hotspot identification upgrade parallel handling apparatus of claim 9, further providing real-time hotspot identification and upgrade capabilities, triggering immediately upon hotspot occurrence without pre-prediction or post-analysis, supporting large concurrent requests, and thread waiting cancellation through version provided by the optimistic lock.
Description
Bank account hot spot identification upgrading parallel handling method and device based on optimistic lock Technical Field The invention relates to the technical field of finance and technology, in particular to the technical field of high concurrency account processing, and particularly relates to a bank account hot spot identification upgrading parallel processing method and device based on optimistic locks. Background With the development of internet financial services, the generation of a centralized single account issuing service initiated by the channels of banking, networking, super-networking and the like is more and more frequent, such as a settlement account opened by an online store merchant at a bank, a plurality of individual clients can transfer money to the settlement account at the same time, and account hot spots can occur at the moment. In the process of settling account billing, the traditional financial account business needs to control account balance and amount, and high-frequency operation on the same account can cause the problem of locking the account hot spot, so that various processing schemes related to the hot spot account are derived. The hot spot account proposal generally needs to mark the hot spot of the account, and then guides a system to a logic branch different from the common billing based on the hot spot mark, thereby avoiding the problems brought by the hot spot account. For the hot spot marking in the process, marking is basically carried out asynchronously in the prior art, and two hot spot identification modes are generally adopted, namely (1) before surrounding a hot spot, an independent hot spot account marking API service is provided, a channel end (counter, online banking and the like) carries out account hot spot marking operation through account opening or signing service packaging, and a client carries out active service handling at the channel end, so that an account is marked as a hot spot. (2) After the hot spot is surrounded, a post analysis prediction mark is provided, and based on a large amount of account business data analysis, the hot spot or possible hot spot of the account at a certain moment is judged, so that a hot spot account list is formed, and after the confirmation of a business operator, the hot spot mark is carried out on the account in the system. Problems of the existing automatic hot spot identification method for bank accounts include asynchronous hot spot identification, incapability of coping with sudden hot spots based on pre-subscription or post-analysis, lack of instantaneity, possibility of a large number of processing failures and poor experience when a sudden event becomes a hot spot for common accounts without marked hot spots, possibility of system paralysis when the sudden event becomes the hot spot for common accounts without marked hot spots, and high risk. Based on the above problems, there is a need for a method for identifying and upgrading a bank account in real time, which immediately realizes the hot spot upgrading of the account in the process that a common account suddenly becomes a hot spot, and avoids a large number of failure responses or risk of system paralysis. Disclosure of Invention Aiming at the problems in the background art, the invention provides a bank account hot spot identification upgrading parallel processing method and device based on optimistic locks, which can effectively prevent lock contention problems caused by the pessimistic locks of common accounts by carrying out hot spot marking and identification before the common account lock list processing in a cyclic optimistic lock counting mode, and simultaneously provide high-performance processing identification capacity to finish dynamic hot spot marking identification processing, thereby guiding the accounting processing of the common accounts to be switched into hot account processing, billing a single common account with high instantaneous concurrency and providing security control and hot spot upgrading processing. In order to achieve the aim, the invention provides a bank account hot spot identification upgrading parallel processing method based on optimistic lock, which comprises the steps of receiving an account operation request initiated by an external system; judging whether the account is marked as a hot spot account or not; If the hot account is not marked, performing hot window checking, wherein the hot window checking comprises the steps of determining a preset time window and detecting concurrent operation in the time window; counting concurrent operations within the time window based on an optimistic lock mechanism, wherein the optimistic lock mechanism includes version number control and cyclic update operations; when the counting result exceeds a preset hot spot threshold value, automatically upgrading the account into a hot spot account, and switching to a hot spot processing mode; in the account hot spot identification pro